Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

commit , stage actions edited

  • Loading branch information...
commit 07df81772ed0147c280f911b7a696848631a5426 1 parent fe85947
@Mparaiso authored
Showing with 1,573 additions and 1,743 deletions.
  1. +59 −60 twitter_client.edge
  2. +41 −41 twitter_client_edge.js
  3. +1,473 −1,642 twitter_client_edgeActions.js
View
119 twitter_client.edge
@@ -6,12 +6,16 @@
"element_${_text_message}":{
"timelineColor":"0xeedf79",
"animationEnabled":"true"}},
- "preloader-Default Timeline_playhead_ms":"0",
+ "wheel-Default Timeline_playhead_anchor_ms":"-1",
"arrow-Default Timeline_playhead_ms":"0",
"CompZoomFactor":"100",
"loading_message-Default Timeline_mark_ms":"-1",
"creativecommon-Default Timeline_playhead_ms":"0",
- "loader-Default Timeline_mark_ms":"-1",
+ "symbol_loader":{
+ "element_${_loader}":{
+ "timelineTreeOpened":"false",
+ "animationEnabled":"true",
+ "timelineColor":"0x00a9fa"}},
"tweets_ui-Default Timeline_playhead_ms":"0",
"stage-Default Timeline_playhead_ms":"2500",
"HTMLFileName":"twitter_client.html",
@@ -20,8 +24,15 @@
\"timelines\": {\
\"Default Timeline\": {\
\"ElementKeyframes\": {\
- \"${_Stage}\": [], \
- \"\": []\
+ \"${_Stage}\": []\
+ }\
+ }\
+ }},\
+\"preloader\": {\
+ \"timelines\": {\
+ \"Default Timeline\": {\
+ \"ElementKeyframes\": {\
+ \"${symbolSelector}\": []\
}\
}\
}},\
@@ -85,14 +96,6 @@
\"Default Timeline\": {\
}\
}},\
-\"preloader\": {\
- \"timelines\": {\
- \"Default Timeline\": {\
- \"ElementKeyframes\": {\
- \"${symbolSelector}\": []\
- }\
- }\
- }},\
\"Niveau inférieur\": {\
\"timelines\": {\
\
@@ -126,16 +129,14 @@
"animationEnabled":"true",
"timelineColor":"0xfb657a"}},
"symbol_footer":{
- "element_${_arrow4}":{
- "timelineColor":"0x00a9fa"},
+ "element_${_arrow2}":{
+ "animationEnabled":"true",
+ "timelineColor":"0x00bda4"},
"element_${_arrow}":{
"animationEnabled":"true",
"timelineColor":"0x008dc8"},
- "element_${_credits}":{
- "locked":"false",
- "animationEnabled":"true",
- "timelineTreeOpened":"true",
- "timelineColor":"0xeedf79"},
+ "element_${_arrow4}":{
+ "timelineColor":"0x00a9fa"},
"element_${_help}":{
"timelineColor":"0x91c767",
"animationEnabled":"true"},
@@ -147,9 +148,11 @@
"animationEnabled":"true",
"locked":"true",
"timelineColor":"0xeedf79"},
- "element_${_arrow2}":{
+ "element_${_credits}":{
+ "locked":"false",
"animationEnabled":"true",
- "timelineColor":"0x00bda4"}},
+ "timelineTreeOpened":"true",
+ "timelineColor":"0xeedf79"}},
"tweet_container-Default Timeline_playhead_anchor_ms":"-1",
"loading_message_text-Default Timeline_mark_ms":"-1",
"usedBOM":"false",
@@ -167,9 +170,7 @@
"pref__general__AutoKeyframeProperties":"true",
"UseCDN":"true",
"pref__general__FilterNonAnimatedElements":"false",
- "symbol_Poster":{
- "element_${_fallback2}":{
- "locked":"true"}},
+ "header-Default Timeline_mark_ms":"0",
"green_rect-Default Timeline_playhead_ms":"0",
"stage-Default Timeline_playhead_anchor_ms":"-1",
"search_strip-Default Timeline_playhead_anchor_ms":"-1",
@@ -179,13 +180,7 @@
"loader-Default Timeline_playhead_anchor_ms":"-1",
"stage-Default Timeline_mark_ms":"-1",
"tweet-Default Timeline_playhead_ms":"0",
- "symbol_wheel":{
- "element_${_wheel}":{
- "animationEnabled":"true",
- "timelineColor":"0x91c767"},
- "element_${_innerwheel}":{
- "animationEnabled":"true",
- "timelineColor":"0x50bd82"}},
+ "footer-Default Timeline_playhead_anchor_ms":"-1",
"symbol_creativecommon":{
"element_${_creativecommon3}":{
"timelineColor":"0x00bda4"},
@@ -193,10 +188,7 @@
"timelineColor":"0x50bd82",
"animationEnabled":"false"}},
"innerwheel-Default Timeline_playhead_ms":"0",
- "symbol_innerwheel":{
- "element_${_wheel}":{
- "timelineColor":"0x00bda4",
- "animationEnabled":"true"}},
+ "header-Default Timeline_playhead_ms":"0",
"symbol_loading_message_text":{
"element_${_loading_message}":{
"timelineTreeOpened":"true",
@@ -215,7 +207,9 @@
"animationEnabled":"true",
"locked":"false",
"timelineColor":"0xceaef4"}},
- "header-Default Timeline_playhead_ms":"0",
+ "symbol_green_rect":{
+ "element_${_footer}":{
+ "timelineColor":"0x91c767"}},
"symbol_tweet_container":{
"element_${_tweet_container}":{
"timelineTreeOpened":"false",
@@ -226,17 +220,16 @@
"locked":"false",
"animationEnabled":"true",
"timelineColor":"0x00bda4"}},
- "symbol_green_rect":{
- "element_${_footer}":{
- "timelineColor":"0x91c767"}},
+ "symbol_innerwheel":{
+ "element_${_wheel}":{
+ "timelineColor":"0x00bda4",
+ "animationEnabled":"true"}},
"wheel-Default Timeline_mark_ms":"-1",
"pref__general__GenerateSmoothTransitions":"true",
- "symbol_loader":{
- "element_${_loader}":{
- "timelineTreeOpened":"false",
- "animationEnabled":"true",
- "timelineColor":"0x00a9fa"}},
- "header-Default Timeline_mark_ms":"0",
+ "loader-Default Timeline_mark_ms":"-1",
+ "symbol_Poster":{
+ "element_${_fallback2}":{
+ "locked":"true"}},
"viewStartMs":"0",
"loading_message_text-Default Timeline_playhead_ms":"0",
"tweet_container-Default Timeline_playhead_ms":"0",
@@ -259,9 +252,9 @@
"element_${_tweet_container2}":{
"timelineColor":"0x91c767",
"animationEnabled":"true"},
- "element_${_result_box}":{
- "animationEnabled":"true",
- "timelineColor":"0x91c767"},
+ "element_${_tweet}":{
+ "timelineColor":"0xeedf79",
+ "animationEnabled":"true"},
"element_${_tweets_ui}":{
"animationEnabled":"true",
"timelineColor":"0x50bd82"},
@@ -285,14 +278,11 @@
"locked":"false",
"animationEnabled":"true",
"timelineColor":"0xeedf79"},
- "element_${_tweet}":{
- "timelineColor":"0xeedf79",
- "animationEnabled":"true"}},
- "symbol_arrow":{
- "element_${_arrow}":{
+ "element_${_result_box}":{
"animationEnabled":"true",
- "timelineColor":"0x63599f"}},
- "wheel-Default Timeline_playhead_anchor_ms":"-1",
+ "timelineColor":"0x91c767"}},
+ "TransitionIdCounter":"8491",
+ "preloader-Default Timeline_playhead_ms":"0",
"viewStartY":"0",
"header-Default Timeline_playhead_anchor_ms":"-1",
"symbol_tweets_ui":{
@@ -303,11 +293,18 @@
"animationEnabled":"true",
"timelineColor":"0x00a096"}},
"tweet_container-Default Timeline_mark_ms":"-1",
- "TransitionIdCounter":"8467",
- "footer-Default Timeline_playhead_anchor_ms":"-1",
+ "symbol_arrow":{
+ "element_${_arrow}":{
+ "animationEnabled":"true",
+ "timelineColor":"0x63599f"}},
+ "symbol_wheel":{
+ "element_${_wheel}":{
+ "animationEnabled":"true",
+ "timelineColor":"0x91c767"},
+ "element_${_innerwheel}":{
+ "animationEnabled":"true",
+ "timelineColor":"0x50bd82"}},
"loading_message-Default Timeline_playhead_anchor_ms":"-1",
- "arrow-Default Timeline_mark_ms":"-1",
- "tweet-Default Timeline_mark_ms":"-1",
"symbol_tweet":{
"element_${_from_user_name}":{
"locked":"false",
@@ -330,4 +327,6 @@
"timelineColor":"0x00a096"},
"element_${_created_at}":{
"locked":"false",
- "timelineColor":"0x91c767"}}}
+ "timelineColor":"0x91c767"}},
+ "arrow-Default Timeline_mark_ms":"-1",
+ "tweet-Default Timeline_mark_ms":"-1"}
View
82 twitter_client_edge.js
@@ -69,20 +69,20 @@ var symbols = {
rect: [0,0,0,0]
},
{
+ transform: [[118,-3]],
type: 'text',
- rect: [0,6,472,17],
id: 'credits',
text: 'Design by M.Paraiso copyrights 2011. Fork the source on Github. contact : mparaiso@online.fr',
font: ['Open sans, sans-serif',12,'rgba(255,255,255,1.00)','normal','none',''],
- transform: [[118,-3]]
+ rect: [0,6,472,17]
},
{
+ transform: [[9,-32]],
type: 'text',
- rect: [0,6,595,31],
id: 'help',
text: 'INSTRUCTIONS : Enter a search keyword in the form to search for tweets , click on the userpicture to search tweets from the user',
font: ['Open sans, sans-serif',12,'rgba(255,255,255,1.00)','normal','none',''],
- transform: [[9,-32]]
+ rect: [0,6,595,31]
},
{
id: 'creativecommon',
@@ -170,10 +170,10 @@ var symbols = {
{ id: "eid5", tween: [ "transform", "${_green_rect}", "scaleY", '1', { fromValue: '0'}], position: 0, duration: 1000, easing: "easeOutBack" },
{ id: "eid5668", tween: [ "style", "${_creativecommon}", "opacity", '1', { fromValue: '0.000000'}], position: 1500, duration: 500 },
{ id: "eid7340", tween: [ "style", "${_arrow}", "-webkit-transform-origin", [50,50], { valueTemplate: '@@0@@% @@1@@%', fromValue: [50,50]}], position: 0, duration: 0 },
- { id: "eid8467", tween: [ "style", "${_arrow}", "-moz-transform-origin", [50,50], { valueTemplate: '@@0@@% @@1@@%', fromValue: [50,50]}], position: 0, duration: 0 },
- { id: "eid8468", tween: [ "style", "${_arrow}", "-ms-transform-origin", [50,50], { valueTemplate: '@@0@@% @@1@@%', fromValue: [50,50]}], position: 0, duration: 0 },
- { id: "eid8469", tween: [ "style", "${_arrow}", "msTransformOrigin", [50,50], { valueTemplate: '@@0@@% @@1@@%', fromValue: [50,50]}], position: 0, duration: 0 },
- { id: "eid8470", tween: [ "style", "${_arrow}", "-o-transform-origin", [50,50], { valueTemplate: '@@0@@% @@1@@%', fromValue: [50,50]}], position: 0, duration: 0 },
+ { id: "eid8491", tween: [ "style", "${_arrow}", "-moz-transform-origin", [50,50], { valueTemplate: '@@0@@% @@1@@%', fromValue: [50,50]}], position: 0, duration: 0 },
+ { id: "eid8492", tween: [ "style", "${_arrow}", "-ms-transform-origin", [50,50], { valueTemplate: '@@0@@% @@1@@%', fromValue: [50,50]}], position: 0, duration: 0 },
+ { id: "eid8493", tween: [ "style", "${_arrow}", "msTransformOrigin", [50,50], { valueTemplate: '@@0@@% @@1@@%', fromValue: [50,50]}], position: 0, duration: 0 },
+ { id: "eid8494", tween: [ "style", "${_arrow}", "-o-transform-origin", [50,50], { valueTemplate: '@@0@@% @@1@@%', fromValue: [50,50]}], position: 0, duration: 0 },
{ id: "eid5055", tween: [ "style", "${_help}", "opacity", '1', { fromValue: '0.000000'}], position: 2500, duration: 500 },
{ id: "eid5184", tween: [ "style", "${_arrow}", "opacity", '1', { fromValue: '0.000000'}], position: 1000, duration: 500 },
{ id: "eid7338", tween: [ "transform", "${_arrow}", "rotateZ", '0deg', { fromValue: '0deg'}], position: 0, duration: 0 },
@@ -253,13 +253,13 @@ var symbols = {
fill: ['rgba(23,7,116,1.00)']
},
{
- transform: [[15,4]],
+ type: 'text',
rect: [23,8,0,0],
- font: ['Exo, Arial, Sans-serif',33,'rgba(217,224,255,1.00)','bold','none','normal'],
+ transform: [[15,4]],
id: 'title',
align: 'auto',
text: 'Ksu.TWEET.Client',
- type: 'text',
+ font: ['Exo, Arial, Sans-serif',33,'rgba(217,224,255,1.00)','bold','none','normal'],
tag: 'h1'
},
{
@@ -334,24 +334,24 @@ var symbols = {
duration: 2250,
autoPlay: true,
timeline: [
- { id: "eid71", tween: [ "transform", "${_dark_blue_rect}", "scaleY", '1', { fromValue: '0'}], position: 1250, duration: 500, easing: "easeOutQuint" },
+ { id: "eid23", tween: [ "transform", "${_blue_rect}", "translateY", '-96px', { fromValue: '-96px'}], position: 0, duration: 0 },
+ { id: "eid32", tween: [ "transform", "${_blue_rect}", "translateY", '-96px', { fromValue: '-96px'}], position: 750, duration: 0, easing: "easeOutQuad" },
+ { id: "eid34", tween: [ "transform", "${_blue_rect}", "translateY", '-96px', { fromValue: '-96px'}], position: 1250, duration: 0, easing: "easeOutQuad" },
{ id: "eid36", tween: [ "transform", "${_title}", "translateX", '15px', { fromValue: '288px'}], position: 750, duration: 500, easing: "easeOutExpo" },
- { id: "eid246", tween: [ "color", "${_title}", "color", 'rgba(255,255,255,1.00)', { animationColorSpace: 'RGB', valueTemplate: undefined, fromValue: 'rgba(255,255,255,1.00)'}], position: 1750, duration: 0 },
+ { id: "eid6858", tween: [ "transform", "${_blue_rect}", "scaleY", '3', { fromValue: '0.021'}], position: 0, duration: 500, easing: "easeOutQuad" },
{ id: "eid31", tween: [ "transform", "${_blue_rect}", "translateX", '-278px', { fromValue: '-278px'}], position: 750, duration: 0, easing: "easeOutQuad" },
{ id: "eid33", tween: [ "transform", "${_blue_rect}", "translateX", '-278px', { fromValue: '-278px'}], position: 1250, duration: 0, easing: "easeOutQuad" },
{ id: "eid69", tween: [ "transform", "${_dark_blue_rect}", "scaleX", '1', { fromValue: '1'}], position: 1250, duration: 0, easing: "easeOutQuart" },
{ id: "eid67", tween: [ "transform", "${_dark_blue_rect}", "scaleX", '1', { fromValue: '1'}], position: 1750, duration: 0, easing: "easeOutQuart" },
{ id: "eid1057", tween: [ "style", "${_html5_logo}", "opacity", '1', { fromValue: '0.000000'}], position: 1750, duration: 500, easing: "easeOutExpo" },
- { id: "eid23", tween: [ "transform", "${_blue_rect}", "translateY", '-96px', { fromValue: '-96px'}], position: 0, duration: 0 },
- { id: "eid32", tween: [ "transform", "${_blue_rect}", "translateY", '-96px', { fromValue: '-96px'}], position: 750, duration: 0, easing: "easeOutQuad" },
- { id: "eid34", tween: [ "transform", "${_blue_rect}", "translateY", '-96px', { fromValue: '-96px'}], position: 1250, duration: 0, easing: "easeOutQuad" },
+ { id: "eid71", tween: [ "transform", "${_dark_blue_rect}", "scaleY", '1', { fromValue: '0'}], position: 1250, duration: 500, easing: "easeOutQuint" },
{ id: "eid173", tween: [ "color", "${_dark_blue_rect}", "background-color", 'rgba(38,34,59,1.00)', { animationColorSpace: 'RGB', valueTemplate: undefined, fromValue: 'rgba(38,34,59,1.00)'}], position: 1750, duration: 0 },
{ id: "eid18", tween: [ "style", "${_blue_rect}", "-webkit-transform-origin", [0,0], { valueTemplate: '@@0@@% @@1@@%', fromValue: [0,0]}], position: 0, duration: 0 },
- { id: "eid8471", tween: [ "style", "${_blue_rect}", "-moz-transform-origin", [0,0], { valueTemplate: '@@0@@% @@1@@%', fromValue: [0,0]}], position: 0, duration: 0 },
- { id: "eid8472", tween: [ "style", "${_blue_rect}", "-ms-transform-origin", [0,0], { valueTemplate: '@@0@@% @@1@@%', fromValue: [0,0]}], position: 0, duration: 0 },
- { id: "eid8473", tween: [ "style", "${_blue_rect}", "msTransformOrigin", [0,0], { valueTemplate: '@@0@@% @@1@@%', fromValue: [0,0]}], position: 0, duration: 0 },
- { id: "eid8474", tween: [ "style", "${_blue_rect}", "-o-transform-origin", [0,0], { valueTemplate: '@@0@@% @@1@@%', fromValue: [0,0]}], position: 0, duration: 0 },
- { id: "eid6858", tween: [ "transform", "${_blue_rect}", "scaleY", '3', { fromValue: '0.021'}], position: 0, duration: 500, easing: "easeOutQuad" },
+ { id: "eid8495", tween: [ "style", "${_blue_rect}", "-moz-transform-origin", [0,0], { valueTemplate: '@@0@@% @@1@@%', fromValue: [0,0]}], position: 0, duration: 0 },
+ { id: "eid8496", tween: [ "style", "${_blue_rect}", "-ms-transform-origin", [0,0], { valueTemplate: '@@0@@% @@1@@%', fromValue: [0,0]}], position: 0, duration: 0 },
+ { id: "eid8497", tween: [ "style", "${_blue_rect}", "msTransformOrigin", [0,0], { valueTemplate: '@@0@@% @@1@@%', fromValue: [0,0]}], position: 0, duration: 0 },
+ { id: "eid8498", tween: [ "style", "${_blue_rect}", "-o-transform-origin", [0,0], { valueTemplate: '@@0@@% @@1@@%', fromValue: [0,0]}], position: 0, duration: 0 },
+ { id: "eid246", tween: [ "color", "${_title}", "color", 'rgba(255,255,255,1.00)', { animationColorSpace: 'RGB', valueTemplate: undefined, fromValue: 'rgba(255,255,255,1.00)'}], position: 1750, duration: 0 },
{ id: "eid40", tween: [ "style", "${_title}", "opacity", '1', { fromValue: '0'}], position: 500, duration: 750, easing: "easeOutQuart" } ]
}
}
@@ -372,12 +372,12 @@ var symbols = {
fill: ['rgba(59,73,106,1.00)']
},
{
+ type: 'text',
rect: [13,12,116,16],
- transform: [[-3]],
id: 'search_label',
text: 'Search:',
font: ['Open sans, sans-serif',16,'rgba(227,227,227,1.00)','normal','none',''],
- type: 'text'
+ transform: [[-3]]
}],
symbolInstances: [
]
@@ -387,21 +387,21 @@ var symbols = {
"${_search_label}": [
["style", "width", '116px'],
["transform", "translateX", '-3px'],
- ["style", "font-weight", 'normal'],
- ["color", "color", 'rgba(227,227,227,1.00)'],
["style", "opacity", '0'],
+ ["color", "color", 'rgba(227,227,227,1.00)'],
["style", "font-family", 'Open sans, sans-serif'],
+ ["style", "font-weight", 'normal'],
["style", "font-size", '16px']
],
"${_background}": [
- ["transform", "scaleX", '0'],
- ["color", "background-color", 'rgba(59,73,106,1.00)'],
- ["transform", "scaleY", '1'],
["style", "-webkit-transform-origin", [0,0], {valueTemplate:'@@0@@% @@1@@%'} ],
["style", "-moz-transform-origin", [0,0],{valueTemplate:'@@0@@% @@1@@%'}],
["style", "-ms-transform-origin", [0,0],{valueTemplate:'@@0@@% @@1@@%'}],
["style", "msTransformOrigin", [0,0],{valueTemplate:'@@0@@% @@1@@%'}],
- ["style", "-o-transform-origin", [0,0],{valueTemplate:'@@0@@% @@1@@%'}]
+ ["style", "-o-transform-origin", [0,0],{valueTemplate:'@@0@@% @@1@@%'}],
+ ["transform", "scaleX", '0'],
+ ["transform", "scaleY", '1'],
+ ["color", "background-color", 'rgba(59,73,106,1.00)']
],
"${symbolSelector}": [
["style", "height", '40px'],
@@ -483,11 +483,11 @@ var symbols = {
"${_from_user_name}": [
["color", "background-color", 'rgba(17,38,69,0.00)'],
["transform", "translateX", '23px'],
- ["style", "border-style", 'solid'],
- ["style", "height", '24px'],
["color", "border-color", 'rgba(84,86,106,0.00)'],
- ["transform", "translateY", '8px'],
- ["style", "border-width", '1px']
+ ["style", "height", '24px'],
+ ["style", "border-style", 'solid'],
+ ["style", "border-width", '1px'],
+ ["transform", "translateY", '8px']
],
"${symbolSelector}": [
["style", "height", '120px'],
@@ -496,10 +496,10 @@ var symbols = {
],
"${_created_at}": [
["color", "background-color", 'rgba(17,38,69,0.00)'],
- ["style", "border-width", '1px'],
+ ["transform", "translateY", '35px'],
["style", "height", '21px'],
["color", "border-color", 'rgba(84,86,106,0.00)'],
- ["transform", "translateY", '35px'],
+ ["style", "border-width", '1px'],
["style", "border-style", 'solid']
],
"${_text}": [
@@ -618,22 +618,22 @@ var symbols = {
content: {
dom: [
{
- transform: [[255,-250]],
- rect: [-168,253,0,0],
+ font: ['Exo, Arial, sans-serif',24,'rgba(255,255,255,1)','normal','none','normal'],
type: 'text',
+ transform: [[255,-250]],
id: 'Text2',
text: 'Searching for tweets',
align: 'center',
- font: ['Exo, Arial, sans-serif',24,'rgba(255,255,255,1)','normal','none','normal']
+ rect: [-168,253,0,0]
},
{
- transform: [[225,-217]],
- rect: [-168,253,285,66],
+ font: ['Exo, Arial, sans-serif',25,'rgba(255,255,255,1)','normal','none','normal'],
type: 'text',
+ transform: [[225,-217]],
id: 'search_string',
text: 'search-string',
align: 'center',
- font: ['Exo, Arial, sans-serif',25,'rgba(255,255,255,1)','normal','none','normal']
+ rect: [-168,253,285,66]
},
{
id: 'wheel',
View
3,115 twitter_client_edgeActions.js
@@ -1,1643 +1,1474 @@
-/***********************
-* Adobe Edge Composition Actions
-*
-* Edit this file with caution, being careful to preserve
-* function signatures and comments starting with 'Edge' to maintain the
-* ability to interact with these actions from within Adobe Edge
-*
-***********************/
-(function($, Edge, compId){
- var Composition = Edge.Composition, Symbol = Edge.Symbol; // aliases for commonly used Edge classes
-
-
- //Edge symbol: 'stage'
- (function(symbolName) {
-
- Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
- /**
-
- * TWEETER.CLIENT
-
- * @author M.PARAISO
-
- * @link mparaiso@online.fr
-
- * @link paraiso.marc@gmail.com
-
- * @copyrights 2011 M.Paraiso , Ksu Multimedia.
-
- * @description a twitter client
-
- * You can search tweets , tweets are parsed and you have the ability to click on
-
- * links , hashtags ,etc within the tweets.
-
- **/
-
- "use strict";
-
- // first add a few css hacks to the compositiun
-
-
- var defautlConfiguration = {
-
-
- "title":"ksu TWEET client",
-
- "search-label" : "Enter a keyword : ",
-
- "footer-note": "© 2011 M.Paraiso. contact : mparaiso@online.fr ",
-
- "search-string": "adobe edge",
-
- "search-url": "http://search.twitter.com/search.json?&callback=?",
-
- "search-params": {
-
- "include_entities": true,
-
- "rpp": 100,
-
- "result_type": "mixed",
-
- "search-lang": "en"
-
- }
-
- };
-
-
- // put the code in a main function so one can control the execution flow
- var main = function(sym){
- // css hacks
- sym.getSymbolElement().css({
- "overflow":"hidden",
- "width":"100%"
- });
- // page hacks
- $("html , body").css({
- "width":"100%",
- "height":"100%",
- "margin":"0",
- "padding":"0"
- });
- // get application script to get extra features like controllers and models
- $.getScript("js/application.js",function (e) {
- // when the script is loaded , init some variables
- // create a model
- window.model = new App_Model();
- // extend model datas with default configuration
- model.extend(defautlConfiguration);
- // create a controller in the window namespace( more like a mediator ) ,
- window.controller = new App_Controller(model);
- // get tweets , trigger some events
-
- controller.getTweets = function () {
-
- $(this).unbind("request").bind("request",function(e,d){
-
- console.log("request");
-
- var _this = this;
-
- $.ajax({
-
- "url" :this.model.get("search-url"),
-
- "cache": false,
-
- "dataType": "jsonp",
-
- "data": $.extend(this.model.get("search-params"), {
- q: this.model.get("search-string")
- }),
-
- "success" : requestSuccess
-
- });// end ajax
-
- });//end request
-
- // start the interlude movie
-
- $(this).trigger("begin.search_interlude");
-
- }
-
- // process the view events , trigger some more events
-
- controller.onViewEvent = function (eventType, datas) {
-
- console.log(eventType, datas)
-
- switch (eventType) {
-
- case "searchinputchanged":
-
- this.model.set("search-string", encodeURI(datas));
-
- this.getTweets();
-
- break;
-
- default:
-
- console.log("not implemented");
-
- break;
-
- }
-
- }
-
- controller.start(
-
- function start() {
-
- sym.play();
-
- },
-
- sym,
-
- [],
-
- {}
-
- );
-
- });
-
- sym.addObserver(update);
-
- // some more css fixes
-
- $("#Stage").addClass("bg");
-
- $("#Stage").css("height", null);
-
- $("#Stage").css("min-height", "100%");
-
- setTimeout(function(){
-
- // firefox width fix
-
- document.getElementById("Stage").style.width= "100%";
-
- },200);
-
- }
-
- // observer
-
- var update = function(message,sender){
-
- console.log("stage update");
-
- redraw(sender);
-
- return;
-
- }
-
- var redraw = function(sym,datas){
-
- console.log("stage redraw",sym);
-
- $("title").text(sym.getVariable("app-title"));
-
- }
-
-
-
- var requestSuccess = function (datas, d){
-
- var tweets = $.map(datas.results,
-
- function (object, index) {
-
- //var url = object.entities.urls.length>0 && typeof object.entities.urls[0].url !='undefined' ? object.entities.urls[0].url : null;
-
- return {
-
- "user_id":0,
-
- "created_at": object.created_at,
-
- "from_user_name": object.from_user_name,
-
- "profile_image_url": object.profile_image_url,
-
- "id": index,
-
- "text": object.text.slice(0,400),
-
- "url": null,
-
- "lang":"en"
-
- }
-
- }
-
- );
-
- model.set("tweets", tweets);
-
- console.log("stop the interlude movie");
-
- $(controller).trigger("end.search_interlude");
-
- $(controller).trigger("change.tweets" );
-
- }
-
-
-
-
-
- main(sym);
-
-
-
- sym.setVariable("app-title",controller.get("title"));
-
-
-
-
- });
- //Edge binding end
-
-
-
-
- Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1500, function(sym, e) {
-
- var footer = sym.createChildSymbol("footer", "stage");
-
-
- footer.setVariable("credits",controller.get("footer-note") ) ;
-
-
- footer.getSymbolElement().css({
- "width":"100%",
- "bottom":"0",
- "position":"absolute"
- });
-
-
- sym.$("footer").css("width","inherit");
-
-
-
-
-
-
-
-
- });
- //Edge binding end
-
-
-
- Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 500, function(sym, e) {
- var header = sym.createChildSymbol("header", "stage");
-
- header.setVariable("title",controller.get("title") );
-
-
-
-
-
- });
- //Edge binding end
-
-
- Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 2500, function(sym, e) {
- var search_strip , tweet_container ;
-
- console.log("create")
-
- var main = function(sym){
-
- // create child symbols
-
- search_strip = sym.createChildSymbol("search_strip","stage");
-
- tweet_container = sym.createChildSymbol("tweet_container","stage");
-
- search_strip.addObserver(search_button_clicked);
-
- tweet_container.addObserver(navigateToUserTweets);
-
- $(controller).unbind("change.tweets").bind("change.tweets",function(event){
-
- tweet_container.setVariable("tweets",controller.get("tweets") );
-
- });
-
- update();
-
- controller.addObserver(update,sym);
-
- }
-
-
-
- var update = function(sym){
-
- search_strip.setVariable("search-label",controller.get("search-label"));
-
- search_strip.setVariable("search-string",controller.get("search-string"));
-
- tweet_container.setVariable("search-string",controller.get("search-string"));
-
- }
-
-
-
- var search_button_clicked = function(message,object){
-
- if(message.indexOf("click")>=0){
-
- console.log("search_button_clicked");
-
- controller.onViewEvent("searchinputchanged",search_strip.getVariable("search-string") );
-
- }
-
- }
-
-
-
- var navigateToUserTweets = function navigateToUserTweets(message,sender){
-
- if(message.indexOf("navigate")>=0){
-
- return;
-
- }
-
- }
-
-
-
- main(sym);
-
-
-
- });
- //Edge binding end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- })("stage");
- //Edge symbol end:'stage'
-
- //=========================================================
-
- //Edge symbol: 'footer'
- (function(symbolName) {
- Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
- var main = function(sym){
-
- sym.addObserver(onvariablechange)
-
- sym.$("green_rect").css("width","100%");
-
- sym.$("help").css({
- "width":"100%"
- }).hide();
-
- sym.getSymbolElement().addClass("footer");
-
- sym.$("arrow").find("div").addClass("arrow");
- sym.$("credits").css({
- "width":"100%"
- });
-
- sym.$("credits").wrap("<a target='_blank' title='' href='https://github.com/Mparaiso/twitter-client'/>");
- }
-
- var onvariablechange = function(message,sender){
-
- if(message.indexOf("credits")>=0){
-
- sym.$("credits").html(sender.getVariable("credits") );
-
- }
-
- }
-
- main(sym);
- });
- //Edge binding end
-
-
-
- Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1000, function(sym, e) {
- var main = function(sym){
-
- stop();
-
- sym.$("arrow").bind("click",grow);
-
- }
-
-
-
- function grow(e){
-
- var _this=this;
-
- $(this).unbind("click",grow);
-
- sym.$("green_rect").animate(
-
- {
- top:sym.$("green_rect").position().top-30,
- "height":(sym.$("green_rect").height()+30)+"px"
- },
-
- 300,
-
- "easeOutExpo",
-
- function(e){
-
- sym.$("help").fadeIn(300);
-
- $(_this).bind("click",shrink);
-
- }
-
- );
-
- return false;
-
- }
-
- function shrink(e){
-
- var _this=this;
-
- $(this).unbind("click",shrink);
-
- sym.$("help").hide();
-
- sym.$("green_rect").animate(
-
- {
- top:sym.$("green_rect").position().top+30,
- "height":(sym.$("green_rect").height()-30)+"px"
- },
-
- 300,
-
- "easeOutExpo",
-
- function(e){
-
- $(_this).bind("click",grow);
-
- }
-
- );
-
- return false;
-
- }
- main(sym);
- });
- //Edge binding end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- })("footer");
- //Edge symbol end:'footer'
-
- //=========================================================
- //Edge symbol: 'green_rect'
- (function(symbolName) {
- Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
- $(sym).css({
- width:"100%"
- });
-
- sym.$("footer").css({
- width:"100%",
- height:"100%"
- });
-
- sym.stop();
- });
- //Edge binding end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- })("green_rect");
- //Edge symbol end:'green_rect'
-
- //=========================================================
-
- //Edge symbol: 'header'
- (function(symbolName) {
- Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
- var main = function(sym){
-
-
-
- sym.getSymbolElement().addClass("head");
-
- sym.getSymbolElement().css({
- width:"100%"
- });
-
- sym.$("blue_rect").css({
- width:"100%"
- })
-
- sym.$("blue_rect").find("div").addClass("logo-container");
-
- sym.$("dark_blue_rect").css({
- width:"100%"
- });
-
- sym.$("html5_logo").addClass("html5_logo");
-
- sym.$("title").css("width","auto");
-
- sym.addObserver(update);
-
- }
-
- var update = function(message,sender){
-
- if( message.indexOf("title")>=0){
-
- sym.$("title").text(sym.getVariable("title") );
-
- sender.redraw(sender);
-
- return
-
- }
-
- }
-
- this.redraw = function(sym){
-
- sym.$("html5_logo").css("left",sym.$("title").width()+sym.$("title").position().left);
-
- }
-
- main(sym)
- });
- //Edge binding end
-
-
-
-
-
-
-
-
-
-
-
- Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1750, function(sym, e) {
- this.redraw(sym)
- });
- //Edge binding end
-
-
-
-
-
-
-
-
-
-
-
-
- })("header");
- //Edge symbol end:'header'
-
- //=========================================================
- //Edge symbol: 'search_box'
- (function(symbolName) {
- Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
- sym.$("search_box").css({
- width:"100%"
- });
-
- sym.$("search_box").css({
- "min-height":"100%"
- });
-
-
- });
- //Edge binding end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- })("search_box");
- //Edge symbol end:'search_box'
-
- //=========================================================
- //Edge symbol: 'result_box'
- (function(symbolName) {
- Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
- sym.$("results_box").css({
- width:"100%"
- });
- });
- //Edge binding end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- })("result_box");
- //Edge symbol end:'result_box'
-
- //=========================================================
- //Edge symbol: 'tweets_ui'
- (function(symbolName) {
- Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
- var ui = sym.getSymbolElement();
-
- ui.css({
- "width":null
- });
-
- ui.css({
- "width":"100%"
- });
-
- $(sym).css({
- "height":"100%"
- });
-
-
-
- sym.$("search_box").css({
- "width":"200px"
- });
-
- sym.$("result_box").css({
- "width":"100%"
- });
-
- sym.$("search_box").css({
- "height":"100%"
- });
-
-
-
- });
- //Edge binding end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- })("tweets_ui");
- //Edge symbol end:'tweets_ui'
-
- //=========================================================
-
- //Edge symbol: 'loader'
- (function(symbolName) {
- Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1000, function(sym, e) {
- sym.play(0);
- });
- //Edge binding end
-
- Symbol.bindTimelineAction(compId, symbolName, "Default Timeline", "complete", function(sym, e) {
- // insert code to be run at timeline end here
- });
- //Edge binding end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- })("loader");
- //Edge symbol end:'loader'
-
- //=========================================================
- //Edge symbol: 'search_strip'
- (function(symbolName) {
- Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
-
-
-
- // render the ui according to the model change
-
-
- var render = function (message, data) {
-
- if(message.indexOf("label")>=0 || message.indexOf("string")>=0){
-
- console.log("search_label");
-
- //debugger
-
- sym.$("search_label")
-
- .html('')
-
- .append("<form id='search-form' method='get' action='javascript:void 0;' >"
-
- +sym.getVariable("search-label")
-
- +"<input x-webkit-speech name='search-tweets' id='search_input' value='"
-
- +decodeURI(sym.getVariable("search-string"))
-
- +"' required='true' autofocus placeholder='#adobe' class='search_input'/>"
-
- +"<input id='search_button' type='submit' value='search'/>"
-
- +"</form>");
-
- $("#search-form").unbind("submit").bind("submit",
-
- function (e) {
-
- sym.setVariable("search-string", sym.$("#search_input").val());
-
- // notify the handler outside the object
-
- sym.notifyObservers("search-button:clicked");
-
- console.log("submitted");
-
- e.preventDefault();
-
- return false;
-
- }
-
- );
-
- sym.$("search_label").css({
- "width": "100%",
- margin: 0,
- padding: 0
- });
-
- return;
-
- }
-
- }
-
- // add listener
-
- sym.addObserver(render);
-
- sym.getSymbolElement().css({
- "width": "100%"
- });
-
- sym.$("background").css({
- "width": "100%",
- margin: 0,
- padding: 0
- });
-
- });
- //Edge binding end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- })("search_strip");
- //Edge symbol end:'search_strip'
-
- //=========================================================
-
- //Edge symbol: 'tweet'
- (function(symbolName) {
-
- Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
- sym.stop();
-
- sym.getSymbolElement().addClass("tweet");
-
- sym.$("bg").addClass("tweet-background");
-
- sym.$("text").addClass("text");
-
- sym.$("from_user_name").addClass("title");
-
- sym.$("from_user_name").css("width","auto");
- /*sym.$("profile_image_url").click(function(e){
-
-controller.onViewEvent("searchinputchanged","from:"+sym.getVariable("from_user_name"));
-
-return false;
-
-});*/
-
- var renderUI = function(message,sender){
-
- if(message.indexOf("from_user_name")>0){
-
- var link ="<a title=\"See user's tweets !\" href='#' data-user='"+sym.getVariable("from_user_name").trim()+"'/>";
-
- sym.$("from_user_name").text(sym.getVariable("from_user_name"));
-
- sym.$("from_user_name").wrap(link)
-
- sym.$("profile_image_url").wrap(link);
-
- return
-
- }
-
- if(message.indexOf("created_at")>0){
-
- sym.$("created_at").text(sym.getVariable("created_at"));
-
- return
-
- }
-
- if(message.indexOf("text")>0){
-
- sym.$("text").html(parseTweet(sym.getVariable("text").trim()) );
-
- return
-
- }
-
-
-
- if(message.indexOf("profile_image_url")>=0){
-
- if(sym.getVariable("profile_image_url").length>3){
-
- sym.$("profile_image_url").append(
-
- $("<img/>").attr("src",sym.getVariable("profile_image_url"))
-
- );
-
- }
-
- return
-
- }
-
-
-
- if(message.indexOf("url") >=0 ){
-
- /*if(sym.getVariable("url")){
-
- var content = $("<a title='Open the link in a new window' target='_blank' />")
-
- content.attr( "href",sym.getVariable("url") )
-
- content.text( sym.getVariable("text") );
-
- sym.$("text").html(content);
-
- }*/
-
- return
-
- }
-
-
-
- }
-
-
-
- sym.addObserver(renderUI);
- });
- //Edge binding end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- })("tweet");
- //Edge symbol end:'tweet'
-
- //=========================================================
- //Edge symbol: 'tweet_container'
- (function(symbolName) {
- Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
- var loading_message;
-
-
-
- var displayTweets = function(tweets){
-
- var data = tweets.shift();
-
- if(typeof data === 'undefined'){
-
- return;
-
- }
-
- var tweet = sym.createChildSymbol("tweet","tweet_container");
-
- tweet.getSymbolElement().hide();
-
- tweet.getSymbolElement().css({
- "margin":"auto"
- });
-
- tweet.setVariable("from_user_name",data.from_user_name);
-
- tweet.setVariable("created_at",data.created_at);
-
- tweet.setVariable("id",data.id);
-
- tweet.setVariable("text",data.text);
-
- tweet.setVariable("url",data.url);
-
- tweet.setVariable("profile_image_url",data.profile_image_url);
-
- tweet.getSymbolElement().fadeIn(300,function(){
-
- t = setTimeout(function(){
-
- displayTweets.call(sym,tweets);
-
- clearTimeout(t);
-
- },100);
-
- return
-
- });
-
- return
-
- }
-
-
-
- var update = function(message,object){
-
- // EN : Observe the tweet_container variables.
-
- if(message.indexOf("tweets")>=0){
-
- // EN : called when the tweets variablechanges
-
- sym.$("tweet_container").html("");
-
- var tweets = sym.getVariable("tweets");
-
- sym.$("tweet_container").delegate("a","click",function(e){
-
- // EN : "global listener" : listen all the links in the tweet_container
-
- console.log(e);
-
- if(e.currentTarget.getAttribute("data-user")){
-
- // if username , search for the user tweets
-
- console.log("click");
-
- controller.onViewEvent("searchinputchanged","from:"+e.currentTarget.getAttribute("data-user") );
-
- return false;
-
- }
-
- if(e.currentTarget.getAttribute("data-link")){
-
- // if # or @ search tweets for the tag
-
- console.log("click");
-
- controller.onViewEvent("searchinputchanged",e.currentTarget.getAttribute("data-link") );
-
- return false;
-
- }
-
- });
-
- displayTweets(tweets);
-
- return;
-
- }
-
- if(message.indexOf("search-string")>=0){
-
- console.log("tweetcontainer update search-string");
-
- sym.getSymbol("loading_message").setVariable("search-string",controller.get("search-string") );
- return
-
- }
-
- }
-
- // compute the height of the container according to it's
-
- // position and the footer's position
-
- var resizeHeight = function(){
-
- var container_top = $(".tweet-container").position().top;
-
- var footer_top = $(".footer").position().top;
-
- var footer_height = $(".footer").height();
-
- var height = footer_top-container_top-footer_height;
-
- console.log(height);
-
- sym.$("tweet_container").css({
- position:"relative"
- });
-
- sym.$("tweet_container").height(height);
-
-
-
- }
-
-
-
- var beginSearchInterlude = function beginSearchInterlude(){
-
- console.log("beginSearchInterlude");
-
- sym.$("tweet_container").fadeOut("fast",function(e){
-
- sym.getSymbolElement().css("overflow","hidden");
-
- $(window).trigger("resize");
-
- sym.getSymbol("loading_message").play(2);
- $(controller).unbind("begin.search_interlude");
-
- $(controller).unbind("end.search_interlude").bind("end.search_interlude",endSearchInterlude);
-
- });
-
- }
-
-
-
- var endSearchInterlude = function endSearchInterlude(){
-
- console.log("endSearchInterlude");
-
- sym.getSymbolElement().css("overflow","auto");
-
-
-
- sym.getSymbol("loading_message").addObserver(requestFinished);
-
- sym.getSymbol("loading_message").notifyObservers("unblink");
-
- sym.getSymbol("loading_message").play(750);
-
- }
-
- var requestFinished = function(message){
-
- if(message.indexOf("finished")>=0){
-
- sym.$("tweet_container").fadeIn("fast");
-
- $(controller).unbind("begin.search_interlude").bind("begin.search_interlude",beginSearchInterlude);
-
- sym.getSymbol("loading_message").removeObserver(requestFinished);
-
- return
-
- }
-
- }
-
- var main = function main(){
-
-
-
- loading_message = sym.getSymbol("loading_message");
- loading_message.setVariable("search-string", controller.get("search-string"));
-
-
- sym.stop();
-
- sym.getSymbolElement().css({
- height:"auto",
- "position":"relative",
- "width":"100%",
- "min-height":"100%"
- });
-
- sym.getSymbolElement().addClass("tweet-container");
-
- sym.$("tweet_container").hide();
-
- sym.$("tweet_container").css({
- "width":"100%",
- "z-index":50
- });
-
- sym.$("loading_message").css({
- "margin":"auto",
-
- "position":"relative",
-
- "z-index":39,
-
- "transform":"auto",
-
- "-webkit-transform":"auto",
-
- "width":"200px",
-
- "left":"auto"
- });
-
-
-
- $(window).bind("resize",resizeHeight);
-
-
-
- sym.addObserver(update);
-
-
-
- resizeHeight();
-
-
-
- $(controller).bind("begin.search_interlude",beginSearchInterlude);
-
- $(controller).bind("end.search_interlude",endSearchInterlude);
-
-
-
- }
-
-
- main();
- });
- //Edge binding end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- })("tweet_container");
- //Edge symbol end:'tweet_container'
-
- //=========================================================
- //Edge symbol: 'loading_message_text'
- (function(symbolName) {
- Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1000, function(sym, e) {
- sym.play(500);
- // insert code here
- });
- //Edge binding end
-
-
-
- Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
- var main = function(sym){
-
- sym.stop()
-
- sym.addObserver(update);
-
- }
-
-
- var update = function(message,sender){
-
- if(message.indexOf("search-string")>=0 ){
-
- console.log("text_message update search-string",sym.getVariable("search-string") );
-
- var search_string = sym.getSymbol("search_string");
-
- sym.$("search_string").text(decodeURI(sym.getVariable("search-string")));
-
- return
-
- }
-
- }
-
-
-
- main(sym);
-
-
-
- });
- //Edge binding end
-
- Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 500, function(sym, e) {
- // insert code here
- });
- //Edge binding end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- })("loading_message_text");
- //Edge symbol end:'loading_message_text'
-
- //=========================================================
- //Edge symbol: 'loading_message'
- (function(symbolName) {
- Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
- var main = function(sym){
-
- sym.stop();
-
- sym.$("text_message").css({
- margin:'auto'
- });
-
- sym.addObserver(update);
-
- }
-
-
-
- var update = function(message,sender){
-
- console.log("loading_message update");
-
- if(message.indexOf("search-string")>=0){
-
- console.log("loading_message update search-string",sym.getVariable("search-string"));
-
- sym.getSymbol("text_message").setVariable("search-string",sym.getVariable("search-string"));
-
- return;
-
- }
-
-
-
- if(message.indexOf("unblink")>=0){
-
- console.log("loading_message update unblink");
-
- sym.getSymbol("text_message").play(0);
-
- return
-
- }
-
-
-
- if(message.indexOf("blink")>=0){
-
- console.log("loading_message update blink");
-
- console.log("blink");
-
- sym.getSymbol("text_message").play();
-
- return
-
- }
-
-
-
- }
-
-
- main(sym);
-
-
-
- });
- //Edge binding end
-
- Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 750, function(sym, e) {
- $(window.controller).trigger("request");
-
- sym.stop()
-
- sym.notifyObservers("blink");
-
-
- });
- //Edge binding end
-
- Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1499, function(sym, e) {
- sym.stop();
-
- sym.notifyObservers("finished");
- });
- //Edge binding end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- })("loading_message");
- //Edge symbol end:'loading_message'
-
- //=========================================================
-
- //Edge symbol: 'arrow'
- (function(symbolName) {
- Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1000, function(sym, e) {
- sym.play(1);
- // insert code here
- });
- //Edge binding end
-
- Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
- });
- //Edge binding end
-
-
-
-
-
-
-
-
-
-
-
-
-
- })("arrow");
- //Edge symbol end:'arrow'
-
- //=========================================================
-
- //Edge symbol: 'creativecommon'
- (function(symbolName) {
- Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
- sym.stop();
-
- sym.getSymbolElement().addClass("creative-common");
- // insert code here
- });
- //Edge binding end
-
-
-
-
-
-
-
-
-
-
-
- })("creativecommon");
- //Edge symbol end:'creativecommon'
-
- //=========================================================
-
- //Edge symbol: 'wheel'
- (function(symbolName) {
- Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
- //sym.stop();
-
- sym.$("innerwheel").addClass("wheel");
-
- // insert code here
- });
- //Edge binding end
-
- Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 2000, function(sym, e) {
- sym.play(3);
- // insert code here
- });
- //Edge binding end
-
-
-
-
-
- })("wheel");
- //Edge symbol end:'wheel'
-
- //=========================================================
-
- //Edge symbol: 'innerwheel'
- (function(symbolName) {
-
-
-
-
- })("innerwheel");
-//Edge symbol end:'innerwheel'
-
+/***********************
+* Adobe Edge Composition Actions
+*
+* Edit this file with caution, being careful to preserve
+* function signatures and comments starting with 'Edge' to maintain the
+* ability to interact with these actions from within Adobe Edge
+*
+***********************/
+(function($, Edge, compId){
+var Composition = Edge.Composition, Symbol = Edge.Symbol; // aliases for commonly used Edge classes
+
+ //Edge symbol: 'stage'
+ (function(symbolName) {
+
+ Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
+ /**
+ * TWEETER.CLIENT
+ * @author M.PARAISO
+ * @link paraiso.marc@gmail.com
+ * @copyrights 2011 M.Paraiso , Ksu Multimedia.
+ * @description a twitter client
+ * You can search tweets , tweets are parsed and you have the ability to click on
+ * links , hashtags ,etc within the tweets.
+ **/
+
+ "use strict";
+ var defautlConfiguration,main,update,redraw,requestSuccess;
+
+ defautlConfiguration = {
+ "title":"ksu TWEET client",
+ "search-label" : "Enter a keyword : ",
+ "footer-note": "&copy; 2011 M.Paraiso. contact : mparaiso@online.fr ",
+ "search-string": "adobe edge",
+ "search-url": "http://search.twitter.com/search.json?&callback=?",
+ "search-params": {
+ "include_entities": true,
+ "rpp": 100, /** tweets per page **/
+ "result_type": "mixed",
+ "search-lang": "en"
+ }
+ };
+
+
+ // put the code in a main function so one can control the execution flow
+ main = function(sym){
+ // css hacks
+ sym.getSymbolElement().css({
+ "overflow":"hidden",
+ "width":"100%",
+ "min-height":"100%",
+ "height":null
+ });
+ // page hacks
+ $("html , body").css({
+ "width":"100%",
+ "height":"100%",
+ "margin":"0",
+ "padding":"0"
+ });
+ $("#Stage").addClass("bg");
+ setTimeout(function(){
+ // firefox width fix, to make the stage full width
+ document.getElementById("Stage").style.width= "100%";
+ },200);
+ // get application script to get extra features like controllers and models
+ $.getScript("js/application.js",function (e) {
+ // when the script is loaded , init some variables
+ // create a model
+ window.model = new App_Model();
+ // extend model datas with default configuration
+ model.extend(defautlConfiguration);
+ // create a controller in the window namespace( more like a mediator ) ,
+ window.controller = new App_Controller(model);
+ // get tweets , trigger some events
+ controller.getTweets = function () {
+ $(this).unbind("request").bind("request",function(e,d){
+ console.log("request");
+ var _this = this;
+ $.ajax({
+ "url" :this.model.get("search-url"),
+ "cache": false,
+ "dataType": "jsonp",
+ "data": $.extend(this.model.get("search-params"), {
+ q: this.model.get("search-string")
+ }),
+ "success" : requestSuccess
+ });// end ajax
+ });//end request
+ // start the interlude movie
+ $(this).trigger("begin.search_interlude");
+ }
+ // process the view events , trigger some more events
+ controller.onViewEvent = function (eventType, datas) {
+ console.log(eventType, datas)
+ switch (eventType) {
+ case "searchinputchanged":
+ this.model.set("search-string", encodeURI(datas));
+ this.getTweets();
+ break;
+ default:
+ console.log("not implemented");
+ break;
+ }
+ }
+ controller.start(function start() {
+ sym.play();
+ },sym,[],{}
+ );
+ });
+ // register update as an observer for symbol variables change
+ sym.addObserver(update);
+ // just change the intial title
+ sym.setVariable("app-title",controller.get("title"));
+ }
+ // observer
+ update = function(message,sender){
+ console.log("stage update");
+ redraw(sender);
+ return;
+ }
+
+ redraw = function(sym,datas){
+ console.log("stage redraw",sym);
+ $("title").text(sym.getVariable("app-title"));
+ }
+
+ requestSuccess = function (datas, d){
+ var tweets = $.map(datas.results, /** transform the tweet results to fit our view model for tweet display **/
+ function (object, index) {
+ return {
+ "user_id":0,
+ "created_at": object.created_at,
+ "from_user_name": object.from_user_name,
+ "profile_image_url": object.profile_image_url,
+ "id": index,
+ "text": object.text.slice(0,400),
+ "url": null,
+ "lang":"en"
+ }
+ }
+ );
+ model.set("tweets", tweets);
+ console.log("stop the interlude movie");
+ $(controller).trigger("end.search_interlude");
+ $(controller).trigger("change.tweets" );
+ }
+
+ // ok let's start that damn app :)
+ main(sym);
+
+ });
+ //Edge binding end
+
+
+
+
+ Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1500, function(sym, e) {
+
+ var footer = sym.createChildSymbol("footer", "stage");
+ // get variable from the controller
+ footer.setVariable("credits",controller.get("footer-note") ) ;
+ // css hacks
+ footer.getSymbolElement().css({
+ "width":"100%",
+ "bottom":"0",
+ "position":"absolute"
+ });
+ });
+ //Edge binding end
+
+
+
+ Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 500, function(sym, e) {
+ var header = sym.createChildSymbol("header", "stage");
+ header.setVariable("title",controller.get("title") );
+ });
+ //Edge binding end
+
+
+ Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 2500, function(sym, e) {
+ var search_strip , tweet_container,main ,update,navigateToUserTweets;
+ console.log("create")
+ main = function(sym){
+ // create child symbols
+
+ search_strip = sym.createChildSymbol("search_strip","stage");
+
+ tweet_container = sym.createChildSymbol("tweet_container","stage");
+
+ search_strip.addObserver(search_button_clicked);
+
+ tweet_container.addObserver(navigateToUserTweets);
+
+ $(controller).unbind("change.tweets").bind("change.tweets",function(event){
+
+ tweet_container.setVariable("tweets",controller.get("tweets") );
+
+ });
+
+ update();
+
+ controller.addObserver(update,sym);
+
+ }
+
+ update = function(sym){
+
+ search_strip.setVariable("search-label",controller.get("search-label"));
+
+ search_strip.setVariable("search-string",controller.get("search-string"));
+
+ tweet_container.setVariable("search-string",controller.get("search-string"));
+
+ }
+
+ var search_button_clicked = function(message,object){
+
+ if(message.indexOf("click")>=0){
+
+ console.log("search_button_clicked");
+
+ controller.onViewEvent("searchinputchanged",search_strip.getVariable("search-string") );
+
+ }
+
+ }
+ navigateToUserTweets = function navigateToUserTweets(message,sender){
+
+ if(message.indexOf("navigate")>=0){
+
+ return;
+
+ }
+
+ }
+ main(sym);
+ });
+ //Edge binding end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ })("stage");
+ //Edge symbol end:'stage'
+
+//=========================================================
+ //Edge symbol: 'footer'
+ (function(symbolName) {
+ Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
+ var main = function(sym){
+
+ sym.addObserver(onvariablechange)
+
+ sym.$("green_rect").css("width","100%");
+
+ sym.$("help").css({
+ "width":"100%"
+ }).hide();
+
+ sym.getSymbolElement().addClass("footer");
+
+ sym.$("arrow").find("div").addClass("arrow");
+ sym.$("credits").css({
+ "width":"100%"
+ });
+
+ sym.$("credits").wrap("<a target='_blank' title='' href='https://github.com/Mparaiso/twitter-client'/>");
+ }
+
+ var onvariablechange = function(message,sender){
+
+ if(message.indexOf("credits")>=0){
+
+ sym.$("credits").html(sender.getVariable("credits") );
+
+ }
+
+ }
+
+ main(sym);
+ });
+ //Edge binding end
+
+
+
+ Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1000, function(sym, e) {
+ var main = function(sym){
+
+ stop();
+
+ sym.$("arrow").bind("click",grow);
+
+ }
+
+
+
+ function grow(e){
+
+ var _this=this;
+
+ $(this).unbind("click",grow);
+
+ sym.$("green_rect").animate(
+
+ {
+ top:sym.$("green_rect").position().top-30,
+ "height":(sym.$("green_rect").height()+30)+"px"
+ },
+
+ 300,
+
+ "easeOutExpo",
+
+ function(e){
+