From ff2490e3b4638b421c381946d8b1ebb30e51141b Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Sun, 17 Apr 2011 22:14:11 +0000 Subject: Cleanup HTML pages. Improvements and a few fixes to get consistent behavior across browsers including Safari/iOS. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1094209 13f79535-47bb-0310-9956-ffa450edef68 --- sca-cpp/trunk/modules/edit/htdocs/store/index.html | 42 +++++----- sca-cpp/trunk/modules/edit/htdocs/store/store.html | 91 ++++++++++++++-------- 2 files changed, 80 insertions(+), 53 deletions(-) (limited to 'sca-cpp/trunk/modules/edit/htdocs/store') diff --git a/sca-cpp/trunk/modules/edit/htdocs/store/index.html b/sca-cpp/trunk/modules/edit/htdocs/store/index.html index 6037746383..596f2e00c8 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/store/index.html +++ b/sca-cpp/trunk/modules/edit/htdocs/store/index.html @@ -1,31 +1,35 @@ -App Store +Store + + @@ -40,12 +44,12 @@ // Load the menu bar ui.loadwidget('menu', '/menu.html', ui.showbody); -$('h1').innerHTML = domaintitle(window.location.hostname); +$('h1').innerHTML = hometitle(window.location.hostname); // Get the store category var category = ui.queryParams()['category']; if (isNil(category)) - category = 'new'; + category = 'myapps'; // Load the store $('store').innerHTML = diff --git a/sca-cpp/trunk/modules/edit/htdocs/store/store.html b/sca-cpp/trunk/modules/edit/htdocs/store/store.html index 33285d9145..c074cc24c2 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/store/store.html +++ b/sca-cpp/trunk/modules/edit/htdocs/store/store.html @@ -1,24 +1,25 @@ + @@ -44,24 +45,24 @@ if (ui.isIE()) $('bodydiv').style.right = -20; */ var category = ui.queryParams()['category']; if (isNil(category)) - category = 'new'; + category = 'myapps'; +log('category', category); /** * Build store menu bar */ function catmenu() { function catmenuitem(name, cat) { - var c = cat == category? "smenu" : "amenu"; + var c = cat == category? 'smenu' : 'amenu'; return '' - + '' + name + ''; + + ui.ahref('/store/?category=' + cat, '_parent', '' + name + '') + ''; } var m = ''; + m += catmenuitem('My Apps', 'myapps'); m += catmenuitem('New Apps', 'new'); m += catmenuitem('Top Charts', 'top'); m += catmenuitem('Featured', 'featured'); - m += catmenuitem('Services', 'services'); - m += catmenuitem('Tests', 'tests'); m += '
'; return m; } @@ -74,6 +75,7 @@ $('catmenu').innerHTML = catmenu(); */ var editWidget = sca.component("EditWidget"); var store = sca.reference(editWidget, "store"); +var dashboard = sca.reference(editWidget, "dashboard"); /** * Return the link to an app. @@ -88,32 +90,50 @@ function applink(appname) { return link; } +/** + * Edit an app. + */ +function editApp(appname) { + return window.open('/page?app=' + appname, '_parent'); +} + +/** + * Clone an app. + */ +function cloneApp(appname) { + return window.open('/public/notyet.html', '_parent'); +} + /** * Get and display list of apps. */ -function getapps(category, sync) { +function getapps(category) { function display(doc) { var apps = '
'; var feed = car(elementsToValues(atom.readATOMFeed(mklist(doc)))); var entries = cadr(assoc("'entry", cdr(feed))); for (var i = 0; i < length(entries); i++) { var entry = entries[i]; - title = cadr(assoc("'title", entry)) - name = cadr(assoc("'id", entry)) - author = 'joe@localhost'; - hreflink = ''; + var title = cadr(assoc("'title", entry)) + var name = cadr(assoc("'id", entry)) + var author = 'joe@localhost'; + var clone = isNil(config.clone)? 'Clone' : config.clone; apps += '
' apps += ''; apps += ''; apps += ''; apps += '
'; - apps += '
' + hreflink + '' + '
'; - apps += '
'; + apps += '
' + ui.ahref(applink(name), '_blank', '') + '
'; + apps += '
'; + if (category == 'myapps') + apps += '
'; apps += '
'; - apps += '
' + hreflink + name + '
'; + apps += '
' + ui.ahref(applink(name), '_blank', name) + '
'; apps += '
' + 'by ' + '' + author + '
'; + apps += '
Feb 4, 2011
'; apps += '
'; apps += '
' + title + '
'; + apps += '
'; apps += '
'; apps += '
'; @@ -125,17 +145,20 @@ function getapps(category, sync) { ui.showbody(); } - if (sync) { - display(store.get(category)); - } else { - store.get(category, function(doc) { + if (category == 'myapps') { + dashboard.get('', function(doc) { display(doc); }); + return true; } + store.get(category, function(doc) { + display(doc); + }); + return true; } // Get and display the list of apps -getapps(category, true); +getapps(category); -- cgit v1.2.3