xcpweb

changeset 6:fa572caf2edc

The interface template and the login part almost ready :)
author Nikola Nikov <nikolanikov@webconnect.bg>
date Tue Jun 15 00:35:25 2010 +0300 (2010-06-15)
parents 3029bf4a2887
children b9279d8aaa76
files interface/border-radius.htc interface/img/header.png interface/img/login_button.png interface/img/login_button_active.png interface/index.html interface/js/interface_init.js interface/some_unfinished_stuff/img/ico-arrow-right.png interface/some_unfinished_stuff/img/tabs/active-gradient.jpg interface/some_unfinished_stuff/img/tabs/border.png interface/some_unfinished_stuff/img/tabs/ico-close.jpg interface/some_unfinished_stuff/img/tabs/unactive-gradient-hover.jpg interface/some_unfinished_stuff/img/tabs/unactive-gradient.jpg interface/some_unfinished_stuff/menu_tmpl.html interface/some_unfinished_stuff/rightmenu.css interface/some_unfinished_stuff/rightmenu.js interface/some_unfinished_stuff/tabs.css interface/some_unfinished_stuff/tabs.js interface/some_unfinished_stuff/tabs_tmpl.html interface/templates/login.css interface/templates/login.html interface/templates/login.js interface/templates/main.html interface/xcp.css libxen/README libxen/callbacks.js libxen/libxen.js libxen/libxen_init.js
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/interface/border-radius.htc	Tue Jun 15 00:35:25 2010 +0300
     1.3 @@ -0,0 +1,620 @@
     1.4 +<public:attach event="oncontentready" onevent="oncontentready('v08vnSVo78t4JfjH')" />
     1.5 +<script type="text/javascript">
     1.6 +/*--Do not remove this if you are using--
     1.7 +Original Author: Remiz Rahnas
     1.8 +Original Author URL: http://www.htmlremix.com
     1.9 +Published date: 2008/09/24
    1.10 +
    1.11 +Changes by Nick Fetchak:
    1.12 +- IE8 standards mode compatibility
    1.13 +- VML elements now positioned behind original box rather than inside of it - should be less prone to breakage
    1.14 +Published date : 2009/11/18
    1.15 +*/
    1.16 +
    1.17 +// functions to take the width and height of hidden elements
    1.18 +// taken from: http://blog.strictly-software.com/2009/10/correctly-measuring-element-dimensions.html
    1.19 +    // Functions for converting properties from camelCase to CSS-Property format and vice versa
    1.20 +    function toCamelCase(name){
    1.21 +        var camelCase = name.replace(/\-(\w)/g, function(all, letter){
    1.22 +            return letter.toUpperCase();
    1.23 +        });
    1.24 +        return camelCase
    1.25 +    }
    1.26 +    function toCSSProp(name){
    1.27 +        return name.replace( /([A-Z])/g, "-$1" ).toLowerCase();
    1.28 +    }
    1.29 +
    1.30 +    //returns the current style of an element with no conversions of units
    1.31 +    function getStyle(el,style){
    1.32 +        var ret = 0;
    1.33 +        var	elem = (typeof(el)=="string")?G(el):el;
    1.34 +        var val = "", doc = (elem.ownerDocument||elem.document||document);
    1.35 +
    1.36 +        // Make sure we have both formats for JS and CSS styles
    1.37 +        var camelCase = toCamelCase(style); //convert to camelCase
    1.38 +        var CSSProp = toCSSProp(style); //convert to css-property
    1.39 +
    1.40 +        // Try for computed style first as this will return the actual value converted to px
    1.41 +        if (typeof doc.defaultView !== 'undefined' && typeof doc.defaultView.getComputedStyle !== 'undefined'){
    1.42 +            // We only require the word float for computedStyle
    1.43 +            if ( style.match( /float/i ) )
    1.44 +                style = "float";
    1.45 +
    1.46 +            var computedStyle = doc.defaultView.getComputedStyle( elem, null );
    1.47 +            //Standard Compliant function that will return the true computed size in px
    1.48 +            if ( computedStyle ){
    1.49 +                ret = computedStyle.getPropertyValue( CSSProp );
    1.50 +            }
    1.51 +        } else if ( elem.currentStyle ) {
    1.52 +            //IE only
    1.53 +            ret = elem.currentStyle[ camelCase ];
    1.54 +        } else if(elem.style && elem.style[ camelCase ] ){
    1.55 +            //Default to style if its been set by JS or inline styling
    1.56 +            ret = elem.style[ camelCase ];
    1.57 +        }
    1.58 +
    1.59 +        return ret
    1.60 +    }
    1.61 +
    1.62 +    function G(i){ return document.getElementById(i) }
    1.63 +
    1.64 +    // returns an array of elements that need to be made visible to carry out a measurement of an element
    1.65 +    function getVisibleObj(elem){
    1.66 +        arrEls = []; // holds array of elements we need to make visible to measure X
    1.67 +
    1.68 +        while(elem && elem!==document){
    1.69 +            var es = getStyle(elem,"display"); // method returns current/computed/style value
    1.70 +
    1.71 +            if(es == 'none'){
    1.72 +                arrEls.push(elem);
    1.73 +            }
    1.74 +
    1.75 +            elem = elem.parentNode;
    1.76 +        }
    1.77 +        return arrEls; //null;
    1.78 +    }
    1.79 +
    1.80 +    // swap styles in and out for an accurate measurment. Taken from jQuery and tweaked by myself to
    1.81 +    // handle multiple elements.
    1.82 +    function Swap(elem, els, styles, callback){
    1.83 +        var obj;
    1.84 +
    1.85 +        for(var x=0,l=els.length;x<l;x++){
    1.86 +             // create hash on element to hold old styles so we can revert later
    1.87 +             obj = els[x];
    1.88 +             obj.old = {};
    1.89 +
    1.90 +             // Remember the old values, and insert the new ones
    1.91 +             for ( var name in styles ) {
    1.92 +                 obj.old[ name ] = obj.style[ name ];
    1.93 +                 obj.style[ name ] = styles[ name ];
    1.94 +             }
    1.95 +        }
    1.96 +
    1.97 +        // call the function passing in any element that needs scope
    1.98 +        callback.call( elem );
    1.99 +
   1.100 +        for(var x=0,l=els.length;x<l;x++){
   1.101 +            obj = els[x];
   1.102 +
   1.103 +            // Revert the old values
   1.104 +            for ( var name in styles ){
   1.105 +                obj.style[ name ] = obj.old[ name ];
   1.106 +            }
   1.107 +            // delete the hash from the element
   1.108 +            try{ delete obj.old; }catch(e){ obj.old=null}
   1.109 +        }
   1.110 +    }
   1.111 +
   1.112 +    // offsetWidth/Height is element.width/height +border+padding (standard box model)
   1.113 +    // clientWidth/Height is element.width/height +padding (if overflow:scroll then -16px)
   1.114 +    function getElementDimensions(el){
   1.115 +        el = (typeof(el)=="string")?G(el):el; //return a reference to the element
   1.116 +
   1.117 +        var w=0,h=0,cw=0,ch=0,x=0,y=0;
   1.118 +
   1.119 +        // if element is currently hidden we won't be able to get measurements so we need to find out whether this or
   1.120 +        // any other parent objects are hiding this element from the flow
   1.121 +        var arrEls = getVisibleObj(el); //returns array of objects we need to show to meaure our element
   1.122 +
   1.123 +        // create function to do the measuring
   1.124 +        function getElDim(){
   1.125 +            // get style object
   1.126 +            var els = el.style;
   1.127 +
   1.128 +            var pos = findPos(el);
   1.129 +            // get dimensions
   1.130 +            w = el.offsetWidth, h = el.offsetHeight, cw = el.clientWidth, ch = el.clientHeight,y = pos.y,x = pos.x;
   1.131 +        }
   1.132 +
   1.133 +        // do we need to toggle other objects before getting our dimensions
   1.134 +        if(arrEls && arrEls.length>0){
   1.135 +            // call function to swap over properties so we can accuratley measure this element
   1.136 +            var styles = {visibility: "hidden",display:"block"};
   1.137 +            Swap(el, arrEls, styles, getElDim);
   1.138 +        }else{
   1.139 +            getElDim();
   1.140 +        }
   1.141 +
   1.142 +        // create object
   1.143 +        var ret = {
   1.144 +            "width":w,  //total width (element+border+padding)
   1.145 +            "height":h,
   1.146 +            "clientWidth":cw, //element+padding
   1.147 +            "clientHeight":ch,
   1.148 +            "x":x,
   1.149 +            "y":y
   1.150 +        }
   1.151 +
   1.152 +        return ret;
   1.153 +    }
   1.154 +// end width/height functons
   1.155 +
   1.156 +// findPos() borrowed from http://www.quirksmode.org/js/findpos.html
   1.157 +function findPos(obj) {
   1.158 +    var curleft = curtop = 0;
   1.159 +
   1.160 +    if (obj.offsetParent) {
   1.161 +        do {
   1.162 +            curleft += obj.offsetLeft;
   1.163 +            curtop += obj.offsetTop;
   1.164 +        } while (obj = obj.offsetParent);
   1.165 +    }
   1.166 +
   1.167 +    return({
   1.168 +        'x': curleft,
   1.169 +        'y': curtop
   1.170 +    });
   1.171 +}
   1.172 +
   1.173 +// get the four arc radiuses
   1.174 +function getarcs(elem) {
   1.175 +    var corners = {topRight: 0, bottomRight: 0, bottomLeft: 0, topLeft: 0}
   1.176 +
   1.177 +    var arcSize = parseInt(elem.currentStyle['-moz-border-radius'] ||
   1.178 +                           elem.currentStyle['-webkit-border-radius'] ||
   1.179 +                           elem.currentStyle['border-radius'] ||
   1.180 +                           elem.currentStyle['-khtml-border-radius']);
   1.181 +    if (!isNaN(arcSize)) {
   1.182 +        corners = {topRight: arcSize, bottomRight: arcSize, bottomLeft: arcSize, topLeft: arcSize}
   1.183 +    }
   1.184 +
   1.185 +    var topRightArc = parseInt(elem.currentStyle['-moz-border-radius-topright'] ||
   1.186 +                               elem.currentStyle['-webkit-border-top-right-radius'] ||
   1.187 +                               elem.currentStyle['border-top-right-radius'] ||
   1.188 +                               elem.currentStyle['-khtml-border-top-right-radius']);
   1.189 +
   1.190 +    if (!isNaN(topRightArc)) {
   1.191 +        corners.topRight = topRightArc;
   1.192 +    }
   1.193 +
   1.194 +    var bottomRightArc = parseInt(elem.currentStyle['-moz-border-radius-bottomright'] ||
   1.195 +                                  elem.currentStyle['-webkit-border-bottom-right-radius'] ||
   1.196 +                                  elem.currentStyle['border-bottom-right-radius'] ||
   1.197 +                                  elem.currentStyle['-khtml-border-bottom-right-radius']);
   1.198 +
   1.199 +    if (!isNaN(bottomRightArc)) {
   1.200 +        corners.bottomRight = bottomRightArc;
   1.201 +    }
   1.202 +
   1.203 +    var bottomLeftArc = parseInt(elem.currentStyle['-moz-border-radius-bottomleft'] ||
   1.204 +                                 elem.currentStyle['-webkit-border-bottom-left-radius'] ||
   1.205 +                                 elem.currentStyle['border-bottom-left-radius'] ||
   1.206 +                                 elem.currentStyle['-khtml-border-bottom-left-radius']);
   1.207 +
   1.208 +    if (!isNaN(bottomLeftArc)) {
   1.209 +        corners.bottomLeft = bottomLeftArc;
   1.210 +    }
   1.211 +
   1.212 +    var topLeftArc = parseInt(elem.currentStyle['-moz-border-radius-topleft'] ||
   1.213 +                              elem.currentStyle['-webkit-border-top-left-radius'] ||
   1.214 +                              elem.currentStyle['border-top-left-radius'] ||
   1.215 +                              elem.currentStyle['-khtml-border-top-left-radius']);
   1.216 +
   1.217 +    if (!isNaN(topLeftArc)) {
   1.218 +        corners.topLeft = topLeftArc;
   1.219 +    }
   1.220 +
   1.221 +    return corners;
   1.222 +}
   1.223 +
   1.224 +// limiting corners depending on the size of the box
   1.225 +function fixCorners(corners,rect_size) {
   1.226 +    // left side
   1.227 +    if (corners.topLeft + corners.bottomLeft >= rect_size.height) {
   1.228 +        if (corners.topLeft <= rect_size.height/2) {
   1.229 +            corners.bottomLeft = rect_size.height - corners.topLeft;
   1.230 +        } else if (corners.bottomLeft <= rect_size.height/2) {
   1.231 +            corners.topLeft = rect_size.height - corners.bottomLeft;
   1.232 +        } else {
   1.233 +            corners.bottomLeft = Math.floor(rect_size.height/2);
   1.234 +            corners.topLeft = Math.floor(rect_size.height/2);
   1.235 +        }
   1.236 +    }
   1.237 +    // alert(corners.bottomLeft);
   1.238 +    // right side
   1.239 +    if (corners.topRight + corners.bottomRight >= rect_size.height) {
   1.240 +        if (corners.topRight <= rect_size.height/2) {
   1.241 +            corners.bottomRight = rect_size.height - corners.topRight;
   1.242 +        } else if (corners.bottomRight <= rect_size.height/2) {
   1.243 +            corners.topRight = rect_size.height - corners.bottomRight;
   1.244 +        } else {
   1.245 +            corners.bottomRight = Math.floor(rect_size.height/2);
   1.246 +            corners.topRight = Math.floor(rect_size.height/2);
   1.247 +        }
   1.248 +    }
   1.249 +    // top side
   1.250 +    if (corners.topRight + corners.topLeft >= rect_size.width) {
   1.251 +        if (corners.topRight <= rect_size.width/2) {
   1.252 +            corners.topLeft = rect_size.width - corners.topRight;
   1.253 +        } else if (corners.topLeft <= rect_size.width/2) {
   1.254 +            corners.topRight = rect_size.width - corners.topLeft;
   1.255 +        } else {
   1.256 +            corners.topLeft = Math.floor(rect_size.width/2);
   1.257 +            corners.topRight = Math.floor(rect_size.width/2);
   1.258 +        }
   1.259 +    }
   1.260 +    // bottom side
   1.261 +    if (corners.bottomRight + corners.bottomLeft >= rect_size.width) {
   1.262 +        if (corners.bottomRight <= rect_size.width/2) {
   1.263 +            corners.bottomLeft = rect_size.width - corners.bottomRight;
   1.264 +        } else if (corners.bottomLeft <= rect_size.width/2) {
   1.265 +            corners.bottomRight = rect_size.width - corners.bottomLeft;
   1.266 +        } else {
   1.267 +            corners.bottomLeft = Math.floor(rect_size.width/2);
   1.268 +            corners.bottomRight = Math.floor(rect_size.width/2);
   1.269 +        }
   1.270 +    }
   1.271 +    return corners;
   1.272 +}
   1.273 +
   1.274 +// check if VML shape and fill are already defined in CSS and do not define them again
   1.275 +function addVMLCss() {
   1.276 +    var hasVMLShape = false;
   1.277 +    var hasVMLFill = false;
   1.278 +    var sheets = window.document.styleSheets, l = sheets.length;
   1.279 +    for(var i=0; i<l; i++) {
   1.280 +        var rules = (sheets[i]).rules;
   1.281 +        for(var j=0; j<l; j++) {
   1.282 +            if (rules[j] != undefined && rules[j].selectorText != null
   1.283 +                && (rules[j].selectorText == 'v:shape' || rules[j].selectorText == 'v\\:shape')
   1.284 +                ) {
   1.285 +                hasVMLShape = true;
   1.286 +            }
   1.287 +            if (rules[j] != undefined && rules[j].selectorText != null
   1.288 +                && (rules[j].selectorText == 'v:fill' || rules[j].selectorText == 'v\\:fill')
   1.289 +                ) {
   1.290 +                hasVMLFill = true;
   1.291 +            }
   1.292 +        }
   1.293 +    }
   1.294 +    if (!hasVMLShape || !hasVMLFill) {
   1.295 +        var css = window.document.createStyleSheet();
   1.296 +    }
   1.297 +    if (!hasVMLShape) {
   1.298 +        css.addRule("v\\:shape", "behavior: url(#default#VML)");
   1.299 +    }
   1.300 +    if (!hasVMLFill) {
   1.301 +        css.addRule("v\\:fill", "behavior: url(#default#VML)");
   1.302 +    }
   1.303 +}
   1.304 +
   1.305 +function makeShape(target,classID,colors) {
   1.306 +    if (target.className.match(classID)) {
   1.307 +        var tmpClassName = target.className;
   1.308 +        target.className = tmpClassName.substring(0,tmpClassName.indexOf(classID))+tmpClassName.substring((tmpClassName.lastIndexOf(classID)+classID.length),tmpClassName.length)
   1.309 +        // return(false);
   1.310 +    }
   1.311 +    target.className = target.className.concat(' ', classID);
   1.312 +    var corners = getarcs(target);
   1.313 +    if (colors == null) {
   1.314 +        var fillColor = target.currentStyle.backgroundColor;
   1.315 +        var fillSrc = target.currentStyle.backgroundImage.replace(/^url\("(.+)"\)$/, '$1');
   1.316 +        var strokeColor = target.currentStyle.borderColor;
   1.317 +    } else {
   1.318 +        var fillColor = colors.backgroundColor;
   1.319 +        var fillSrc = colors.backgroundImage;
   1.320 +        var strokeColor = colors.borderColor;
   1.321 +    }
   1.322 +    var strokeWeight = parseInt(target.currentStyle.borderWidth);
   1.323 +    var stroked = 'true';
   1.324 +    if (isNaN(strokeWeight)) {
   1.325 +        strokeWeight = 0;
   1.326 +        strokeColor = fillColor;
   1.327 +        stroked = 'false';
   1.328 +    }
   1.329 +    target.style.background = 'transparent';
   1.330 +    target.style.borderColor = 'transparent';
   1.331 +
   1.332 +    // Find which element provides position:relative for the target element (default to BODY)
   1.333 +    var el = target;
   1.334 +    var limit = 100, i = 0;
   1.335 +    // added absolute positioning also
   1.336 +    while ((typeof(el) != 'unknown') && (el.currentStyle.position != 'relative') && (el.currentStyle.position != 'absolute') && (el.tagName != 'BODY')) {
   1.337 +        el = el.parentElement;
   1.338 +        i++;
   1.339 +        if (i >= limit) { return(false); }
   1.340 +    }
   1.341 +    var el_zindex = parseInt(el.currentStyle.zIndex);
   1.342 +    if (isNaN(el_zindex)) { el_zindex = 0; }
   1.343 +    //alert('got tag '+ el.tagName +' with pos '+ el.currentStyle.position);
   1.344 +
   1.345 +    var rect_size = {
   1.346 +        'width': target.offsetWidth - strokeWeight,
   1.347 +        'height': target.offsetHeight - strokeWeight
   1.348 +    };
   1.349 +    // if sizes are <= 0 (when the element is hidden) use the function to get them
   1.350 +    if (rect_size.width <= 0 && rect_size.height <= 0) {
   1.351 +        var dimensions = getElementDimensions(target);
   1.352 +        rect_size.width = dimensions.clientWidth;
   1.353 +        rect_size.height = dimensions.clientHeight;
   1.354 +    }
   1.355 +
   1.356 +    corners = fixCorners(corners,rect_size);
   1.357 +
   1.358 +    var el_pos = findPos(el);
   1.359 +    var target_pos = findPos(target);
   1.360 +
   1.361 +    // if positions are <= 0 (when the element is hidden - happened on IE8 only) get the function to get them
   1.362 +    if (el_pos.x <= 0 && el_pos.y <= 0) {
   1.363 +        el_pos = getElementDimensions(el);
   1.364 +    }
   1.365 +    if (target_pos.x <= 0 && target_pos.y <= 0) {
   1.366 +        target_pos = getElementDimensions(target);
   1.367 +    }
   1.368 +    target_pos.y = target_pos.y + (0.5 * strokeWeight) - el_pos.y;
   1.369 +    target_pos.x = target_pos.x + (0.5 * strokeWeight) - el_pos.x;
   1.370 +
   1.371 +    var rect = document.createElement('v:shape');
   1.372 +    rect.coordorigin="0 0";
   1.373 +    rect.coordsize = rect_size.width+" "+rect_size.height;
   1.374 +    var topRightPoint = (rect_size.width - corners.topRight);
   1.375 +    if (topRightPoint < 0) {
   1.376 +        topRightPoint = corners.topLeft;
   1.377 +    }
   1.378 +    topRightPoint += ',0';
   1.379 +    var rightTopPoint = rect_size.width+','+corners.topRight;
   1.380 +    var rightBottomPoint = (rect_size.height - corners.bottomRight);
   1.381 +    if (rightBottomPoint < 0) {
   1.382 +        rightBottomPoint = corners.topRight;
   1.383 +    }
   1.384 +    rightBottomPoint = rect_size.width+','+rightBottomPoint;
   1.385 +    var bottomRightPoint = (rect_size.width - corners.bottomRight)+','+rect_size.height;
   1.386 +    var bottomLeftPoint = corners.bottomLeft+','+rect_size.height;
   1.387 +    var leftBottomPoint = '0,'+(rect_size.height - corners.bottomLeft);
   1.388 +    var leftTopPoint = '0,'+corners.topLeft;
   1.389 +    var topLeftPoint = corners.topLeft+',0';
   1.390 +
   1.391 +    var rightTopArc = '';
   1.392 +    if (corners.topRight != 0) {
   1.393 +        rightTopArc = 'c '+(rect_size.width-Math.ceil(corners.topRight/2))+',0 '+
   1.394 +            rect_size.width+','+(Math.ceil(corners.topRight/2))+' '+
   1.395 +            rightTopPoint+' ';
   1.396 +    }
   1.397 +    var rightBottomArc = '';
   1.398 +    if (corners.bottomRight != 0) {
   1.399 +        rightBottomArc = 'c '+(rect_size.width)+','+(rect_size.height - Math.ceil(corners.bottomRight/2))+' '+
   1.400 +            (rect_size.width - Math.ceil(corners.bottomRight/2))+','+(rect_size.height)+' '+
   1.401 +            bottomRightPoint+' ';
   1.402 +    }
   1.403 +    var leftBottomArc = '';
   1.404 +    if (corners.bottomLeft != 0) {
   1.405 +        leftBottomArc = 'c '+(Math.ceil(corners.bottomLeft/2))+','+rect_size.height+' '+
   1.406 +            '0,'+(rect_size.height - Math.ceil(corners.bottomLeft/2))+' '+
   1.407 +            leftBottomPoint+' ';
   1.408 +    }
   1.409 +    var topLeftArc = '';
   1.410 +    if (corners.topLeft != 0) {
   1.411 +        topLeftArc = 'c '+
   1.412 +            '0,'+(Math.ceil(corners.topLeft/2))+' '+
   1.413 +            (Math.ceil(corners.topLeft/2))+',0 '+
   1.414 +            topLeftPoint+' ';
   1.415 +    }
   1.416 +
   1.417 +    rect.path = 'm '+topLeftPoint+                          // start point
   1.418 +        'l '+topRightPoint+' '+                             // top line
   1.419 +        rightTopArc+                                        // top right arc
   1.420 +        'l '+ rightBottomPoint+' '+                         // right line
   1.421 +        rightBottomArc+                                     // bottom right arc
   1.422 +        'l '+bottomLeftPoint+' '+                           // bottom line
   1.423 +        leftBottomArc+                                      // bottom left arc
   1.424 +        'l '+leftTopPoint+' '+                              // left line
   1.425 +        topLeftArc+                                         // top left arc
   1.426 +        ' x e';
   1.427 +
   1.428 +    rect.strokecolor = strokeColor;
   1.429 +    rect.strokeWeight = strokeWeight +'px';
   1.430 +    rect.stroked = stroked;
   1.431 +    rect.style.display = 'block';
   1.432 +    rect.style.position = 'absolute';
   1.433 +    rect.style.top = target_pos.y +'px';
   1.434 +    rect.style.left = target_pos.x +'px';
   1.435 +    rect.style.width = rect_size.width +'px';
   1.436 +    rect.style.height = rect_size.height +'px';
   1.437 +    rect.style.antialias = true;
   1.438 +    rect.style.zIndex = el_zindex - 1;
   1.439 +    // debug(rect.style.zIndex);
   1.440 +
   1.441 +    var fill = document.createElement('v:fill');
   1.442 +    fill.color = fillColor;
   1.443 +    fill.src = fillSrc;
   1.444 +    fill.type = 'tile';
   1.445 +
   1.446 +    rect.appendChild(fill);
   1.447 +    el.appendChild(rect);
   1.448 +
   1.449 +    isIE6 = /msie|MSIE 6/.test(navigator.userAgent);
   1.450 +    // IE6 doesn't support transparent borders, use padding to offset original element
   1.451 +    if (isIE6 && (strokeWeight > 0)) {
   1.452 +        target.style.borderStyle = 'none';
   1.453 +        target.style.paddingTop = parseInt(target.currentStyle.paddingTop || 0) + strokeWeight;
   1.454 +        target.style.paddingBottom = parseInt(target.currentStyle.paddingBottom || 0) + strokeWeight;
   1.455 +    }
   1.456 +    target.vml = rect;
   1.457 +}
   1.458 +
   1.459 +
   1.460 +function getRulesFor(target) {
   1.461 +    var classes = target.className;
   1.462 +    classes = classes.split(' ');
   1.463 +    var classesTmp = new Array();
   1.464 +    for (i = 0;i < classes.length;i++) {
   1.465 +        if (classes[i] != '') {
   1.466 +            classesTmp.push(classes[i]);
   1.467 +        }
   1.468 +    }
   1.469 +    classes = classesTmp;
   1.470 +
   1.471 +    var sheets = window.document.styleSheets, l = sheets.length;
   1.472 +    var rules = new Array();
   1.473 +    for(var i=0; i<l; i++) {
   1.474 +        rules = getRules(sheets[i],classes,rules);
   1.475 +    }
   1.476 +    return rules;
   1.477 +}
   1.478 +
   1.479 +function getRules(sheet,classes,rulesExt) {
   1.480 +    if(sheet.imports) {
   1.481 +        try {
   1.482 +            var imports = sheet.imports, l = imports.length;
   1.483 +            for(var i=0; i<l; i++) getRules(sheet.imports[i],classes,rulesExt);
   1.484 +        } catch(securityException){}
   1.485 +    }
   1.486 +
   1.487 +    var rules = (currentSheet = sheet).rules, l = rules.length;
   1.488 +    for(var j=0; j<l; j++) {
   1.489 +        var rule = rules[j];
   1.490 +        for (k = 0;k < classes.length;k++) {
   1.491 +            if ('.'+classes[k] == rule.selectorText ||
   1.492 +                '.'+classes[k]+':hover' == rule.selectorText
   1.493 +                ) {
   1.494 +                rulesExt.push(rule);
   1.495 +            }
   1.496 +        }
   1.497 +    }
   1.498 +    return rulesExt;
   1.499 +}
   1.500 +
   1.501 +function hoverSupport(target,classID,unhoverBackgroundColor,unhoverBackgroundImage,unhoverBorderColor) {
   1.502 +    // return false;
   1.503 +    var hoverRule;
   1.504 +    var hoverBackgroundColor;
   1.505 +    var hoverBackgroundImage;
   1.506 +    var hoverBorderColor;
   1.507 +
   1.508 +    function hover() {
   1.509 +        var rules = getRulesFor(target);
   1.510 +        for (i = 0;i < rules.length;i++) {
   1.511 +            if (rules[i].selectorText.match(':hover')) {
   1.512 +                hoverRule = rules[i];
   1.513 +            }
   1.514 +        }
   1.515 +        if (hoverRule == undefined) {
   1.516 +            return false;
   1.517 +        }
   1.518 +
   1.519 +        // remove the whatever:hover class if it is there
   1.520 +        isIE6 = /msie|MSIE 6/.test(navigator.userAgent);
   1.521 +        if (isIE6) {
   1.522 +            var removeClass = hoverRule.selectorText.substring(1,hoverRule.selectorText.indexOf(':hover'))+'onhover';
   1.523 +            if (target.className.match(removeClass)) {
   1.524 +                var tmpClassName = target.className;
   1.525 +                target.className = tmpClassName.substring(0,tmpClassName.indexOf(removeClass))+tmpClassName.substring((tmpClassName.lastIndexOf(removeClass)+removeClass.length),tmpClassName.length)
   1.526 +            }
   1.527 +        }
   1.528 +
   1.529 +        hoverBackgroundColor = hoverRule.style.backgroundColor;
   1.530 +        hoverBackgroundImage = hoverRule.style.backgroundImage;
   1.531 +        hoverBorderColor = hoverRule.style.borderColor;
   1.532 +        var colors = {'backgroundColor':hoverBackgroundColor,
   1.533 +            'backgroundImage':hoverBackgroundImage,
   1.534 +            'borderColor':hoverBorderColor};
   1.535 +
   1.536 +        var rect = target.vml;
   1.537 +        var offsetParent = rect.offsetParent;
   1.538 +        offsetParent.removeChild(rect);
   1.539 +
   1.540 +        makeShape(target,classID,colors);
   1.541 +        hoverRule.style.backgroundColor = 'transparent';
   1.542 +        hoverRule.style.backgroundImage = '';
   1.543 +        hoverRule.style.borderColor = 'transparent';
   1.544 +
   1.545 +    }
   1.546 +    function unHover() {
   1.547 +        var rules = getRulesFor(target);
   1.548 +        for (i = 0;i < rules.length;i++) {
   1.549 +            if (rules[i].selectorText.match(':hover')) {
   1.550 +                hoverRule = rules[i];
   1.551 +            }
   1.552 +        }
   1.553 +
   1.554 +        if (hoverRule == undefined) {
   1.555 +            return false;
   1.556 +        }
   1.557 +
   1.558 +        target.style.backgroundColor = unhoverBackgroundColor;
   1.559 +        target.style.backgroundImage = unhoverBackgroundImage;
   1.560 +        target.style.borderColor = unhoverBorderColor;
   1.561 +
   1.562 +        var rect = target.vml;
   1.563 +        var offsetParent = rect.offsetParent;
   1.564 +        offsetParent.removeChild(rect);
   1.565 +        makeShape(target,classID);
   1.566 +
   1.567 +        hoverRule.style.backgroundColor = hoverBackgroundColor;
   1.568 +        hoverRule.style.backgroundImage = hoverBackgroundImage;
   1.569 +        hoverRule.style.borderColor = hoverBorderColor;
   1.570 +    }
   1.571 +    target.attachEvent('onmouseenter', function() {setTimeout(hover,0)});
   1.572 +    target.attachEvent('onmouseleave', function() {setTimeout(unHover,0)});
   1.573 +}
   1.574 +
   1.575 +function oncontentready(classID) {
   1.576 +    if (!document.namespaces.v) { document.namespaces.add("v", "urn:schemas-microsoft-com:vml"); }
   1.577 +    var target = this.element;
   1.578 +
   1.579 +    var unhoverBackgroundColor = target.currentStyle.backgroundColor;
   1.580 +    var unhoverBackgroundImage = target.currentStyle.backgroundImage;
   1.581 +    var unhoverBorderColor = target.currentStyle.borderColor;
   1.582 +
   1.583 +    makeShape(target,classID);
   1.584 +
   1.585 +    // :hover support
   1.586 +    hoverSupport(target,classID,unhoverBackgroundColor,unhoverBackgroundImage,unhoverBorderColor);
   1.587 +
   1.588 +    addVMLCss()
   1.589 +
   1.590 +    if (typeof(window.rounded_elements) == 'undefined') {
   1.591 +        window.rounded_elements = new Array();
   1.592 +
   1.593 +        if (typeof(window.onresize) == 'function') { window.previous_onresize = window.onresize; }
   1.594 +        window.onresize = window_resize;
   1.595 +    }
   1.596 +    window.rounded_elements.push(target);
   1.597 +}
   1.598 +
   1.599 +function window_resize() {
   1.600 +    var classID = 'v08vnSVo78t4JfjH';
   1.601 +    if (typeof(window.rounded_elements) == 'undefined') { return(false); }
   1.602 +
   1.603 +    for (var i in window.rounded_elements) {
   1.604 +        var target = window.rounded_elements[i];
   1.605 +        var rect = target.vml;
   1.606 +
   1.607 +        // since the target colors has been set to transparent, we need to supply the right colors. We can read then from the shape element and its fill element.
   1.608 +        var fill = rect.childNodes[0];
   1.609 +        var fillColor = new String(fill.color);
   1.610 +        var fillSrc = new String(fill.src);
   1.611 +        var borderColor = rect.strokeColor;
   1.612 +        var colors = {'backgroundColor':fillColor,
   1.613 +                      'backgroundImage':fillSrc,
   1.614 +                      'borderColor':borderColor};
   1.615 +
   1.616 +        var offsetParent = rect.offsetParent;
   1.617 +        offsetParent.removeChild(rect);
   1.618 +
   1.619 +        makeShape(target,classID,colors);
   1.620 +    }
   1.621 +    if (typeof(window.previous_onresize) == 'function') { window.previous_onresize(); }
   1.622 +}
   1.623 +</script>
     2.1 Binary file interface/img/header.png has changed
     3.1 Binary file interface/img/login_button.png has changed
     4.1 Binary file interface/img/login_button_active.png has changed
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/interface/index.html	Tue Jun 15 00:35:25 2010 +0300
     5.3 @@ -0,0 +1,33 @@
     5.4 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     5.5 +<html xmlns="http://www.w3.org/1999/xhtml">
     5.6 +<head>
     5.7 +<title>Xen Cloud Platform</title>
     5.8 +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     5.9 +<meta http-equiv="Pragma" content="no-cache"/>
    5.10 +<meta http-equiv="Expires" content="0"/>
    5.11 +<script type="text/javascript">
    5.12 +var interface_path='/interface';
    5.13 +var libxen_path='/libxen';
    5.14 +</script>
    5.15 +
    5.16 +<script type="text/javascript" src="/interface/js/interface_init.js"></script>
    5.17 +<script type="text/javascript" src="/libxen/libxen_init.js"></script>
    5.18 +
    5.19 +
    5.20 +<link href="/interface/xcp.css" rel="stylesheet" type="text/css" />
    5.21 +<link href="/interface/templates/login.css" rel="stylesheet" type="text/css" />
    5.22 +
    5.23 +
    5.24 +</head>
    5.25 +<body onLoad="templates.LoadJS(interface_path+'/templates/login.js');templates.LoadTemplate(interface_path+'/templates/login.html','content');">
    5.26 +
    5.27 +<div class="page">
    5.28 +
    5.29 +<div class="header" id="header">&nbsp;</div>
    5.30 +<div class="content" id="content">&nbsp;</div>
    5.31 +
    5.32 +</div>
    5.33 +
    5.34 +
    5.35 +</body>
    5.36 +</html>
    5.37 \ No newline at end of file
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/interface/js/interface_init.js	Tue Jun 15 00:35:25 2010 +0300
     6.3 @@ -0,0 +1,57 @@
     6.4 +function templates_req() {
     6.5 +	var self = this;
     6.6 +	var xmldoc;
     6.7 +	var param;
     6.8 +	var url;
     6.9 +
    6.10 +	this.CreateHttpRequestObject = function(param) {
    6.11 +		if (!param) { param = 'text/xml'; }
    6.12 +		var http_request=false;
    6.13 +		if (window.XMLHttpRequest) {
    6.14 +			http_request = new XMLHttpRequest();
    6.15 +			if (http_request.overrideMimeType) { http_request.overrideMimeType(param); }
    6.16 +		}
    6.17 +		else if (window.ActiveXObject) {
    6.18 +			try {
    6.19 +				http_request = new ActiveXObject("Msxml2.XMLHTTP");
    6.20 +			}
    6.21 +			catch (e) {
    6.22 +				try {
    6.23 +					http_request = new ActiveXObject("Microsoft.XMLHTTP");
    6.24 +				}
    6.25 +				catch (e) {}
    6.26 +			}
    6.27 +		}
    6.28 +		return http_request;
    6.29 +	}
    6.30 +	this.LoadTemplate = function(url,put_id) {
    6.31 +		var httpRequest=self.CreateHttpRequestObject();
    6.32 +		httpRequest.onreadystatechange = function() {
    6.33 +			if (httpRequest.readyState == 4) {
    6.34 +				if (httpRequest.status == 200) {
    6.35 +					document.getElementById(put_id).innerHTML=httpRequest.responseText;
    6.36 +				}
    6.37 +				else {
    6.38 +					if(httpRequest.status!=404) {
    6.39 +						setTimeout("templates.makeRequest('"+url+"','GET','','1')",5000);
    6.40 +					}
    6.41 +				}
    6.42 +			}
    6.43 +		};
    6.44 +		httpRequest.open('GET', url, '1');
    6.45 +		httpRequest.send();
    6.46 +	}
    6.47 +	this.LoadJS = function(param) {
    6.48 +		var fileref=document.createElement('script');
    6.49 +		fileref.setAttribute("type","text/javascript");
    6.50 +		fileref.setAttribute("src", param);
    6.51 +		document.getElementsByTagName('head')[0].appendChild(fileref);
    6.52 +		return true;
    6.53 +	}
    6.54 +	
    6.55 +
    6.56 +}
    6.57 +var templates = new templates_req();
    6.58 +
    6.59 +
    6.60 +
     7.1 Binary file interface/some_unfinished_stuff/img/ico-arrow-right.png has changed
     8.1 Binary file interface/some_unfinished_stuff/img/tabs/active-gradient.jpg has changed
     9.1 Binary file interface/some_unfinished_stuff/img/tabs/border.png has changed
    10.1 Binary file interface/some_unfinished_stuff/img/tabs/ico-close.jpg has changed
    11.1 Binary file interface/some_unfinished_stuff/img/tabs/unactive-gradient-hover.jpg has changed
    12.1 Binary file interface/some_unfinished_stuff/img/tabs/unactive-gradient.jpg has changed
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/interface/some_unfinished_stuff/menu_tmpl.html	Tue Jun 15 00:35:25 2010 +0300
    13.3 @@ -0,0 +1,35 @@
    13.4 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    13.5 +<html xmlns="http://www.w3.org/1999/xhtml">
    13.6 +<head>
    13.7 +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    13.8 +<title>XCP web interface submenu test</title>
    13.9 +<link href="rightmenu.css" rel="stylesheet" type="text/css" />
   13.10 +<script type="Text/JavaScript" Language="JavaScript" src="rightmenu.js"></script>
   13.11 +<style media="all" type="text/css">
   13.12 +.more-info {display:none}
   13.13 +</style>
   13.14 +<script type="text/javascript" language="javascript">
   13.15 +var param;
   13.16 +function createMenu(param,e) {
   13.17 +	if (xcp_menu.getMenu(param)) { xcp_menu.dropMenu(param); }
   13.18 +	var currentMenu = xcp_menu.createMenu(param);
   13.19 +	if (typeof(currentMenu) == 'object') {
   13.20 +		xcp_menu.appendInMenu(currentMenu,'item1','Item 1',"alert('Item 1')",'/interface/img/ico-arrow-right.png');
   13.21 +		xcp_menu.appendInMenu(currentMenu,'item2','Item 2',"alert('Item 2');",'/interface/img/ico-arrow-right.png');
   13.22 +		var subcurrent = xcp_menu.appendSubInMenu(currentMenu,'sub1','Sub1','/interface/img/ico-arrow-right.png');
   13.23 +		if (typeof(subcurrent) == 'object') {
   13.24 +			xcp_menu.appendInMenu(subcurrent,'submenu1','Sub Menu 1',"alert('Sub Menu 1')",'/interface/img/ico-arrow-right.png');
   13.25 +		}
   13.26 +		xcp_menu.appendInMenu(currentMenu,'item3','Item 3',"alert('item3');",'/interface/img/ico-arrow-right.png');
   13.27 +		xcp_menu.appendInMenu(currentMenu,'item4','Item 4',"alert('item4')",'/interface/img/ico-arrow-right.png');
   13.28 +		xcp_menu.openRightMenu('menu_'+param,e);
   13.29 +	}
   13.30 +}
   13.31 +</script>
   13.32 +</head>
   13.33 +<body>
   13.34 +<a href="#" onclick="createMenu('current_prv',event);">test menu</a>
   13.35 +<div id="otherPages"></div>
   13.36 +<div id="submenus"></div>
   13.37 +</body>
   13.38 +</html>
   13.39 \ No newline at end of file
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/interface/some_unfinished_stuff/rightmenu.css	Tue Jun 15 00:35:25 2010 +0300
    14.3 @@ -0,0 +1,117 @@
    14.4 +.rightmenu {
    14.5 +	margin: 0px;
    14.6 +	padding: 0px;
    14.7 +	background-color: #f2f2f2;
    14.8 +	font-size: 11px;
    14.9 +	width: 160px;
   14.10 +	font-family: Arial, Helvetica, sans-serif;
   14.11 +	border-top-width: 1px;
   14.12 +	border-right-width: 2px;
   14.13 +	border-bottom-width: 2px;
   14.14 +	border-left-width: 1px;
   14.15 +	border-top-style: solid;
   14.16 +	border-right-style: solid;
   14.17 +	border-bottom-style: solid;
   14.18 +	border-left-style: solid;
   14.19 +	border-top-color: #CCCCCC;
   14.20 +	border-right-color: #666666;
   14.21 +	border-bottom-color: #666666;
   14.22 +	border-left-color: #CCCCCC;
   14.23 +	position: fixed;
   14.24 +	_position:absolute;
   14.25 +	z-index: 30!important;
   14.26 +	z-index:30;
   14.27 +	left: 0px;
   14.28 +	top: 0px;
   14.29 +	display: none;
   14.30 +}
   14.31 +.rightmenu li.sub {
   14.32 +	background-color: #f2f2f2;
   14.33 +	background-image: url(ico-arrow-right.png);
   14.34 +	background-repeat: no-repeat;
   14.35 +	background-position: 145px center;
   14.36 +} 
   14.37 +
   14.38 +.rightmenu ul {
   14.39 +	width:160px;
   14.40 +	height:auto;
   14.41 +	overflow:visible;
   14.42 +	padding:0;
   14.43 +	margin:0;
   14.44 +}
   14.45 +.rightmenu ul li {
   14.46 +	list-style-image:none;
   14.47 +	list-style:none;
   14.48 +	list-style-type:none;
   14.49 +	width:160px;
   14.50 +	height:21px;
   14.51 +	text-align:left;
   14.52 +	margin:0;
   14.53 +	padding:0;
   14.54 +	margin-top:-1px;
   14.55 +	clear:both;
   14.56 +	overflow:visible;
   14.57 +	position:relative;
   14.58 +	padding-top:5px;
   14.59 +	border-top-width: 1px;
   14.60 +	border-top-style: solid;
   14.61 +	border-top-color: #CCCCCC;
   14.62 +	cursor:pointer;
   14.63 +}
   14.64 +.rightmenu ul li a {
   14.65 +	text-decoration:none;
   14.66 +	color:#000000;
   14.67 +}
   14.68 +.rightmenu ul li:hover {
   14.69 +	color:#000000;
   14.70 +	background-color: #9dd4fc;
   14.71 +}
   14.72 +.rightmenu ul li ul {
   14.73 +	position:absolute;
   14.74 +	top:-30px;
   14.75 +	left:145px;
   14.76 +	padding:30px 50px 40px 0px;
   14.77 +	display:none;
   14.78 +	z-index:30;
   14.79 +}
   14.80 +.rightmenu ul li ul li {
   14.81 +	border-top-width: 1px;
   14.82 +	border-right-width: 2px;
   14.83 +	border-bottom-width: 2px;
   14.84 +	border-left-width: 1px;
   14.85 +	border-top-style: solid;
   14.86 +	border-right-style: solid;
   14.87 +	border-bottom-style: solid;
   14.88 +	border-left-style: solid;
   14.89 +	border-top-color: #CCCCCC;
   14.90 +	border-right-color: #666666;
   14.91 +	border-bottom-color: #666666;
   14.92 +	border-left-color: #CCCCCC;
   14.93 +	background-color: #f2f2f2;
   14.94 +	margin-top:-2px;
   14.95 +}
   14.96 +.rightmenu ul li:hover > ul {
   14.97 +	display:block;
   14.98 +}
   14.99 +.menu-ico {
  14.100 +	padding:0;
  14.101 +	float: left;
  14.102 +	width: 16px;
  14.103 +	margin-right: 6px;
  14.104 +	padding-right:0;
  14.105 +	padding-left:6px;
  14.106 +	margin-top:-2px;
  14.107 +}
  14.108 +.menu-ico input {
  14.109 +	float:left;
  14.110 +	margin:0;
  14.111 +	margin-top:2px;
  14.112 +}
  14.113 +.menu-ico-sub {
  14.114 +	padding:0;
  14.115 +	float: left;
  14.116 +	width: 16px;
  14.117 +	margin-right: 3px;
  14.118 +	padding-right:3px;
  14.119 +	padding-left:6px;
  14.120 +}
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/interface/some_unfinished_stuff/rightmenu.js	Tue Jun 15 00:35:25 2010 +0300
    15.3 @@ -0,0 +1,458 @@
    15.4 +function xcp_Menu() {
    15.5 +	var bw=document.getElementById&&!document.all;
    15.6 +	var winm;
    15.7 +	var prgm;
    15.8 +	var param;
    15.9 +	var attr;
   15.10 +	var oname;
   15.11 +	var fobj;
   15.12 +	var self = this;
   15.13 +	this.openedForFiles = new Array();
   15.14 +	this.openedForObjects = false;
   15.15 +	this.menuopen = new Array();
   15.16 +	this.menubeforeopen = new Array();
   15.17 +	this.winm = false;
   15.18 +	this.mousedown = function(e) {
   15.19 +		fobj = bw ? e.target : event.srcElement;
   15.20 +		self.checkforopenmenu(e,fobj);
   15.21 +	}
   15.22 +	this.checkforopenmenu = function(e,fobj) {
   15.23 +		if (self.winm && typeof(self.winm) == 'object') {
   15.24 +			if (!fobj.getAttribute('submenu')) {
   15.25 +				var menuid;
   15.26 +				if (menuid = self.getMainMenuId(fobj)) {
   15.27 +					self.dropMenu(menuid.substr(5));
   15.28 +				}
   15.29 +				else if (menuid = self.getMainMenuId(self.winm)) {
   15.30 +					self.dropMenu(menuid.substr(5));
   15.31 +				}
   15.32 +
   15.33 +			}
   15.34 +			else {
   15.35 +				var menuid = self.getMainMenuId(fobj);
   15.36 +				if (document.getElementById(menuid)) {
   15.37 +					var menuObj = document.getElementById(menuid);
   15.38 +					var menuObjLeft = tplf.findPosX(menuObj);
   15.39 +					if (menuObjLeft > menuObj.offsetWidth) {
   15.40 +						var mx = bw ? e.clientX : event.clientX;
   15.41 +						menuObj.style.left = (menuObjLeft-(menuObj.offsetWidth - 15))+'px';
   15.42 +					}
   15.43 +				}
   15.44 +			}
   15.45 +		}
   15.46 +		if (fobj.getAttribute('menuclick') && self.isEnabled(fobj)) {
   15.47 +			if (fobj.tagName == 'INPUT' && fobj.type == 'checkbox') {
   15.48 +				fobj.checked = !fobj.checked;
   15.49 +			}
   15.50 +			else {
   15.51 +				var obj = self.getMenuId(fobj);
   15.52 +				if (typeof(obj) == 'string' && document.getElementById(obj)) {
   15.53 +					self.changeCheckBox(obj);
   15.54 +				}
   15.55 +			}
   15.56 +			eval(fobj.getAttribute('menuclick'));
   15.57 +		}
   15.58 +	}
   15.59 +	this.openRightMenu = function(winm,e,param) {
   15.60 +		if (!document.getElementById(winm)) { return false; }
   15.61 +		var mx = bw ? e.clientX : event.clientX;
   15.62 +		var my = bw ? e.clientY : event.clientY;
   15.63 +		self.winm = document.getElementById(winm);
   15.64 +		if (!param) {
   15.65 +			self.winm.style.left=mx+"px";
   15.66 +			self.winm.style.top=my+"px";
   15.67 +		}
   15.68 +		self.winm.style.display="block";
   15.69 +		if (!param) {
   15.70 +			if (parseInt(navigator.appVersion)>3) {
   15.71 +				if (navigator.appName=="Netscape") {
   15.72 +					var winW = window.innerWidth;
   15.73 +					var winH = window.innerHeight;
   15.74 +				}
   15.75 +				if (navigator.appName.indexOf("Microsoft")!=-1) {
   15.76 +					var winW = document.body.scrollWidth;
   15.77 +					var winH = document.body.scrollHeight;
   15.78 +				}
   15.79 +			}
   15.80 +			if ((Number(self.winm.offsetLeft) + Number(self.winm.offsetWidth)) >= winW) {
   15.81 +				self.winm.style.left = Number(self.winm.offsetLeft) - Number(self.winm.offsetWidth)+'px';
   15.82 +			}
   15.83 +			if ((Number(self.winm.offsetTop) + Number(self.winm.offsetHeight)) >= winH) {
   15.84 +				self.winm.style.top = Number(winH) - Number(self.winm.offsetHeight)+'px';
   15.85 +			}
   15.86 +		}
   15.87 +	}
   15.88 +
   15.89 +	
   15.90 +	var menuobj;
   15.91 +	var menupos;
   15.92 +	var menuname;
   15.93 +	var menuclick;
   15.94 +	var menuicon;
   15.95 +	this.isMenu = function(param) {
   15.96 +		if (document.getElementById('menu_'+param)) { return true; }
   15.97 +		else { return false; }
   15.98 +	}
   15.99 +	this.getMenu = function(param) {
  15.100 +		if (self.isMenu(param)) { return document.getElementById('menu_'+param); }
  15.101 +		else { return false; }
  15.102 +	}
  15.103 +	this.isInMenu = function(menuobj,param) {
  15.104 +		if (!menuobj) { return false; }
  15.105 +		if (typeof(menuobj) == 'object') {
  15.106 +			var mname = self.getMainMenuId(menuobj);
  15.107 +			if (!mname) { return false; }
  15.108 +			if (document.getElementById(mname+'_'+param)) { return true; }
  15.109 +			else { return false; }
  15.110 +		}
  15.111 +		return false;
  15.112 +	}
  15.113 +	this.getInMenu = function(menuobj,param) {
  15.114 +		if (!menuobj) { return false; }
  15.115 +		if (typeof(menuobj) == 'object') {
  15.116 +			var mname = self.getMainMenuId(menuobj);
  15.117 +			if (!mname) { return false; }
  15.118 +			if ((menuobj.className && menuobj.className == 'sub') || menuobj.tagName == 'DIV') {
  15.119 +				menuobj = menuobj.getElementsByTagName('UL');
  15.120 +				if (menuobj.length) { menuobj = menuobj[0]; }
  15.121 +				else { return false; }
  15.122 +			}
  15.123 +			for (i=0;i<menuobj.childNodes.length;i++) {
  15.124 +				if (menuobj.childNodes[i].id && menuobj.childNodes[i].id == mname+'_'+param) {
  15.125 +					return menuobj.childNodes[i];
  15.126 +				}
  15.127 +			}
  15.128 +			return false;
  15.129 +		}
  15.130 +		else { return false; }
  15.131 +	}
  15.132 +	this.getMainMenuId = function(menuobj) {
  15.133 +		if (!menuobj) { return false; }
  15.134 +		if (menuobj.className && menuobj.className == 'rightmenu') { return menuobj.id; }
  15.135 +		while (menuobj.tagName != undefined && menuobj.tagName != 'HTML' && menuobj.tagName != 'HEAD' && menuobj.tagName != 'BODY' && menuobj.parentNode) {
  15.136 +			menuobj = menuobj.parentNode;
  15.137 +			if (menuobj.className && menuobj.className == 'rightmenu') { return menuobj.id; break; }
  15.138 +		}
  15.139 +		return false;
  15.140 +	}
  15.141 +	this.getMenuId = function(menuobj) {
  15.142 +		if (!menuobj) { return false; }
  15.143 +		if (menuobj.tagName && menuobj.tagName == 'LI') { return menuobj.id; }
  15.144 +		while (menuobj.tagName != undefined && menuobj.tagName != 'HTML' && menuobj.tagName != 'HEAD' && menuobj.tagName != 'BODY' && menuobj.parentNode) {
  15.145 +			menuobj = menuobj.parentNode;
  15.146 +			if (menuobj.tagName && menuobj.tagName == 'LI') { return menuobj.id; break; }
  15.147 +		}
  15.148 +		return false;
  15.149 +	}
  15.150 +	this.createMenu = function(param) {
  15.151 +		if (!self.isMenu(param)) {
  15.152 +			var divmenu = document.createElement('DIV');
  15.153 +			divmenu.className = 'rightmenu';
  15.154 +			divmenu.setAttribute('id','menu_'+param);
  15.155 +			var ulmenu = document.createElement('UL');
  15.156 +			ulmenu.setAttribute('id','ul_'+param);
  15.157 +			divmenu.appendChild(ulmenu);
  15.158 +			document.getElementById('submenus').appendChild(divmenu);
  15.159 +			return ulmenu;
  15.160 +		}
  15.161 +		else { return false; }
  15.162 +	}
  15.163 +	this.dropMenu = function(param) {
  15.164 +		if (self.isMenu(param)) {
  15.165 +			var obj = self.getMenu(param);
  15.166 +			obj.parentNode.removeChild(obj);
  15.167 +			obj = undefined;
  15.168 +			return true;
  15.169 +		}
  15.170 +		else { return false; }
  15.171 +	}
  15.172 +	this.appendInMenu = function(menuobj,param,menuname,menuclick,menuicon,menupos) {
  15.173 +		if (typeof(menuobj) != 'object') { return false; }
  15.174 +		if (self.isInMenu(menuobj,param)) { return true; }
  15.175 +		if ((menuobj.className && menuobj.className == 'sub') || menuobj.tagName == 'DIV') {
  15.176 +			menuobj = menuobj.getElementsByTagName('UL');
  15.177 +			if (menuobj.length) { menuobj = menuobj[0]; }
  15.178 +			else { return false; }
  15.179 +		}
  15.180 +		var mname = self.getMainMenuId(menuobj);
  15.181 +		if (!mname) { return false; }
  15.182 +		var newmenu = document.createElement('li');
  15.183 +		newmenu.setAttribute('id',mname+'_'+param);
  15.184 +		newmenu.setAttribute('main','yes');
  15.185 +		if (menuclick) { newmenu.setAttribute('menuclick',menuclick); }
  15.186 +		var mico = document.createElement('span');
  15.187 +		mico.className = 'menu-ico';
  15.188 +		if (menuicon) {
  15.189 +			if (menuicon != 'checkbox' && menuicon != 'null') {
  15.190 +				var icoimg = document.createElement('IMG');
  15.191 +				icoimg.setAttribute('src',menuicon);
  15.192 +				icoimg.setAttribute('border','0');
  15.193 +				var ailink = document.createElement('A');
  15.194 +				ailink.style.cursor = 'pointer';
  15.195 +				ailink.setAttribute('id',mname+'_'+param);
  15.196 +				ailink.className = 'right-menu-'+param;
  15.197 +				if (menuclick) { mico.setAttribute('menuclick',menuclick); icoimg.setAttribute('menuclick',menuclick); ailink.setAttribute('menuclick',menuclick); }
  15.198 +				ailink.appendChild(icoimg);
  15.199 +				mico.appendChild(ailink);
  15.200 +			}
  15.201 +			else {
  15.202 +				if (menuicon == 'checkbox') {
  15.203 +					var icoimg = document.createElement('INPUT');
  15.204 +					icoimg.setAttribute('type',menuicon);
  15.205 +					icoimg.checked = true;
  15.206 +					icoimg.setAttribute('classname',menuicon);
  15.207 +					icoimg.setAttribute('id','checkbox_'+mname+'_'+param);
  15.208 +					if (menuclick) { mico.setAttribute('menuclick',menuclick); icoimg.setAttribute('menuclick',menuclick); }
  15.209 +					mico.appendChild(icoimg);
  15.210 +				}
  15.211 +				if (menuicon == 'null') {
  15.212 +					mico.innerHTML = '&nbsp';
  15.213 +				}
  15.214 +			}
  15.215 +		}
  15.216 +		newmenu.appendChild(mico);
  15.217 +		var alink = document.createElement('A');
  15.218 +		if (menuclick) { alink.setAttribute('menuclick',menuclick); }
  15.219 +		alink.style.cursor = 'pointer';
  15.220 +		alink.setAttribute('id',mname+'_'+param);
  15.221 +		alink.className = 'right-menu-'+param;
  15.222 +		alink.innerHTML = menuname;
  15.223 +		newmenu.appendChild(alink);
  15.224 +		if (menupos && menupos <= menuobj.childNodes.length) {
  15.225 +			menuobj.insertBefore(newmenu,menuobj.childNodes[menupos - 1]);
  15.226 +		}
  15.227 +		else { menuobj.appendChild(newmenu); }
  15.228 +		return newmenu;
  15.229 +	}
  15.230 +
  15.231 +	this.appendSubInMenu = function(menuobj,param,menuname,menuicon,menupos) {
  15.232 +		if (typeof(menuobj) != 'object') { return false; }
  15.233 +		if (self.isInMenu(menuobj,param)) { return true; }
  15.234 +		if ((menuobj.className && menuobj.className == 'sub') || menuobj.tagName == 'DIV') {
  15.235 +			menuobj = menuobj.getElementsByTagName('UL');
  15.236 +			if (menuobj.length) { menuobj = menuobj[0]; }
  15.237 +			else { return false; }
  15.238 +		}
  15.239 +		var mname = self.getMainMenuId(menuobj);
  15.240 +		if (!mname) { return false; }
  15.241 +		var newmenu = document.createElement('li');
  15.242 +		newmenu.setAttribute('id',mname+'_'+param);
  15.243 +		newmenu.setAttribute('main','yes');
  15.244 +		newmenu.className = 'sub';
  15.245 +		var mico = document.createElement('span');
  15.246 +		mico.className = 'menu-ico-sub';
  15.247 +		if (menuicon) {
  15.248 +			if (menuicon == 'null') {
  15.249 +				mico.innerHTML = '&nbsp';
  15.250 +			}
  15.251 +			else {
  15.252 +				var icoimg = document.createElement('IMG');
  15.253 +				icoimg.setAttribute('src',menuicon);
  15.254 +				icoimg.setAttribute('border','0');
  15.255 +				icoimg.setAttribute('submenu','yes');
  15.256 +				mico.appendChild(icoimg);
  15.257 +			}
  15.258 +		}
  15.259 +		mico.setAttribute('submenu','yes');
  15.260 +		newmenu.appendChild(mico);
  15.261 +
  15.262 +		var alink = document.createElement('A');
  15.263 +		alink.style.cursor = 'pointer';
  15.264 +		alink.setAttribute('submenu','yes');
  15.265 +		alink.innerHTML = menuname;
  15.266 +		newmenu.appendChild(alink);
  15.267 +		var subul = document.createElement('UL');
  15.268 +		newmenu.appendChild(subul);
  15.269 +		newmenu.setAttribute('submenu','yes');
  15.270 +		if (menupos && menupos <= menuobj.childNodes.length) {
  15.271 +			menuobj.insertBefore(newmenu,menuobj.childNodes[menupos - 1]);
  15.272 +		}
  15.273 +		else { menuobj.appendChild(newmenu); }
  15.274 +		return subul;
  15.275 +	}
  15.276 +	this.dropInMenu = function(menuobj,param) {
  15.277 +		if (typeof(menuobj) != 'object') { return false; }
  15.278 +		if (!self.isInMenu(menuobj,param)) { return true; }
  15.279 +		if ((menuobj.className && menuobj.className == 'sub') || menuobj.tagName == 'DIV') {
  15.280 +			menuobj = menuobj.getElementsByTagName('UL');
  15.281 +			if (menuobj.length) { menuobj = menuobj[0]; }
  15.282 +			else { return false; }
  15.283 +		}
  15.284 +		var mname = self.getMainMenuId(menuobj);
  15.285 +		if (!mname) { return false; }
  15.286 +		for (i = 0;i<menuobj.childNodes.length;i++) {
  15.287 +			if (menuobj.childNodes[i].tagName == 'LI' && menuobj.childNodes[i].id == mname+'_'+param) {
  15.288 +				menuobj.removeChild(menuobj.childNodes[i]);
  15.289 +				return true;
  15.290 +				break;
  15.291 +			}
  15.292 +		}
  15.293 +		return false;
  15.294 +	}
  15.295 +	this.isEnabled = function(menuobj) {
  15.296 +		if (typeof(menuobj) == 'object' && menuobj.getAttribute('menuclick')) {
  15.297 +			while(!menuobj.getAttribute('main')) {
  15.298 +				menuobj = menuobj.parentNode;
  15.299 +			}
  15.300 +			if (menuobj.getAttribute('disabled')) { return false; }
  15.301 +			return true;
  15.302 +		}
  15.303 +		return false;
  15.304 +	}
  15.305 +	this.enableMenu = function(menuobj) {
  15.306 +		if (typeof(menuobj) == 'object') {
  15.307 +			var elms = menuobj.getElementsByTagName('A');
  15.308 +			if (elms.length) {
  15.309 +				for (var i=0;i<elms.length;i++) {
  15.310 +					elms[i].style.color = "#000000";
  15.311 +				}
  15.312 +			}
  15.313 +			menuobj.style.color="#000000";
  15.314 +			if (menuobj.getAttribute('disabled')) {
  15.315 +				menuobj.removeAttribute('disabled');
  15.316 +			}
  15.317 +		}
  15.318 +	}
  15.319 +	this.changeCheckBox = function(param,attr) {
  15.320 +		if (typeof(param) != 'string' || !document.getElementById(param)) { return false; }
  15.321 +		var chb = self.getCheckBox(param);
  15.322 +		if (!chb) { return false; }
  15.323 +		if (typeof(attr) == 'undefined') {
  15.324 +			chb.checked = !chb.checked;
  15.325 +		}
  15.326 +		else { chb.checked = attr; }
  15.327 +	}
  15.328 +	this.getCheckBox = function(param) {
  15.329 +		if (typeof(param) != 'string' || !document.getElementById(param)) { return false; }
  15.330 +		if (document.getElementById('checkbox_'+param)) {
  15.331 +			return document.getElementById('checkbox_'+param);
  15.332 +		}
  15.333 +	}
  15.334 +	this.disableMenu = function(menuobj) {
  15.335 +		if (typeof(menuobj) == 'object') {
  15.336 +			var elms = menuobj.getElementsByTagName('A');
  15.337 +			if (elms.length) {
  15.338 +				for (var i=0;i<elms.length;i++) {
  15.339 +					elms[i].style.color = "#b1b1b1";
  15.340 +				}
  15.341 +			}
  15.342 +			menuobj.style.color="#b1b1b1";
  15.343 +			menuobj.setAttribute('disabled','yes');
  15.344 +		}
  15.345 +	}
  15.346 +	this.uploadMenu = false;
  15.347 +	this.openUploadMenu = function() {
  15.348 +		if (self.uploadMenu) { document.getElementById('uploadmenu').style.display = 'none'; }
  15.349 +		else { document.getElementById('uploadmenu').style.display = 'block'; }
  15.350 +		self.uploadMenu = !self.uploadMenu;
  15.351 +	}
  15.352 +}
  15.353 +var xcp_menu = new xcp_Menu();
  15.354 +function xcp_Functions() {
  15.355 +	var self = this;
  15.356 +	var param;
  15.357 +	var attr;
  15.358 +
  15.359 +	var objElement;
  15.360 +	var strClass;
  15.361 +	var binMayAlredyExists;
  15.362 +	this.HasClassName = function(objElement, strClass) {
  15.363 +		if ( objElement.className ) {
  15.364 +			var arrList = objElement.className.split(' ');
  15.365 +			var strClassUpper = strClass.toUpperCase();
  15.366 +			for ( var i = 0; i < arrList.length; i++ ) {
  15.367 +				if ( arrList[i].toUpperCase() == strClassUpper ) {
  15.368 +					return true;
  15.369 +				}
  15.370 +			}
  15.371 +		}
  15.372 +		return false;
  15.373 +	}
  15.374 +	this.addClassName = function(objElement, strClass, blnMayAlreadyExist) {
  15.375 +		if ( objElement.className ) {
  15.376 +			var arrList = objElement.className.split(' ');
  15.377 +			if ( blnMayAlreadyExist ) {
  15.378 +				var strClassUpper = strClass.toUpperCase();
  15.379 +				for ( var i = 0; i < arrList.length; i++ ) {
  15.380 +					if ( arrList[i].toUpperCase() == strClassUpper ) {
  15.381 +						arrList.splice(i, 1);
  15.382 +						i--;
  15.383 +					}
  15.384 +				}
  15.385 +			}
  15.386 +			arrList[arrList.length] = strClass;
  15.387 +			objElement.className = arrList.join(' ');
  15.388 +		}
  15.389 +		else {
  15.390 +			objElement.className = strClass;
  15.391 +		}
  15.392 +	}
  15.393 +	this.removeClassName = function(objElement, strClass) {
  15.394 +		if ( objElement.className ) {
  15.395 +			var arrList = objElement.className.split(' ');
  15.396 +			var strClassUpper = strClass.toUpperCase();
  15.397 +			for ( var i = 0; i < arrList.length; i++ ) {
  15.398 +				if ( arrList[i].toUpperCase() == strClassUpper ) {
  15.399 +					arrList.splice(i, 1);
  15.400 +					i--;
  15.401 +				}
  15.402 +			}
  15.403 +			objElement.className = arrList.join(' ');
  15.404 +		}
  15.405 +	}
  15.406 +	this.findPos = function(fobj) {
  15.407 +		if (typeof(fobj) != 'object') { return [0,0]; }
  15.408 +		var curleft = curtop = 0;
  15.409 +		if (fobj.offsetParent) {
  15.410 +			curleft = fobj.offsetLeft
  15.411 +			curtop = fobj.offsetTop
  15.412 +			while (fobj = fobj.offsetParent) {
  15.413 +				curleft += fobj.offsetLeft
  15.414 +				curtop += fobj.offsetTop
  15.415 +			}
  15.416 +		}
  15.417 +		return [curleft,curtop];
  15.418 +	}
  15.419 +	this.findPosX = function(fobj) {
  15.420 +		if (typeof(fobj) != 'object') { return 0; }
  15.421 +		if (navigator.appName == 'Microsoft Internet Explorer' || navigator.appName == 'Opera' || navigator.appName == 'Netscape') {
  15.422 +			return fobj.offsetLeft;
  15.423 +		}
  15.424 +		if (navigator.userAgent.indexOf('Chrome') > -1) {
  15.425 +			return fobj.offsetLeft;
  15.426 +		}
  15.427 +		var curleft = 0;
  15.428 +		if(fobj.offsetParent)
  15.429 +		while(1) {
  15.430 +			curleft += fobj.offsetLeft;
  15.431 +			if(!fobj.offsetParent)
  15.432 +			break;
  15.433 +			fobj = fobj.offsetParent;
  15.434 +		}
  15.435 +		else if(fobj.x)
  15.436 +		curleft += fobj.x;
  15.437 +		return curleft;
  15.438 +	}
  15.439 +	this.findPosY = function(fobj) {
  15.440 +		if (typeof(fobj) != 'object') { return 0; }
  15.441 +		if (navigator.appName == 'Microsoft Internet Explorer' || navigator.appName == 'Opera' || navigator.appName == 'Netscape') {
  15.442 +			return fobj.offsetTop;
  15.443 +		}
  15.444 +		if (navigator.userAgent.indexOf('Chrome') > -1) {
  15.445 +			return fobj.offsetTop;
  15.446 +		}
  15.447 +		var curtop = 0;
  15.448 +		if(fobj.offsetParent)
  15.449 +		while(1) {
  15.450 +			  curtop += fobj.offsetTop;
  15.451 +			  if(!fobj.offsetParent)
  15.452 +			  break;
  15.453 +			  fobj = fobj.offsetParent;
  15.454 +		}
  15.455 +		else if(fobj.y)
  15.456 +		curtop += fobj.y;
  15.457 +		return curtop;
  15.458 +	}
  15.459 +}
  15.460 +var tplf = new xcp_Functions();
  15.461 +document.onmousedown = xcp_menu.mousedown;
  15.462 \ No newline at end of file
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/interface/some_unfinished_stuff/tabs.css	Tue Jun 15 00:35:25 2010 +0300
    16.3 @@ -0,0 +1,105 @@
    16.4 +table.tabs {
    16.5 +	height:24px;
    16.6 +	padding:0;
    16.7 +	border:0;
    16.8 +}
    16.9 +table.tabs td {
   16.10 +	min-width:30px;
   16.11 +	border:0;
   16.12 +	padding:0;
   16.13 +	padding-top:0px;
   16.14 +	width:auto;
   16.15 +}
   16.16 +table.tabs td .tabBg {
   16.17 +	float:left;
   16.18 +	margin-top:5px;
   16.19 +	border:1px solid #867878;
   16.20 + 	min-width:30px;
   16.21 +	font-size:12px;
   16.22 +	border-right:0;
   16.23 +	height:15px;
   16.24 +	padding:0;
   16.25 +	padding-top:3px;
   16.26 +	padding-left:5px;
   16.27 +	padding-right:5px;
   16.28 +	background-color:#EEEAEB;
   16.29 +	background-image:url('img/tabs/unactive-gradient.jpg');
   16.30 +	background-repeat:repeat-x;
   16.31 +	background-position:left top;
   16.32 +	color:#8B7F7F;
   16.33 +	border-left:1px solid #000000;
   16.34 +	overflow:hidden;
   16.35 +	position:relative;
   16.36 +}
   16.37 +table.tabs td .tabBg span.tabClose {
   16.38 +	position:absolute;
   16.39 +	top:0px;
   16.40 +	right:0px;
   16.41 +	display:none;
   16.42 +}
   16.43 +table.tabs td .tabBg:hover  span.tabClose {
   16.44 +	display:block;
   16.45 +	position:absolute;
   16.46 +	top:0px;
   16.47 +	right:0px;
   16.48 +}
   16.49 +table.tabs td .tabBg a {
   16.50 +	height:100%;
   16.51 +	text-decoration:none;
   16.52 +	cursor:pointer;
   16.53 +}
   16.54 +table.tabs td.activeTab {
   16.55 +	background-image:url('img/tabs/border.png');
   16.56 +	background-repeat:no-repeat;
   16.57 +	background-position:bottom right;
   16.58 +	padding-right:4px;
   16.59 +}
   16.60 +table.tabs td.activeTab .tabBg {
   16.61 +	border:1px solid #867878;
   16.62 + 	min-width:30px;
   16.63 +	font-size:12px;
   16.64 +	height:16px;
   16.65 +	padding:0;
   16.66 +	padding-top:7px;
   16.67 +	padding-left:12px;
   16.68 +	padding-right:12px;
   16.69 +	font-weight:bold;
   16.70 +	background-color:#f3f3f3;
   16.71 +	background-image:url('img/tabs/active-gradient.jpg');
   16.72 +	background-repeat:repeat-x;
   16.73 +	background-position:left top;
   16.74 +	border-bottom:1px solid #f3f3f3;
   16.75 +	margin-top:0px;
   16.76 +	text-align:center;
   16.77 +	color:#4E4747;
   16.78 +	border-left:1px solid #000000;
   16.79 +}
   16.80 +table.tabs td.singleTab .active {
   16.81 +	padding-right:13px;
   16.82 +}
   16.83 +table.tabs td.singleTab:hover .tabBg {
   16.84 +	color: #5c5e5d;
   16.85 +	background-color:#EEEAEB;
   16.86 +	background-image:url('img/tabs/unactive-gradient-hover.jpg');
   16.87 +	background-repeat:repeat-x;
   16.88 +	background-position:left top;
   16.89 +}
   16.90 +.tabs .singleTab:last-child .tabBg {
   16.91 +	border-right:1px solid #867878;
   16.92 +}
   16.93 +.tabs .activeTab:first-child .tabBg {
   16.94 +	border-left:1px solid #867878;
   16.95 +}
   16.96 +.tabs .singleTab:first-child .tabBg {
   16.97 +	border-left:1px solid #867878;
   16.98 +}
   16.99 +.tabs div { cursor:pointer; }
  16.100 +.tabContent {
  16.101 +	border:1px solid #867878;
  16.102 +	background-color:#f3f3f3;
  16.103 +	min-width:400px;
  16.104 +	min-height:100px;
  16.105 +	height:auto;
  16.106 +	float:left;
  16.107 +	margin-top:-1px;
  16.108 +}
  16.109 \ No newline at end of file
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/interface/some_unfinished_stuff/tabs.js	Tue Jun 15 00:35:25 2010 +0300
    17.3 @@ -0,0 +1,56 @@
    17.4 +function FileTabs() {
    17.5 +	var self = this;
    17.6 +	var tempTab = false;
    17.7 +	this.clear = function() { tempTab = true; }
    17.8 +	this.construct = function(tabId) {
    17.9 +		var tbl = document.createElement('TABLE');
   17.10 +		tbl.className = 'tabs';
   17.11 +		tbl.setAttribute('tabList','yes');
   17.12 +		tbl.setAttribute('id',tabId);
   17.13 +		tbl.setAttribute('cellpadding',0);
   17.14 +		tbl.setAttribute('cellspacing',0);
   17.15 +		tbl.insertRow(0);
   17.16 +		tempTab = tbl;
   17.17 +		return tempTab;
   17.18 +	}
   17.19 +	this.getTr = function(param) { return param ? param.rows[0] : false; }
   17.20 +	this.getDom = function() { return tempTab; }
   17.21 +	this.append = function(tabAlias,tabName,onclickEvent,temp) {
   17.22 +		if (!temp) { temp = tempTab; }
   17.23 +		var tr = self.getTr(temp);
   17.24 +		var cl = tr.insertCell(tr.cells.length);
   17.25 +		var div = document.createElement('DIV');
   17.26 +		div.className = 'tabBg';
   17.27 +		cl.appendChild(div);
   17.28 +		cl.setAttribute('nowrap','nowrap');
   17.29 +		cl.setAttribute('tabAlias',tabAlias);
   17.30 +		var a = document.createElement('A');
   17.31 +		a.onclick = function() {
   17.32 +			tabs.activate(this.parentNode.parentNode);
   17.33 +			onclickEvent();
   17.34 +		}
   17.35 +		a.appendChild(document.createTextNode(tabName));
   17.36 +		div.appendChild(a);
   17.37 +		tempTab = temp;
   17.38 +		return tempTab;
   17.39 +	}
   17.40 +	this.activate = function(param) {
   17.41 +		var tr = param;
   17.42 +		while (tr = tr.parentNode) {
   17.43 +			if (tr.tagName == 'TR') { break; }
   17.44 +		}
   17.45 +		for (var i=0,len=tr.cells.length;i<len;i++) { tr.cells[i].className = 'singleTab'; }
   17.46 +		param.className = 'activeTab';
   17.47 +	}
   17.48 +	this.activateByAlias = function(alias,temp) {
   17.49 +		if (!temp) { return false; }
   17.50 +		var tr = self.getTr(temp);
   17.51 +		for (var i=0,len=tr.cells.length;i<len;i++) {
   17.52 +			if (tr.cells[i].getAttribute('tabAlias') == alias) {
   17.53 +				tr.cells[i].className = 'activeTab';
   17.54 +			}
   17.55 +			else { tr.cells[i].className = 'singleTab'; }
   17.56 +		}
   17.57 +	}
   17.58 +}
   17.59 +var tabs = new FileTabs();
   17.60 \ No newline at end of file
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/interface/some_unfinished_stuff/tabs_tmpl.html	Tue Jun 15 00:35:25 2010 +0300
    18.3 @@ -0,0 +1,35 @@
    18.4 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    18.5 +<html xmlns="http://www.w3.org/1999/xhtml">
    18.6 +<head>
    18.7 +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    18.8 +<title>XCP web interface tabs test</title>
    18.9 +<link href="tabs.css" rel="stylesheet" type="text/css" />
   18.10 +<script type="Text/JavaScript" Language="JavaScript" src="tabs.js"></script>
   18.11 +<script type="text/javascript" language="javascript">
   18.12 +function testTabs() {
   18.13 +	tabs.construct('testtab');
   18.14 +	tabs.append('name','name of the tab',function() { myFunc(1); });
   18.15 +	tabs.append('name2','name2 of the tab',function() { myFunc(2); });
   18.16 +	tabs.activateByAlias('name',tabs.getDom());
   18.17 +	document.getElementById('tabDiv').appendChild(tabs.getDom());
   18.18 +	var cnt = document.createElement('DIV');
   18.19 +	cnt.setAttribute('id','tabContent');
   18.20 +	cnt.className = 'tabContent';
   18.21 +	document.getElementById('tabDiv').appendChild(cnt);
   18.22 +	tabs.clear();
   18.23 +}
   18.24 +function myFunc(param) {
   18.25 +	document.getElementById('tabContent').innerHTML = param;
   18.26 +}
   18.27 +</script>
   18.28 +<style>
   18.29 +#tabDiv {
   18.30 +	width:auto;
   18.31 +	text-align:left;
   18.32 +}
   18.33 +</style>
   18.34 +</head>
   18.35 +<body onload="testTabs();">
   18.36 +<div id="tabDiv"></div>
   18.37 +</body>
   18.38 +</html>
   18.39 \ No newline at end of file
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/interface/templates/login.css	Tue Jun 15 00:35:25 2010 +0300
    19.3 @@ -0,0 +1,65 @@
    19.4 +
    19.5 +.login_box
    19.6 +{
    19.7 +margin: 0 auto;
    19.8 +margin-top: 70px;
    19.9 +margin-bottom: 70px;
   19.10 +text-align: left;
   19.11 +clear:both;
   19.12 +width: 390px;
   19.13 +height: 230px;
   19.14 +background-color:#eef6f7;
   19.15 +border: 1px solid #89b1c1;
   19.16 +behavior: url("/interface/border-radius.htc");
   19.17 +-moz-border-radius: 4px;
   19.18 +-webkit-border-radius: 4px;
   19.19 +border-radius: 4px;
   19.20 +}
   19.21 +
   19.22 +.login_box  .label
   19.23 +{
   19.24 +font-family: Tahoma;
   19.25 +font-size: 1.7em;
   19.26 +text-align: center;
   19.27 +margin:20px;
   19.28 +}
   19.29 +
   19.30 +.login_box  .small_label
   19.31 +{
   19.32 +font-family: Tahoma;
   19.33 +font-size: 1.5em;
   19.34 +text-align: right;
   19.35 +}
   19.36 +
   19.37 +.login_box  .textfield
   19.38 +{
   19.39 +width: 200px;
   19.40 +height: 30px;
   19.41 +font-family: Tahoma;
   19.42 +font-size: 1.5em;
   19.43 +padding-left: 4px;
   19.44 +outline: none;
   19.45 +border: 1px solid #89b1c1;
   19.46 +-moz-border-radius: 4px;
   19.47 +-webkit-border-radius: 4px;
   19.48 +border-radius: 4px;
   19.49 +}
   19.50 +
   19.51 +.login_box  .textfield:focus 
   19.52 +{
   19.53 +border: 3px solid #89b1c1;
   19.54 +}
   19.55 +
   19.56 +.login_box .login_button
   19.57 +{
   19.58 +width: 210px;
   19.59 +height: 50px;
   19.60 +background-image: url(../img/login_button.png);
   19.61 +display: block;
   19.62 +cursor: pointer;
   19.63 +}
   19.64 +
   19.65 +.login_box .login_button:hover
   19.66 +{
   19.67 +background-image: url(../img/login_button_active.png);
   19.68 +}
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/interface/templates/login.html	Tue Jun 15 00:35:25 2010 +0300
    20.3 @@ -0,0 +1,15 @@
    20.4 +
    20.5 +<div class="login_box">
    20.6 +
    20.7 +<div class="label">Login Information</div>
    20.8 +<div style="clear:both;">
    20.9 +<form name="login_form" onSubmit="alert('a');">
   20.10 +<table width="100%">
   20.11 +<tr height="44"><td align="right" class="small_label">Username :</td><td align="center"><input type="text" class="textfield" id="login_username" onKeyDown="if(event.keyCode==13)login.try_login();"></td></tr>
   20.12 +<tr height="44"><td align="right" class="small_label">Password :</td><td align="center"><input type="password" class="textfield" id="login_password" onKeyDown="if(event.keyCode==13)login.try_login();"></td></tr>
   20.13 +<tr height="54"><td>&nbsp;</td><td align="center"><div class="login_button" onClick="login.try_login();"></div></td></tr>
   20.14 +</table>
   20.15 +</form>
   20.16 +
   20.17 +</div>
   20.18 +</div>
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/interface/templates/login.js	Tue Jun 15 00:35:25 2010 +0300
    21.3 @@ -0,0 +1,24 @@
    21.4 +function login_req()
    21.5 +{
    21.6 +
    21.7 +this.try_login = function()
    21.8 +	{
    21.9 +	xen_init(document.getElementById('login_username').value,document.getElementById('login_password').value,this.callback,this.callback_error);
   21.10 +	return ;
   21.11 +	}
   21.12 +	
   21.13 +this.callback = function()
   21.14 +	{
   21.15 +	templates.LoadTemplate(interface_path+'/templates/main.html','content');
   21.16 +	return ;
   21.17 +	}
   21.18 +
   21.19 +this.callback_error = function(raw,xmldoc,param_pass)
   21.20 +	{
   21.21 +	alert('error');
   21.22 +	return ;
   21.23 +	}	
   21.24 +
   21.25 +}
   21.26 +
   21.27 +var login = new login_req();
   21.28 \ No newline at end of file
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/interface/templates/main.html	Tue Jun 15 00:35:25 2010 +0300
    22.3 @@ -0,0 +1,2 @@
    22.4 +Logged !!!
    22.5 +The main template is loaded... now is time for the real content
    22.6 \ No newline at end of file
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/interface/xcp.css	Tue Jun 15 00:35:25 2010 +0300
    23.3 @@ -0,0 +1,52 @@
    23.4 +*
    23.5 +{
    23.6 +	margin: 0;
    23.7 +	border-style: none;
    23.8 +	padding: 0;
    23.9 +	text-decoration: none;
   23.10 +	font-family: Arial, Helvetica, sans-serif;
   23.11 +	font-size: 9pt;
   23.12 +	color: #222222;
   23.13 +}
   23.14 +
   23.15 +body
   23.16 +{
   23.17 +	position: relative;
   23.18 +	background-color: #89b1c1;
   23.19 +	display: block;
   23.20 +	color: #222222;
   23.21 +	margin-top:20px;
   23.22 +}
   23.23 +
   23.24 +
   23.25 +.page
   23.26 +{
   23.27 +margin: 0 auto;
   23.28 +text-align: left;
   23.29 +height:700px;
   23.30 +width:1000px;
   23.31 +background-color:#fff;
   23.32 +border: 1px solid #89b1c1;
   23.33 +behavior: url("/interface/border-radius.htc");
   23.34 +-moz-border-radius: 8px;
   23.35 +-webkit-border-radius: 8px;
   23.36 +border-radius: 8px;
   23.37 +
   23.38 +}
   23.39 +
   23.40 +.header
   23.41 +{
   23.42 +background-image: url(img/header.png);
   23.43 +background-repeat: repeat-x;
   23.44 +display: block;
   23.45 +width:1000px;
   23.46 +height: 131px; 
   23.47 +float:left;
   23.48 +}
   23.49 +
   23.50 +.content
   23.51 +{
   23.52 +width:100%;
   23.53 +float:left;
   23.54 +clear:both;
   23.55 +}
   23.56 \ No newline at end of file
    24.1 --- a/libxen/README	Mon Jun 07 10:44:31 2010 +0300
    24.2 +++ b/libxen/README	Tue Jun 15 00:35:25 2010 +0300
    24.3 @@ -1,1 +0,0 @@
    24.4 -TODO: to post more information about the functions
    25.1 --- a/libxen/callbacks.js	Mon Jun 07 10:44:31 2010 +0300
    25.2 +++ b/libxen/callbacks.js	Tue Jun 15 00:35:25 2010 +0300
    25.3 @@ -1,1 +1,1 @@
    25.4 -function xen_callback_proceed_init(result,xmldoc,param_pass)
{
var params=new Array();
var event_params=new Array();
params[0]=xen_db['session_id'];
event_params[0]=xen_db['session_id'];
event_params[1]=new Array('*');

ApiCall('event.register',event_params,true,0,xen_callback_get_next_event,0,0); //TODO callback error
var initCalls=new Array('VM.get_all_records','task.get_all_records','VBD.get_all_records','VBD_metrics.get_all_records','VDI.get_all_records','network.get_all_records','PIF.get_all_records','PIF_metrics.get_all_records','PBD.get_all_records','VIF.get_all_records','VIF_metrics.get_all_records','VM_guest_metrics.get_all_records','VM_metrics.get_all_records','host_metrics.get_all_records','host_cpu.get_all_records','Bond.get_all_records','pool_patch.get_all_records','host_patch.get_all_records','console.get_all_records','host.get_all_records','pool.get_all_records','SR.get_all_records','message.get_all_records');
for (call_id in initCalls)ApiCall(initCalls[call_id],params,false,1,0,0,0); //TODO callback error
param_pass();
return ;
}

function xen_callback_get_next_event(result,xmldoc,param_pass)
{
//this calls the next event function
var params=new Array();
params[0]=xen_db['session_id'];

ApiCall('event.next',params,true,1,xen_callback_get_next_event,0,0); //TODO callback error
}

function xen_callback_login_error(raw,xmldoc,param_pass)
{
xen_db['errors']['login_error']=0;
return ;
}
    25.5 \ No newline at end of file
    25.6 +function xen_callback_proceed_init(result,xmldoc,param_pass)
{
var params=new Array();
var event_params=new Array();
params[0]=xen_db['session_id'];
event_params[0]=xen_db['session_id'];
event_params[1]=new Array('*');

ApiCall('event.register',event_params,true,0,xen_callback_get_next_event,0,0); //TODO callback error
var initCalls=new Array('VM.get_all_records','task.get_all_records','VBD.get_all_records','VBD_metrics.get_all_records','VDI.get_all_records','network.get_all_records','PIF.get_all_records','PIF_metrics.get_all_records','PBD.get_all_records','VIF.get_all_records','VIF_metrics.get_all_records','VM_guest_metrics.get_all_records','VM_metrics.get_all_records','host_metrics.get_all_records','host_cpu.get_all_records','Bond.get_all_records','pool_patch.get_all_records','host_patch.get_all_records','console.get_all_records','host.get_all_records','pool.get_all_records','SR.get_all_records','message.get_all_records');
for (call_id in initCalls)ApiCall(initCalls[call_id],params,false,1,0,0,0); //TODO callback error
param_pass();
return ;
}

function xen_callback_get_next_event(result,xmldoc,param_pass)
{
//this calls the next event function
var params=new Array();
params[0]=xen_db['session_id'];

ApiCall('event.next',params,true,1,xen_callback_get_next_event,0,0); //TODO callback error
}
    25.7 \ No newline at end of file
    26.1 --- a/libxen/libxen.js	Mon Jun 07 10:44:31 2010 +0300
    26.2 +++ b/libxen/libxen.js	Tue Jun 15 00:35:25 2010 +0300
    26.3 @@ -4,7 +4,7 @@ var xen_db=new Array();
    26.4  var xen_db_events=new Array(); 
    26.5  //var xen=new xen_core();
    26.6  //This function initializes the session.
    26.7 -function xen_init(username,password,callback_login)
    26.8 +function xen_init(username,password,callback_login,callback_error)
    26.9  {
   26.10  var params=new Array();
   26.11  //var xen=new xen_core();
   26.12 @@ -12,7 +12,7 @@ var params=new Array();
   26.13  params[0]=username;
   26.14  params[1]=password;
   26.15  //xen.ApiCall('session.login_with_password',params,1,xen_callback_proceed_init,xen_callback_login_error,callback_login);
   26.16 -ApiCall('session.login_with_password',params,true,1,xen_callback_proceed_init,xen_callback_login_error,callback_login);
   26.17 +ApiCall('session.login_with_password',params,true,1,xen_callback_proceed_init,callback_error,callback_login);
   26.18  return ;
   26.19  }
   26.20  
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/libxen/libxen_init.js	Tue Jun 15 00:35:25 2010 +0300
    27.3 @@ -0,0 +1,12 @@
    27.4 +var loadjs = function(param) {
    27.5 +		var fileref=document.createElement('script');
    27.6 +		fileref.setAttribute("type","text/javascript");
    27.7 +		fileref.setAttribute("src", param);
    27.8 +		document.getElementsByTagName('head')[0].appendChild(fileref);
    27.9 +		return true;
   27.10 +	}
   27.11 +
   27.12 +loadjs(libxen_path+'/callbacks.js');
   27.13 +loadjs(libxen_path+'/db_callbacks.js');
   27.14 +loadjs(libxen_path+'/core.js');
   27.15 +loadjs(libxen_path+'/libxen.js');