You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by bu...@apache.org on 2013/12/19 18:42:50 UTC
svn commit: r891069 - in /websites/staging/flex/trunk: cgi-bin/ content/
content/js/showcase.js
Author: buildbot
Date: Thu Dec 19 17:42:50 2013
New Revision: 891069
Log:
Staging update by buildbot for flex
Modified:
websites/staging/flex/trunk/cgi-bin/ (props changed)
websites/staging/flex/trunk/content/ (props changed)
websites/staging/flex/trunk/content/js/showcase.js
Propchange: websites/staging/flex/trunk/cgi-bin/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Thu Dec 19 17:42:50 2013
@@ -1 +1 @@
-1552374
+1552376
Propchange: websites/staging/flex/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Thu Dec 19 17:42:50 2013
@@ -1 +1 @@
-1552374
+1552376
Modified: websites/staging/flex/trunk/content/js/showcase.js
==============================================================================
--- websites/staging/flex/trunk/content/js/showcase.js (original)
+++ websites/staging/flex/trunk/content/js/showcase.js Thu Dec 19 17:42:50 2013
@@ -1,127 +1,124 @@
/* helper function to create the showcase
-* props:
-* title: app title
-* author: string
-* description: app description
-* [ website: url ]
-* [dev : string ]
-* links : [( "linkTyp", "url " ) + ]
-* [ videos: url ]
-* imgDir: subdirectory for images
-* images: Array of file names
-* */
-
- function addShowcaseEntry( props) {
- var i;
-
- // TITLE
- var entry = '<div class="headline"><h4>'+props.title+'</h4></div>' +
- ' <ul class="arrow_list">' +
- '<li><span class="sc_header">Summary:</span> '+props.description+' </li>' +
- '<li><span class="sc_header">Author:</span> '+props.author+' </li>' ;
- if (props.dev){
+ * props:
+ * title: app title
+ * author: string
+ * description: app description
+ * [ website: url ]
+ * [dev : string ]
+ * links : [( "linkTyp", "url " ) + ]
+ * [ videos: url ]
+ * imgDir: subdirectory for images
+ * images: Array of file names
+ * */
+
+function addShowcaseEntry(props) {
+ var i;
+
+ // TITLE
+ var entry = '<div class="headline"><h4>' + props.title + '</h4></div>' +
+ ' <ul class="arrow_list">' +
+ '<li><span class="sc_header">Summary:</span> ' + props.description + ' </li>' +
+ '<li><span class="sc_header">Author:</span> ' + props.author + ' </li>';
+ if (props.dev) {
entry += '<li><span class="sc_header">Dev details:</span> ' + props.dev + '</li>';
}
- if (props.website) {
- entry += '<li><span class="sc_header">Web site:</span> <A href="'+ props.website+'" target="_blank">' + props.website + '</A></li>';
- }
- var links = props.links;
- if (links){
- for (i=0; i < links.length; i+= 2){
- entry += '<li> <span class="sc_header">'+links[i]+':</span> <A href="' + links[i+1] + '" target="_blank">' + links[i+1] + '</A></li>';
- }
- }
- entry += '</ul>' ;
+ if (props.website) {
+ entry += '<li><span class="sc_header">Web site:</span> <A href="' + props.website + '" target="_blank">' + props.website + '</A></li>';
+ }
+ var links = props.links;
+ if (links) {
+ for (i = 0; i < links.length; i += 2) {
+ entry += '<li> <span class="sc_header">' + links[i] + ':</span> <A href="' + links[i + 1] + '" target="_blank">' + links[i + 1] + '</A></li>';
+ }
+ }
+ entry += '</ul>';
// image gallery
var imgs = props.images;
var img;
var imgPath;
- if (imgs){
- entry+="<div class='gallery_strip'>";
+ if (imgs) {
+ entry += "<div class='gallery_strip'>";
for (i = 0; i < imgs.length; i++) {
img = imgs[i];
- imgPath = "images/showcase/"+ props.imgDir + "/"
- entry += '<a class="gallery" rel="'+ props.imgDir +'" href="'+ imgPath + img + '" title="' + img + '">'
- + '<img class="showcase" src="' + imgPath + 'prev/' + img + '"/>';
+ imgPath = "images/showcase/" + props.imgDir + "/"
+ entry += '<a class="gallery" rel="' + props.imgDir + '" href="' + imgPath + img + '" title="' + img + '">'
+ + '<img class="showcase" src="' + imgPath + 'prev/' + img + '"/>';
}
- entry+="</div>";
+ entry += "</div>";
}
var entryDiv = document.createElement("div");
- entryDiv.innerHTML = entry ;
+ entryDiv.innerHTML = entry;
var showcaseContainer = document.getElementById("showcaseContainer");
showcaseContainer.appendChild(entryDiv);
}
- $(document).ready(function () {
+$(document).ready(function () {
- if (!document.getElementById("showcaseContainer"))
- return;
+ if (!document.getElementById("showcaseContainer"))
+ return;
$("a.gallery").fancybox({ cyclic: false});
- alert("showcase-ready 3");
- // retrieve showcase XML file
- // $.get("data/showcase.xml", "false", processShowcaseXML,"xml") ;
-
- $.ajax({ url: "showcase/data/showcase.xml", type: "GET", dataType: "xml",
- complete: function (result, state) {
- if (state == "success"){
- alert("complete" );
- processShowcaseXML(result.responseXML) ;
- }
- },
- error: function (result, state, error) {
- alert("http://localhost/BB_WEBSERVICES_5/showcase/showcase.xml file is not reachable:" + error)
- }
- });
+ // retrieve showcase XML file
+ // $.get("data/showcase.xml", "false", processShowcaseXML,"xml") ;
+ $.ajax({ url: "showcase/data/showcase.xml", type: "GET", dataType: "xml",
+ complete: function (result, state) {
+ if (state == "success") {
+ processShowcaseXML(result.responseXML);
+ }
+ },
+ error: function (result, state, error) {
+ alert("showcase/data/showcase.xml file is not reachable:" + error)
+ }
+ });
});
/**
*
* @param xmlData == document
*/
-function processShowcaseXML( xmlDoc) {
- var items = xmlDoc.getElementsByTagName("app");
- var i;
+function processShowcaseXML(xmlDoc) {
+ var items = xmlDoc.getElementsByTagName("app");
+ var i;
var item;
- for (i = 0; i < items.length; i++){
- item = items[i];
- // build links Array
- var linksXML = item.getElementsByTagName("link") ;
- var j;
- var links = [];
- for ( j=0; j < linksXML.length;j++){
- links.push(linksXML[j].getAttribute("header")) ;
- links.push(linksXML[j].getAttribute("url"));
- }
- // builds images array
- var imagesRootXML = item.getElementsByTagName("images") ;
- var images = [];
- if (imagesRootXML.length > 0 ){
- imagesRootXML = imagesRootXML[0] ;
- var imgBaseDir = imagesRootXML.getAttribute("baseDir");
- var imagesXML = imagesRootXML.getElementsByTagName("image");
- for (j = 0; j < imagesXML.length; j++) {
- images.push(imagesXML[j].getAttribute("file"));
- }
- }
-
- addShowcaseEntry({
- title: item.getAttribute("title") ,
- description: item.getElementsByTagName("description")[0].textContent,
- author: item.getAttribute("author"),
- website: item.getAttribute("website") ,
- dev: item.getAttribute("dev"),
- links: links,
- imgDir: imgBaseDir,
- images: images
- });
- }
+ for (i = 0; i < items.length; i++) {
+ item = items[i];
+ // build links Array
+ var linksXML = item.getElementsByTagName("link");
+ var j;
+ var links = [];
+ for (j = 0; j < linksXML.length; j++) {
+ links.push(linksXML[j].getAttribute("header"));
+ links.push(linksXML[j].getAttribute("url"));
+ }
+ // builds images array
+ var imagesRootXML = item.getElementsByTagName("images");
+ var images = [];
+ if (imagesRootXML.length > 0) {
+ imagesRootXML = imagesRootXML[0];
+ var imgBaseDir = imagesRootXML.getAttribute("baseDir");
+ var imagesXML = imagesRootXML.getElementsByTagName("image");
+ for (j = 0; j < imagesXML.length; j++) {
+ images.push(imagesXML[j].getAttribute("file"));
+ }
+ }
+
+ addShowcaseEntry({
+ title: item.getAttribute("title"),
+ description: item.getElementsByTagName("description")[0].textContent,
+ author: item.getAttribute("author"),
+ website: item.getAttribute("website"),
+ dev: item.getAttribute("dev"),
+ links: links,
+ imgDir: imgBaseDir,
+ images: images
+ });
+ }
}