/adei/ui

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/ui

« back to all changes in this revision

Viewing changes to js/dom.js

  • Committer: Suren A. Chilingaryan
  • Date: 2008-04-20 05:22:25 UTC
  • Revision ID: csa@dside.dyndns.org-20080420052225-enu1yngq1pny531z
Layout redesign: search tab, controls, menu

Show diffs side-by-side

added added

removed removed

Lines of Context:
279
279
        node.style.height = (height - node.corr_y) + "px";
280
280
}
281
281
 
282
 
function domSetHeight(node, height, extend, check_node) {
 
282
function domSetHeight(node, height, extend, check_node, check_size) {
283
283
    if (typeof node.corr_y == "undefined") {
284
284
        node.style.height = height + "px";
285
285
 
286
 
        if (check_node) node.corr_y = check_node.offsetHeight - height;
287
 
        else node.corr_y = node.offsetHeight - height;
 
286
        if (check_node) {
 
287
            if (check_size)
 
288
                node.corr_y = check_node.offsetHeight - check_size;
 
289
            else 
 
290
                node.corr_y = check_node.offsetHeight - height;
 
291
        } else node.corr_y = node.offsetHeight - height;
288
292
 
289
293
        if (!node.corr_y) return;
 
294
 
290
295
        else if ((!extend)&&(node.corr_y<0)) {
291
296
            node.corr_y = 0;
292
297
            return;
339
344
}
340
345
 
341
346
 
 
347
function domGetChildsByName(node, name) {
 
348
    var ucname = name.toUpperCase();
 
349
    
 
350
    var arr = new Array();
 
351
    for (var n = node.firstChild; n; n = n.nextSibling) {
 
352
        if (n.nodeName.toUpperCase() == ucname) {
 
353
            arr.push(n);
 
354
        }
 
355
    }
 
356
    return arr;
 
357
}
 
358
 
 
359
function domGetFirstChildByName(node, name) {
 
360
    var ucname = name.toUpperCase();
 
361
    
 
362
    for (var n = node.firstChild; n; n = n.nextSibling) {
 
363
        if (n.nodeName.toUpperCase() == ucname) return n;
 
364
    }
 
365
    return false;
 
366
}
 
367
 
 
368
function domGetLastChildByName(node, name) {
 
369
    var ucname = name.toUpperCase();
 
370
    
 
371
    var res = false;
 
372
    for (var n = node.firstChild; n; n = n.nextSibling) {
 
373
        if (n.nodeName.toUpperCase() == ucname) res = n;
 
374
    }
 
375
    return res;
 
376
}
 
377
 
 
378
 
342
379
function dateFormat(d) {
343
380
    return (d.getUTCMonth()+1) + '/' + d.getUTCDate() + '/' + d.getUTCFullYear() + ' ' +
344
381
        d.getUTCHours() + ':' + d.getUTCMinutes() + ':' + d.getUTCSeconds();