Permalink
Browse files

te

quit
  • Loading branch information...
1 parent b73f4a5 commit dd5eafc5b450b641a02e64c9e7cff9070914fe5f @chetanankola committed Aug 19, 2012
View
72 README
@@ -1,72 +0,0 @@
-Install mojito first as:
-$ git clone git://github.com/yahoo/mojito.git
-$ cd mojito/source
-$ npm install -g .
-$ npm install .
-
-or check the http://github.com/yahoo/mojito for more details on installation
-
-enter mojito/source dir (cd ~/mojito/source)
-and do: git clone git://github.com/chetanankola/feather-application.git
-
-this will create a dir called feather-application with all the source files.
-
-cd feather-application
-
-run
- mojito start
- or
- mojito start --context "environment:dev"
-check your application running at http://localhost:8001/
-
-
-
-
-CHECKIN MOJIT AND LOGIN MOJIT:
-==============================
-These two mojit are facebook related mojits.
-Login mojit does authentication and puts the access_token in a cookie named "fb_access_token"
-All othe mojits including checkin mojit if need to pull data from facebook graph needs to use this access token.
- ================================
- What about APP KEY for Facebook:
- ================================
- As you would know that every facebook graph api needs an app key app secret etc? and its all tied to a host url.
- Currently for this scaffold mojito app all that details is stored in defaults.json of login mojit ["mojits/login/defaults.json"] and is tied to localhost:8001
-
- if you want to use this mojito on your own host url facebook related stuff will fail. so you need to get app key for ur url from facebook developer api and put ur information in the defaults.json.
-
-
-
-
-TWITTER MOJIT : how does this work
-===================================
-so go to the mojits/twitter/controller.server.js and to the index function
-thats where you start from.
- if(!ac.params.getFromRoute('defer')){
- var loaderImg1 = 'http://a.l.yimg.com/a/i/us/sch/mob/spinner-white-small.gif';
- var loaderImg2 = 'http://a.l.yimg.com/a/i/us/sch/mob/spinner-1.0.0.gif';
- return ac.done({'onload':{url:loaderImg2}});
- }
-So here I do my own custom lazy loading where the mojits execute later after the parent (main mojit) has finished execution
-here you check for any defer params passed to the controller by either mojits/twitter/binders/index.js or from url etc..
-
-if you see none then you just put a "loading gif" and return meaning no more code of twitter mojit runs.
-
-now lets go back to mojits/twitter/binders/index.js
-here since controller.server.js a while ago since finished itself.. this gets loaded..
-here I do
- var args = {params: {route: {
- coord:{lat:lat,lon:lon,radius:radius},defer:true
- }}};
- this.mojitProxy.refreshView(args);
-so what this does is basically refresh the mojit (passing the code execution control to controller back again.)
-now the controller.. again
-
-
-this time if(!ac.params.getFromRoute('defer')){ wont run.. instead runs the later part of the server code.. which is pulling the tweets..
-
-
-
-
-
-
View
@@ -26,23 +26,14 @@
"type" : "main",
"config" : {
"children" : {
- "checkin": {
- "base" : "checkin"
+ "instagram": {
+ "base" : "instagram"
},
- "login": {
- "base" : "login"
+ "flickr": {
+ "base": "flickr"
},
- "weather": {
- "base" : "weather"
- },
- "gmap" : {
- "base" : "gmap"
- },
- "twitter" : {
- "base" : "twitter"
- },
- "geocode" : {
- "base" : "geocode"
+ "search": {
+ "base": "search"
}
}
}
@@ -58,6 +49,15 @@
}
}
},
+ "search": {
+ "type": "search"
+ },
+ "instagram": {
+ "type": "instagram"
+ },
+ "flickr": {
+ "type": "flickr"
+ },
"checkin": {
"type" : "checkin"
},
@@ -0,0 +1,81 @@
+.flickr{
+ position:absolute;
+ margin:0 auto;
+ margin-top:30px;
+ top:45%;
+ left:10px;
+}
+
+.wrap{
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ display:block;
+ overflow: hidden;
+}
+
+
+.splash {
+ text-align:center;
+ font-size:1.4em;padding:20px;width:320px;
+ border: 1px solid #9c9c9c; border: 1px solid rgba(0, 0, 0, 0.3); -webkit-border-radius: .5em;-webkit-border-top-left-radius: .5em;-webkit-border-top-right-radius: .5em;-webkit-border-bottom-left-radius: .5em;-webkit-border-bottom-right-radius: .5em;
+ -moz-border-radius: .5em;border-radius: .5em;
+ background: #fefefe;background: -moz-linear-gradient(top, #fefefe, #d8d8d8);background: -webkit-gradient(linear, left top, left bottom, from(#fefefe), to(#d8d8d8));
+ -moz-box-shadow: 1px 1px 3px #292929;-webkit-box-shadow: 1px 1px 3px #292929;box-shadow: 1px 1px 3px #292929;filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#656565', EndColorStr='#141414');
+}
+
+.flickfont{
+
+ margin-top:40px;
+ margin-left:10px;
+ width:320px;
+ text-align:center;
+ padding:2px;
+ font-family: 'Fredericka the Great', cursive;
+ font-size:50px;
+}
+
+#flickr-farm-container{
+ margin-top:20px;
+white-space:nowrap;
+ bottom:0px;
+ left:0px;
+}
+
+
+#flickr-farm-container ul{
+list-style-type: none;
+margin: 0;
+padding: 0;
+}
+
+#flickr-farm-container li {
+ display: inline-block;
+ position:relative;
+ height: inherit;
+}
+
+#flickr-farm-container img {
+ display: inline-block;
+ height:130px;
+ -webkit-transition:all 0.7s;
+ box-shadow:1px 1px 9px #000;
+ margin-left:6px;
+}
+
+#flickr-farm-container ul:hover{
+}
+
+#flickr-farm-container img:hover {
+ height:200px;
+
+ -webkit-transition:all 0.7s;
+}
+
+.flickr-farm{
+ margin: 0 auto;
+ padding: 0;
+}
+
+.flickr-farm {
+
+}
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2012 Yahoo! Inc. All rights reserved.
+ */
+/*jslint anon:true, sloppy:true, nomen:true*/
+YUI.add('flickrBinderIndex', function(Y, NAME) {
+
+/**
+ * The flickrBinderIndex module.
+ *
+ * @module flickrBinderIndex
+ */
+
+ /**
+ * Constructor for the flickrBinderIndex class.
+ *
+ * @class flickrBinderIndex
+ * @constructor
+ */
+ Y.namespace('mojito.binders')[NAME] = {
+
+ /**
+ * Binder initialization method, invoked after all binders on the page
+ * have been constructed.
+ */
+ init: function(mojitProxy) {
+ this.mojitProxy = mojitProxy;
+ },
+
+ /**
+ * The binder method, invoked to allow the mojit to attach DOM event
+ * handlers.
+ * ***FLICKR*****FLICKR*****FLICKR*****FLICKR*****FLICKR*****FLICKR*****FLICKR*****FLICKR*****FLICKR*****FLICKR**
+ * @param node {Node} The DOM node to which this mojit is attached.
+ */
+ bind: function(node) {
+ var me = this;
+ this.node = node;
+ Y.on('SEARCH_UPDATE', function(e, search) {
+ //alert(search.val);
+ console.log('on SEARCH_UPDATE:Flickr'+search.val);
+ var args = {
+ params: {
+ route: {
+ searchTerm:search.val,
+ numofImages:(search.num || 10 )
+ }
+ }
+ };
+ this.mojitProxy.refreshView(args);
+ }, this);
+
+ var scrollview_bookmarked_friends = new Y.ScrollView({
+ srcNode:this.node.one('#flickr-farm-container'),
+ deceleration: 0.9,
+ bounce:0.1,
+ flick: {
+ minDistance:10,
+ minVelocity:0.1,
+ axis: "x"
+ }
+ });
+ setTimeout(function(){
+ scrollview_bookmarked_friends.syncUI();
+ },4000);
+ scrollview_bookmarked_friends.render();
+ Y.on('resize', function (e) {
+ scrollview_bookmarked_friends.syncUI();
+ });
+
+
+ }
+
+
+ };
+
+}, '0.0.1', {requires: ['event-mouseenter', 'mojito-client', 'node', 'scrollview','scrollview-base', 'scrollview-paginator']});
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2012 Yahoo! Inc. All rights reserved.
+ */
+/*jslint anon:true, sloppy:true, nomen:true*/
+YUI.add('flickr', function(Y, NAME) {
+
+/**
+ * The flickr module.
+ *
+ * @module flickr
+ */
+
+ /**
+ * Constructor for the Controller class.
+ *
+ * @class Controller
+ * @constructor
+ */
+ Y.namespace('mojito.controllers')[NAME] = {
+
+ init: function(config) {
+ this.config = config;
+ },
+
+ /**
+ * Method corresponding to the 'index' action.
+ *
+ * @param ac {Object} The ActionContext that provides access
+ * to the Mojito API.
+ */
+ index: function(ac) {
+ var searchTerm = ac.params.getFromRoute('searchTerm') || 'Yahoo';
+ var defaultnumofImages = 10;
+ var number = ac.params.getFromRoute('numofImages') || defaultnumofImages;
+ ac.assets.addCss('./index.css');
+
+
+ ac.models.flickrModelFoo.getPics(searchTerm,number, function(err, rsp) {
+
+ var jsonFlickrApi = function(rsp){
+ if(rsp && rsp.stat != "ok"){
+ return ac.done({searchTerm:searchTerm, error:'Flickr! you failed me!! '});
+
+ } else {
+ if(rsp.photos){
+ var photosArr = rsp.photos.photo;
+ console.log(photosArr);
+
+ ac.done({searchTerm:searchTerm,photosArr:photosArr});
+ }
+ }
+ };
+
+ if (err) {
+ ac.error(err);
+ return;
+ }
+
+ if(rsp && rsp._resp && rsp._resp.responseText){
+ console.log(rsp);
+ return eval(rsp._resp.responseText);
+ }
+
+ ac.done({
+ searchTerm:searchTerm,
+ error:'Flickr! you failed me!!'
+ });
+ });
+ }
+
+ };
+
+}, '0.0.1', {requires: ['mojito', 'flickrModelFoo','json-parse']});
@@ -0,0 +1,5 @@
+[
+ {
+ "settings": [ "master" ]
+ }
+]
Oops, something went wrong.

0 comments on commit dd5eafc

Please sign in to comment.