[limb-svn] r6943 - in syncman/trunk: . lib lib/JsHttpRequest settings src src/controller template/projects www/js www/styles

svn at limb-project.com svn at limb-project.com
Mon Apr 21 13:25:34 MSD 2008


Author: wiliam
Date: 2008-04-21 13:25:34 +0400 (Mon, 21 Apr 2008)
New Revision: 6943
URL: http://fisheye.limb-project.com/changelog/limb/?cs=6943

Added:
   syncman/trunk/lib/JsHttpRequest/
   syncman/trunk/lib/JsHttpRequest/JsHttpRequest.php
   syncman/trunk/settings/macro.conf.php
   syncman/trunk/settings/routes.conf.php
   syncman/trunk/template/projects/detail.phtml
   syncman/trunk/template/projects/diff.phtml
   syncman/trunk/template/projects/display.phtml
   syncman/trunk/template/projects/simple.phtml
   syncman/trunk/template/projects/simple_sync.phtml
   syncman/trunk/template/projects/sync.phtml
   syncman/trunk/template/projects/unlock.phtml
   syncman/trunk/www/js/JsHttpRequest.js
   syncman/trunk/www/js/getDetailForCategory.js
Removed:
   syncman/trunk/lib/limb/
Modified:
   syncman/trunk/common.inc.php
   syncman/trunk/lib/
   syncman/trunk/src/SyncmanApplication.class.php
   syncman/trunk/src/controller/ProjectsController.class.php
   syncman/trunk/www/js/main.js
   syncman/trunk/www/styles/main.css
Log:
-- limb version updated to 2007.4
-- templates migrated to macro
-- added ajax requests for checking statuses of a selected portion of projects

Modified: syncman/trunk/common.inc.php
===================================================================
--- syncman/trunk/common.inc.php	2008-04-17 17:38:14 UTC (rev 6942)
+++ syncman/trunk/common.inc.php	2008-04-21 09:25:34 UTC (rev 6943)
@@ -3,4 +3,6 @@
 require_once('limb/core/common.inc.php');
 require_once('limb/web_app/common.inc.php');
 
+lmbToolkit :: instance()->setSupportedViewTypes(array('.phtml' => 'lmbMacroView'));
+
 ?>
\ No newline at end of file


Property changes on: syncman/trunk/lib
___________________________________________________________________
Name: svn:externals
   + limb https://svn.limb-project.com/3.x/tags/2007.4/limb/


Added: syncman/trunk/lib/JsHttpRequest/JsHttpRequest.php
===================================================================
--- syncman/trunk/lib/JsHttpRequest/JsHttpRequest.php	                        (rev 0)
+++ syncman/trunk/lib/JsHttpRequest/JsHttpRequest.php	2008-04-21 09:25:34 UTC (rev 6943)
@@ -0,0 +1,521 @@
+<?php
+/**
+ * JsHttpRequest: PHP backend for JavaScript DHTML loader.
+ * (C) Dmitry Koterov, http://en.dklab.ru
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * See http://www.gnu.org/copyleft/lesser.html
+ *
+ * Do not remove this comment if you want to use the script!
+ * Íå óäàëÿéòå äàííûé êîììåíòàðèé, åñëè âû õîòèòå èñïîëüçîâàòü ñêðèïò!
+ *
+ * This backend library also supports POST requests additionally to GET.
+ *
+ * @author Dmitry Koterov 
+ * @version 5.x $Id$
+ */
+
+class JsHttpRequest
+{
+    var $SCRIPT_ENCODING = "windows-1251";
+    var $SCRIPT_DECODE_MODE = '';
+    var $LOADER = null;
+    var $ID = null;    
+    var $RESULT = null;
+    
+    // Internal; uniq value.
+    var $_uniqHash;
+    // Magic number for display_error checking.
+    var $_magic = 14623;
+    // Previous display_errors value.
+    var $_prevDisplayErrors = null;    
+    // Internal: response content-type depending on loader type.
+    var $_contentTypes = array(
+        "script" => "text/javascript",
+        "xml"    => "text/plain", // In XMLHttpRequest mode we must return text/plain - stupid Opera 8.0. :(
+        "form"   => "text/html",
+        ""       => "text/plain", // for unknown loader
+    );
+    // Internal: conversion to UTF-8 JSON cancelled because of non-ascii key.
+    var $_toUtfFailed = false;
+    // Internal: list of characters 128...255 (for strpbrk() ASCII check).
+    var $_nonAsciiChars = '';
+    // Which Unicode conversion function is available?
+    var $_unicodeConvMethod = null;
+    // Emergency memory buffer to be freed on memory_limit error.
+    var $_emergBuffer = null;
+
+    
+    /**
+     * Constructor.
+     * 
+     * Create new JsHttpRequest backend object and attach it
+     * to script output buffer. As a result - script will always return
+     * correct JavaScript code, even in case of fatal errors.
+     *
+     * QUERY_STRING is in form of: PHPSESSID=<sid>&a=aaa&b=bbb&JsHttpRequest=<id>-<loader>
+     * where <id> is a request ID, <loader> is a loader name, <sid> - a session ID (if present), 
+     * PHPSESSID - session parameter name (by default = "PHPSESSID").
+     * 
+     * If an object is created WITHOUT an active AJAX query, it is simply marked as
+     * non-active. Use statuc method isActive() to check.
+     */
+    function JsHttpRequest($enc)
+    {
+        global $JsHttpRequest_Active;
+        
+        // To be on a safe side - do not allow to drop reference counter on ob processing.
+        $GLOBALS['_RESULT'] =& $this->RESULT; 
+        
+        // Parse QUERY_STRING.
+        if (preg_match('/^(.*)(?:&|^)JsHttpRequest=(?:(\d+)-)?([^&]+)((?:&|$).*)$/s', @$_SERVER['QUERY_STRING'], $m)) {
+            $this->ID = $m[2];
+            $this->LOADER = strtolower($m[3]);
+            $_SERVER['QUERY_STRING'] = preg_replace('/^&+|&+$/s', '', preg_replace('/(^|&)'.session_name().'=[^&]*&?/s', '&', $m[1] . $m[4]));
+            unset(
+                $_GET['JsHttpRequest'],
+                $_REQUEST['JsHttpRequest'],
+                $_GET[session_name()],
+                $_POST[session_name()],
+                $_REQUEST[session_name()]
+            );
+            // Detect Unicode conversion method.
+            $this->_unicodeConvMethod = function_exists('mb_convert_encoding')? 'mb' : (function_exists('iconv')? 'iconv' : null);
+    
+            // Fill an emergency buffer. We erase it at the first line of OB processor
+            // to free some memory. This memory may be used on memory_limit error.
+            $this->_emergBuffer = str_repeat('a', 1024 * 200);
+
+            // Intercept fatal errors via display_errors (seems it is the only way).     
+            $this->_uniqHash = md5('JsHttpRequest' . microtime() . getmypid());
+            $this->_prevDisplayErrors = ini_get('display_errors');
+            ini_set('display_errors', $this->_magic); //
+            ini_set('error_prepend_string', $this->_uniqHash . ini_get('error_prepend_string'));
+            ini_set('error_append_string',  ini_get('error_append_string') . $this->_uniqHash);
+
+            // Start OB handling early.
+            ob_start(array(&$this, "_obHandler"));
+            $JsHttpRequest_Active = true;
+    
+            // Set up the encoding.
+            $this->setEncoding($enc);
+    
+            // Check if headers are already sent (see Content-Type library usage).
+            // If true - generate a debug message and exit.
+            $file = $line = null;
+            $headersSent = version_compare(PHP_VERSION, "4.3.0") < 0? headers_sent() : headers_sent($file, $line);
+            if ($headersSent) {
+                trigger_error(
+                    "HTTP headers are already sent" . ($line !== null? " in $file on line $line" : " somewhere in the script") . ". "
+                    . "Possibly you have an extra space (or a newline) before the first line of the script or any library. "
+                    . "Please note that JsHttpRequest uses its own Content-Type header and fails if "
+                    . "this header cannot be set. See header() function documentation for more details",
+                    E_USER_ERROR
+                );
+                exit();
+            }
+        } else {
+            $this->ID = 0;
+            $this->LOADER = 'unknown';
+            $JsHttpRequest_Active = false;
+        }
+    }
+    
+
+    /**
+     * Static function.
+     * Returns true if JsHttpRequest output processor is currently active.
+     * 
+     * @return boolean    True if the library is active, false otherwise.
+     */
+    function isActive()
+    {
+        return !empty($GLOBALS['JsHttpRequest_Active']);
+    }
+    
+
+    /**
+     * string getJsCode()
+     * 
+     * Return JavaScript part of the library.
+     */
+    function getJsCode()
+    {
+        return file_get_contents(dirname(__FILE__) . '/JsHttpRequest.js');
+    }
+
+
+    /**
+     * void setEncoding(string $encoding)
+     * 
+     * Set an active script encoding & correct QUERY_STRING according to it.
+     * Examples:
+     *   "windows-1251"          - set plain encoding (non-windows characters, 
+     *                             e.g. hieroglyphs, are totally ignored)
+     *   "windows-1251 entities" - set windows encoding, BUT additionally replace:
+     *                             "&"         ->  "&amp;" 
+     *                             hieroglyph  ->  &#XXXX; entity
+     */
+    function setEncoding($enc)
+    {
+        // Parse an encoding.
+        preg_match('/^(\S*)(?:\s+(\S*))$/', $enc, $p);
+        $this->SCRIPT_ENCODING    = strtolower(!empty($p[1])? $p[1] : $enc);
+        $this->SCRIPT_DECODE_MODE = !empty($p[2])? $p[2] : '';
+        // Manually parse QUERY_STRING because of damned Unicode's %uXXXX.
+        $this->_correctSuperglobals();
+    }
+
+    
+    /**
+     * string quoteInput(string $input)
+     * 
+     * Quote a string according to the input decoding mode.
+     * If entities are used (see setEncoding()), no '&' character is quoted,
+     * only '"', '>' and '<' (we presume that '&' is already quoted by
+     * an input reader function).
+     *
+     * Use this function INSTEAD of htmlspecialchars() for $_GET data 
+     * in your scripts.
+     */
+    function quoteInput($s)
+    {
+        if ($this->SCRIPT_DECODE_MODE == 'entities')
+            return str_replace(array('"', '<', '>'), array('&quot;', '&lt;', '&gt;'), $s);
+        else
+            return htmlspecialchars($s);
+    }
+    
+
+    /**
+     * Convert a PHP scalar, array or hash to JS scalar/array/hash. This function is 
+     * an analog of json_encode(), but it can work with a non-UTF8 input and does not 
+     * analyze the passed data. Output format must be fully JSON compatible.
+     * 
+     * @param mixed $a   Any structure to convert to JS.
+     * @return string    JavaScript equivalent structure.
+     */
+    function php2js($a=false)
+    {
+        if (is_null($a)) return 'null';
+        if ($a === false) return 'false';
+        if ($a === true) return 'true';
+        if (is_scalar($a)) {
+            if (is_float($a)) {
+                // Always use "." for floats.
+                $a = str_replace(",", ".", strval($a));
+            }
+            // All scalars are converted to strings to avoid indeterminism.
+            // PHP's "1" and 1 are equal for all PHP operators, but 
+            // JS's "1" and 1 are not. So if we pass "1" or 1 from the PHP backend,
+            // we should get the same result in the JS frontend (string).
+            // Character replacements for JSON.
+            static $jsonReplaces = array(
+                array("\\", "/", "\n", "\t", "\r", "\b", "\f", '"'),
+                array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"')
+            );
+            return '"' . str_replace($jsonReplaces[0], $jsonReplaces[1], $a) . '"';
+        }
+        $isList = true;
+        for ($i = 0, reset($a); $i < count($a); $i++, next($a)) {
+            if (key($a) !== $i) { 
+                $isList = false; 
+                break; 
+            }
+        }
+        $result = array();
+        if ($isList) {
+            foreach ($a as $v) {
+                $result[] = JsHttpRequest::php2js($v);
+            }
+            return '[ ' . join(', ', $result) . ' ]';
+        } else {
+            foreach ($a as $k => $v) {
+                $result[] = JsHttpRequest::php2js($k) . ': ' . JsHttpRequest::php2js($v);
+            }
+            return '{ ' . join(', ', $result) . ' }';
+        }
+    }
+    
+        
+    /**
+     * Internal methods.
+     */
+
+    /**
+     * Parse & decode QUERY_STRING.
+     */
+    function _correctSuperglobals()
+    {
+        // In case of FORM loader we may go to nirvana, everything is already parsed by PHP.
+        if ($this->LOADER == 'form') return;
+        
+        // ATTENTION!!!
+        // HTTP_RAW_POST_DATA is only accessible when Content-Type of POST request
+        // is NOT default "application/x-www-form-urlencoded"!!!
+        // Library frontend sets "application/octet-stream" for that purpose,
+        // see JavaScript code. In PHP 5.2.2.HTTP_RAW_POST_DATA is not set sometimes; 
+        // in such cases - read the POST data manually from the STDIN stream.
+        $rawPost = strcasecmp($_SERVER['REQUEST_METHOD'], 'POST') == 0? (isset($GLOBALS['HTTP_RAW_POST_DATA'])? $GLOBALS['HTTP_RAW_POST_DATA'] : @file_get_contents("php://input")) : null;
+        $source = array(
+            '_GET' => !empty($_SERVER['QUERY_STRING'])? $_SERVER['QUERY_STRING'] : null, 
+            '_POST'=> $rawPost,
+        );
+        foreach ($source as $dst=>$src) {
+            // First correct all 2-byte entities.
+            $s = preg_replace('/%(?!5B)(?!5D)([0-9a-f]{2})/si', '%u00\\1', $src);
+            // Now we can use standard parse_str() with no worry!
+            $data = null;
+            parse_str($s, $data);
+            $GLOBALS[$dst] = $this->_ucs2EntitiesDecode($data);
+        }
+        $GLOBALS['HTTP_GET_VARS'] = $_GET; // deprecated vars
+        $GLOBALS['HTTP_POST_VARS'] = $_POST;
+        $_REQUEST = 
+            (isset($_COOKIE)? $_COOKIE : array()) + 
+            (isset($_POST)? $_POST : array()) + 
+            (isset($_GET)? $_GET : array());
+        if (ini_get('register_globals')) {
+            // TODO?
+        }
+    }
+
+
+    /**
+     * Called in case of error too!
+     */
+    function _obHandler($text)
+    {
+        unset($this->_emergBuffer); // free a piece of memory for memory_limit error
+        unset($GLOBALS['JsHttpRequest_Active']);
+        
+        // Check for error & fetch a resulting data.
+        if (preg_match("/{$this->_uniqHash}(.*?){$this->_uniqHash}/sx", $text, $m)) {
+            if (!ini_get('display_errors') || (!$this->_prevDisplayErrors && ini_get('display_errors') == $this->_magic)) {
+                // Display_errors:
+                // 1. disabled manually after the library initialization, or
+                // 2. was initially disabled and is not changed
+                $text = str_replace($m[0], '', $text); // strip whole error message
+            } else {
+                $text = str_replace($this->_uniqHash, '', $text);
+            }
+        }
+        if ($m && preg_match('/\bFatal error(<.*?>)?:/i', $m[1])) {
+            // On fatal errors - force null result (generate 500 error).
+            $this->RESULT = null;
+        } else {
+            // Make a resulting hash.
+            if (!isset($this->RESULT)) {
+                global $_RESULT;
+                $this->RESULT = $_RESULT;
+            }
+        }
+        
+        $result = array(
+            'id'   => $this->ID,
+            'js'   => $this->RESULT,
+            'text' => $text,
+        );
+        $text = null;
+        $encoding = $this->SCRIPT_ENCODING;
+        $status = $this->RESULT !== null? 200 : 500;
+
+        // Try to use very fast json_encode: 3-4 times faster than a manual encoding.
+        if (function_exists('array_walk_recursive') && function_exists('json_encode') && $this->_unicodeConvMethod) {
+            $this->_nonAsciiChars = join("", array_map('chr', range(128, 255)));
+            $this->_toUtfFailed = false;
+            $resultUtf8 = $result;
+            array_walk_recursive($resultUtf8, array(&$this, '_toUtf8_callback'), $this->SCRIPT_ENCODING);
+            if (!$this->_toUtfFailed) {
+                // If some key contains non-ASCII character, convert everything manually.
+                $text = json_encode($resultUtf8);
+                $encoding = "UTF-8";
+            }
+        }
+        
+        // On failure, use manual encoding.
+        if ($text === null) {
+            $text = $this->php2js($result);
+        }
+
+        if ($this->LOADER != "xml") {
+            // In non-XML mode we cannot use plain JSON. So - wrap with JS function call.
+            // If top.JsHttpRequestGlobal is not defined, loading is aborted and 
+            // iframe is removed, so - do not call dataReady().
+            $text = "" 
+                . ($this->LOADER == "form"? 'top && top.JsHttpRequestGlobal && top.JsHttpRequestGlobal' : 'JsHttpRequest') 
+                . ".dataReady(" . $text . ")\n"
+                . "";
+            if ($this->LOADER == "form") {
+                $text = '<script type="text/javascript" language="JavaScript"><!--' . "\n$text" . '//--></script>';
+            }
+            
+            // Always return 200 code in non-XML mode (else SCRIPT does not work in FF).
+            // For XML mode, 500 code is okay.
+            $status = 200;
+        }
+
+        // Status header. To be safe, display it only in error mode. In case of success 
+        // termination, do not modify the status (""HTTP/1.1 ..." header seems to be not
+        // too cross-platform).
+        if ($this->RESULT === null) {
+            if (php_sapi_name() == "cgi") {
+                header("Status: $status");
+            } else {
+                header("HTTP/1.1 $status");
+            }
+        }
+
+        // In XMLHttpRequest mode we must return text/plain - damned stupid Opera 8.0. :(
+        $ctype = !empty($this->_contentTypes[$this->LOADER])? $this->_contentTypes[$this->LOADER] : $this->_contentTypes[''];
+        header("Content-type: $ctype; charset=$encoding");
+
+        return $text;
+    }
+
+
+    /**
+     * Internal function, used in array_walk_recursive() before json_encode() call.
+     * If a key contains non-ASCII characters, this function sets $this->_toUtfFailed = true,
+     * becaues array_walk_recursive() cannot modify array keys.
+     */
+    function _toUtf8_callback(&$v, $k, $fromEnc)
+    {
+        if ($v === null || is_bool($v)) return;
+        if ($this->_toUtfFailed || !is_scalar($v) || strpbrk($k, $this->_nonAsciiChars) !== false) {
+            $this->_toUtfFailed = true;
+        } else {
+            $v = $this->_unicodeConv($fromEnc, 'UTF-8', $v);
+        }
+    }
+    
+
+    /**
+     * Decode all %uXXXX entities in string or array (recurrent).
+     * String must not contain %XX entities - they are ignored!
+     */
+    function _ucs2EntitiesDecode($data)
+    {
+        if (is_array($data)) {
+            $d = array();
+            foreach ($data as $k=>$v) {
+                $d[$this->_ucs2EntitiesDecode($k)] = $this->_ucs2EntitiesDecode($v);
+            }
+            return $d;
+        } else {
+            if (strpos($data, '%u') !== false) { // improve speed
+                $data = preg_replace_callback('/%u([0-9A-F]{1,4})/si', array(&$this, '_ucs2EntitiesDecodeCallback'), $data);
+            }
+            return $data;
+        }
+    }
+
+
+    /**
+     * Decode one %uXXXX entity (RE callback).
+     */
+    function _ucs2EntitiesDecodeCallback($p)
+    {
+        $hex = $p[1];
+        $dec = hexdec($hex);
+        if ($dec === "38" && $this->SCRIPT_DECODE_MODE == 'entities') {
+            // Process "&" separately in "entities" decode mode.
+            $c = "&amp;";
+        } else {
+            if ($this->_unicodeConvMethod) {
+                $c = @$this->_unicodeConv('UCS-2BE', $this->SCRIPT_ENCODING, pack('n', $dec));
+            } else {
+                $c = $this->_decUcs2Decode($dec, $this->SCRIPT_ENCODING);
+            }
+            if (!strlen($c)) {
+                if ($this->SCRIPT_DECODE_MODE == 'entities') {
+                    $c = '&#' . $dec . ';';
+                } else {
+                    $c = '?';
+                }
+            }
+        }
+        return $c;
+    }
+
+
+    /**
+     * Wrapper for iconv() or mb_convert_encoding() functions.
+     * This function will generate fatal error if none of these functons available!
+     * 
+     * @see iconv()
+     */
+    function _unicodeConv($fromEnc, $toEnc, $v)
+    {
+        if ($this->_unicodeConvMethod == 'iconv') {
+            return iconv($fromEnc, $toEnc, $v);
+        } 
+        return mb_convert_encoding($v, $toEnc, $fromEnc);
+    }
+
+
+    /**
+     * If there is no ICONV, try to decode 1-byte characters manually
+     * (for most popular charsets only).
+     */
+     
+    /**
+     * Convert from UCS-2BE decimal to $toEnc.
+     */
+    function _decUcs2Decode($code, $toEnc)
+    {
+        if ($code < 128) return chr($code);
+        if (isset($this->_encTables[$toEnc])) {
+            // TODO: possible speedup by using array_flip($this->_encTables) and later hash access in the constructor.
+            $p = array_search($code, $this->_encTables[$toEnc]);
+            if ($p !== false) return chr(128 + $p);
+        }
+        return "";
+    }
+    
+
+    /**
+     * UCS-2BE -> 1-byte encodings (from #128).
+     */
+    var $_encTables = array(
+        'windows-1251' => array(
+            0x0402, 0x0403, 0x201A, 0x0453, 0x201E, 0x2026, 0x2020, 0x2021,
+            0x20AC, 0x2030, 0x0409, 0x2039, 0x040A, 0x040C, 0x040B, 0x040F,
+            0x0452, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
+            0x0098, 0x2122, 0x0459, 0x203A, 0x045A, 0x045C, 0x045B, 0x045F,
+            0x00A0, 0x040E, 0x045E, 0x0408, 0x00A4, 0x0490, 0x00A6, 0x00A7,
+            0x0401, 0x00A9, 0x0404, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x0407,
+            0x00B0, 0x00B1, 0x0406, 0x0456, 0x0491, 0x00B5, 0x00B6, 0x00B7,
+            0x0451, 0x2116, 0x0454, 0x00BB, 0x0458, 0x0405, 0x0455, 0x0457,
+            0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417,
+            0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F,
+            0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427,
+            0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F,
+            0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437,
+            0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F,
+            0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447,
+            0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F,
+        ),
+        'koi8-r' => array(
+            0x2500, 0x2502, 0x250C, 0x2510, 0x2514, 0x2518, 0x251C, 0x2524,
+            0x252C, 0x2534, 0x253C, 0x2580, 0x2584, 0x2588, 0x258C, 0x2590,
+            0x2591, 0x2592, 0x2593, 0x2320, 0x25A0, 0x2219, 0x221A, 0x2248,
+            0x2264, 0x2265, 0x00A0, 0x2321, 0x00B0, 0x00B2, 0x00B7, 0x00F7,
+            0x2550, 0x2551, 0x2552, 0x0451, 0x2553, 0x2554, 0x2555, 0x2556,
+            0x2557, 0x2558, 0x2559, 0x255A, 0x255B, 0x255C, 0x255d, 0x255E,
+            0x255F, 0x2560, 0x2561, 0x0401, 0x2562, 0x2563, 0x2564, 0x2565,
+            0x2566, 0x2567, 0x2568, 0x2569, 0x256A, 0x256B, 0x256C, 0x00A9,
+            0x044E, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433,
+            0x0445, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043d, 0x043E,
+            0x043F, 0x044F, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432,
+            0x044C, 0x044B, 0x0437, 0x0448, 0x044d, 0x0449, 0x0447, 0x044A,
+            0x042E, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413,
+            0x0425, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041d, 0x041E,
+            0x041F, 0x042F, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412,
+            0x042C, 0x042B, 0x0417, 0x0428, 0x042d, 0x0429, 0x0427, 0x042A      
+        ),
+    );
+}

Added: syncman/trunk/settings/macro.conf.php
===================================================================
--- syncman/trunk/settings/macro.conf.php	                        (rev 0)
+++ syncman/trunk/settings/macro.conf.php	2008-04-21 09:25:34 UTC (rev 6943)
@@ -0,0 +1,6 @@
+<?php
+$conf = array(
+'forcescan' => false,
+'forcecompile' => false
+);
+

Added: syncman/trunk/settings/routes.conf.php
===================================================================
--- syncman/trunk/settings/routes.conf.php	                        (rev 0)
+++ syncman/trunk/settings/routes.conf.php	2008-04-21 09:25:34 UTC (rev 6943)
@@ -0,0 +1,19 @@
+<?php
+
+$conf = array(
+'HomePage' =>
+  array('path' => '/',
+        'defaults' => array('controller' => 'main_page', 'action' => 'display')),
+
+'ServiceActionId' =>
+  array('path' => '/:controller/:action/:id',
+        'defaults' => array('action' => 'display')),
+
+'ServiceAction' =>
+  array('path' => '/:controller/:action'),
+
+'Service' =>
+  array('path' => '/:controller'),
+);
+
+?>

Modified: syncman/trunk/src/SyncmanApplication.class.php
===================================================================
--- syncman/trunk/src/SyncmanApplication.class.php	2008-04-17 17:38:14 UTC (rev 6942)
+++ syncman/trunk/src/SyncmanApplication.class.php	2008-04-21 09:25:34 UTC (rev 6943)
@@ -1,6 +1,21 @@
 <?php
 lmb_require('limb/web_app/src/lmbWebApplication.class.php');
 
-class SyncmanApplication extends lmbWebApplication{}
+class SyncmanApplication extends lmbWebApplication
 
+{
+
+  function __construct()
+  {
+    $this->registerFilter(new lmbHandle('limb/web_app/src/filter/lmbUncaughtExceptionHandlingFilter'));
+    $this->registerFilter(new lmbHandle('limb/web_app/src/filter/lmbSessionStartupFilter'));
+    $this->registerFilter(new lmbHandle('limb/web_app/src/filter/lmbRequestDispatchingFilter',
+                                        array(new lmbHandle('limb/web_app/src/request/lmbRoutesRequestDispatcher'))));
+    $this->registerFilter(new lmbHandle('limb/web_app/src/filter/lmbResponseTransactionFilter'));
+    $this->registerFilter(new lmbHandle('limb/web_app/src/filter/lmbActionPerformingFilter'));
+    $this->registerFilter(new lmbHandle('limb/web_app/src/filter/lmbViewRenderingFilter'));
+  }
+
+}
+
 ?>

Modified: syncman/trunk/src/controller/ProjectsController.class.php
===================================================================
--- syncman/trunk/src/controller/ProjectsController.class.php	2008-04-17 17:38:14 UTC (rev 6942)
+++ syncman/trunk/src/controller/ProjectsController.class.php	2008-04-21 09:25:34 UTC (rev 6943)
@@ -7,12 +7,19 @@
 {
   function doDisplay()
   {
-    $this->view->findChild('categories')->registerDataset(Category :: findAllCategories());
+    //$this->view->findChild('categories')->registerDataset(Category :: findAllCategories());
+    $this->view->set('category', Category :: findAllCategories());
+
+    if(isset($_COOKIE['category_detail']))
+      $this->view->set('category_detail', $_COOKIE['category_detail']);
+    else
+      $this->view->set('category_detail', array());
   }
 
   function doSimple()
   {
-    $this->view->findChild('projects')->registerDataset(Project :: findAllProjects());
+    //$this->view->findChild('projects')->registerDataset(Project :: findAllProjects());
+    $this->view->set('projects', Project :: findAllProjects());
   }
 
   function doSync()
@@ -62,6 +69,34 @@
     $project->unlock();
   }
 
+  function doDetail()
+  {
+    if($category = $this->request->get('category'))
+    {
+      $value = isset($_COOKIE['category_detail'][$category]) ? $_COOKIE['category_detail'][$category] : 0;
+
+      $value = (int) (! $value);
+      $this->_setCookie($category, $value);
+
+      if($this->request->getInteger('js') !== 1)
+        $this->redirect(array('controller' => 'projects', 'action' => 'display'));
+      else
+      {
+        require_once "lib/JsHttpRequest/JsHttpRequest.php";
+        $JsHttpRequest = new JsHttpRequest("utf-8");
+        if($value == 1)
+          $this->view->set('item', Category :: findCategory($category));
+        else
+          exit();
+      }
+    }
+  }
+
+  protected function _setCookie($category, $value)
+  {
+    setcookie("category_detail[{$category}]", $value, $value ? time()+3600*24*30: time(), "/");
+  }
+
   function notify($project, $cmd, $log)
   {
     static $cmds = array();

Added: syncman/trunk/template/projects/detail.phtml
===================================================================
--- syncman/trunk/template/projects/detail.phtml	                        (rev 0)
+++ syncman/trunk/template/projects/detail.phtml	2008-04-21 09:25:34 UTC (rev 6943)
@@ -0,0 +1,56 @@
+
+{{form name='list_form' method='post'}}
+{{list using="$#item.projects" as="$project"}}
+  <table id='list'>
+  <tr>
+    <th></th>
+    <th>Name</th>
+    <th>Last Sync</th>
+    <th>Last Rev</th>
+    <th>Current Rev</th>
+    <th>Info</th>
+    <th>Actions</th>
+  </tr>
+  {{list:item}}
+  <tr class='list'>
+    <td class='selector'>{{input type='checkbox' name='ids[]' value='{$project.name}' class='input' /}}</td>
+    <td class='project_name'>
+      <?php $project_class = $project->is_changed ? 'changed' : 'not_changed'; ?>
+      <span class="{$project_class}" onclick='info_toggle("{$project.name}_info"); return false;'>
+          {$project->name}
+      </span>
+    </td>
+    <td>{$project.last_sync_date}</td>
+    <td>{$project.last_sync_rev}</td>
+    <td>{$project.repository_rev}</td>
+    <td width='50%'>
+      <a href='#' id='{$project.name}_info_toggle' onclick='info_toggle("{$project.name}_info"); return false;'><img src="/images/icon/plus.gif"  width='10' height='10' alt='plus'/></a>
+      <dl id='{$project.name}_info' class='info'>
+        <dt>Repos:</dt><dd>{$project.repository}</dd>
+        <dt>Remote host:</dt><dd>{$project.user}@{$project.host}</dd>
+        <dt>Remote dir:</dt><dd>{$project.remote_dir}</dd>
+        <dt>Presync cmd:</dt><dd>{$project.presync_cmd}</dd>
+        <dt>Sync cmd:</dt><dd>{$project.sync_cmd}</dd>
+        <dt>Postsync cmd:</dt><dd>{$project.postsync_cmd}</dd>
+        <?php if (isset($project->url)) { ?>
+          <dt>Project URI:</dt><dd><a href="{$project.url}" class='project' target="_blank">{$project.url}</a></dd>
+        <?php } ?>
+
+      </dl>
+    </td>
+    <td class='actions'>
+      <?php if($project->is_locked) {?>
+        <a href="{{route_url params='action:unlock,id:{$project.name}'}}"  onclick="res = confirm('Confirm action: unlock project \'{$project.name}\'.');if(res){w = window.open(this.href, 'Unlock', 'toolbar=0,location=0,width=400px,height=400px');w.focus();};return false"><img src="/images/icon/unlock.gif" alt="Unlock" title="Force unlock"/></a>
+      <?php } else { ?>
+        <a href="{{route_url params='action:sync'}}?id={$project.name}" onclick="res = confirm('Confirm action: synchronize project \'{$project.name}\' with remote.');if(res){w = window.open(this.href, 'Sync!', 'toolbar=0,location=0,width=800px,height=800px');w.focus();};return false"><img src="/images/icon/sync.gif" alt="Sync!" title="Synchronize project with remote"/></a>
+      <?php } ?>
+      <a href="{{route_url params='action:diff,id:{$project.name}'}}"  onclick="w = window.open(this.href, 'Diff', 'toolbar=0,location=0,width=800px,height=800px');w.focus();return false"><img src="/images/icon/diff.gif" alt="Diff" title="Show difference"/></a>
+    </td>
+  </tr>
+  {{/list:item}}
+  </table>
+  <?php $url_js = lmbToolkit :: instance()->getRoutesUrl(array('action'=>'sync'), '', false); ?>
+  {{input type='submit' value='Sync!' onclick='Limb.Form.submit(this.form, "{$url_js}?popup=1"); return false;'/}}
+{{/list}}  
+{{/form}}
+

Added: syncman/trunk/template/projects/diff.phtml
===================================================================
--- syncman/trunk/template/projects/diff.phtml	                        (rev 0)
+++ syncman/trunk/template/projects/diff.phtml	2008-04-21 09:25:34 UTC (rev 6943)
@@ -0,0 +1,23 @@
+<html>
+<head>
+  <title>Syncman projects</title>
+  <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
+  <link rel="stylesheet" href="/styles/main.css" type="text/css" />
+</head>
+<body id='popup'>
+
+  <div id="wrapper">
+
+    <div id="head">
+      <img src="/images/logo.syncman.small.gif"  width='159' height='40' alt='SYNCMAN' id='logo'/>
+    </div>
+    
+    <fieldset>
+       <legend>Getting diff...</legend>
+       <iframe width='100%' height='100%' src='/projects/perform_diff/{$#request.id}'></iframe>
+    </fieldset>
+    
+  </div>
+
+</body>
+</html>

Added: syncman/trunk/template/projects/display.phtml
===================================================================
--- syncman/trunk/template/projects/display.phtml	                        (rev 0)
+++ syncman/trunk/template/projects/display.phtml	2008-04-21 09:25:34 UTC (rev 6943)
@@ -0,0 +1,74 @@
+<html>
+<head>
+  <title>Syncman projects</title>
+  <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
+  <link rel="stylesheet" href="/styles/main.css" type="text/css" />
+  <script src="/shared/js/prototype.js"></script>
+  <script src="/shared/js/Limb.js"></script>
+  <script src="/shared/js/Limb/browser.js"></script>
+  <script src="/shared/js/Limb/events.js"></script>
+  <script src="/shared/js/Limb/http.js"></script>
+  <script src="/shared/js/Limb/window.js"></script>
+  <script src="/shared/js/Limb/forms.js"></script>
+  <script src="/shared/js/Limb/form_elements.js"></script>
+  <script src="/shared/js/scriptaculous/scriptaculous.js"></script>
+  <script src="/js/jquery.js"></script>
+  <script src="/js/main.js"></script>
+  <script src="/js/JsHttpRequest.js"></script>
+  <script src="/js/getDetailForCategory.js"></script>
+</head>
+<body>
+
+  <div id="wrapper">
+
+    <div id="content">
+
+      <div id="head">
+        <img src="/images/logo.syncman.gif"  width='250' height='63' alt='SYNCMAN' id='logo'/>
+        <span class='version'><?php echo SYNCMAN_VERSION; ?></span>
+      </div>
+
+      {{list:list using="$#category" as="$item"}}
+      {{list:item}}
+
+      <?php if(isset($this->category_detail[$item->name]) && $this->category_detail[$item->name] == 1)  
+              $open = 1;
+            else
+              $open = 0;
+      ?>
+       <fieldset>
+         <legend>
+         <?php $state = $open == 0 ? 'open' : 'close'; ?>
+         <a href="{{route_url params='action:detail'}}?category={$item.name}"
+            id='{$item.name}_category_toggle' 
+            onclick="getDetailForCategory('{$item.name}_category'); return false;"
+            class="category">
+         <strong>Category '{$item.name}'</strong>
+         <img src="/images/icon/{$state}.gif"  width='11' height='11' alt='{$state}'/>
+         </a>
+         </legend>
+
+         <?php $state = $open == 0 ? 'none' : 'block'; ?>
+         <div id='{$item.name}_category' style="display: {$state};">
+         <?php if($open == 1) { ?>
+          <?php $this->item = $item; ?>
+          {{include file='projects/detail.phtml' /}}
+         <?php } ?>
+         </div>
+
+        </fieldset>
+
+      {{/list:item}}
+      {{/list:list}}
+
+    </div>
+
+    <div id="footer">
+      <a href="http://www.bit-creative.com/" target="_blank" title="BIT project" id='bit'><img src="/images/bit.gif"  onMouseOut="this.src='/images/bit.gif';" onMouseOver="this.src='/images/bit_hover.gif';" alt="BIT project" width="80" height="21"/></a>
+      <a href="http://www.limb-project.com" id='limb'><img src="/images/logo.limb.gif"  width='114' height='41' alt='LIMB'/></a>
+    </div>
+
+  </div>
+
+</body>
+</html>

Added: syncman/trunk/template/projects/simple.phtml
===================================================================
--- syncman/trunk/template/projects/simple.phtml	                        (rev 0)
+++ syncman/trunk/template/projects/simple.phtml	2008-04-21 09:25:34 UTC (rev 6943)
@@ -0,0 +1,45 @@
+<html>
+<head>
+  <title>Syncman projects</title>
+  <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
+  <link rel="stylesheet" href="/styles/lightbox.css" type="text/css" />
+  <link rel="stylesheet" href="/styles/main.css" type="text/css" />
+  <script type="text/javascript" src="/js/prototype.js"></script>
+  <script type="text/javascript" src="/js/lightbox.js"></script>
+  <script type="text/javascript" src="/js/Console.js"></script>
+  <script type="text/javascript" src="/js/ProgressBar.js"></script>
+  <script type="text/javascript" src="/js/http.js"></script>
+</head>
+<body>
+<h2>Syncman projects</h2>
+{{list:list using="$#projects" as="$item"}}
+<table width='100%' cellpadding="1" cellspacing="1" border="1">
+<tr>
+  <th>Name</th>
+  <th>Status</th>
+  <th>Actions</th>
+</tr>
+{{list:item}}
+<tr>
+  <td>{$item.name}</td>
+  <td>
+    <?php if($item->is_changed) { ?>
+      <span class='changed'>Changed</span>
+    <?php } else { ?>
+      <span class='not_changed'>Not changed</span>
+    <?php } ?>
+  </td>
+  <td>
+    <?php if($item->is_locked) { ?>
+      Sync already in progress
+    <?php } else { ?>
+      <a href="{{route_url params='action:sync,id:{$item.name}'}}"  onclick="res = confirm('Are you sure?');if(res){w = window.open(this.href, 'Sync!', 'toolbar=0,location=0,width=800px,height=800px');w.focus();};return false"><img src="/images/sync.gif" alt="Sync!" title="Synchronize project with remote"/></a>
+    <?php } ?>
+  </td>
+</tr>
+{{/list:item}}
+</table>
+{{/list:list}}
+</body>
+</html>
+

Added: syncman/trunk/template/projects/simple_sync.phtml
===================================================================
--- syncman/trunk/template/projects/simple_sync.phtml	                        (rev 0)
+++ syncman/trunk/template/projects/simple_sync.phtml	2008-04-21 09:25:34 UTC (rev 6943)
@@ -0,0 +1,61 @@
+<!-- Begin content -->
+<table cellpadding='0' cellspacing='0' class='status'>
+<tr>
+  <td id='status_text'>Synchronization...</td>
+  <td id='close_button'>
+    <a href="#" class="lbAction" rel="deactivate">
+      <input type='button' class='button' value='x' onclick='window.close();' />
+    </a>
+  </td>
+</tr>
+</table>
+<table cellpadding='0' cellspacing='0' border='0' width='100%' height='100%' class='main_panel'>
+<tr>
+  <td>
+    <div id='state'>Updating sources</div>
+    <div class='progress_bar_container'><div id='progress_bar'></div></div>
+    <div id='console' style='display: none'></div>
+  </td>
+</tr>
+</table>
+
+
+<!-- End content -->
+
+<script>
+  var params = {
+    'onReady': function ()
+    {
+      var status = document.getElementById('status_text');
+      status.innerHTML = 'Synchronization complete';
+      
+      var close_button = document.getElementById('close_button'); 
+      close_button.style.display = 'block';
+
+      var state = document.getElementById('state');  
+      state.innerHTML = 'Synchronization finished';
+
+      window.progress_bar.stop();
+    },
+
+    'onCommandPerformed': function()
+    {
+      window.current_state++;
+
+      var state = document.getElementById('state');  
+
+      switch(window.current_state)
+      {
+        case 2: state.innerHTML = 'Preparing project'; break;
+        case 3: state.innerHTML = 'Uploadind project to server'; break;
+        case 4: state.innerHTML = 'Clearing cache and updating database. Finishing installation.'; break;
+      }
+    }
+  };
+
+  new Ajax.Request('/projects/start_sync/{$#request.id}?sync_date={$#sync_date}', { method: 'get' } );
+  window.progress_bar = new ProgressBar('progress_bar');
+  window.console = new Console('console', '/projects/progress/{$#request.id}?sync_date={$#sync_date}', params);
+  window.current_state = 0;
+</script>
+

Added: syncman/trunk/template/projects/sync.phtml
===================================================================
--- syncman/trunk/template/projects/sync.phtml	                        (rev 0)
+++ syncman/trunk/template/projects/sync.phtml	2008-04-21 09:25:34 UTC (rev 6943)
@@ -0,0 +1,28 @@
+<html>
+<head>
+  <title>Syncman projects</title>
+  <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
+  <link rel="stylesheet" href="/styles/main.css" type="text/css" />
+</head>
+<body id='popup'>
+
+  <div id="wrapper">
+
+    <div id="head">
+      <img src="/images/logo.syncman.small.gif"  width='159' height='40' alt='SYNCMAN' id='logo'/>
+    </div>
+  
+    <fieldset>
+       <legend>Synchronization...</legend>
+        <?php
+          if(isset($_REQUEST['id']))
+            echo "<iframe width='100%' height='95%' src='/projects/start_sync/{$_REQUEST['id']}'></iframe>";
+          elseif(isset($_REQUEST['ids']))  
+            echo "<iframe width='100%' height='95%' src='/projects/start_sync?ids[]=" . implode('&ids[]=', $_REQUEST['ids']) . "'></iframe>";
+        ?>
+    </fieldset>
+  
+  </div>
+
+</body>
+</html>

Added: syncman/trunk/template/projects/unlock.phtml
===================================================================
--- syncman/trunk/template/projects/unlock.phtml	                        (rev 0)
+++ syncman/trunk/template/projects/unlock.phtml	2008-04-21 09:25:34 UTC (rev 6943)
@@ -0,0 +1,27 @@
+<html>
+<head>
+  <title>Syncman projects</title>
+  <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
+  <link rel="stylesheet" href="/styles/main.css" type="text/css" />
+</head>
+<body id='popup'>
+
+  <div id="wrapper">
+
+    <div id="head">
+      <img src="/images/logo.syncman.small.gif"  width='159' height='40' alt='SYNCMAN' id='logo'/>
+    </div>
+  
+    <fieldset>
+       <legend>Unlock...</legend>
+       <div class="content">
+          <input type="button" value='OK' onclick='window.opener.location.reload();window.close();' style='margin:10px;'/>
+       </div> 
+    </fieldset>
+  
+  </div>
+
+
+  
+</body>
+</html>

Added: syncman/trunk/www/js/JsHttpRequest.js
===================================================================
--- syncman/trunk/www/js/JsHttpRequest.js	                        (rev 0)
+++ syncman/trunk/www/js/JsHttpRequest.js	2008-04-21 09:25:34 UTC (rev 6943)
@@ -0,0 +1,576 @@
+/**
+ * JsHttpRequest: JavaScript "AJAX" data loader
+ * Minimized version: see debug directory for the complete one.
+ *
+ * @license LGPL
+ * @author Dmitry Koterov, http://en.dklab.ru/lib/JsHttpRequest/
+ * @version 5.x $Id$
+ */
+function JsHttpRequest(){
+var t=this;
+t.onreadystatechange=null;
+t.readyState=0;
+t.responseText=null;
+t.responseXML=null;
+t.status=200;
+t.statusText="OK";
+t.responseJS=null;
+t.caching=false;
+t.loader=null;
+t.session_name="PHPSESSID";
+t._ldObj=null;
+t._reqHeaders=[];
+t._openArgs=null;
+t._errors={inv_form_el:"Invalid FORM element detected: name=%, tag=%",must_be_single_el:"If used, <form> must be a single HTML element in the list.",js_invalid:"JavaScript code generated by backend is invalid!\n%",url_too_long:"Cannot use so long query with GET request (URL is larger than % bytes)",unk_loader:"Unknown loader: %",no_loaders:"No loaders registered at all, please check JsHttpRequest.LOADERS array",no_loader_matched:"Cannot find a loader which may process the request. Notices are:\n%"};
+t.abort=function(){
+with(this){
+if(_ldObj&&_ldObj.abort){
+_ldObj.abort();
+}
+_cleanup();
+if(readyState==0){
+return;
+}
+if(readyState==1&&!_ldObj){
+readyState=0;
+return;
+}
+_changeReadyState(4,true);
+}
+};
+t.open=function(_2,_3,_4,_5,_6){
+with(this){
+if(_3.match(/^((\w+)\.)?(GET|POST)\s+(.*)/i)){
+this.loader=RegExp.$2?RegExp.$2:null;
+_2=RegExp.$3;
+_3=RegExp.$4;
+}
+try{
+if(document.location.search.match(new RegExp("[&?]"+session_name+"=([^&?]*)"))||document.cookie.match(new RegExp("(?:;|^)\\s*"+session_name+"=([^;]*)"))){
+_3+=(_3.indexOf("?")>=0?"&":"?")+session_name+"="+this.escape(RegExp.$1);
+}
+}
+catch(e){
+}
+_openArgs={method:(_2||"").toUpperCase(),url:_3,asyncFlag:_4,username:_5!=null?_5:"",password:_6!=null?_6:""};
+_ldObj=null;
+_changeReadyState(1,true);
+return true;
+}
+};
+t.send=function(_7){
+if(!this.readyState){
+return;
+}
+this._changeReadyState(1,true);
+this._ldObj=null;
+var _8=[];
+var _9=[];
+if(!this._hash2query(_7,null,_8,_9)){
+return;
+}
+var _a=null;
+if(this.caching&&!_9.length){
+_a=this._openArgs.username+":"+this._openArgs.password+"@"+this._openArgs.url+"|"+_8+"#"+this._openArgs.method;
+var _b=JsHttpRequest.CACHE[_a];
+if(_b){
+this._dataReady(_b[0],_b[1]);
+return false;
+}
+}
+var _c=(this.loader||"").toLowerCase();
+if(_c&&!JsHttpRequest.LOADERS[_c]){
+return this._error("unk_loader",_c);
+}
+var _d=[];
+var _e=JsHttpRequest.LOADERS;
+for(var _f in _e){
+var ldr=_e[_f].loader;
+if(!ldr){
+continue;
+}
+if(_c&&_f!=_c){
+continue;
+}
+var _11=new ldr(this);
+JsHttpRequest.extend(_11,this._openArgs);
+JsHttpRequest.extend(_11,{queryText:_8.join("&"),queryElem:_9,id:(new Date().getTime())+""+JsHttpRequest.COUNT++,hash:_a,span:null});
+var _12=_11.load();
+if(!_12){
+this._ldObj=_11;
+JsHttpRequest.PENDING[_11.id]=this;
+return true;
+}
+if(!_c){
+_d[_d.length]="- "+_f.toUpperCase()+": "+this._l(_12);
+}else{
+return this._error(_12);
+}
+}
+return _f?this._error("no_loader_matched",_d.join("\n")):this._error("no_loaders");
+};
+t.getAllResponseHeaders=function(){
+with(this){
+return _ldObj&&_ldObj.getAllResponseHeaders?_ldObj.getAllResponseHeaders():[];
+}
+};
+t.getResponseHeader=function(_13){
+with(this){
+return _ldObj&&_ldObj.getResponseHeader?_ldObj.getResponseHeader(_13):null;
+}
+};
+t.setRequestHeader=function(_14,_15){
+with(this){
+_reqHeaders[_reqHeaders.length]=[_14,_15];
+}
+};
+t._dataReady=function(_16,js){
+with(this){
+if(caching&&_ldObj){
+JsHttpRequest.CACHE[_ldObj.hash]=[_16,js];
+}
+responseText=responseXML=_16;
+responseJS=js;
+if(js!==null){
+status=200;
+statusText="OK";
+}else{
+status=500;
+statusText="Internal Server Error";
+}
+_changeReadyState(2);
+_changeReadyState(3);
+_changeReadyState(4);
+_cleanup();
+}
+};
+t._l=function(_18){
+var i=0,p=0,msg=this._errors[_18[0]];
+while((p=msg.indexOf("%",p))>=0){
+var a=_18[++i]+"";
+msg=msg.substring(0,p)+a+msg.substring(p+1,msg.length);
+p+=1+a.length;
+}
+return msg;
+};
+t._error=function(msg){
+msg=this._l(typeof (msg)=="string"?arguments:msg);
+msg="JsHttpRequest: "+msg;
+if(!window.Error){
+throw msg;
+}else{
+if((new Error(1,"test")).description=="test"){
+throw new Error(1,msg);
+}else{
+throw new Error(msg);
+}
+}
+};
+t._hash2query=function(_1e,_1f,_20,_21){
+if(_1f==null){
+_1f="";
+}
+if((""+typeof (_1e)).toLowerCase()=="object"){
+var _22=false;
+if(_1e&&_1e.parentNode&&_1e.parentNode.appendChild&&_1e.tagName&&_1e.tagName.toUpperCase()=="FORM"){
+_1e={form:_1e};
+}
+for(var k in _1e){
+var v=_1e[k];
+if(v instanceof Function){
+continue;
+}
+var _25=_1f?_1f+"["+this.escape(k)+"]":this.escape(k);
+var _26=v&&v.parentNode&&v.parentNode.appendChild&&v.tagName;
+if(_26){
+var tn=v.tagName.toUpperCase();
+if(tn=="FORM"){
+_22=true;
+}else{
+if(tn=="INPUT"||tn=="TEXTAREA"||tn=="SELECT"){
+}else{
+return this._error("inv_form_el",(v.name||""),v.tagName);
+}
+}
+_21[_21.length]={name:_25,e:v};
+}else{
+if(v instanceof Object){
+this._hash2query(v,_25,_20,_21);
+}else{
+if(v===null){
+continue;
+}
+if(v===true){
+v=1;
+}
+if(v===false){
+v="";
+}
+_20[_20.length]=_25+"="+this.escape(""+v);
+}
+}
+if(_22&&_21.length>1){
+return this._error("must_be_single_el");
+}
+}
+}else{
+_20[_20.length]=_1e;
+}
+return true;
+};
+t._cleanup=function(){
+var _28=this._ldObj;
+if(!_28){
+return;
+}
+JsHttpRequest.PENDING[_28.id]=false;
+var _29=_28.span;
+if(!_29){
+return;
+}
+_28.span=null;
+var _2a=function(){
+_29.parentNode.removeChild(_29);
+};
+JsHttpRequest.setTimeout(_2a,50);
+};
+t._changeReadyState=function(s,_2c){
+with(this){
+if(_2c){
+status=statusText=responseJS=null;
+responseText="";
+}
+readyState=s;
+if(onreadystatechange){
+onreadystatechange();
+}
+}
+};
+t.escape=function(s){
+return escape(s).replace(new RegExp("\\+","g"),"%2B");
+};
+}
+JsHttpRequest.COUNT=0;
+JsHttpRequest.MAX_URL_LEN=2000;
+JsHttpRequest.CACHE={};
+JsHttpRequest.PENDING={};
+JsHttpRequest.LOADERS={};
+JsHttpRequest._dummy=function(){
+};
+JsHttpRequest.TIMEOUTS={s:window.setTimeout,c:window.clearTimeout};
+JsHttpRequest.setTimeout=function(_2e,dt){
+window.JsHttpRequest_tmp=JsHttpRequest.TIMEOUTS.s;
+if(typeof (_2e)=="string"){
+id=window.JsHttpRequest_tmp(_2e,dt);
+}else{
+var id=null;
+var _31=function(){
+_2e();
+delete JsHttpRequest.TIMEOUTS[id];
+};
+id=window.JsHttpRequest_tmp(_31,dt);
+JsHttpRequest.TIMEOUTS[id]=_31;
+}
+window.JsHttpRequest_tmp=null;
+return id;
+};
+JsHttpRequest.clearTimeout=function(id){
+window.JsHttpRequest_tmp=JsHttpRequest.TIMEOUTS.c;
+delete JsHttpRequest.TIMEOUTS[id];
+var r=window.JsHttpRequest_tmp(id);
+window.JsHttpRequest_tmp=null;
+return r;
+};
+JsHttpRequest.query=function(url,_35,_36,_37){
+var req=new this();
+req.caching=!_37;
+req.onreadystatechange=function(){
+if(req.readyState==4){
+_36(req.responseJS,req.responseText);
+}
+};
+req.open(null,url,true);
+req.send(_35);
+};
+JsHttpRequest.dataReady=function(d){
+var th=this.PENDING[d.id];
+delete this.PENDING[d.id];
+if(th){
+th._dataReady(d.text,d.js);
+}else{
+if(th!==false){
+throw "dataReady(): unknown pending id: "+d.id;
+}
+}
+};
+JsHttpRequest.extend=function(_3b,src){
+for(var k in src){
+_3b[k]=src[k];
+}
+};
+JsHttpRequest.LOADERS.xml={loader:function(req){
+JsHttpRequest.extend(req._errors,{xml_no:"Cannot use XMLHttpRequest or ActiveX loader: not supported",xml_no_diffdom:"Cannot use XMLHttpRequest to load data from different domain %",xml_no_headers:"Cannot use XMLHttpRequest loader or ActiveX loader, POST method: headers setting is not supported, needed to work with encodings correctly",xml_no_form_upl:"Cannot use XMLHttpRequest loader: direct form elements using and uploading are not implemented"});
+this.load=function(){
+if(this.queryElem.length){
+return ["xml_no_form_upl"];
+}
+if(this.url.match(new RegExp("^([a-z]+://[^\\/]+)(.*)","i"))){
+if(RegExp.$1.toLowerCase()!=document.location.protocol+"//"+document.location.hostname.toLowerCase()){
+return ["xml_no_diffdom",RegExp.$1];
+}
+}
+var xr=null;
+if(window.XMLHttpRequest){
+try{
+xr=new XMLHttpRequest();
+}
+catch(e){
+}
+}else{
+if(window.ActiveXObject){
+try{
+xr=new ActiveXObject("Microsoft.XMLHTTP");
+}
+catch(e){
+}
+if(!xr){
+try{
+xr=new ActiveXObject("Msxml2.XMLHTTP");
+}
+catch(e){
+}
+}
+}
+}
+if(!xr){
+return ["xml_no"];
+}
+var _40=window.ActiveXObject||xr.setRequestHeader;
+if(!this.method){
+this.method=_40&&this.queryText.length?"POST":"GET";
+}
+if(this.method=="GET"){
+if(this.queryText){
+this.url+=(this.url.indexOf("?")>=0?"&":"?")+this.queryText;
+}
+this.queryText="";
+if(this.url.length>JsHttpRequest.MAX_URL_LEN){
+return ["url_too_long",JsHttpRequest.MAX_URL_LEN];
+}
+}else{
+if(this.method=="POST"&&!_40){
+return ["xml_no_headers"];
+}
+}
+this.url+=(this.url.indexOf("?")>=0?"&":"?")+"JsHttpRequest="+(req.caching?"0":this.id)+"-xml";
+var id=this.id;
+xr.onreadystatechange=function(){
+if(xr.readyState!=4){
+return;
+}
+xr.onreadystatechange=JsHttpRequest._dummy;
+req.status=null;
+try{
+req.status=xr.status;
+req.responseText=xr.responseText;
+}
+catch(e){
+}
+if(!req.status){
+return;
+}
+try{
+eval("JsHttpRequest._tmp = function(id) { var d = "+req.responseText+"; d.id = id; JsHttpRequest.dataReady(d); }");
+}
+catch(e){
+return req._error("js_invalid",req.responseText);
+}
+JsHttpRequest._tmp(id);
+JsHttpRequest._tmp=null;
+};
+xr.open(this.method,this.url,true,this.username,this.password);
+if(_40){
+for(var i=0;i<req._reqHeaders.length;i++){
+xr.setRequestHeader(req._reqHeaders[i][0],req._reqHeaders[i][1]);
+}
+xr.setRequestHeader("Content-Type","application/octet-stream");
+}
+xr.send(this.queryText);
+this.span=null;
+this.xr=xr;
+return null;
+};
+this.getAllResponseHeaders=function(){
+return this.xr.getAllResponseHeaders();
+};
+this.getResponseHeader=function(_43){
+return this.xr.getResponseHeader(_43);
+};
+this.abort=function(){
+this.xr.abort();
+this.xr=null;
+};
+}};
+JsHttpRequest.LOADERS.script={loader:function(req){
+JsHttpRequest.extend(req._errors,{script_only_get:"Cannot use SCRIPT loader: it supports only GET method",script_no_form:"Cannot use SCRIPT loader: direct form elements using and uploading are not implemented"});
+this.load=function(){
+if(this.queryText){
+this.url+=(this.url.indexOf("?")>=0?"&":"?")+this.queryText;
+}
+this.url+=(this.url.indexOf("?")>=0?"&":"?")+"JsHttpRequest="+this.id+"-"+"script";
+this.queryText="";
+if(!this.method){
+this.method="GET";
+}
+if(this.method!=="GET"){
+return ["script_only_get"];
+}
+if(this.queryElem.length){
+return ["script_no_form"];
+}
+if(this.url.length>JsHttpRequest.MAX_URL_LEN){
+return ["url_too_long",JsHttpRequest.MAX_URL_LEN];
+}
+var th=this,d=document,s=null,b=d.body;
+if(!window.opera){
+this.span=s=d.createElement("SCRIPT");
+var _49=function(){
+s.language="JavaScript";
+if(s.setAttribute){
+s.setAttribute("src",th.url);
+}else{
+s.src=th.url;
+}
+b.insertBefore(s,b.lastChild);
+};
+}else{
+this.span=s=d.createElement("SPAN");
+s.style.display="none";
+b.insertBefore(s,b.lastChild);
+s.innerHTML="Workaround for IE.<s"+"cript></"+"script>";
+var _49=function(){
+s=s.getElementsByTagName("SCRIPT")[0];
+s.language="JavaScript";
+if(s.setAttribute){
+s.setAttribute("src",th.url);
+}else{
+s.src=th.url;
+}
+};
+}
+JsHttpRequest.setTimeout(_49,10);
+return null;
+};
+}};
+JsHttpRequest.LOADERS.form={loader:function(req){
+JsHttpRequest.extend(req._errors,{form_el_not_belong:"Element \"%\" does not belong to any form!",form_el_belong_diff:"Element \"%\" belongs to a different form. All elements must belong to the same form!",form_el_inv_enctype:"Attribute \"enctype\" of the form must be \"%\" (for IE), \"%\" given."});
+this.load=function(){
+var th=this;
+if(!th.method){
+th.method="POST";
+}
+th.url+=(th.url.indexOf("?")>=0?"&":"?")+"JsHttpRequest="+th.id+"-"+"form";
+if(th.method=="GET"){
+if(th.queryText){
+th.url+=(th.url.indexOf("?")>=0?"&":"?")+th.queryText;
+}
+if(th.url.length>JsHttpRequest.MAX_URL_LEN){
+return ["url_too_long",JsHttpRequest.MAX_URL_LEN];
+}
+var p=th.url.split("?",2);
+th.url=p[0];
+th.queryText=p[1]||"";
+}
+var _4d=null;
+var _4e=false;
+if(th.queryElem.length){
+if(th.queryElem[0].e.tagName.toUpperCase()=="FORM"){
+_4d=th.queryElem[0].e;
+_4e=true;
+th.queryElem=[];
+}else{
+_4d=th.queryElem[0].e.form;
+for(var i=0;i<th.queryElem.length;i++){
+var e=th.queryElem[i].e;
+if(!e.form){
+return ["form_el_not_belong",e.name];
+}
+if(e.form!=_4d){
+return ["form_el_belong_diff",e.name];
+}
+}
+}
+if(th.method=="POST"){
+var _51="multipart/form-data";
+var _52=(_4d.attributes.encType&&_4d.attributes.encType.nodeValue)||(_4d.attributes.enctype&&_4d.attributes.enctype.value)||_4d.enctype;
+if(_52!=_51){
+return ["form_el_inv_enctype",_51,_52];
+}
+}
+}
+var d=_4d&&(_4d.ownerDocument||_4d.document)||document;
+var _54="jshr_i_"+th.id;
+var s=th.span=d.createElement("DIV");
+s.style.position="absolute";
+s.style.display="none";
+s.style.visibility="hidden";
+s.innerHTML=(_4d?"":"<form"+(th.method=="POST"?" enctype=\"multipart/form-data\" method=\"post\"":"")+"></form>")+"<iframe name=\""+_54+"\" id=\""+_54+"\" style=\"width:0px; height:0px; overflow:hidden; border:none\"></iframe>";
+if(!_4d){
+_4d=th.span.firstChild;
+}
+d.body.insertBefore(s,d.body.lastChild);
+var _56=function(e,_58){
+var sv=[];
+var _5a=e;
+if(e.mergeAttributes){
+var _5a=d.createElement("form");
+_5a.mergeAttributes(e,false);
+}
+for(var i=0;i<_58.length;i++){
+var k=_58[i][0],v=_58[i][1];
+sv[sv.length]=[k,_5a.getAttribute(k)];
+_5a.setAttribute(k,v);
+}
+if(e.mergeAttributes){
+e.mergeAttributes(_5a,false);
+}
+return sv;
+};
+var _5e=function(){
+top.JsHttpRequestGlobal=JsHttpRequest;
+var _5f=[];
+if(!_4e){
+for(var i=0,n=_4d.elements.length;i<n;i++){
+_5f[i]=_4d.elements[i].name;
+_4d.elements[i].name="";
+}
+}
+var qt=th.queryText.split("&");
+for(var i=qt.length-1;i>=0;i--){
+var _63=qt[i].split("=",2);
+var e=d.createElement("INPUT");
+e.type="hidden";
+e.name=unescape(_63[0]);
+e.value=_63[1]!=null?unescape(_63[1]):"";
+_4d.appendChild(e);
+}
+for(var i=0;i<th.queryElem.length;i++){
+th.queryElem[i].e.name=th.queryElem[i].name;
+}
+var sv=_56(_4d,[["action",th.url],["method",th.method],["onsubmit",null],["target",_54]]);
+_4d.submit();
+_56(_4d,sv);
+for(var i=0;i<qt.length;i++){
+_4d.lastChild.parentNode.removeChild(_4d.lastChild);
+}
+if(!_4e){
+for(var i=0,n=_4d.elements.length;i<n;i++){
+_4d.elements[i].name=_5f[i];
+}
+}
+};
+JsHttpRequest.setTimeout(_5e,100);
+return null;
+};
+}};
+

Added: syncman/trunk/www/js/getDetailForCategory.js
===================================================================
--- syncman/trunk/www/js/getDetailForCategory.js	                        (rev 0)
+++ syncman/trunk/www/js/getDetailForCategory.js	2008-04-21 09:25:34 UTC (rev 6943)
@@ -0,0 +1,25 @@
+function getDetailForCategory(category) {
+  aOnClick = document.getElementById(category + '_toggle').onclick;
+  aHref = document.getElementById(category + '_toggle').href;
+
+  document.getElementById(category + '_toggle').onclick = function onclick(event) {return false;};
+  document.getElementById(category + '_toggle').href = '#';
+  document.getElementById(category).innerHTML = "Loading..."
+  // Create new JsHttpRequest object.
+  var req = new JsHttpRequest();
+  // Code automatically called on load finishing.
+  req.onreadystatechange = function() {
+      if (req.readyState == 4) {
+          // Write debug information too (output becomes responseText).
+          document.getElementById(category).innerHTML = req.responseText;
+          document.getElementById(category + '_toggle').onclick = aOnClick;
+          document.getElementById(category + '_toggle').href = aHref;
+          category_toggle(category);
+          on_load();
+        }
+  }
+  // Prepare request object (automatically choose GET or POST).
+  req.open('GET', aHref + '&js=1', true);
+  // Send data to backend.
+  req.send( );
+}
\ No newline at end of file

Modified: syncman/trunk/www/js/main.js
===================================================================
--- syncman/trunk/www/js/main.js	2008-04-17 17:38:14 UTC (rev 6942)
+++ syncman/trunk/www/js/main.js	2008-04-21 09:25:34 UTC (rev 6943)
@@ -1,16 +1,20 @@
-jQuery(document).ready(function(){
+function on_load(){
+  jQuery(document).ready(function(){
+  
+    jQuery("tr.list:nth-child(odd)").addClass("odd");  
+    jQuery("tr.list").bind("mouseover", function(){
+            jQuery(this).find("td").css('backgroundColor','#e2e7ec');
+          });
+    jQuery("tr.list").bind("mouseout", function(){
+          if (jQuery(this).attr('class')== 'list odd') 
+            jQuery(this).find("td").css('backgroundColor','#F9F9F9');
+          else
+            jQuery(this).find("td").css('backgroundColor','#fff');
+          });
+  });
+}
 
-  jQuery("tr.list:nth-child(odd)").addClass("odd");  
-  jQuery("tr.list").bind("mouseover", function(){
-          jQuery(this).find("td").css('backgroundColor','#e2e7ec');
-         });
-  jQuery("tr.list").bind("mouseout", function(){
-        if (jQuery(this).attr('class')== 'list odd') 
-          jQuery(this).find("td").css('backgroundColor','#F9F9F9');
-        else
-          jQuery(this).find("td").css('backgroundColor','#fff');
-        });
-});
+on_load();
 
 function category_toggle (elem_selector){
   var elem = document.getElementById(elem_selector);

Modified: syncman/trunk/www/styles/main.css
===================================================================
--- syncman/trunk/www/styles/main.css	2008-04-17 17:38:14 UTC (rev 6942)
+++ syncman/trunk/www/styles/main.css	2008-04-21 09:25:34 UTC (rev 6943)
@@ -10,7 +10,9 @@
   a:hover{text-decoration:none}
   a:focus{ outline: none; }
   
-  
+  a.category{font:bold 1em "Trebuchet MS";color:#2a3f62;text-decoration:none}
+  a.project{font:bold 1em "Trebuchet MS";text-decoration:none}
+
 /*TAGS*/
   h1{font: 2.2em "Times new roman"; color:#000; margin:0;padding: 0;}
   h2{font:2.0em "Times New Roman";color:#000;margin:0;padding: 0;}
@@ -33,8 +35,8 @@
   #list td{font:1.4em "Trebuchet MS"; color:#2a3f62}
   #copyright {font:1em "Trebuchet MS";color:#fff;}
   #list .project_name {font-weight:bold;}
+  .info dt{font-weight: bold;color: grey;}
   .changed { color: red }
-  .info dt{font-weight: bold;color: grey;}
   .not_changed { color: green }
   .version {display:block;width:297px;text-align:right;position:absolute;top:67px}
 
@@ -62,7 +64,7 @@
   #list .project_name {text-align:left;}
 
   #footer {background:#2a3f62;height:74px;position:absolute;bottom:0px;width:100%;}
-    #limb {float:right;margin:15px 0 0 30px;}
+    #limb {float:right;margin:15px 0 0 30px;}
     #bit {margin: 25px 30px 0px;float:right;}
   
   



More information about the limb-svn mailing list