diff options
Diffstat (limited to 'sca-cpp/trunk/hosting/server/htdocs')
21 files changed, 224 insertions, 224 deletions
diff --git a/sca-cpp/trunk/hosting/server/htdocs/account/index.html b/sca-cpp/trunk/hosting/server/htdocs/account/index.html index 47c0ea0e9c..9357a89dd6 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/account/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/account/index.html @@ -133,29 +133,29 @@ var savedpicxml = ''; var acct = cadr(assoc("'content", acctentry)); var email = assoc("'email", acct); - $('userEmail').value = isNil(email) || isNil(cdr(email))? '' : cadr(email); + $('userEmail').value = isNull(email) || isNull(cdr(email))? '' : cadr(email); var desc = assoc("'description", acct); - $('userDescription').innerHTML = isNil(desc) || isNil(cdr(desc))? '' : cadr(desc); + $('userDescription').innerHTML = isNull(desc) || isNull(cdr(desc))? '' : cadr(desc); /* TODO disabled for now var cal = assoc("'calendar", acct); reduce(function(i, evt) { var sched = assoc("'@schedule", evt); var svc = assoc("'@service", evt); - $('sched' + i).value = isNil(sched)? '' : cadr(sched); - $('service' + i).value = isNil(svc)? '' : cadr(svc); + $('sched' + i).value = isNull(sched)? '' : cadr(sched); + $('service' + i).value = isNull(svc)? '' : cadr(svc); return i + 1; - }, 1, isNil(cal)? mklist() : cadr(cadr(cal))); + }, 1, isNull(cal)? mklist() : cadr(cadr(cal))); var keys = assoc("'keys", acct); reduce(function(i, key) { var kn = assoc("'@name", key); var kv = assoc("'@value", key); - $('name' + i).value = isNil(kn)? '' : cadr(kn); - $('value' + i).value = isNil(kv)? '' : cadr(kv); + $('name' + i).value = isNull(kn)? '' : cadr(kn); + $('value' + i).value = isNull(kv)? '' : cadr(kv); return i + 1; - }, 1, isNil(keys)? mklist() : cadr(cadr(keys))); + }, 1, isNull(keys)? mklist() : cadr(cadr(keys))); */ savedacctxml = car(atom.writeATOMEntry(valuesToElements(mklist(acctentry)))); @@ -184,7 +184,7 @@ var savedpicxml = ''; var content = assoc("'content", picentry); var picture = assoc("'picture", content); var img = assoc("'image", picture); - if (!isNil(img)) + if (!isNull(img)) $('userPicture').src = cadr(img); onlinestatus(); @@ -216,11 +216,11 @@ function refreshpic() { var token = assoc("'token", picture); // Update picture - if (isNil(token)) { + if (isNull(token)) { var entryxml = car(atom.writeATOMEntry(valuesToElements(mklist(picentry)))); savedpicxml = entryxml; var img = assoc("'image", picture); - if (!isNil(img)) + if (!isNull(img)) $('userPicture').src = cadr(img); $('refreshingPicture').style.display = 'none'; refreshingpic = false; @@ -237,7 +237,7 @@ function refreshpic() { * Save the user's account. */ function saveacct(entryxml) { - if (isNil(username)) + if (isNull(username)) return false; workingstatus(true); showstatus('Saving'); @@ -261,7 +261,7 @@ function saveacct(entryxml) { * Save the user's picture. */ function savepic(entryxml) { - if (isNil(username)) + if (isNull(username)) return false; workingstatus(true); showstatus('Uploading'); diff --git a/sca-cpp/trunk/hosting/server/htdocs/app/index.html b/sca-cpp/trunk/hosting/server/htdocs/app/index.html index cd033118a3..9ff3a72b0f 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/app/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/app/index.html @@ -207,7 +207,7 @@ window.addEventListener('online', function(e) { * as a list of ids. */ function namedvalue(l, id) { - if (isNil(l)) + if (isNull(l)) return null; var e = car(l); @@ -215,7 +215,7 @@ function namedvalue(l, id) { if (car(id) == elementName(e)) { // Found element matching the whole id path - if (isNil(cdr(id))) + if (isNull(cdr(id))) return e; // Search for next id segments in child elements @@ -267,15 +267,15 @@ function setwidgetvalue(e, dv) { } function vattr(dv) { - return (elementHasValue(dv) && !isNil(elementValue(dv)))? mklist(mklist('value', isNil(elementValue(dv))? '' : elementValue(dv))) : mklist(); + return (elementHasValue(dv) && !isNull(elementValue(dv)))? mklist(mklist('value', isNull(elementValue(dv))? '' : elementValue(dv))) : mklist(); } function sattr(dv) { var s = namedElementChild("'htstyle", dv); - return isNil(s)? mklist() : mklist(mklist('style', elementHasValue(s)? elementValue(s) : elementChildren(s))) + return isNull(s)? mklist() : mklist(mklist('style', elementHasValue(s)? elementValue(s) : elementChildren(s))) } - var attrs = append(append(isNil(htattrs)? mklist() : map(attr, elementChildren(htattrs)), vattr(dv)), sattr(dv)); + var attrs = append(append(isNull(htattrs)? mklist() : map(attr, elementChildren(htattrs)), vattr(dv)), sattr(dv)); // Set the attributes of the widget function setattrs(vsetter, attrs, ce) { @@ -312,7 +312,7 @@ function setwidgetvalue(e, dv) { // Define the stylesheet if (s != '') { var esheet = ui.elementByID(contentdiv, 'style_' + e.id); - if (isNil(esheet)) { + if (isNull(esheet)) { var nesheet = document.createElement('style'); nesheet.id = 'style_' + e.id; nesheet.type = 'text/css'; @@ -330,7 +330,7 @@ function setwidgetvalue(e, dv) { ce.setAttribute('style', p); // Restart current animation if necessary - if (!isNil(aname) && ce.style.webkitAnimationName == aname) { + if (!isNull(aname) && ce.style.webkitAnimationName == aname) { ce.style.webkitAnimationName = ''; ui.async(function restartanimation() { ce.style.webkitAnimationName = aname; @@ -381,12 +381,12 @@ function setwidgetvalue(e, dv) { return setattrs(setselectvalue, attrs, ce); } if (e.className == 'list') { - var dl = ui.datalist(isNil(dv)? mklist() : mklist(dv)); + var dl = ui.datalist(isNull(dv)? mklist() : mklist(dv)); e.innerHTML = dl; return dl; } if (e.className == 'table') { - var dl = ui.datatable(isNil(dv)? mklist() : mklist(dv)); + var dl = ui.datatable(isNull(dv)? mklist() : mklist(dv)); e.innerHTML = dl; return dl; } @@ -422,19 +422,19 @@ function setwidgetvalue(e, dv) { * Update the app page with the given app data. */ function updatepage(l) { - if (isNil(l)) + if (isNull(l)) return true; // Update the widgets values function updatewidget(e) { var dv = namedvalue(l, map(function(t) { return "'" + t; }, e.id.split('.'))); - if (dv == null || isNil(dv)) + if (dv == null || isNull(dv)) return e; setwidgetvalue(e, dv); return e; } - map(updatewidget, filter(function(e) { return !isNil(e.id) && e.id.substring(0, 5) != 'page:'; }, nodeList(ui.elementByID(contentdiv, 'page').childNodes))); + map(updatewidget, filter(function(e) { return !isNull(e.id) && e.id.substring(0, 5) != 'page:'; }, nodeList(ui.elementByID(contentdiv, 'page').childNodes))); return true; } @@ -442,7 +442,7 @@ function updatepage(l) { * Convert a document to application data. */ function docdata(doc) { - if (isNil(doc)) + if (isNull(doc)) return null; if (json.isJSON(mklist(doc))) @@ -566,7 +566,7 @@ function fixupwidget(e) { * Set initial value of a widget. */ function initwidget(e) { - if (!isNil(e.id) && e.id.substring(0, 5) != 'page:') + if (!isNull(e.id) && e.id.substring(0, 5) != 'page:') setwidgetvalue(e, mklist()); return e; } @@ -575,9 +575,9 @@ function initwidget(e) { * Return the component bound to a uri. */ function isbound(uri, comps) { - return !isNil(filter(function(comp) { - return !isNil(filter(function(svc) { - return !isNil(filter(function(b) { + return !isNull(filter(function(comp) { + return !isNull(filter(function(svc) { + return !isNull(filter(function(b) { return uri == scdl.uri(b); }, scdl.bindings(svc))); }, scdl.services(comp))); @@ -592,7 +592,7 @@ function getappdata(appname, page, compos) { // Eval a component init script function evalcompinit(doc) { - if (isNil(doc)) + if (isNull(doc)) return true; var js = car(json.readJSON(mklist(doc))); if (!elementHasValue(js)) @@ -609,7 +609,7 @@ function getappdata(appname, page, compos) { } // Setup the widgets - map(setupwidget, filter(function(e) { return !isNil(e.id); }, nodeList(ui.elementByID(contentdiv, 'page').childNodes))); + map(setupwidget, filter(function(e) { return !isNull(e.id); }, nodeList(ui.elementByID(contentdiv, 'page').childNodes))); // Get the app components var comps = scdl.components(compos); @@ -617,7 +617,7 @@ function getappdata(appname, page, compos) { // Get the component app data if (isbound("start", comps)) { startcomp.get(location.search, function(doc, e) { - if (isNil(doc)) { + if (isNull(doc)) { debug('error on get(start, ' + location.search + ')', e); return false; } @@ -630,7 +630,7 @@ function getappdata(appname, page, compos) { // Get and eval the optional timer, animation and location watch setup scripts if (isbound("timer", comps)) { timercomp.get('setup', function(doc, e) { - if (isNil(doc)) { + if (isNull(doc)) { debug('error on get(timer, setup)', e); return false; } @@ -642,7 +642,7 @@ function getappdata(appname, page, compos) { if (isbound("animation", comps)) { animationcomp.get('setup', function(doc, e) { - if (isNil(doc)) { + if (isNull(doc)) { debug('error on get(animation, setup)', e); return false; } @@ -654,7 +654,7 @@ function getappdata(appname, page, compos) { if (isbound("location", comps)) { locationcomp.get('setup', function(doc, e) { - if (isNil(doc)) { + if (isNull(doc)) { debug('error on get(location, setup)', e); return false; } @@ -677,7 +677,7 @@ function getappdata(appname, page, compos) { */ function atompage(doc) { var entry = atom.readATOMEntry(mklist(doc)); - if (isNil(entry)) + if (isNull(entry)) return mklist(); var content = namedElementChild("'content", car(entry)); if (content == null) @@ -691,7 +691,7 @@ function atompage(doc) { function getapppage(appname, compos) { pagecomp.get(appname, function(doc, e) { //debug('page get'); - if (isNil(doc)) { + if (isNull(doc)) { debug('error in getapppage', e); return false; } @@ -702,7 +702,7 @@ function getapppage(appname, compos) { apppage = page; // Merge in the app data - if (!isNil(appcomposite)) + if (!isNull(appcomposite)) getappdata(appname, apppage, appcomposite); }); @@ -720,10 +720,10 @@ function compquery() { return append(nodeList(n.childNodes), reduce(append, mklist(), map(childrenList, nodeList(n.childNodes)))); } - var args = map(queryarg, filter(function(e) { return !isNil(e.id) && !isNil(inputvalue(e)); }, childrenList(ui.elementByID(contentdiv, 'page')))); + var args = map(queryarg, filter(function(e) { return !isNull(e.id) && !isNull(inputvalue(e)); }, childrenList(ui.elementByID(contentdiv, 'page')))); // Append current location properties if known - if (!isNil(geoposition)) { + if (!isNull(geoposition)) { var g = geoposition; args = append(args, mklist('latitude=' + g.coords.latitude, 'longitude=' + g.coords.longitude, 'altitude=' + g.coords.altitude, 'accuracy=' + g.coords.accuracy, 'altitudeAccuracy=' + g.coords.altitudeAccuracy, 'heading=' + g.coords.heading, @@ -740,7 +740,7 @@ function buttonClickHandler(id, appname) { try { var uri = compquery(); return sca.component(id, appname).get(uri, function(doc, e) { - if (isNil(doc)) { + if (isNull(doc)) { debug('error on get(button, ' + uri + ')', e); return false; } @@ -761,7 +761,7 @@ function intervalHandler() { try { var uri = compquery(); return timercomp.get(uri, function(doc, e) { - if (isNil(doc)) { + if (isNull(doc)) { debug('error on get(timer, ' + uri + ')', e); return false; } @@ -804,7 +804,7 @@ function animationHandler() { updatepage(car(currentAnimationData)); // End of animation? - if (isNil(cdr(currentAnimationData))) { + if (isNull(cdr(currentAnimationData))) { if (currentAnimationLoop == -1) { // Repeat current animation forever currentAnimationData = animationData; @@ -830,12 +830,12 @@ function animationHandler() { } // Get new animation data if necessary - if (isNil(animationData)) { + if (isNull(animationData)) { if (gettingAnimationData) return true; var uri = compquery(); return animationcomp.get(uri, function(doc, e) { - if (isNil(doc)) { + if (isNull(doc)) { debug('error on get(animation, ' + uri + ')', e); return false; } @@ -882,7 +882,7 @@ function locationHandler(pos) { geoposition = pos; var uri = compquery(); return locationcomp.get(uri, function(doc, e) { - if (isNil(doc)) { + if (isNull(doc)) { debug('error on get(location, ' + uri + ')', e); return false; } @@ -897,7 +897,7 @@ function locationHandler(pos) { function locationErrorHandler(e) { debug('location error', e); - if (!isNil(locationWatch)) { + if (!isNull(locationWatch)) { try { navigator.geolocation.clearWatch(locationWatch); } catch(e) {} @@ -911,7 +911,7 @@ function locationErrorHandler(e) { */ function setupLocationHandler() { function installLocationHandler() { - if (!isNil(locationWatch)) + if (!isNull(locationWatch)) return true; try { locationWatch = navigator.geolocation.watchPosition(locationHandler, locationErrorHandler); @@ -940,7 +940,7 @@ document.body.onorientationchange = function(e) { */ function atomcomposite(doc) { var entry = atom.readATOMEntry(mklist(doc)); - if (isNil(entry)) + if (isNull(entry)) return mklist(); var content = namedElementChild("'content", car(entry)); if (content == null) @@ -954,13 +954,13 @@ function atomcomposite(doc) { function getappcomposite(appname) { return composcomp.get(appname, function(doc, e) { //debug('page get'); - if (isNil(doc)) { + if (isNull(doc)) { debug('error in getappcomposite', e); return false; } var compos = atomcomposite(doc); - if (isNil(compos)) { + if (isNull(compos)) { // Create a default empty composite if necessary var x = '<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" ' + @@ -970,7 +970,7 @@ function getappcomposite(appname) { appcomposite = compos; // Merge in the app data - if (!isNil(apppage)) + if (!isNull(apppage)) getappdata(appname, apppage, appcomposite); }); } diff --git a/sca-cpp/trunk/hosting/server/htdocs/clone/index.html b/sca-cpp/trunk/hosting/server/htdocs/clone/index.html index c6a9658ce0..e9de1be1fb 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/clone/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/clone/index.html @@ -72,7 +72,7 @@ var savedappxml = ''; * Get and display the requested app. */ (function getapp() { - if (isNil(appname)) + if (isNull(appname)) return false; workingstatus(true); showstatus('Loading'); @@ -149,7 +149,7 @@ $('cloneAppForm').onsubmit = function() { // Check reserved app names var reserved = mklist('account', 'app', 'cache', 'clone', 'create', 'delete', 'graph', 'home', 'login', 'new', 'page', 'proxy', 'public', 'private', 'info', 'store'); - if (!isNil(assoc(name, map(function(r) { return mklist(r, r); }, reserved)))) { + if (!isNull(assoc(name, map(function(r) { return mklist(r, r); }, reserved)))) { errorstatus('App name is taken, please pick another name'); return false; } diff --git a/sca-cpp/trunk/hosting/server/htdocs/config.js b/sca-cpp/trunk/hosting/server/htdocs/config.js index 355174e6f7..20212980f0 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/config.js +++ b/sca-cpp/trunk/hosting/server/htdocs/config.js @@ -17,7 +17,7 @@ * under the License. */ -if (isNil(config)) +if (isNull(config)) config = {}; /** diff --git a/sca-cpp/trunk/hosting/server/htdocs/create/index.html b/sca-cpp/trunk/hosting/server/htdocs/create/index.html index a11c0958f5..3fc26b8515 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/create/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/create/index.html @@ -114,7 +114,7 @@ $('createAppForm').onsubmit = function() { // Check reserved app names var reserved = mklist('account', 'app', 'cache', 'clone', 'create', 'delete', 'graph', 'home', 'login', 'new', 'page', 'proxy', 'public', 'private', 'info', 'store'); - if (!isNil(assoc(name, map(function(r) { return mklist(r, r); }, reserved)))) { + if (!isNull(assoc(name, map(function(r) { return mklist(r, r); }, reserved)))) { errorstatus('App name is taken, please pick another name'); return false; } diff --git a/sca-cpp/trunk/hosting/server/htdocs/delete/index.html b/sca-cpp/trunk/hosting/server/htdocs/delete/index.html index 81cfa0b625..3855a09e3c 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/delete/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/delete/index.html @@ -83,7 +83,7 @@ var appentry; * Get and display the requested app. */ (function getapp() { - if (isNil(appname)) + if (isNull(appname)) return false; workingstatus(true); showstatus('Loading'); @@ -103,7 +103,7 @@ var appentry; $('appUpdated').value = xmldatetime(cadr(assoc("'updated", appentry))).toLocaleDateString(); var content = cadr(assoc("'content", appentry)); var description = assoc("'description", content); - $('appDescription').value = isNil(description) || isNil(cadr(description))? '' : cadr(description); + $('appDescription').value = isNull(description) || isNull(cadr(description))? '' : cadr(description); onlinestatus(); workingstatus(false); diff --git a/sca-cpp/trunk/hosting/server/htdocs/graph/index.html b/sca-cpp/trunk/hosting/server/htdocs/graph/index.html index d01bfa1c02..557f427e38 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/graph/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/graph/index.html @@ -32,11 +32,11 @@ */ var appname = ui.fragmentParams(location)['app']; var ispalette = false; -if (isNil(appname)) { +if (isNull(appname)) { appname = ui.fragmentParams(location)['palette']; // Edit a palette instead of a regular app - if (!isNil(appname)) + if (!isNull(appname)) ispalette = true; } @@ -179,7 +179,7 @@ graph.mkedit = function(graphdiv, pos, atitle, cvalue, cadd, ccopy, cdelete, onc //debug('draggable', n); if (n == graphdiv || n == null) return null; - if (n.className == 'g' && !isNil(n.id) && n.id != '') + if (n.className == 'g' && !isNull(n.id) && n.id != '') return n; return draggable(n.parentNode); } @@ -301,7 +301,7 @@ graph.mkedit = function(graphdiv, pos, atitle, cvalue, cadd, ccopy, cdelete, onc if (graph.dragging.parentNode == graphdiv && graph.dragging.id.substring(0, 8) != 'palette:') { // Add new dragged component to the composite - if (isNil(graph.dragging.compos)) { + if (isNull(graph.dragging.compos)) { var compos = scdl.composite(graphdiv.compos); setElement(compos, graph.sortcompos(graph.addcomps(mklist(graph.dragging.comp), compos))); graph.dragging.compos = graphdiv.compos; @@ -311,7 +311,7 @@ graph.mkedit = function(graphdiv, pos, atitle, cvalue, cadd, ccopy, cdelete, onc setElement(graph.dragging.comp, graph.movecomp(graph.dragging.comp, graph.abspos(graph.draggingg))); // Wire component to neighboring reference - if (!isNil(graph.dragging.svcpos)) { + if (!isNull(graph.dragging.svcpos)) { var compos = scdl.composite(graphdiv.compos); setElement(compos, graph.sortcompos(graph.clonerefs(graph.wire(graph.dragging, compos, graphdiv)))); } @@ -332,7 +332,7 @@ graph.mkedit = function(graphdiv, pos, atitle, cvalue, cadd, ccopy, cdelete, onc var nodes = graph.refresh(graphdiv); // Reselect the previously selected component - if (!isNil(graph.selected)) { + if (!isNull(graph.selected)) { graph.selected = graph.findcompnode(scdl.name(graph.selected.comp), nodes); graph.compselect(graph.selected, true, atitle, cvalue, ccopy, cdelete); @@ -544,7 +544,7 @@ graph.mkedit = function(graphdiv, pos, atitle, cvalue, cadd, ccopy, cdelete, onc // Remove selected component var compos = scdl.composite(graphdiv.compos); - if (isNil(graph.selected.compos)) + if (isNull(graph.selected.compos)) setElement(compos, graph.sortcompos(graph.cutwire(graph.selected, compos, graphdiv))); setElement(compos, graph.sortcompos(graph.clonerefs(graph.gcollect(graph.removecomp(graph.selected.comp, compos))))); @@ -752,8 +752,8 @@ graph.drawshape = function(g) { // Draw the shape ctx.fillStyle = g.fillStyle; - ctx.strokeStyle = !isNil(g.strokeStyle)? g.strokeStyle : graph.colors.gray; - ctx.lineWidth = !isNil(g.lineWidth)? g.lineWidth : 1; + ctx.strokeStyle = !isNull(g.strokeStyle)? g.strokeStyle : graph.colors.gray; + ctx.lineWidth = !isNull(g.lineWidth)? g.lineWidth : 1; g.path.draw(ctx); // Reset canvas context @@ -794,7 +794,7 @@ graph.comptitle = function(comp) { */ graph.comptitlewidth = function(comp) { var title = graph.comptitle(comp); - if (isNil(title)) + if (isNull(title)) return 0; return title.clientWidth; }; @@ -803,14 +803,14 @@ graph.comptitlewidth = function(comp) { * Draw a component shape selection. */ graph.compselect = function(g, s, atitle, cvalue, ccopy, cdelete) { - if (isNil(g) || !s) { + if (isNull(g) || !s) { cvalue.value = ''; cvalue.readOnly = true; cvalue.style.display = 'none'; atitle.style.display = 'block'; ccopy.disabled = true; cdelete.disabled = true; - if (isNil(g)) + if (isNull(g)) return true; g.shape.strokeStyle = null; g.shape.lineWidth = null; @@ -836,7 +836,7 @@ graph.compselect = function(g, s, atitle, cvalue, ccopy, cdelete) { * Draw a palette shape selection. */ graph.paletteselect = function(g, s) { - if (isNil(g)) + if (isNull(g)) return true; if (!s) { g.shape.strokeStyle = null; @@ -879,7 +879,7 @@ graph.compnode = function(comp, cassoc, pos) { g.shape = shape; g.style.width = ui.pixpos(shape.width); g.style.height = ui.pixpos(shape.height); - if (!isNil(title)) { + if (!isNull(title)) { title.style.left = ui.pixpos(shape.path.xmin * -1); g.appendChild(title); } @@ -895,14 +895,14 @@ graph.compnode = function(comp, cassoc, pos) { * Find the node representing a component. */ graph.findcompnode = function(name, nodes) { - if (isNil(nodes)) + if (isNull(nodes)) return null; - if (isNil(car(nodes).comp)) + if (isNull(car(nodes).comp)) return graph.findcompnode(name, cdr(nodes)); if (name == scdl.name(car(nodes).comp)) return car(nodes); var node = graph.findcompnode(name, nodeList(car(nodes).childNodes)); - if (!isNil(node)) + if (!isNull(node)) return node; return graph.findcompnode(name, cdr(nodes)); } @@ -969,7 +969,7 @@ graph.move = function(g, pos) { * Return the absolute position of a component node. */ graph.abspos = function(e) { - if (isNil(e) || e == graphdiv) + if (isNull(e) || e == graphdiv) return graph.mkpath(); var gpos = graph.relpos(e); var pgpos = graph.abspos(e.parentNode); @@ -1010,7 +1010,7 @@ graph.title = function(e) { */ graph.property = function(e) { var p = scdl.properties(e); - if (isNil(p)) + if (isNull(p)) return ''; if (scdl.visible(car(p)) == 'false') return ''; @@ -1034,7 +1034,7 @@ graph.propertytitle = function(e) { */ graph.hasproperty = function(e) { var p = scdl.properties(e); - if (isNil(p)) + if (isNull(p)) return false; if (scdl.visible(car(p)) == 'false') return false; @@ -1046,7 +1046,7 @@ graph.hasproperty = function(e) { */ graph.setproperty = function(e, value) { var p = scdl.properties(e); - if (isNil(p)) + if (isNull(p)) return ''; if (scdl.visible(car(p)) == 'false') return ''; @@ -1071,14 +1071,14 @@ graph.color = function(comp) { graph.lsvcs = function(comp) { return memo(comp, 'lsvcs', function() { var svcs = scdl.services(comp); - if (isNil(svcs)) + if (isNull(svcs)) return mklist(mklist("'element","'service","'attribute","'name",scdl.name(comp))); var l = filter(function(s) { var a = scdl.align(s); var v = scdl.visible(s); return (a == null || a == 'left') && v != 'false'; }, svcs); - if (isNil(l)) + if (isNull(l)) return mklist(); return mklist(car(l)); }); @@ -1103,7 +1103,7 @@ graph.rrefs = function(comp) { graph.rrefheight = function(ref, cassoc) { return memo(ref, 'rheight', function() { var target = assoc(scdl.target(ref), cassoc); - if (isNil(target)) + if (isNull(target)) return graph.tabsz * 8; return graph.compclosureheight(cadr(target), cassoc); }); @@ -1113,7 +1113,7 @@ graph.rrefheight = function(ref, cassoc) { * Return the total height of the references on the right side of a component. */ graph.rrefsheight = function(refs, cassoc) { - if (isNil(refs)) + if (isNull(refs)) return 0; return graph.rrefheight(car(refs), cassoc) + graph.rrefsheight(cdr(refs), cassoc); }; @@ -1144,7 +1144,7 @@ graph.compclosureheight = function(comp, cassoc) { * Return the max width of the references on the right side of a component. */ graph.rrefswidth = function(refs, cassoc) { - if (isNil(refs)) + if (isNull(refs)) return 0; return Math.max(graph.rrefwidth(car(refs), cassoc), graph.rrefswidth(cdr(refs), cassoc)); }; @@ -1155,7 +1155,7 @@ graph.rrefswidth = function(refs, cassoc) { graph.compwidth = function(comp, cassoc) { return memo(comp, 'width', function() { var ctw = graph.comptitlewidth(comp); - var rrefsw = (isNil(graph.rrefs(comp))? 0 : (graph.tabsz * 4)); + var rrefsw = (isNull(graph.rrefs(comp))? 0 : (graph.tabsz * 4)); var twidth = (graph.titlex * 2) + ctw + rrefsw; var width = Math.max(twidth, (graph.tabsz * 8) + (graph.tabsz * 4)); return width; @@ -1205,7 +1205,7 @@ graph.comppath = function(comp, cassoc) { * Apply a path rendering function to a list of services or references. */ function renderpath(x, f, cassoc, path, height) { - if (isNil(x)) + if (isNull(x)) return path; return renderpath(cdr(x), f, cassoc, f(car(x), cassoc, path, height), height); } @@ -1290,7 +1290,7 @@ graph.composite = function(compos, pos, aspalette) { */ function renderrref(ref, cassoc, pos, gcomp) { var target = assoc(scdl.target(ref), cassoc); - if (isNil(target)) + if (isNull(target)) return null; // Render the component target of the reference @@ -1304,7 +1304,7 @@ graph.composite = function(compos, pos, aspalette) { return pos.clone().rmove(0, graph.rrefheight(ref, cassoc)); } - if (isNil(refs)) + if (isNull(refs)) return mklist(); // Return list of (ref, comp rendering) pairs @@ -1322,7 +1322,7 @@ graph.composite = function(compos, pos, aspalette) { // Store list of (ref, pos, component rendering) triplets in the component function refposgcomp(refpos, grefs) { - if (isNil(refpos)) + if (isNull(refpos)) return mklist(); // Append component rendering to component @@ -1347,7 +1347,7 @@ graph.composite = function(compos, pos, aspalette) { */ function promcomp(svc, cassoc) { var c = assoc(scdl.promote(svc), cassoc); - if (isNil(c)) + if (isNull(c)) return mklist(); return cadr(c); } @@ -1359,13 +1359,13 @@ graph.composite = function(compos, pos, aspalette) { return pos.clone().rmove(0, graph.compclosureheight(comp, cassoc) + Math.max((graph.tabsz * 2), 8)); } - if (isNil(svcs)) + if (isNull(svcs)) return mklist(); // Render the first promoted component in the list // then recurse to render the rest of the list var comp = promcomp(car(svcs), cassoc); - if (isNil(comp)) + if (isNull(comp)) return renderproms(cdr(svcs), cassoc, rendermove(car(svcs), cassoc, pos)); var cpos = graph.comppos(comp, pos); @@ -1401,14 +1401,14 @@ graph.ucid = function(prefix, compos1, compos2, clone) { // Build an assoc list keyed by component name var comps = map(function(c) { return mklist(scdl.name(c), c); }, append(namedElementChildren("'component", compos1), namedElementChildren("'component", compos2))); - if (!clone && isNil(assoc(prefix, comps))) + if (!clone && isNull(assoc(prefix, comps))) return prefix; /** * Find a free component id. */ function ucid(p, id) { - if (isNil(assoc(p + id, comps))) + if (isNull(assoc(p + id, comps))) return p + id; return ucid(p, id + 1); } @@ -1447,7 +1447,7 @@ graph.clonepalette = function(e, compos) { * Move a SCDL component to the given position. */ graph.movecomp = function(comp, pos) { - if (isNil(pos)) + if (isNull(pos)) return append(mklist(element, "'component"), filter(function(e) { return !(isAttribute(e) && (attributeName(e) == "'x" || attributeName(e) == "'y")); }, elementChildren(comp))); return append(mklist(element, "'component", mklist(attribute, "'x", '' + (pos.x - graph.palcx)), mklist(attribute, "'y", '' + pos.y)), @@ -1469,11 +1469,11 @@ graph.clonecomp = function(e, compos) { // Write the component and the components it references to XML function collectcomp(e) { function collectrefs(refpos) { - if (isNil(refpos)) + if (isNull(refpos)) return mklist(); var r = car(refpos); var n = caddr(r); - if (isNil(n)) + if (isNull(n)) return collectrefs(cdr(refpos)); return append(collectcomp(n), collectrefs(cdr(refpos))); } @@ -1578,7 +1578,7 @@ graph.gcollect = function(compos) { // Filter out the unused components var used = append(proms, refs); return append(mklist(element, "'composite"), - filter(function(c) { return !(isElement(c) && elementName(c) == "'component" && isNil(assoc(scdl.name(c), used))); }, elementChildren(compos))); + filter(function(c) { return !(isElement(c) && elementName(c) == "'component" && isNull(assoc(scdl.name(c), used))); }, elementChildren(compos))); } /** @@ -1592,7 +1592,7 @@ graph.clonerefs = function(compos) { // If the references are clonable var refs = scdl.references(c); - if (isNil(refs)) + if (isNull(refs)) return c; if (scdl.clonable(car(refs)) != 'true') return c; @@ -1611,7 +1611,7 @@ graph.clonerefs = function(compos) { * Refactor references to a component. */ graph.refactorrefs = function(refs, oname, nname) { - if (isNil(refs)) + if (isNull(refs)) return true; var ref = car(refs); if (scdl.target(ref) != oname) @@ -1636,7 +1636,7 @@ graph.renamecomp = function(comp, compos, name) { // Rename the SCDL promoted service and component var proms = filter(function(s) { return scdl.name(s) == oname }, scdl.services(compos)); - if (!isNil(proms)) + if (!isNull(proms)) setElement(car(proms), mklist(element, "'service", mklist(attribute, "'name", name), mklist(attribute, "'promote", name))); setElement(comp, append(mklist(element, "'component"), cons(mklist(attribute, "'name", name), @@ -1655,7 +1655,7 @@ graph.cutwire = function(node, compos, g) { * Find the reference wired to a node and cut its wire. */ function cutref(refs, node) { - if (isNil(refs)) + if (isNull(refs)) return true; var ref = car(refs); if (caddr(ref) == node) { @@ -1702,13 +1702,13 @@ graph.wire = function(n, compos, g) { * references of a node. */ function closerefs(npos, refs, spos, cref) { - if (isNil(refs)) + if (isNull(refs)) return cref; var fdist = cadddr(cref); var ref = car(refs); // Skip wired reference - if (!isNil(filter(function(n) { return isAttribute(n) && attributeName(n) == "'target"; }, car(ref)))) + if (!isNull(filter(function(n) { return isAttribute(n) && attributeName(n) == "'target"; }, car(ref)))) return closerefs(npos, cdr(refs), spos, cref); // Compute distance between service node and reference node @@ -1723,12 +1723,12 @@ graph.wire = function(n, compos, g) { return closerefs(npos, cdr(refs), spos, fdist < rdist? cref : mklist(car(ref), cadr(ref), caddr(ref), rdist)); } - if (isNil(nodes)) + if (isNull(nodes)) return cref; // Skip non-component nodes var node = car(nodes); - if (isNil(node.comp)) + if (isNull(node.comp)) return closecomprefs(cdr(nodes), spos, cref); // Compute the component absolute position @@ -1771,7 +1771,7 @@ graph.display = function(nodes, g) { graph.hide = function(g) { // Remove nodes from the graph - map(function(n) { if (!isNil(n.comp) && n.id.substr(0, 8) != 'palette:') { g.removeChild(n); } return n; }, nodeList(g.childNodes)); + map(function(n) { if (!isNull(n.comp) && n.id.substr(0, 8) != 'palette:') { g.removeChild(n); } return n; }, nodeList(g.childNodes)); return g; }; @@ -1782,7 +1782,7 @@ graph.refresh = function(g) { //debug('refresh'); // Remove existing nodes from the graph - map(function(n) { if (!isNil(n.comp) && n.id.substr(0, 8) != 'palette:') { g.removeChild(n); } return n; }, nodeList(g.childNodes)); + map(function(n) { if (!isNull(n.comp) && n.id.substr(0, 8) != 'palette:') { g.removeChild(n); } return n; }, nodeList(g.childNodes)); // Redisplay the composite associated with the graph var nodes = graph.composite(g.compos, graph.mkpath().pos(graph.palcx,0), false); @@ -1802,7 +1802,7 @@ graph.edit = function(appname, compos, nodes, g) { setElement(scompos, graph.sortcompos(scompos)); // Remove existing nodes from the graph - map(function(n) { if (!isNil(n.comp) && n.id.substr(0, 8) != 'palette:') { g.removeChild(n); } return n; }, nodeList(g.childNodes)); + map(function(n) { if (!isNull(n.comp) && n.id.substr(0, 8) != 'palette:') { g.removeChild(n); } return n; }, nodeList(g.childNodes)); // Display the composite nodes appendNodes(nodes, g); @@ -1829,7 +1829,7 @@ var bpalette = null; * Get and display an application composite. */ function getapp(name, g) { - if (isNil(name)) + if (isNull(name)) return false; workingstatus(true); showstatus('Loading'); @@ -1846,8 +1846,8 @@ function getapp(name, g) { // Get the composite from the ATOM entry var composentry = car(atom.readATOMEntry(mklist(doc))); var content = namedElementChild("'content", composentry); - composite = isNil(content)? mklist() : elementChildren(content); - if (isNil(composite)) { + composite = isNull(content)? mklist() : elementChildren(content); + if (isNull(composite)) { // Create a default empty composite if necessary var x = '<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" ' + @@ -1879,15 +1879,15 @@ function getapp(name, g) { * Display a palette. Get it from the server if needed. */ function displaypalette(name, g, palette, gpalettes) { - if (isNil(name)) + if (isNull(name)) return; - if (isNil(gpalettes[name])) { + if (isNull(gpalettes[name])) { // Get the palette from the server palettes.get(name, function(doc) { var entry = car(atom.readATOMEntry(mklist(doc))); var content = namedElementChild("'content", entry); - var compos = isNil(content)? mklist() : elementChildren(content); + var compos = isNull(content)? mklist() : elementChildren(content); gpalettes[name] = graph.composite(compos, graph.mkpath().move(2580,0), true, g); graph.display(gpalettes[name], g); }); @@ -1985,7 +1985,7 @@ function oncomposchange(prop) { * Return the link to a component. */ function complink(appname, cname) { - if (cname == '' || isNil(cname)) + if (cname == '' || isNull(cname)) return ''; var protocol = location.protocol; var host = location.hostname; @@ -2004,9 +2004,9 @@ function oncompselect(gsel) { return true; gcomp = gsel; - cdelete.disabled = isNil(gsel) || !editable; - ccopy.disabled = isNil(gsel) || !editable; - cplay.disabled = isNil(gsel); + cdelete.disabled = isNull(gsel) || !editable; + ccopy.disabled = isNull(gsel) || !editable; + cplay.disabled = isNull(gsel); return true; } @@ -2016,7 +2016,7 @@ function oncompselect(gsel) { function showdata(gcomp) { if (!gvisible) return true; - if (isNil(gcomp)) + if (isNull(gcomp)) return true; cvalue.value = complink(appname, gcomp.id); cplay.value = '<'; diff --git a/sca-cpp/trunk/hosting/server/htdocs/home/index.html b/sca-cpp/trunk/hosting/server/htdocs/home/index.html index d7a098e998..b5240bfd11 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/home/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/home/index.html @@ -60,7 +60,7 @@ $('getstarted').onclick = function() { */ (function homeanimation() { var anim = $('homeanimation'); - if (!isNil(anim)) { + if (!isNull(anim)) { anim.style.background = 'url(\'' + ui.b64png(appcache.get('/home/home.b64')) + '\')'; var bgpos = 0; setInterval(function homeanimation() { diff --git a/sca-cpp/trunk/hosting/server/htdocs/index.html b/sca-cpp/trunk/hosting/server/htdocs/index.html index 6ea6f80939..7722f96e3f 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/index.html @@ -203,7 +203,7 @@ var appresources = [ * Init status message area. */ (function initstatus() { - if (isNil($('status'))) + if (isNull($('status'))) return; $('status').style.display = 'none'; @@ -221,7 +221,7 @@ var appresources = [ */ window.showstatus = function(s, c) { //debug('show status', s); - if (isNil($('status')) || $('status').error) + if (isNull($('status')) || $('status').error) return s; $('status').innerHTML = '<span class="' + (c? c : 'okstatus') + '">' + s + '</span>'; $('status').className = ui.isMobile()? 'status3dm' : 'status3d'; @@ -249,7 +249,7 @@ window.errorstatus = function(s) { */ window.workingstatus = function(w, c) { //debug('show working', w); - if (isNil($('working'))) + if (isNull($('working'))) return w; if (!ui.isMobile()) $('working').style.top = ui.pixpos(Math.round(window.clientHeight / 2)); @@ -286,10 +286,10 @@ map(function(res) { */ function viewtransition(ouri, uri) { var ot = apptransitions[ouri]; - if (isNil(ot)) + if (isNull(ot)) return 'left'; var t = apptransitions[uri]; - if (isNil(t)) + if (isNull(t)) return 'left'; return t < ot? 'right' : 'left'; } @@ -330,7 +330,7 @@ function showmenu(view, appname) { append(mklist(ui.menu('menuhome', 'Home', '/', '_view', view == 'home'), ui.menu('menustore', 'Store', '/#view=store&category=' + storecat + '&idx=' + storeidx, '_view', view == 'store'), ui.menu('menusearch', 'Search', '/#view=search', '_view', view == 'search')), - (isNil(appname) || appname == 'undefined')? + (isNull(appname) || appname == 'undefined')? mklist() : mklist( ui.menu('menuinfo', 'Info', '/#view=info&app=' + appname, '_view', view == 'info'), @@ -341,7 +341,7 @@ function showmenu(view, appname) { ui.menu('menurun', '<span class="greentext" style="font-weight: bold">Run!</span>', '/' + appname + '/', '_blank', false) */ )), - (isNil(appname) || appname == 'undefined')? mklist( + (isNull(appname) || appname == 'undefined')? mklist( ui.menufunc('menusignout', 'Sign out', 'return logout();', false), ui.menu('menuaccount', 'Account', '/#view=account', '_view', view == 'account')) : mklist()); @@ -376,13 +376,13 @@ function showview(url) { // Determine the view to show var params = ui.fragmentParams(url); - var view = isNil(params['view'])? 'home' : params['view'];; + var view = isNull(params['view'])? 'home' : params['view'];; var uri = '/' + view + '/'; - var idx = isNil(params['idx'])? 0 : parseInt(params['idx']); + var idx = isNull(params['idx'])? 0 : parseInt(params['idx']); // Track store category view if (view == 'store') { - storecat = isNil(params['category'])? 'top' : params['category']; + storecat = isNull(params['category'])? 'top' : params['category']; storeidx = idx; } @@ -406,7 +406,7 @@ function showview(url) { if (ui.isMobile()) { // Prepare current view for transition out var ovdiv = viewdiv; - if (!isNil(ovdiv)) { + if (!isNull(ovdiv)) { ovdiv.skipNode = true; ovdiv.className = 'viewunloading3dm'; } @@ -420,7 +420,7 @@ function showview(url) { ui.async(function mtransitionview() { // Transition the old view out - if (!isNil(ovdiv)) + if (!isNull(ovdiv)) ovdiv.className = vtransition + 'viewunloaded3dm'; // Transition the new view in @@ -430,7 +430,7 @@ function showview(url) { } else { // Prepare current view for transition out var ovdiv = viewdiv; - if (!isNil(ovdiv)) + if (!isNull(ovdiv)) ovdiv.skipNode = true; // Load the requested doc into the view @@ -445,7 +445,7 @@ function showview(url) { vdiv.className = 'viewloaded3d'; // Transition the old view out - if (!isNil(ovdiv)) + if (!isNull(ovdiv)) ovdiv.parentNode.removeChild(ovdiv); }); } @@ -649,7 +649,7 @@ document.body.onorientationchange = function(e) { appcache.remove(res[0]); appcache.get(res[0], 'remote'); }, append(appresources, config.appresources())); - if (!isNil(lcmf)) { + if (!isNull(lcmf)) { //debug('reloading'); window.location.reload(); } @@ -697,7 +697,7 @@ window.onload = function() { document.referrer.indexOf('//accounts.google.com/ServiceLogin') != -1 || document.referrer.indexOf('//www.facebook.com/login.php') != -1)) { var lv = lastvisited(); - var url = isNil(lv)? location.pathname : lv; + var url = isNull(lv)? location.pathname : lv; updatelocation(url); if (url == viewurl) return true; diff --git a/sca-cpp/trunk/hosting/server/htdocs/info/index.html b/sca-cpp/trunk/hosting/server/htdocs/info/index.html index 0d72062719..3038d37cf2 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/info/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/info/index.html @@ -100,7 +100,7 @@ var savediconxml; * Get and display the requested app. */ (function getapp() { - if (isNil(appname)) + if (isNull(appname)) return false; workingstatus(true); showstatus('Loading'); @@ -118,10 +118,10 @@ var savediconxml; author = cadr(assoc("'author", appentry)); $('appAuthor').value = author.split('@')[0]; var updated = assoc("'updated", appentry); - $('appUpdated').value = isNil(updated)? '' : xmldatetime(cadr(updated)).toLocaleDateString(); + $('appUpdated').value = isNull(updated)? '' : xmldatetime(cadr(updated)).toLocaleDateString(); var content = cadr(assoc("'content", appentry)); var description = assoc("'description", content); - $('appDescription').value = isNil(description) || isNil(cadr(description))? '' : cadr(description); + $('appDescription').value = isNull(description) || isNull(cadr(description))? '' : cadr(description); //var ratingy = -20 * (4 - Math.floor(Math.random() * 4)); //$('appRating').style.backgroundPosition = '0px ' + ratingy + 'px'; //$('appRatings').value = ''; @@ -165,7 +165,7 @@ var savediconxml; var content = assoc("'content", picentry); var picture = assoc("'picture", content); var img = assoc("'image", picture); - if (!isNil(img)) + if (!isNull(img)) $('authorPicture').src = cadr(img); onlinestatus(); @@ -179,7 +179,7 @@ var savediconxml; * Get and display the app icon. */ (function geticon() { - if (isNil(appname)) + if (isNull(appname)) return false; workingstatus(true); showstatus('Loading'); @@ -197,7 +197,7 @@ var savediconxml; var content = assoc("'content", iconentry); var icon = assoc("'icon", content); var img = assoc("'image", icon); - if (!isNil(img)) + if (!isNull(img)) $('appIcon').src = cadr(img); onlinestatus(); @@ -212,7 +212,7 @@ var savediconxml; */ var refreshingicon = false; function refreshicon() { - if (isNil(appname)) + if (isNull(appname)) return false; if (!refreshingicon) return false; @@ -231,11 +231,11 @@ function refreshicon() { var token = assoc("'token", icon); // Update icon - if (isNil(token)) { + if (isNull(token)) { var entryxml = car(atom.writeATOMEntry(valuesToElements(mklist(iconentry)))); savediconxml = entryxml; var img = assoc("'image", icon); - if (!isNil(img)) + if (!isNull(img)) $('appIcon').src = cadr(img); $('refreshingIcon').style.display = 'none'; refreshingicon = false; @@ -252,7 +252,7 @@ function refreshicon() { * Get and display the app ratings. */ (function getratings() { - if (isNil(appname)) + if (isNull(appname)) return false; workingstatus(true); showstatus('Loading'); @@ -272,8 +272,8 @@ function refreshicon() { var ar2 = assoc("'rating2", aratings); var ar3 = assoc("'rating3", aratings); var ar4 = assoc("'rating4", aratings); - var rating = isNil(ar)? 0 : Number(cadr(ar)); - var reviews = (isNil(ar1)? 0 : Number(cadr(ar1))) + (isNil(ar2)? 0 : Number(cadr(ar2))) + (isNil(ar3)? 0 : Number(cadr(ar3))) + (isNil(ar4)? 0 : Number(cadr(ar4))); + var rating = isNull(ar)? 0 : Number(cadr(ar)); + var reviews = (isNull(ar1)? 0 : Number(cadr(ar1))) + (isNull(ar2)? 0 : Number(cadr(ar2))) + (isNull(ar3)? 0 : Number(cadr(ar3))) + (isNull(ar4)? 0 : Number(cadr(ar4))); var ratingy = -20 * (4 - Math.floor(rating)); $('appRating').style.backgroundPosition = '0px ' + ratingy + 'px'; diff --git a/sca-cpp/trunk/hosting/server/htdocs/login/index.html b/sca-cpp/trunk/hosting/server/htdocs/login/index.html index efc3feaeaa..93d47d3f28 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/login/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/login/index.html @@ -212,7 +212,7 @@ try { * Initialize status message area. */ (function initstatus() { - if (isNil($('status'))) + if (isNull($('status'))) return; $('status').style.display = 'none'; @@ -230,7 +230,7 @@ try { */ window.showstatus = function(s, c) { //debug('show status', s); - if (isNil($('status')) || $('status').error) + if (isNull($('status')) || $('status').error) return s; $('status').innerHTML = '<span class="' + (c? c : 'okstatus') + '">' + s + '</span>'; $('status').className = ui.isMobile()? 'status3dm' : 'status3d'; @@ -258,7 +258,7 @@ window.errorstatus = function(s) { */ window.workingstatus = function(w, c) { //debug('show working', w); - if (isNil($('working'))) + if (isNull($('working'))) return w; if (!ui.isMobile()) $('working').style.top = ui.pixpos(Math.round(window.clientHeight / 2)); @@ -469,7 +469,7 @@ var appresources = [ appcache.remove(res[0]); appcache.get(res[0], 'remote'); }, append(appresources, config.appresources())); - if (!isNil(lcmf)) { + if (!isNull(lcmf)) { //debug('reloading'); window.location.reload(); } diff --git a/sca-cpp/trunk/hosting/server/htdocs/page/index.html b/sca-cpp/trunk/hosting/server/htdocs/page/index.html index c6e1108ce5..ca89ed34db 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/page/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/page/index.html @@ -132,7 +132,7 @@ var pages = sca.reference(editorComp, 'pages'); */ var msiefixupbounds = ui.isMSIE(); function widgettransform(e) { - if (!isNil(e.xtranslate)) + if (!isNull(e.xtranslate)) return [e.xtranslate, e.ytranslate]; var t = e.style.getPropertyValue('-webkit-transform') || e.style.getPropertyValue('-moz-transform') || e.style.getPropertyValue('-ms-transform') || e.style.getPropertyValue('-o-transform') || @@ -156,7 +156,7 @@ function widgettransform(e) { */ function widgetxpos(e) { var t = widgettransform(e)[0]; - return ui.numpos(e.style.left) + (isNil(t)? 0 : t); + return ui.numpos(e.style.left) + (isNull(t)? 0 : t); } /** @@ -164,7 +164,7 @@ function widgetxpos(e) { */ function widgetypos(e) { var t = widgettransform(e)[1]; - return ui.numpos(e.style.top) + (isNil(t)? 0 : t); + return ui.numpos(e.style.top) + (isNull(t)? 0 : t); } /** @@ -290,7 +290,7 @@ function clonewidget(e) { */ function selectwidget(n, s) { //debug('selectwidget', n, s); - if (isNil(n) || !s) { + if (isNull(n) || !s) { // Clear the widget value field $('widgetValue').value = ''; $('widgetValue').readOnly = true; @@ -304,7 +304,7 @@ function selectwidget(n, s) { $('deleteWidgetButton').disabled = true; // Clear the widget outline - if (!isNil(n)) + if (!isNull(n)) n.style.removeProperty('outline'); return true; } @@ -422,44 +422,44 @@ function setwidgettext(e, t) { e.id = f != ''? f.substring(1) : ('page:' + wc); if (wc == 'hd1' || wc == 'hd2' || wc == 'text' || wc == 'section') { - car(childElements(e)).innerHTML = isNil(c)? f : car(c); + car(childElements(e)).innerHTML = isNull(c)? f : car(c); return t; } if (wc == 'button') { - car(childElements(e)).value = isNil(c)? f : car(c); + car(childElements(e)).value = isNull(c)? f : car(c); return t; } if (wc == 'entry' || wc == 'password') { - car(childElements(e)).defaultValue = isNil(c)? f : car(c); + car(childElements(e)).defaultValue = isNull(c)? f : car(c); return t; } if (wc == 'checkbox') { - car(childElements(e)).value = isNil(c)? f : car(c); - map(function(n) { if (n.nodeName == "SPAN") n.innerHTML = isNil(c)? f : car(c); return n; }, nodeList(e.childNodes)); + car(childElements(e)).value = isNull(c)? f : car(c); + map(function(n) { if (n.nodeName == "SPAN") n.innerHTML = isNull(c)? f : car(c); return n; }, nodeList(e.childNodes)); return t; } if (wc == 'select') { var ce = car(childElements(car(childElements(e)))); - ce.value = isNil(c)? f : car(c); - ce.innerHTML = isNil(c)? f : car(c); + ce.value = isNull(c)? f : car(c); + ce.innerHTML = isNull(c)? f : car(c); return t; } if (wc == 'list') { - e.innerHTML = '<table class="datatable" style="width: 100%;;"><tr><td class="datatd">' + (isNil(c)? f : car(c)) + '</td></tr><tr><td class="datatd">...</td></tr></table>'; + e.innerHTML = '<table class="datatable" style="width: 100%;;"><tr><td class="datatd">' + (isNull(c)? f : car(c)) + '</td></tr><tr><td class="datatd">...</td></tr></table>'; return t; } if (wc == 'table') { - e.innerHTML = '<table class="datatable" style="width: 100%;"><tr><td class="datatdl">' + (isNil(c)? f : car(c)) + '</td><td class="datatdr">...</td></tr><tr><td class="datatdl">...</td><td class="datatdr">...</td></tr></table>'; + e.innerHTML = '<table class="datatable" style="width: 100%;"><tr><td class="datatdl">' + (isNull(c)? f : car(c)) + '</td><td class="datatdr">...</td></tr><tr><td class="datatdl">...</td><td class="datatdr">...</td></tr></table>'; return t; } if (wc == 'link') { var ce = car(childElements(e)); - ce.href = isNil(c)? 'link:/index.html' : ('link:' + car(c)); - car(childElements(ce)).innerHTML = isNil(c)? (f != ''? f : '/index.html') : isNil(cdr(c))? (f != ''? f : car(c)) : cadr(c); + ce.href = isNull(c)? 'link:/index.html' : ('link:' + car(c)); + car(childElements(ce)).innerHTML = isNull(c)? (f != ''? f : '/index.html') : isNull(cdr(c))? (f != ''? f : car(c)) : cadr(c); return t; } if (wc == 'img') { - car(childElements(e)).src = isNil(c)? '/public/img.png' : car(c); + car(childElements(e)).src = isNull(c)? '/public/img.png' : car(c); return t; } return ''; @@ -512,7 +512,7 @@ function widgetbounds(e) { //debug('fixup br', e, br.left, br.top, br.right, br.bottom, t[0], t[1]); function fixuptransform(e) { var t = widgettransform(e); - if (!isNil(e.xtranslate)) + if (!isNull(e.xtranslate)) return [e.xtranslate, e.ytranslate]; var t = e.style.getPropertyValue('-webkit-transform') || e.style.getPropertyValue('-moz-transform') || e.style.getPropertyValue('-ms-transform') || e.style.getPropertyValue('-o-transform') || @@ -538,12 +538,12 @@ function widgetbounds(e) { */ function draggable(x, y, l) { //debug('draggable?', x, y, l); - if (isNil(l)) + if (isNull(l)) return null; var n = car(l); - if (isNil(n.id) || n.id == '') { + if (isNull(n.id) || n.id == '') { var d = draggable(x, y, reverse(nodeList(n.childNodes))); - if (!isNil(d)) + if (!isNull(d)) return d; return draggable(x, y, cdr(l)); } @@ -849,9 +849,9 @@ function mkeditor() { onpagechange(false); // On Firefox > 4, re-apply the outline after the widget has been repositioned - if (fffixupoutline && !isNil(selected)) { + if (fffixupoutline && !isNull(selected)) { ui.delay(function() { - if (!isNil(selected)) + if (!isNull(selected)) selected.style.outline = '2px solid #598edd'; }, 32); } @@ -932,7 +932,7 @@ function mkeditor() { } // Dismiss the palette - if (palvis && isNil(draggable(moveX, moveY, mklist($('palettecontent'))))) + if (palvis && isNull(draggable(moveX, moveY, mklist($('palettecontent'))))) hidepalette(); return true; @@ -1091,7 +1091,7 @@ function mkeditor() { * Get and display the requested app page. */ (function getpage() { - if (isNil(appname)) + if (isNull(appname)) return false; workingstatus(true); showstatus('Loading'); @@ -1108,15 +1108,15 @@ function mkeditor() { // Get the page from the ATOM entry, convert it to XHTML and place it in a hidden buffer var pageentry = car(atom.readATOMEntry(mklist(doc))); var content = namedElementChild("'content", pageentry); - var el = isNil(content)? mklist() : elementChildren(content); - if (isNil(el)) + var el = isNull(content)? mklist() : elementChildren(content); + if (isNull(el)) $('xhtmlbuffer').innerHTML = '<div id="page"></div>'; else $('xhtmlbuffer').innerHTML = writeStrings(writeXML(el, false)); // Remove any existing page nodes from the editor div var fnodes = filter(function(e) { - if (isNil(e.id) || e.id == '') + if (isNull(e.id) || e.id == '') return false; return true; }, nodeList($('pagediv').childNodes)); @@ -1169,7 +1169,7 @@ function pagexhtml() { // part of the page, as well as nodes positioned out the // editing area var fnodes = filter(function(e) { - if (isNil(e.id) || e.id == '') + if (isNull(e.id) || e.id == '') return false; return true; }, nodes); diff --git a/sca-cpp/trunk/hosting/server/htdocs/proxy/public/oops/index.html b/sca-cpp/trunk/hosting/server/htdocs/proxy/public/oops/index.html index 5ea9d7619d..f7cdab9bf2 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/proxy/public/oops/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/proxy/public/oops/index.html @@ -161,7 +161,7 @@ try { * Initialize status message area. */ (function initstatus() { - if (isNil($('status'))) + if (isNull($('status'))) return; $('status').style.display = 'none'; @@ -179,7 +179,7 @@ try { */ window.showstatus = function(s, c) { //debug('show status', s); - if (isNil($('status')) || $('status').error) + if (isNull($('status')) || $('status').error) return s; $('status').innerHTML = '<span class="' + (c? c : 'okstatus') + '">' + s + '</span>'; $('status').className = ui.isMobile()? 'status3dm' : 'status3d'; @@ -207,7 +207,7 @@ window.errorstatus = function(s) { */ window.workingstatus = function(w, c) { //debug('show working', w); - if (isNil($('working'))) + if (isNull($('working'))) return w; if (!ui.isMobile()) $('working').style.top = ui.pixpos(Math.round(window.clientHeight / 2)); @@ -329,7 +329,7 @@ var appresources = [ appcache.remove(res[0]); appcache.get(res[0], 'remote'); }, append(appresources, config.appresources())); - if (!isNil(lcmf)) { + if (!isNull(lcmf)) { //debug('reloading'); window.location.reload(); } diff --git a/sca-cpp/trunk/hosting/server/htdocs/public/config.js b/sca-cpp/trunk/hosting/server/htdocs/public/config.js index be23c7c01e..e3b966d542 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/public/config.js +++ b/sca-cpp/trunk/hosting/server/htdocs/public/config.js @@ -17,7 +17,7 @@ * under the License. */ -if (isNil(config)) +if (isNull(config)) config = {}; /** diff --git a/sca-cpp/trunk/hosting/server/htdocs/public/notauth/index.html b/sca-cpp/trunk/hosting/server/htdocs/public/notauth/index.html index f453e0491c..cf5f3465d8 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/public/notauth/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/public/notauth/index.html @@ -161,7 +161,7 @@ try { * Initialize status message area. */ (function initstatus() { - if (isNil($('status'))) + if (isNull($('status'))) return; $('status').style.display = 'none'; @@ -179,7 +179,7 @@ try { */ window.showstatus = function(s, c) { //debug('show status', s); - if (isNil($('status')) || $('status').error) + if (isNull($('status')) || $('status').error) return s; $('status').innerHTML = '<span class="' + (c? c : 'okstatus') + '">' + s + '</span>'; $('status').className = ui.isMobile()? 'status3dm' : 'status3d'; @@ -207,7 +207,7 @@ window.errorstatus = function(s) { */ window.workingstatus = function(w, c) { //debug('show working', w); - if (isNil($('working'))) + if (isNull($('working'))) return w; if (!ui.isMobile()) $('working').style.top = ui.pixpos(Math.round(window.clientHeight / 2)); @@ -328,7 +328,7 @@ var appresources = [ appcache.remove(res[0]); appcache.get(res[0], 'remote'); }, append(appresources, config.appresources())); - if (!isNil(lcmf)) { + if (!isNull(lcmf)) { //debug('reloading'); window.location.reload(); } diff --git a/sca-cpp/trunk/hosting/server/htdocs/public/notfound/index.html b/sca-cpp/trunk/hosting/server/htdocs/public/notfound/index.html index c8475147d7..ba82ecb897 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/public/notfound/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/public/notfound/index.html @@ -162,7 +162,7 @@ try { * Initialize status message area. */ (function initstatus() { - if (isNil($('status'))) + if (isNull($('status'))) return; $('status').style.display = 'none'; @@ -180,7 +180,7 @@ try { */ window.showstatus = function(s, c) { //debug('show status', s); - if (isNil($('status')) || $('status').error) + if (isNull($('status')) || $('status').error) return s; $('status').innerHTML = '<span class="' + (c? c : 'okstatus') + '">' + s + '</span>'; $('status').className = ui.isMobile()? 'status3dm' : 'status3d'; @@ -208,7 +208,7 @@ window.errorstatus = function(s) { */ window.workingstatus = function(w, c) { //debug('show working', w); - if (isNil($('working'))) + if (isNull($('working'))) return w; if (!ui.isMobile()) $('working').style.top = ui.pixpos(Math.round(window.clientHeight / 2)); @@ -329,7 +329,7 @@ var appresources = [ appcache.remove(res[0]); appcache.get(res[0], 'remote'); }, append(appresources, config.appresources())); - if (!isNil(lcmf)) { + if (!isNull(lcmf)) { //debug('reloading'); window.location.reload(); } diff --git a/sca-cpp/trunk/hosting/server/htdocs/public/notyet/index.html b/sca-cpp/trunk/hosting/server/htdocs/public/notyet/index.html index 4bcb3728ae..0597d10942 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/public/notyet/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/public/notyet/index.html @@ -162,7 +162,7 @@ try { * Initialize status message area. */ (function initstatus() { - if (isNil($('status'))) + if (isNull($('status'))) return; $('status').style.display = 'none'; @@ -180,7 +180,7 @@ try { */ window.showstatus = function(s, c) { //debug('show status', s); - if (isNil($('status')) || $('status').error) + if (isNull($('status')) || $('status').error) return s; $('status').innerHTML = '<span class="' + (c? c : 'okstatus') + '">' + s + '</span>'; $('status').className = ui.isMobile()? 'status3dm' : 'status3d'; @@ -208,7 +208,7 @@ window.errorstatus = function(s) { */ window.workingstatus = function(w, c) { //debug('show working', w); - if (isNil($('working'))) + if (isNull($('working'))) return w; if (!ui.isMobile()) $('working').style.top = ui.pixpos(Math.round(window.clientHeight / 2)); @@ -329,7 +329,7 @@ var appresources = [ appcache.remove(res[0]); appcache.get(res[0], 'remote'); }, append(appresources, config.appresources())); - if (!isNil(lcmf)) { + if (!isNull(lcmf)) { //debug('reloading'); window.location.reload(); } diff --git a/sca-cpp/trunk/hosting/server/htdocs/public/oops/index.html b/sca-cpp/trunk/hosting/server/htdocs/public/oops/index.html index 68554efdb0..788435289f 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/public/oops/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/public/oops/index.html @@ -161,7 +161,7 @@ try { * Initialize status message area. */ (function initstatus() { - if (isNil($('status'))) + if (isNull($('status'))) return; $('status').style.display = 'none'; @@ -179,7 +179,7 @@ try { */ window.showstatus = function(s, c) { //debug('show status', s); - if (isNil($('status')) || $('status').error) + if (isNull($('status')) || $('status').error) return s; $('status').innerHTML = '<span class="' + (c? c : 'okstatus') + '">' + s + '</span>'; $('status').className = ui.isMobile()? 'status3dm' : 'status3d'; @@ -207,7 +207,7 @@ window.errorstatus = function(s) { */ window.workingstatus = function(w, c) { //debug('show working', w); - if (isNil($('working'))) + if (isNull($('working'))) return w; if (!ui.isMobile()) $('working').style.top = ui.pixpos(Math.round(window.clientHeight / 2)); @@ -328,7 +328,7 @@ var appresources = [ appcache.remove(res[0]); appcache.get(res[0], 'remote'); }, append(appresources, config.appresources())); - if (!isNil(lcmf)) { + if (!isNull(lcmf)) { //debug('reloading'); window.location.reload(); } diff --git a/sca-cpp/trunk/hosting/server/htdocs/rate/index.html b/sca-cpp/trunk/hosting/server/htdocs/rate/index.html index 22f11f631a..90d45bd3ea 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/rate/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/rate/index.html @@ -116,7 +116,7 @@ var savedxml = ''; * Get and display the requested app rating. */ (function getrating() { - if (isNil(appname)) + if (isNull(appname)) return false; workingstatus(true); showstatus('Loading'); @@ -133,7 +133,7 @@ var savedxml = ''; appentry = doc != null? car(elementsToValues(atom.readATOMEntry(mklist(doc)))) : mklist("'entry", mklist("'title", ''), mklist("'id", appname)); savedxml = car(atom.writeATOMEntry(valuesToElements(mklist(appentry)))); var content = cadr(assoc("'content", appentry)); - if (!isNil(content)) + if (!isNull(content)) selectrating(parseInt(cadr(content))); onlinestatus(); diff --git a/sca-cpp/trunk/hosting/server/htdocs/search/index.html b/sca-cpp/trunk/hosting/server/htdocs/search/index.html index 47d5a757f3..d46b0528c4 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/search/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/search/index.html @@ -74,7 +74,7 @@ function viewapp(appname) { * Get and display an app icon. */ function geticon(appname) { - if (isNil(appname)) + if (isNull(appname)) return false; return icons.get(appname, function(doc) { @@ -86,9 +86,9 @@ function geticon(appname) { var content = assoc("'content", iconentry); var icon = assoc("'icon", content); var img = assoc("'image", icon); - if (!isNil(img)) { + if (!isNull(img)) { var appimg = $('search_app_img_' + appname); - if (!isNil(appimg)) + if (!isNull(appimg)) appimg.src = cadr(img); } return true; @@ -114,7 +114,7 @@ function getapps(query) { var feed = car(elementsToValues(atom.readATOMFeed(mklist(doc)))); var aentries = assoc("'entry", feed); - var entries = isNil(aentries)? mklist() : isList(car(cadr(aentries)))? cadr(aentries) : mklist(cdr(aentries)); + var entries = isNull(aentries)? mklist() : isList(car(cadr(aentries)))? cadr(aentries) : mklist(cdr(aentries)); var defappimg = ui.b64png(appcache.get('/public/app.b64')); @@ -122,7 +122,7 @@ function getapps(query) { var icons = mklist(); (function displayentries(entries) { - if (isNil(entries)) + if (isNull(entries)) return apps; var entry = car(entries); var title = cadr(assoc("'title", entry)) @@ -136,8 +136,8 @@ function getapps(query) { var ar2 = assoc("'rating2", aratings); var ar3 = assoc("'rating3", aratings); var ar4 = assoc("'rating4", aratings); - var rating = isNil(ar)? 0 : Number(cadr(ar)); - var reviews = (isNil(ar1)? 0 : Number(cadr(ar1))) + (isNil(ar2)? 0 : Number(cadr(ar2))) + (isNil(ar3)? 0 : Number(cadr(ar3))) + (isNil(ar4)? 0 : Number(cadr(ar4))); + var rating = isNull(ar)? 0 : Number(cadr(ar)); + var reviews = (isNull(ar1)? 0 : Number(cadr(ar1))) + (isNull(ar2)? 0 : Number(cadr(ar2))) + (isNull(ar3)? 0 : Number(cadr(ar3))) + (isNull(ar4)? 0 : Number(cadr(ar4))); apps += '<div class="box">' apps += '<div class="appicon">' @@ -165,7 +165,7 @@ function getapps(query) { ui.unmemo$('search_app_'); (function displayicons(icons) { - if (isNil(icons)) + if (isNull(icons)) return true; geticon(car(icons)); return displayicons(cdr(icons)); diff --git a/sca-cpp/trunk/hosting/server/htdocs/store/index.html b/sca-cpp/trunk/hosting/server/htdocs/store/index.html index 15e7aeed0c..57920ede2e 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/store/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/store/index.html @@ -59,10 +59,10 @@ var categories = [ * Find a store category. */ function findcategory(name) { - if (isNil(name)) + if (isNull(name)) return findcategory('featured'); var f = filter(function(c) { return cadr(c) == name }, categories); - if (isNil(f)) + if (isNull(f)) return findcategory('featured'); return car(f); } @@ -121,7 +121,7 @@ $('createApp').onclick = function() { * Get and display an app icon. */ function geticon(appname) { - if (isNil(appname)) + if (isNull(appname)) return false; return icons.get(appname, function(doc) { @@ -133,9 +133,9 @@ function geticon(appname) { var content = assoc("'content", iconentry); var icon = assoc("'icon", content); var img = assoc("'image", icon); - if (!isNil(img)) { + if (!isNull(img)) { var appimg = $('store_app_img_' + appname); - if (!isNil(appimg)) + if (!isNull(appimg)) appimg.src = cadr(img); } return true; @@ -161,7 +161,7 @@ function geticon(appname) { var feed = car(elementsToValues(atom.readATOMFeed(mklist(doc)))); var aentries = assoc("'entry", feed); - var entries = isNil(aentries)? mklist() : isList(car(cadr(aentries)))? cadr(aentries) : mklist(cdr(aentries)); + var entries = isNull(aentries)? mklist() : isList(car(cadr(aentries)))? cadr(aentries) : mklist(cdr(aentries)); var defappimg = ui.b64png(appcache.get('/public/app.b64')); @@ -169,7 +169,7 @@ function geticon(appname) { var icons = mklist(); (function displayentries(entries) { - if (isNil(entries)) + if (isNull(entries)) return apps; var entry = car(entries); var title = cadr(assoc("'title", entry)) @@ -183,8 +183,8 @@ function geticon(appname) { var ar2 = assoc("'rating2", aratings); var ar3 = assoc("'rating3", aratings); var ar4 = assoc("'rating4", aratings); - var rating = isNil(ar)? 0 : Number(cadr(ar)); - var reviews = (isNil(ar1)? 0 : Number(cadr(ar1))) + (isNil(ar2)? 0 : Number(cadr(ar2))) + (isNil(ar3)? 0 : Number(cadr(ar3))) + (isNil(ar4)? 0 : Number(cadr(ar4))); + var rating = isNull(ar)? 0 : Number(cadr(ar)); + var reviews = (isNull(ar1)? 0 : Number(cadr(ar1))) + (isNull(ar2)? 0 : Number(cadr(ar2))) + (isNull(ar3)? 0 : Number(cadr(ar3))) + (isNull(ar4)? 0 : Number(cadr(ar4))); apps += '<div class="box">' apps += '<div class="appicon">' @@ -213,7 +213,7 @@ function geticon(appname) { ui.unmemo$('store_app_'); (function displayicons(icons) { - if (isNil(icons)) + if (isNull(icons)) return true; geticon(car(icons)); return displayicons(cdr(icons)); |