diff --git a/stoneSoup/config/DataTalks.php b/stoneSoup/config/DataTalks.php new file mode 100755 index 0000000..009dc4f --- /dev/null +++ b/stoneSoup/config/DataTalks.php @@ -0,0 +1,14 @@ +talks; + + $response = array(); + foreach($mocks as $key => $elem){ + $response[] = Place::fromJsonObject($elem); + } + + return $response; + } + + $places = generateMocks(); +?> diff --git a/stoneSoup/config/generalConfig.json b/stoneSoup/config/generalConfig.json new file mode 100644 index 0000000..c4cf239 --- /dev/null +++ b/stoneSoup/config/generalConfig.json @@ -0,0 +1,4 @@ +{ + "applicationPath" : "/usr/share/nginx/www/stoneSoup/", + "fileDataTalks" : "talks.json" +} diff --git a/stoneSoup/config/load.php b/stoneSoup/config/load.php new file mode 100755 index 0000000..96cfbbe --- /dev/null +++ b/stoneSoup/config/load.php @@ -0,0 +1,15 @@ +talks = json_decode(file_get_contents($configObject->fileDataTalks,true)); + + return $configObject; + } +} + +?> \ No newline at end of file diff --git a/stoneSoup/config/sections.json b/stoneSoup/config/sections.json new file mode 100644 index 0000000..3170c9c --- /dev/null +++ b/stoneSoup/config/sections.json @@ -0,0 +1,94 @@ +[ + { + "id":1, + "name":"Splash image", + "image":"banner.jpg", + "type":"image", + "controller":null, + "innerName":"splashScreen" + }, + { + "id":2, + "name":"Agile Open Buenos Aires Seguridad 2013", + "views":[ + "initialText.mustache" + ], + "type":"htmlTemplate", + "controller":null, + "innerName":"generalDescription" + }, + { + "id":3, + "name":"Charlas actuales", + "views":[ + "talkHref.mustache", + "talkPages.mustache" + ], + "comments":[false], + "type":"list", + "controller":"querys/talks.php?q=now", + "innerName":"actualTalks" + }, + { + "id":4, + "name":"Pr\u00f3ximas charlas", + "views":[ + "talkHref.mustache", + "talkPages.mustache" + ], + "type":"list", + "comments":[true], + "controller":"querys/talks.php?q=after", + "innerName":"nextTalks" + }, + { + "id":5, + "name":"queryer", + "views":["query.mustache"], + "type":"htmlTemplate", + "innerName":"queryer" + }, + { + "id":6, + "name":"mapaLugar", + "views":["mapTpl.mustache"], + "type":"map", + "innerName":"Mapa del lugar", + "mapData" : { + "position":{"longitude":-34.58445,"latitude":-58.39801}, + "zoom":17, + "polygons":[ + { + "points": [ + {"longitude":-34.5845053, "latitude":-58.3984702}, + {"longitude":-34.584785, "latitude":-58.3981282}, + {"longitude":-34.5845133, "latitude":-58.3977805}, + {"longitude": -34.5843965, "latitude":-58.3976309}, + {"longitude": -34.584109, "latitude":-58.3979417}, + {"longitude": -34.5845053, "latitude":-58.3984702} + ], + "color": "green", + "fillColor": "#0f3", + "fillOpacity": 0.5 + } + ], + "circles":[ + { + "center":{"longitude":-34.5845133, "latitude":-58.3977805}, + "radius": 3, + "color": "red", + "fillColor": "#f03", + "fillOpacity": 0.5 + } + ] + } + }, + { + "id":7, + "name":"Acerca de...", + "type":"html", + "html":"", + "controller":null, + "innerName":"acercaDe" + } +] diff --git a/stoneSoup/config/talks.json b/stoneSoup/config/talks.json new file mode 100644 index 0000000..fdc1343 --- /dev/null +++ b/stoneSoup/config/talks.json @@ -0,0 +1,144 @@ +[ + { + "id":0, + "name":"Sala 1", + "talks":[ + { + "name":"Mesa redonda: ¿Que medialunas te gustan?", + "timeDateInit":{ + "date":"2013/07/01 04:00:00", + "timezone_type":3, + "timezone":"America\/Argentina\/Buenos_Aires" + }, + "timeDateFinish":{ + "date":"2013/07/01 04:59:00", + "timezone_type":3, + "timezone":"America\/Argentina\/Buenos_Aires" + }, + "description":"Lorem ipsum dolor sit amet2", + "id":1, + "dataUrls":"" + }, + { + "name":"Despertando con seguridad", + "timeDateInit":{ + "date":"2013/07/01 05:00:00", + "timezone_type":3, + "timezone":"America\/Argentina\/Buenos_Aires" + }, + "timeDateFinish":{ + "date":"2013/07/01 06:00:00", + "timezone_type":3, + "timezone":"America\/Argentina\/Buenos_Aires" + }, + "description":"Lorem ipsum dolor sit amet", + "id":2, + "dataUrls":"" + }, + { + "name":"Minuto 1", + "timeDateInit":{ + "date":"2013/07/01 07:01:00", + "timezone_type":3, + "timezone":"America\/Argentina\/Buenos_Aires" + }, + "timeDateFinish":{ + "date":"2013/07/01 09:00:00", + "timezone_type":3, + "timezone":"America\/Argentina\/Buenos_Aires" + }, + "description":"Lorem ipsum dolor sit amet2.1111", + "id":3, + "dataUrls":"" + }, + { + "name":"Hora 9", + "timeDateInit":{ + "date":"2013/07/01 10:01:00", + "timezone_type":3, + "timezone":"America\/Argentina\/Buenos_Aires" + }, + "timeDateFinish":{ + "date":"2013/07/01 23:54:00", + "timezone_type":3, + "timezone":"America\/Argentina\/Buenos_Aires" + }, + "description":"Lorem ipsum dolor sit amet2.1111", + "id":4, + "dataUrls":"" + }, + { + "name":"Hora 12", + "timeDateInit":{ + "date":"2013/07/01 23:55:00", + "timezone_type":3, + "timezone":"America\/Argentina\/Buenos_Aires" + }, + "timeDateFinish":{ + "date":"2013/07/01 23:59:59", + "timezone_type":3, + "timezone":"America\/Argentina\/Buenos_Aires" + }, + "description":"Lorem ipsum dolor sit amet2.1111", + "id":5, + "dataUrls":"" + } + ], + "urlPhoto":"" + }, + { + "id":1, + "name":"Sala 2", + "talks":[ + { + "name":"YaSePaso", + "timeDateInit":{ + "date":"2013/07/01 05:35:50", + "timezone_type":3, + "timezone":"America\/Argentina\/Buenos_Aires" + }, + "timeDateFinish":{ + "date":"2013/07/01 12:35:50", + "timezone_type":3, + "timezone":"America\/Argentina\/Buenos_Aires" + }, + "description":"Lorem ipsum dolor sit amet3", + "id":6, + "dataUrls":"" + }, + { + "name":"Almuerzo", + "timeDateInit":{ + "date":"2013/07/01 14:00:00", + "timezone_type":3, + "timezone":"America\/Argentina\/Buenos_Aires" + }, + "timeDateFinish":{ + "date":"2013/07/01 20:00:00", + "timezone_type":3, + "timezone":"America\/Argentina\/Buenos_Aires" + }, + "description":"Lorem ipsum dolor sit amet4", + "id":7, + "dataUrls":"" + }, + { + "name":"Cena", + "timeDateInit":{ + "date":"2013/07/01 21:00:00", + "timezone_type":3, + "timezone":"America\/Argentina\/Buenos_Aires" + }, + "timeDateFinish":{ + "date":"2013/07/01 23:00:00", + "timezone_type":3, + "timezone":"America\/Argentina\/Buenos_Aires" + }, + "description":"Lorem ipsum dolor sit amet4", + "id":8, + "dataUrls":"" + } + ], + "urlPhoto":"" + } +] diff --git a/stoneSoup/dao/DAOs.php b/stoneSoup/dao/DAOs.php new file mode 100755 index 0000000..d7be3c0 --- /dev/null +++ b/stoneSoup/dao/DAOs.php @@ -0,0 +1,174 @@ +data = $data; + } + + public function all(){ //All talks! + $resp = array(); + foreach ($this->data as $key => $elem) { + $resp = array_merge($resp, $elem->talks); + } + return $resp; + } + + public function now(){ + $now = new DateTime(); + $resp = array(); + + // Filter if init is before "NOW". + $theQuery = array(); + $theQuery["type"] = "simple"; + $theQuery["operator"] = "antes"; + $theQuery["object"] = "charla"; + $theQuery["prop1"] = "timeDateInit"; + $theQuery["value"] = $now->format(DateUtils::getDateFormat()); + + $queryResponse = $this->query($theQuery); + + // Filter if end is after "NOW" (the talk doesn't finished yet) + $theQuery["type"] = "simple"; + $theQuery["operator"] = "despues"; + $theQuery["object"] = "charla"; + $theQuery["prop1"] = "timeDateFinish"; + $theQuery["value"] = $now->format(DateUtils::getDateFormat()); + + $resp = $this->query($theQuery,$queryResponse); + + return $resp; + } + + public function after(){ + $now = new DateTime(); + $resp = array(); + + // Filter if init is after "NOW" + $theQuery = array(); + $theQuery["type"] = "simple"; + $theQuery["operator"] = "despues"; + $theQuery["object"] = "charla"; + $theQuery["prop1"] = "timeDateInit"; + $theQuery["value"] = $now->format(DateUtils::getDateFormat()); + + $queryResponse = $this->query($theQuery); + + // TODO: Only use the Query language. + // Obtained all AFTER elements. + // Now, obtain minimals per Places: + + $resp = array(); + foreach ($queryResponse as $key => $elem) { + $actualMinimal = null; + if(array_key_exists($elem->place->id,$resp)) + $actualMinimal = $resp[$elem->place->id]; + + $resp[$elem->place->id] = $elem->closerETA($actualMinimal); + + } + + return $resp; + } + + public function before(){ + return array(); + } + + public function talksIn($idPlace){ + return array(); + } + /* + { + - "type": "simple", + - "operator": "(igual|mayor|menor|cantidad)", + - "object" : "(salon|charla)" + "prop1": name|timeDateInit|timeDateFinish|description|id|dataUrls|anyTalk", + "prop2": si es anyTalk, la propiedad de la charla. + "value": valor (constante) con el cual comparará. + "return": "\d+|all" + } + */ + public function query($theQuery, $optionalArray = null){ + + // Operadores binarios + $igualComparator = function ($elem,$i,$theQuery,$prop = "prop1",$value= "value"){ + return $elem->$theQuery[$prop] == $theQuery[$value]; + }; + $mayorComparator = function ($elem,$i,$theQuery,$prop = "prop1",$value= "value"){ + return $elem->$theQuery[$prop] > $theQuery[$value]; + }; + $menorComparator = function ($elem,$i,$theQuery,$prop = "prop1",$value= "value"){ + return $elem->$theQuery[$prop] < $theQuery[$value]; + }; + $cantidadComparator = function ($elem,$i,$theQuery,$prop= "prop1",$value= "value"){ + return count($elem->$theQuery[$prop]) == $theQuery[$value]; + }; + + $antesComparator = function ($elem,$i,$theQuery,$prop = "prop1",$value= "value"){ + return $elem->$theQuery[$prop] <= DateUtils::getDate($theQuery[$value]); + }; + $despuesComparator = function ($elem,$i,$theQuery,$prop = "prop1",$value= "value"){ + return $elem->$theQuery[$prop] >= DateUtils::getDate($theQuery[$value]); + }; + + // Operadores ternarios + $entreComparator = function ($elem,$i,$theQuery) use (&$despuesComparator,&$antesComparator){ + $prop1 = "prop1"; + $prop2 = "prop2"; + if($theQuery["prop2"] == "") + $prop2 = $prop1; + + return $despuesComparator($elem,$i,$theQuery,$prop1,"value1") && + $antesComparator($elem,$i,$theQuery,$prop2,"value2"); + }; + + // Operadores lógicos + // TODO: Revisar!!! + $OComparator = function($func1,$func2,$elem,$i,$theQuery){ + return call_user_func($func1,$elem,$i,$theQuery) || + call_user_func($func2,$elem,$i,$theQuery); + }; + $YComparator = function($func1,$func2,$elem,$i,$theQuery){ + return call_user_func($func1,$elem,$i,$theQuery) && + call_user_func($func2,$elem,$i,$theQuery); + }; + + if ($theQuery["type"] == "simple"){ + // Divido por mayusculas + $arr = preg_split('/(?=[A-Z])/',$theQuery["operator"]); + $sizeArr = count($arr); + /* + Si sizeArr == 1, entonces estoy en una query comun. + Si sizeArr > 2, entonces estoy en una query "compuesta". + */ + if($sizeArr == 1) + $functionToDo = ${$arr[0] . "Comparator"}; + elseif($sizeArr>2){ //TODO: Aplicar a mas de dos argumentos + + } + + // Despues me fijo en el objeto. + $arrayObjects = null; + if($optionalArray){ + $arrayObjects = $optionalArray; + } else if($theQuery["object"] == "charla"){ + $arrayObjects = $this->all(); + } else if($theQuery["object"] == "salon"){ + $arrayObjects = $this->data; + } + + // Ahora voy a comparar! + $queryResponse = array(); + foreach ($arrayObjects as $key => $elem){ + $r = call_user_func($functionToDo,$elem,$key,$theQuery); + if($r){ + $queryResponse[] = $elem; + } + } + + return $queryResponse; + } + return "ERROR"; // see how to throw exceptions in php. + } +} +?> diff --git a/stoneSoup/dao/Models.php b/stoneSoup/dao/Models.php new file mode 100755 index 0000000..4a78c9a --- /dev/null +++ b/stoneSoup/dao/Models.php @@ -0,0 +1,98 @@ +", $timeDateInit = null, $timeDateFinish= null, $description = "", $dataUrls = "", + $place = "") { + $this->name = $name; + $this->timeDateInit = $timeDateInit; + $this->timeDateFinish = $timeDateFinish; + $this->description = $description; + $this->id = $id; + $this->dataUrls = $dataUrls; + $this->place = $place; + } + + public static function fromJsonObject($object){ + $instance = new self(); + $instance->name = $object->name; + + $instance->timeDateInit = DateUtils::getDate($object->timeDateInit->date); + $instance->timeDateFinish = DateUtils::getDate($object->timeDateFinish->date); + $instance->description = $object->description; + $instance->id = $object->id; + $instance->dataUrls = $object->dataUrls; + + + return $instance; + } + + public function ETA(){ + return $this->timeDateInit->diff(new DateTime()); + } + + public function closerETA($talk){ + if($talk) + return $this->ETA() < $talk->ETA()? $this : $talk; + else + return $this; + } +} + +class Place { + public $name; + public $talks; + public $urlPhoto; + public $id; + + function __construct($id = 0, $name = "", $talks = array(),$urlPhoto = ""){ + $this->name = $name; + $this->talks = $talks; + $this->urlPhoto = $urlPhoto; + $instance->id = $id; + + } + + public static function fromJsonObject($object){ + $instance = new self(); + $instance->name = $object->name; + $instance->urlPhoto = $object->urlPhoto; + $instance->talks = array(); + $instance->id = $object->id; + + $instanceForTalks = clone $instance; + $tmpTalks = array(); + + foreach($object->talks as $key => $elem){ + $newTalk = Talk::fromJsonObject($elem); + $newTalk->place = $instanceForTalks; + $tmpTalks[] = $newTalk; + } + + $instance->talks = $tmpTalks; + + return $instance; + } +} + + + + + +?> diff --git a/stoneSoup/files/templates/initialText.mustache b/stoneSoup/files/templates/initialText.mustache new file mode 100755 index 0000000..4c59ec0 --- /dev/null +++ b/stoneSoup/files/templates/initialText.mustache @@ -0,0 +1,7 @@ +
+

Agiles Open Buenos Aires Seguridad 2013!

+ +

Desde 2008 con las Jornadas Latinoamericanas Ágiles, y desde el 2009 con los Agile Open en Buenos Aires, Córdoba, Tandil, La Plata, Mar del Plata, Bahía Blanca, Tucumán y Paraná, este año organizamos el evento Agile Open Buenos Aires Seguridad 2013, enfocado en el tema Seguridad y Agile.

+ +

Este evento servirá para la capacitación y el intercambio de experiencias relacionadas con la seguridad informática. Esperamos juntar distintas comunidades en un encuentro enriquecedor con un formato que nunca falla (Open Space).

+
\ No newline at end of file diff --git a/stoneSoup/files/templates/mapTpl.mustache b/stoneSoup/files/templates/mapTpl.mustache new file mode 100644 index 0000000..dc0188b --- /dev/null +++ b/stoneSoup/files/templates/mapTpl.mustache @@ -0,0 +1,30 @@ +

Mapa del evento.

+ +
+ +
diff --git a/stoneSoup/files/templates/query.mustache b/stoneSoup/files/templates/query.mustache new file mode 100755 index 0000000..b224928 --- /dev/null +++ b/stoneSoup/files/templates/query.mustache @@ -0,0 +1,18 @@ + + +

+ diff --git a/stoneSoup/files/templates/section.mustache b/stoneSoup/files/templates/section.mustache new file mode 100755 index 0000000..21ac2ad --- /dev/null +++ b/stoneSoup/files/templates/section.mustache @@ -0,0 +1,5 @@ +
+

{{name}}

+
+
\ No newline at end of file diff --git a/stoneSoup/files/templates/talkHref.mustache b/stoneSoup/files/templates/talkHref.mustache new file mode 100755 index 0000000..bbfad11 --- /dev/null +++ b/stoneSoup/files/templates/talkHref.mustache @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/stoneSoup/files/templates/talkPages.mustache b/stoneSoup/files/templates/talkPages.mustache new file mode 100755 index 0000000..c8c11d2 --- /dev/null +++ b/stoneSoup/files/templates/talkPages.mustache @@ -0,0 +1,19 @@ + +
+
+ Inicio

{{name}}

+
+
+
+

{{name}}

+

{{timeDateInit}} a {{timeDateFinish}}

+

{{place.name}}

+

{{description}}

+
+
+

Archivos adjuntos

+
+
+
+
+ diff --git a/stoneSoup/img/banner.jpg b/stoneSoup/img/banner.jpg new file mode 100644 index 0000000..867f566 Binary files /dev/null and b/stoneSoup/img/banner.jpg differ diff --git a/stoneSoup/img/logo_flisol.png b/stoneSoup/img/logo_flisol.png new file mode 100755 index 0000000..cf1f0e3 Binary files /dev/null and b/stoneSoup/img/logo_flisol.png differ diff --git a/stoneSoup/index.php b/stoneSoup/index.php new file mode 100755 index 0000000..5f80d20 --- /dev/null +++ b/stoneSoup/index.php @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + +
+
+ Agile Open Buenos Aires 2013 +
+ +
+
+
+
+
+ Creado y mantendio por GNUtn +
+
+ + diff --git a/stoneSoup/js/eventCatchers/default.js b/stoneSoup/js/eventCatchers/default.js new file mode 100755 index 0000000..6686755 --- /dev/null +++ b/stoneSoup/js/eventCatchers/default.js @@ -0,0 +1,128 @@ +Utils = { + _createPage: function(html, page) { + //append the new page onto the end of the body + if(page == null) + return; + $('#theBody').append(html); + $("#"+page).one( 'pagecreate', $.mobile._bindPageRemove ); + } +} + +ListComponent = { // TODO: Inherit from CollapsableComponent + func: function(section){ + return function(evt){ + var theContent = $("[id='" + this.id + "Content']"); + theContent.empty(); + var name = this.id + var tpl = View.tpl[name][0]; + var tplPage = View.tpl[name][1]; + // Obtengo las proximas charlas. + Model[name](function(talks){ + // Creo las paginas + ListComponent.createListOfTalks(talks,tplPage,tpl,name+"Ul",name+"Content") + }); + }; + }, + component:function(section){ + var div = $(Mustache.render(View.tpl.section,section)); + div.collapsible({refresh:true}); + div.bind('expand', View.components[section.type].func(section)); + return div; + }, + createListOfTalks:function(talks,tplPage,tpl,idUl,idContent){ + var viewTalks = []; + for(var i in talks){ + id = null; + + id = "talkPage" + talks[i].id; + + //clonning attribute by atribute in javascript is too slow :( + var viewTalk = JSON.parse(JSON.stringify(talks[i])); + viewTalk.timeDateInit = talks[i].timeDateInit.date.substring(11,16); + viewTalk.timeDateFinish = talks[i].timeDateFinish.date.substring(11,16); + viewTalks.push(viewTalk); + + Utils._createPage(Mustache.render(tplPage, viewTalk),id); + + } + + var obj = { 'data' : viewTalks, 'id' : idUl }; + + $("#" + idContent).html( Mustache.render(tpl, obj) ); + $("#" + idUl ).listview(); + } +} + +CollapsableHtmlComponent = { + expand : function(section){ + return function(evt){ + var name = this.id + var tpl = View.tpl[name][0]; + $("#" + name + "Content").html(Mustache.render(tpl,section)); + } + }, + component: function(section){ + var div = $(Mustache.render(View.tpl.section,section)); + div.collapsible({refresh:true}); + div.bind('expand', this.expand(section)); + return div; + } +} + +ImageComponent = { + component:function(section){ + return ""; + } +} + +PicasaComponent = { //TODO : all ;) + component:function(section){ + return ""; + } +} + +PlainComponent = { + component:function(section){ + return div = $(Mustache.render(View.tpl.section,section)); + } +} + + +OpenStreetMapComponent = { + component: function(section){ + var div = $("
"); + div.attr("style","width:95%;height:280px;margin:0px auto;margin-bottom:30px"); //TODO: pass to class + $(document).ready(function(){ + var name = section.innerName + var tpl = View.tpl[name][0]; + div.prepend($(Mustache.render(tpl,section))); + }); + return div; + } +}; + +TextComponent = Object.create(CollapsableHtmlComponent,{ + expand: { + value: function(section){ + return function(evt){ + var name = section.innerName + $("#" + name + "Content").html(section.html); + } + } + } +}); + +DefaultComponents = { + "list": ListComponent, + "htmlTemplate": CollapsableHtmlComponent, + "plain" : PlainComponent, + "image" : ImageComponent, + "map" : OpenStreetMapComponent, + "html" : TextComponent, + addComponent : function(name,component){ + if(DefaultComponents[name]) + throw "Component " + name + " already exists"; + else + DefaultComponents[name] = component; + } +}; \ No newline at end of file diff --git a/stoneSoup/js/injector.js b/stoneSoup/js/injector.js new file mode 100755 index 0000000..2cd9a25 --- /dev/null +++ b/stoneSoup/js/injector.js @@ -0,0 +1,5 @@ +$.getJSON("config/sections.json",function(data){ + Model.loadAll(data); + View.loadEvents(DefaultComponents); + View.loadAll(data); +}); diff --git a/stoneSoup/js/models.js b/stoneSoup/js/models.js new file mode 100755 index 0000000..9f21d3b --- /dev/null +++ b/stoneSoup/js/models.js @@ -0,0 +1,29 @@ +Model = { + loadAll: function(sections){ + for(var i in sections){ + elem = sections[i]; + + if(elem.controller) + Model[elem.innerName] = Model.genericGetter(elem.innerName, elem); + }; + }, + genericGetter : function(name, elem){ + return function(callback){ + $.getJSON(elem.controller, function(data){ + Cache[name] = { + response: data, + date: new Date() + }; + callback(data); + }); + } + }, + NullTalk : function(){ + this.name = "No hay charlas"; + this.id = null; + } +} + +Cache = { + +} diff --git a/stoneSoup/js/views.js b/stoneSoup/js/views.js new file mode 100755 index 0000000..339db9d --- /dev/null +++ b/stoneSoup/js/views.js @@ -0,0 +1,78 @@ +View = { + tpl : { + "section" : "files/templates/section.mustache" + }, + components : {}, + loadEvents:function(component){ + View.components = component; + }, + loadAll:function(sections){ + View._countSections = sections.length; + + $.get(View.tpl["section"],function(data){ + View.tpl["section"] = data; + View.loadTemplates(sections); + }); + }, + loadTemplates : function(sections){ + $.each(sections, function(i,section){ + View.tpl[section.innerName] = []; + if(section.views){ + $.each(section.views, function(i,elem){ + $.get("files/templates/"+elem,View._loadTemplate(section)); + }); + } else { + View.eventLoadedAllTemplatesOf(section); + } + }); + }, + _loadTemplate: function(section){ + return function(data){ + View.tpl[section.innerName].push(data); + /** + * _loadTemplate loads a template :P. + * If all templates of this section are loaded, then + * throw the LoadedAllTemplatesOf event. + */ + + if(section.views.length == View.tpl[section.innerName].length){ + View.eventLoadedAllTemplatesOf(section); + + } + } + }, + eventLoadedAllTemplatesOf: function(section){ + /** + * + * save the Loaded template. + * + */ + View._loadedTemplates.push (section); + /** + * + * If all the section's templates are loaded, throw + * the LoadedAllComponents event. + * + */ + if(View._loadedTemplates.length == View._countSections){ + View._loadedTemplates.sort(function(a,b){ + return a.id-b.id; + }); + console.log(View._loadedTemplates); + View.eventLoadedAllComponents(); + } + }, + eventLoadedAllComponents: function(){ + $.each(View._loadedTemplates,function(i,data){ + if(data){ + View.loadComponent(data); + } + }); + }, + loadComponent : function(section){ + var div = View.components[section.type].component(section); + $("#mainContent").append(div); + }, + _loadedTemplates : [], + _countSections : 0 + }; \ No newline at end of file diff --git a/stoneSoup/model.php b/stoneSoup/model.php new file mode 100755 index 0000000..4b838e8 --- /dev/null +++ b/stoneSoup/model.php @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/stoneSoup/phpinfo.php b/stoneSoup/phpinfo.php new file mode 100644 index 0000000..34f1171 --- /dev/null +++ b/stoneSoup/phpinfo.php @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/stoneSoup/querys/talks.php b/stoneSoup/querys/talks.php new file mode 100755 index 0000000..3ea380d --- /dev/null +++ b/stoneSoup/querys/talks.php @@ -0,0 +1,20 @@ +data);;break; + case "now": $resp = json_encode($dao->now());; break; + case "after": $resp = json_encode($dao->after());; break; + case "before": $resp = json_encode($dao->before());; break; + case "query": $resp = json_encode($dao->query($_POST["query"])); + break; + default: $resp = '["STATUS":"BAD REQUEST"]'; +} +header('Content-type: application/json'); +exit($resp); +?>