+ * These are the default configuration settings of this hotglue
+ * installation. Do not edit this file directly but overwrite specific
+ * variables by setting them in the user-config.inc.php file, which
+ * will not be overwritten by future updates.
+ */
+
+error_reporting(E_ALL); // see php documentation
+
+// try to include user configuration
+@include('user-config.inc.php');
+
+// otherwise fall back to these defaults
+@define('ALWAYS_PROMPT_CREATE_PAGE', false); // invoke the "create page" controller when trying to access a non-existing page even if the user is not logged in yet (otherwise they receive a 404)
+@define('AUTH_METHOD', 'none'); // can be digest, basic or none
+@define('SNAPSHOT_MAX_AGE', 60*60*24*7); // auto- revisions are automatically deleted after n seconds (zero to disable)
+@define('SNAPSHOT_MIN_AGE', 60*60); // auto- revisions are created every n seconds (zero to disable)
+@define('USE_MIN_FILES', true); // use minified files if possible (see also JQUERY define)
+// default modules
+@define('IMAGE_JPEG_QUAL', 80); // quality for jpeg resizing (0 < 100)
+@define('IMAGE_PNG_QUAL', 5); // quality for png resizing (9 < 0)
+@define('IMAGE_RESIZING', true); // resize uploaded images on the server (needs gd installed)
+@define('IMAGE_UPLOAD_RESIZE_LARGER', '120%'); // automatically resize uploaded image when larger than n% of window width or height (set to 0% to disable)
+@define('IMAGE_UPLOAD_RESIZE_TO', '80%'); // target size in n% of window width or height
+@define('OBJECT_DEFAULT_COLORS', '#61b9cf #ff00ff #ffff00'); // default colors for new objects (space-separated string)
+@define('PAGE_DEFAULT_GRID_X', 50); // default grid x spacing in px
+@define('PAGE_DEFAULT_GRID_Y', 50); // default grid y spacing in px
+@define('PAGE_GUIDES_X', ''); // show a grid line after n horizontal px (space-separated string)
+@define('PAGE_GUIDES_Y', ''); // show a grid line after n vertical px (space-separated string)
+<a class="el" href="common_8inc_8php.html">common.inc.php</a> Common hotglue infrastructure<p>
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. save a page in the cache<p>
+ <tr><td valign="top"></td><td valign="top"><em>bool</em> </td><td>$header_only only send header information this function does not return. </td></tr>
+ <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$fn filename of newly uploaded file (most likely in /tmp) </td></tr>
+ <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$page page or pagename </td></tr>
+ <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$orig_fn the original filename on the client machine (optional) </td></tr>
+ <tr><td valign="top"></td><td valign="top"><em>bool</em> </td><td>&$existed set to true if the filename returned did already exist before </td></tr>
+ </table>
+</dl>
+<dl class="return" compact><dt><b>Returns:</b></dt><dd>filename inside the shared directory or false in case of error </dd></dl>
+<a class="el" href="controller_8inc_8php.html">controller.inc.php</a> Generic dispatcher code mixed with some hotglue-specific controllers<p>
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. show a site where authenticated users can create new pages
+this might be helpful as other controller's authentication seem to be only valid for the respective directory. (e.g. having privileges in '/foo/edit' does not seem to have an effect on the parent directory or any other sibling directory.
+the function might not return (e.g. when a module calls <a class="el" href="util_8inc_8php.html#9d3ab20fc8b79fb6ab860f93600c745e">serve_file()</a>). <dl compact><dt><b>Parameters:</b></dt><dd>
+this function is similar to <a class="el" href="html_8inc_8php.html#e28d850c3c906c6884462ca89c06f59b">elem_val()</a>. <dl compact><dt><b>Parameters:</b></dt><dd>
+this function is similar to <a class="el" href="html_8inc_8php.html#ea37c451f5d55e2efbb2656e340c1dae">elem_append()</a>. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <tr><td valign="top"></td><td valign="top"><em>bool</em> </td><td>&$cache is output cachable (will only modified if $cache is true before) </td></tr>
+ </table>
+</dl>
+<dl class="return" compact><dt><b>Returns:</b></dt><dd>string html </dd></dl>
+<a class="el" href="html_8inc_8php.html">html.inc.php</a> Generic html element functions<p>
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details.
+</div>
+</div><p>
+</div>
+<hr size="1"><address style="text-align: right;"><small>Generated on Thu Dec 2 16:37:34 2010 for hotglue by
+<a class="el" href="html__parse_8inc_8php.html">html_parse.inc.php</a> Generic html parsing functions<p>
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details.
+this function decodes html's special characters except for the content (when it too is not being parsed). this function is more fragile than <a class="el" href="html__parse_8inc_8php.html#6d9c21ee610953fb5b5b64fae3f74ed3">html_parse_elem()</a> when it comes to malformatted input. <dl compact><dt><b>Parameters:</b></dt><dd>
+this function decodes html's special characters except for the content (when it too is not being parsed). this function is less fragile than <a class="el" href="html__parse_8inc_8php.html#1003b146f08aef5a3a78d75a3538a4d7">html_parse()</a> when it comes to malformatted input. <dl compact><dt><b>Parameters:</b></dt><dd>
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. log a message to file<p>
+<a class="el" href="module__download_8inc_8php.html">module_download.inc.php</a> Module for allowing to download arbitrary files that were uploaded by the user<p>
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details.
+<a class="el" href="module__glue_8inc_8php.html">module_glue.inc.php</a> Main hotglue module<p>
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. helper function for <a class="el" href="module__glue_8inc_8php.html#1dc65b69a920ac4ebc8f7c1df305060b">revisions_info()</a><p>
+delete a file in the shared directory of a page<p>
+this function only deletes the file when there are no references to it left. this is not meant to be called directly from the frontend, but modules should use it when implementing delete_object. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'pagename' is the pagename (i.e. page) key 'file' filename of file in the shared directory key 'max_cnt' delete the file if there are <= max_cnt references (defaults to zero) </td></tr>
+ </table>
+</dl>
+<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response true if the file got deleted for good, false if not </dd></dl>
+ <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'name' is the object name (i.e. page.rev.obj) </td></tr>
+ </table>
+</dl>
+<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response key 'data' either has the target as object name, an empty string if the target is outside the content directory or false if the object is no symlink </dd></dl>
+ <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'name' is the object name (i.e. page.rev.obj) key 'attr' is either a string or an array containing the attribute names (keys) to remove </td></tr>
+the function also appends the resulting string to the output in <a class="el" href="html_8inc_8php.html">html.inc.php</a>. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments string 'name' is the object name (i.e. page.rev.obj) bool 'edit' are we editing or not </td></tr>
+ </table>
+</dl>
+<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response html </dd></dl>
+the function also appends the resulting string to the output in <a class="el" href="html_8inc_8php.html">html.inc.php</a>. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'page' is the page (i.e. page.rev) key 'edit' are we editing or not </td></tr>
+ </table>
+</dl>
+<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response html </dd></dl>
+ <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'pagename' is the pagename (i.e. page) key 'sort' can be either 'time' (descending) or 'name' (ascending, the default) </td></tr>
+use <a class="el" href="module__glue_8inc_8php.html#4aed316adcde13b40c9fc1b35e6537a4">update_object()</a> whenever possible as we want to preserve any object metadata that is stored in as attributes. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'name' is the object name (i.e. page.rev.obj) key 'content' is the object's content all other key/value pairs are treated as attributes </td></tr>
+ <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'page' page to shapshot (i.e. page.rev) key 'rev' (optional) new revision name (i.e. rev2) (if empty or not set a revision starting with 'auto-' and the current date will be created) </td></tr>
+ </table>
+</dl>
+<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response (holding the page of the newly created revision if successful) </dd></dl>
+this function merges the attributes in $args with the object already on disk. the object need not exist before, though. this function takes the object lock. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'name' is the object name (i.e. page.rev.obj) key 'content' is the object's content all other key/value pairs are treated as attributes </td></tr>
+ <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'pagename' is the pagename (i.e. page) key 'file' filename of file in the shared directory key 'stop_after' n references </td></tr>
+ </table>
+</dl>
+<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response array of objects (i.e. page.rev.obj) </dd></dl>
+
+</div>
+</div><p>
+</div>
+<hr size="1"><address style="text-align: right;"><small>Generated on Thu Dec 2 16:37:34 2010 for hotglue by
+<a class="el" href="module__iframe_8inc_8php.html">module_iframe.inc.php</a> Module for embedding iframe elements<p>
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details.
+<a class="el" href="module__image_8inc_8php.html">module_image.inc.php</a> Module for displaying images uploaded by the user<p>
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. return if GD image functions are available<p>
+this function drops the reference to any currently resized version, saves the resized image together with the original image in the page's shared folder and updates the object file to use the resized version. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'name' name of the objects key 'width' width in px key 'height' height in px </td></tr>
+ </table>
+</dl>
+<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response true if the client is advised to reload the image, false if not </dd></dl>
+<a class="el" href="module__object_8inc_8php.html">module_object.inc.php</a> Module for handling general object properties<p>
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details.
+<a class="el" href="module__page_8inc_8php.html">module_page.inc.php</a> Module for managing pages<p>
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details.
+<a class="el" href="module__page__browser_8inc_8php.html">module_page_browser.inc.php</a> Module for listing and managing all available pages<p>
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details.
+<a class="el" href="module__revisions__browser_8inc_8php.html">module_revisions_browser.inc.php</a> Module for browsing through revisions of a page<p>
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details.
+<a class="el" href="module__text_8inc_8php.html">module_text.inc.php</a> Module for placing text elements on a page<p>
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details.
+<a class="el" href="module__video_8inc_8php.html">module_video.inc.php</a> Module for embedding video elements on a page<p>
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details.
+ <td class="memname">if (!isset($hooks)) if (!isset($modules)) if (!isset($services)) get_hooks </td>
+ <td>(</td>
+ <td class="paramname"> </td>
+ <td> ) </td>
+ <td></td>
+ </tr>
+ </table>
+</div>
+<div class="memdoc">
+
+<p>
+<a class="el" href="modules_8inc_8php.html">modules.inc.php</a> Generic modules and services infrastructure<p>
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. get an array of all currently registered hooks<p>
+call <a class="el" href="modules_8inc_8php.html#23f8be02dc2148a3c860119a1d6ea276">load_modules()</a> before calling this function. <dl compact><dt><b>Parameters:</b></dt><dd>
+this function is for information purposes only. you can also use a hook without registering it here. this is not recommended though. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <tr><td valign="top"></td><td valign="top"><em>mixed</em> </td><td>$data (payload) data (should be the error-message if $error is true) </td></tr>
+ <tr><td valign="top"></td><td valign="top"><em>mixed</em> </td><td>$error error core or true if an error occurred </td></tr>
+this function checks the arguments in $args against the (optional) declaration given in <a class="el" href="modules_8inc_8php.html#e6ed600fb2ce39a4b0837bbb01fe8d6e">register_service()</a>. <dl compact><dt><b>Parameters:</b></dt><dd>
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. convert an associative array to a javascript block<p>
+ <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$users array of possible users (usernames as keys, password as values) </td></tr>
+ <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$realm realm (e.g. name of the site) </td></tr>
+\hyperlink{common_8inc_8php}{common.inc.php} Common hotglue infrastructure
+
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. save a page in the cache
+move an uploaded file to the shared directory of a page
+
+this function reuses existing files when possible. \begin{Desc}
+\item[Parameters:]
+\begin{description}
+\item[{\em string}]\$fn filename of newly uploaded file (most likely in /tmp) \item[{\em string}]\$page page or pagename \item[{\em string}]\$orig\_\-fn the original filename on the client machine (optional) \item[{\em bool}]\&\$existed set to true if the filename returned did already exist before \end{description}
+\end{Desc}
+\begin{Desc}
+\item[Returns:]filename inside the shared directory or false in case of error \end{Desc}
+\hyperlink{controller_8inc_8php}{controller.inc.php} Generic dispatcher code mixed with some hotglue-specific controllers
+
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. show a site where authenticated users can create new pages \hypertarget{controller_8inc_8php_e9c67435a37f4b70d0769079c9dbf379}{
+this might be helpful as other controller's authentication seem to be only valid for the respective directory. (e.g. having privileges in '/foo/edit' does not seem to have an effect on the parent directory or any other sibling directory. \hypertarget{controller_8inc_8php_d135971740244b9e81718d4cd0407b11}{
+\item[{\em string}]\$arg0 first argument of query to match ($\ast$ for wildcard) \item[{\em string}]\$arg1 second argument of query to match ($\ast$ for widcard) \item[{\em string}]\$func function name \item[{\em array}]\$args optional arguments \end{description}
+\item[{\em array}]\&\$elem reference to an element \item[{\em string}]css property name \item[{\em mixed}]css property value (to set it; empty string to clear it) \end{description}
+this function is similar to \hyperlink{html_8inc_8php_ea37c451f5d55e2efbb2656e340c1dae}{elem\_\-append()}. \begin{Desc}
+\item[Parameters:]
+\begin{description}
+\item[{\em array}]\&\$elem reference to an element \item[{\em mixed}]\$c content (to set it, can be either a string or another element) \end{description}
+\item[{\em string}]\$url url attribute (url-encoded if necessary) \item[{\em int}]\$prio when to insert reference (0 - very early to 9 - late) \item[{\em string}]\$media media attribute (optional) \end{description}
+add a reference to a javascript file to the html header
+
+duplicate references will be removed from the output. \begin{Desc}
+\item[Parameters:]
+\begin{description}
+\item[{\em string}]\$url url attribute (url-encoded if necessary) \item[{\em int}]\$prio when to insert reference (0 - very early to 9 - late) \end{description}
+\item[{\em string}]\$code javscript code \item[{\em int}]\$prio when to insert code (0 - very early to 9 - late) \item[{\em string}]\$reason (e.g. your module) (optional) \end{description}
+\hyperlink{html_8inc_8php}{html.inc.php} Generic html element functions
+
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details.
+\hyperlink{html__parse_8inc_8php}{html\_\-parse.inc.php} Generic html parsing functions
+
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. \hypertarget{html__parse_8inc_8php_1003b146f08aef5a3a78d75a3538a4d7}{
+this function decodes html's special characters except for the content (when it too is not being parsed). this function is more fragile than \hyperlink{html__parse_8inc_8php_6d9c21ee610953fb5b5b64fae3f74ed3}{html\_\-parse\_\-elem()} when it comes to malformatted input. \begin{Desc}
+\item[Parameters:]
+\begin{description}
+\item[{\em string}]\$html input string \item[{\em bool}]\$recursive also parse children elements \end{description}
+this function decodes html's special characters except for the content (when it too is not being parsed). this function is less fragile than \hyperlink{html__parse_8inc_8php_1003b146f08aef5a3a78d75a3538a4d7}{html\_\-parse()} when it comes to malformatted input. \begin{Desc}
+\item[Parameters:]
+\begin{description}
+\item[{\em string}]\$html input string (must start and end with the element's tag) \item[{\em bool}]\$recursive also parse children elements \end{description}
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. log a message to file
+
+\begin{Desc}
+\item[Parameters:]
+\begin{description}
+\item[{\em string}]\$level can be error, warn, info or debug \item[{\em string}]\$msg message \end{description}
+\end{Desc}
+\begin{Desc}
+\item[Returns:]bool true if successful, false if not \end{Desc}
+\hyperlink{module__download_8inc_8php}{module\_\-download.inc.php} Module for allowing to download arbitrary files that were uploaded by the user
+
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. \hypertarget{module__download_8inc_8php_61a6050abc43cf71d0ca422a9240ae7c}{
+\hyperlink{module__glue_8inc_8php}{module\_\-glue.inc.php} Main hotglue module
+
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. helper function for \hyperlink{module__glue_8inc_8php_1dc65b69a920ac4ebc8f7c1df305060b}{revisions\_\-info()}
+
+\begin{Desc}
+\item[Parameters:]
+\begin{description}
+\item[{\em array}]\$a array to compare \item[{\em array}]\$b array to compare \end{description}
+this function only deletes the file when there are no references to it left. this is not meant to be called directly from the frontend, but modules should use it when implementing delete\_\-object. \begin{Desc}
+\item[Parameters:]
+\begin{description}
+\item[{\em array}]\$args arguments key 'pagename' is the pagename (i.e. page) key 'file' filename of file in the shared directory key 'max\_\-cnt' delete the file if there are $<$= max\_\-cnt references (defaults to zero) \end{description}
+\end{Desc}
+\begin{Desc}
+\item[Returns:]array response true if the file got deleted for good, false if not \end{Desc}
+\item[{\em array}]\$args arguments key 'name' is the object name (i.e. page.rev.obj) \end{description}
+\end{Desc}
+\begin{Desc}
+\item[Returns:]array response key 'data' either has the target as object name, an empty string if the target is outside the content directory or false if the object is no symlink \end{Desc}
+remove one or more attributes from an object in the content directory
+
+this function takes the object lock. \begin{Desc}
+\item[Parameters:]
+\begin{description}
+\item[{\em array}]\$args arguments key 'name' is the object name (i.e. page.rev.obj) key 'attr' is either a string or an array containing the attribute names (keys) to remove \end{description}
+return an array with informations about all revisions of a page
+
+\begin{Desc}
+\item[Parameters:]
+\begin{description}
+\item[{\em array}]\$args arguments key 'pagename' is the pagename (i.e. page) key 'sort' can be either 'time' (descending) or 'name' (ascending, the default) \end{description}
+use \hyperlink{module__glue_8inc_8php_4aed316adcde13b40c9fc1b35e6537a4}{update\_\-object()} whenever possible as we want to preserve any object metadata that is stored in as attributes. \begin{Desc}
+\item[Parameters:]
+\begin{description}
+\item[{\em array}]\$args arguments key 'name' is the object name (i.e. page.rev.obj) key 'content' is the object's content all other key/value pairs are treated as attributes \end{description}
+\item[{\em array}]\$args arguments key 'page' page to shapshot (i.e. page.rev) key 'rev' (optional) new revision name (i.e. rev2) (if empty or not set a revision starting with 'auto-' and the current date will be created) \end{description}
+\end{Desc}
+\begin{Desc}
+\item[Returns:]array response (holding the page of the newly created revision if successful) \end{Desc}
+this function merges the attributes in \$args with the object already on disk. the object need not exist before, though. this function takes the object lock. \begin{Desc}
+\item[Parameters:]
+\begin{description}
+\item[{\em array}]\$args arguments key 'name' is the object name (i.e. page.rev.obj) key 'content' is the object's content all other key/value pairs are treated as attributes \end{description}
+list all objects referencing a certain file in the shared directory
+
+\begin{Desc}
+\item[Parameters:]
+\begin{description}
+\item[{\em array}]\$args arguments key 'pagename' is the pagename (i.e. page) key 'file' filename of file in the shared directory key 'stop\_\-after' n references \end{description}
+\end{Desc}
+\begin{Desc}
+\item[Returns:]array response array of objects (i.e. page.rev.obj) \end{Desc}
+\hyperlink{module__iframe_8inc_8php}{module\_\-iframe.inc.php} Module for embedding iframe elements
+
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. \hypertarget{module__iframe_8inc_8php_40856482f79fb837bc538e8eed66aff4}{
+\hyperlink{module__image_8inc_8php}{module\_\-image.inc.php} Module for displaying images uploaded by the user
+
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. return if GD image functions are available
+this function drops the reference to any currently resized version, saves the resized image together with the original image in the page's shared folder and updates the object file to use the resized version. \begin{Desc}
+\item[Parameters:]
+\begin{description}
+\item[{\em array}]\$args arguments key 'name' name of the objects key 'width' width in px key 'height' height in px \end{description}
+\end{Desc}
+\begin{Desc}
+\item[Returns:]array response true if the client is advised to reload the image, false if not \end{Desc}
+\hyperlink{module__object_8inc_8php}{module\_\-object.inc.php} Module for handling general object properties
+
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. \hypertarget{module__object_8inc_8php_6b5bf16a15b7d5809bd7c6d15cd05a52}{
+\hyperlink{module__page_8inc_8php}{module\_\-page.inc.php} Module for managing pages
+
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. \hypertarget{module__page_8inc_8php_80aff2ea069c7a2ba120e26bb218efa5}{
+\hyperlink{module__page__browser_8inc_8php}{module\_\-page\_\-browser.inc.php} Module for listing and managing all available pages
+
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. \hypertarget{module__page__browser_8inc_8php_a94d17bbea100ee50f09c7bf4094a1db}{
+\hyperlink{module__revisions__browser_8inc_8php}{module\_\-revisions\_\-browser.inc.php} Module for browsing through revisions of a page
+
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. \hypertarget{module__revisions__browser_8inc_8php_eb482f35141c71dd933daeec9e9ce599}{
+\hyperlink{module__text_8inc_8php}{module\_\-text.inc.php} Module for placing text elements on a page
+
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. \hypertarget{module__text_8inc_8php_c57835ba072c7df9367b2c277d2f5bd7}{
+\hyperlink{module__video_8inc_8php}{module\_\-video.inc.php} Module for embedding video elements on a page
+
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. \hypertarget{module__video_8inc_8php_4d25a132251840ed2ade27b636a6694e}{
+\subsubsection[{get\_\-hooks}]{\setlength{\rightskip}{0pt plus 5cm}if (!isset(\$hooks)) if (!isset(\$modules)) if (!isset(\$services)) get\_\-hooks ()}}
+\hyperlink{modules_8inc_8php}{modules.inc.php} Generic modules and services infrastructure
+
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. get an array of all currently registered hooks
+invoke a hook with a specified module being called first
+
+this function also takes care of loading all modules. \begin{Desc}
+\item[Parameters:]
+\begin{description}
+\item[{\em string}]\$hook hook to invoke \item[{\em string}]\$first\_\-module name of first module to call \item[{\em array}]\$args arguments-array (can include references) \end{description}
+\end{Desc}
+\begin{Desc}
+\item[Returns:]array of results (module=$>$result) \end{Desc}
+invoke a hook with a specified module being called last
+
+this function also takes care of loading all modules. \begin{Desc}
+\item[Parameters:]
+\begin{description}
+\item[{\em string}]\$hook hook to invoke \item[{\em string}]\$first\_\-module name of last module to call \item[{\em array}]\$args arguments-array (can include references) \end{description}
+\end{Desc}
+\begin{Desc}
+\item[Returns:]array of results (module=$>$result) \end{Desc}
+invoke a hook while the returned result is \$while
+
+this function also takes care of loading all modules. \begin{Desc}
+\item[Parameters:]
+\begin{description}
+\item[{\em string}]\$hook hook to invoke \item[{\em mixed}]\$while value to compare the returned result with \item[{\em array}]\$args arguments-array \end{description}
+\end{Desc}
+\begin{Desc}
+\item[Returns:]array with result (module=$>$result) or empty result if there was none \end{Desc}
+use this function instead of including module\_\-$\ast$ files directly. \begin{Desc}
+\item[Parameters:]
+\begin{description}
+\item[{\em string}]\$search module to load (by default all modules are loaded) \item[{\em bool}]\$optional whether to log any error to locate the module \end{description}
+\end{Desc}
+\begin{Desc}
+\item[Returns:]bool true if successful, false if not \end{Desc}
+\item[{\em mixed}]\$data (payload) data (should be the error-message if \$error is true) \item[{\em mixed}]\$error error core or true if an error occurred \end{description}
+this function checks the arguments in \$args against the (optional) declaration given in \hyperlink{modules_8inc_8php_e6ed600fb2ce39a4b0837bbb01fe8d6e}{register\_\-service()}. \begin{Desc}
+\item[Parameters:]
+\begin{description}
+\item[{\em string}]\$service service name \item[{\em array}]\$args arguments-array \end{description}
+\end{Desc}
+\begin{Desc}
+\item[Returns:]return value of the service function or a response-array in case of an error \end{Desc}
+Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. convert an associative array to a javascript block
+\item[{\em array}]\$users array of possible users (usernames as keys, password as values) \item[{\em string}]\$realm realm (e.g. name of the site) \end{description}
+\end{Desc}
+\begin{Desc}
+\item[Return values:]
+\begin{description}
+\item[{\em 0}]authenticated \item[{\em -1}]user did not request authentication \item[{\em -2}]parts of the response are missing \item[{\em -3}]unknown username \item[{\em -4}]invalid password \end{description}
+\item[{\em string}]\$s string to operate on \item[{\em int}]\$num number of characters desired \item[{\em string}]\$chr character to pad the string with \end{description}
+ $.glue.error('Your browser is not supported. Update to a recent version of Firefox or Chrome.');
+ if (typeof options.abort == 'function') {
+ options.abort();
+ }
+ return false;
+ }
+ },
+ handle_response: function(data, x, y) {
+ if (!data) {
+ $.glue.error('There was a problem communicating with the server');
+ } else if (data['#error']) {
+ $.glue.error('There was a problem uploading the file ('+data['#data']+')');
+ } else {
+ // add new elements to the dom and register them
+ if (data['#data'].length == 0) {
+ // special case for no new elements
+ $.glue.error('The server did not reply with any object. The file type you were uploading could either not be supported (look around for more modules!) or there could be an internal problem. Check the log file to be sure!');
+ return;
+ }
+ // we're not selecting the new objects but at least clear the current selection
+e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a,
+!F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&&
+l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H<G;){if(s.apply(j[H++],v)===false)break}else if(K)for(z in j){if(s.call(j[z],
+[];return{browser:j[1]||"",version:j[2]||"0"}},browser:{}});b.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(j,s){R["[object "+s+"]"]=s.toLowerCase()});m=b.uaMatch(m);if(m.browser){b.browser[m.browser]=true;b.browser.version=m.version}if(b.browser.webkit)b.browser.safari=true;if(D)b.inArray=function(j,s){return D.call(s,j)};if(!/\s/.test("\u00a0")){k=/^[\s\xA0]+/;o=/[\s\xA0]+$/}f=b(t);if(t.addEventListener)u=function(){t.removeEventListener("DOMContentLoaded",u,
+attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&
+Y(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,d){if(c.isWindow(this))this.onbeforeunload=d},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.removeEvent=t.removeEventListener?function(a,b,d){a.removeEventListener&&a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent&&a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=
+"file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]===
+0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h<k;h++)c.event.add(this[h],d,l,e)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault)for(var d in a)this.unbind(d,
+p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g=
+d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i,
+encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess",
+if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show",
+this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide||
+this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=
+ click: { //Where the click happened, relative to the element
+ left: event.pageX - this.offset.left,
+ top: event.pageY - this.offset.top
+ },
+ parent: this._getParentOffset(),
+ relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
+ var self = $(this).data("resizable"), o = self.options;
+ if (self.ghost && self.helper) self.helper.get(0).removeChild(self.ghost.get(0));
+ }
+
+});
+
+$.ui.plugin.add("resizable", "grid", {
+
+ resize: function(event, ui) {
+ var self = $(this).data("resizable"), o = self.options, cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || event.shiftKey;
+c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&
+d(this).data("draggable").options;d(a.iframeFix===true?"iframe":a.iframeFix).each(function(){d('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")})},stop:function(){d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;
+nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var d=0;d<c.length;d++){var f=e.trim(c[d]),g=e('<div class="ui-resizable-handle '+("ui-resizable-"+f)+'"></div>');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor==
+if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a=false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(),
+ if (!empty($obj['video-file']) && !empty($obj['video-file-mime'])) {
+ elem_val($v, '<div class="video-fallback">You are not seeing the video because your browser does not support '.htmlspecialchars($obj['video-file-mime'], ENT_NOQUOTES, 'UTF-8').'. Consider using a contemporary web browser.</div>');
+ } else {
+ elem_val($v, '<div class="video-fallback">You are not seeing the video because your browser does not support it. Consider using a contemporary web browser.</div>');
+ }
+ // autoplay
+ if (!isset($obj['video-autoplay']) || $obj['video-autoplay'] == 'autoplay') {
+ // autoplay is the default
+ elem_attr($v, 'autoplay', 'autoplay');
+ } else {
+ if (VIDEO_START_ON_CLICK) {
+ elem_attr($v, 'onclick', 'this.play()');
+ }
+ }
+ // loop
+ if (!empty($obj['video-loop'])) {
+ elem_attr($v, 'loop', 'loop');
+ }
+ // controls
+ if (!empty($obj['video-controls'])) {
+ elem_attr($v, 'controls', 'controls');
+ }
+ // volume
+ if (isset($obj['video-volume']) && $obj['video-volume'] == '0') {
+ elem_attr($v, 'audio', 'muted');
+ }
+ elem_append($elem, $v);
+
+ return true;
+}
+
+
+function video_render_object($args)
+{
+ $obj = $args['obj'];
+ if (!isset($obj['type']) || $obj['type'] != 'video') {
+ // put the iframe behind some shield for editing
+ child = $('<div class="glue-iframe-shield glue-ui" style="height: 100%; position: absolute; width: 100%;" title="visitors will be able to interact with the webpage below"></div>');
+ elem = $('<img src="'+$.glue.base_url+'modules/object/object-symlink.png" alt="btn" title="make this object appear on all pages" width="32" height="32">');
+ elem = $('<img src="'+$.glue.base_url+'modules/text/text-font-size.png" alt="btn" title="drag to change font size, click to reset to default one" width="32" height="32">');
+ // TODO (later): my px to em calculation is not working perfectly, so leave this out for now
+ /*
+ var obj = $(this).data('owner');
+ if ($(obj).css('line-height').substr(-2) == 'em') {
+ $(this).attr('title', 'change line height ('+$(obj).css('line-height')+'), click to reset to default one');
+ } else if ($(obj).css('line-height').substr(-2) == 'px') {
+ $(this).attr('title', 'change line height ('+parseFloat($(obj).css('line-height'))/parseFloat($(obj).css('font-size'))+'em), click to reset to default one');
+ }
+ */
+ });
+ $(elem).bind('mousedown', function(e) {
+ var obj = $(this).data('owner');
+ // jquery seems to always return line-height in px
+ // but just in case, try to handle em as well
+ // assume px for font-size
+ var font_size = parseFloat($(obj).css('font-size'));
+ if ($(obj).css('line-height').substr(-2) == 'em') {
+ var orig_val = parseFloat($(obj).css('line-height'))*font_size;
+ } else if ($(obj).css('line-height').substr(-2) == 'px') {
+ var orig_val = parseFloat($(obj).css('line-height'));
+ if ($(obj).css('line-height').substr(-2) == 'em') {
+ $(that).attr('title', 'change line height ('+$(obj).css('line-height')+'), click to reset to default one');
+ } else if ($(obj).css('line-height').substr(-2) == 'px') {
+ $(that).attr('title', 'change line height ('+parseFloat($(obj).css('line-height'))/parseFloat($(obj).css('font-size'))+'em), click to reset to default one');
+ // TODO (later): my px to em calculation is not working perfectly, so leave this out for now
+ /*
+ var obj = $(this).data('owner');
+ if ($(obj).css('letter-spacing').substr(-2) == 'em') {
+ $(this).attr('title', 'change letter spacing ('+$(obj).css('letter-spacing')+'), click to reset to default one');
+ } else if ($(obj).css('letter-spacing').substr(-2) == 'px') {
+ $(this).attr('title', 'change letter spacing ('+parseFloat($(obj).css('letter-spacing'))/parseFloat($(obj).css('font-size'))+'em), click to reset to default one');
+ }
+ */
+ });
+ $(elem).bind('mousedown', function(e) {
+ var obj = $(this).data('owner');
+ // jquery seems to always return letter-spacing in px
+ // but just in case, try to handle em as well
+ // assume px for font-size
+ var font_size = parseFloat($(obj).css('font-size'));
+ if ($(obj).css('letter-spacing').substr(-2) == 'em') {
+ var orig_val = parseFloat($(obj).css('letter-spacing'))*font_size;
+ } else if ($(obj).css('letter-spacing').substr(-2) == 'px') {
+ var orig_val = parseFloat($(obj).css('letter-spacing'));
+ if ($(obj).css('letter-spacing').substr(-2) == 'em') {
+ $(that).attr('title', 'change letter spacing ('+$(obj).css('letter-spacing')+'), click to reset to default one');
+ } else if ($(obj).css('letter-spacing').substr(-2) == 'px') {
+ $(that).attr('title', 'change letter spacing ('+parseFloat($(obj).css('letter-spacing'))/parseFloat($(obj).css('font-size'))+'em), click to reset to default one');
+ // TODO (later): my px to em calculation is not working perfectly, so leave this out for now
+ /*
+ var obj = $(this).data('owner');
+ if ($(obj).css('word-spacing').substr(-2) == 'em') {
+ $(this).attr('title', 'change word spacing ('+$(obj).css('word-spacing')+'), click to reset to default one');
+ } else if ($(obj).css('word-spacing').substr(-2) == 'px') {
+ $(this).attr('title', 'change word spacing ('+parseFloat($(obj).css('word-spacing'))/parseFloat($(obj).css('font-size'))+'em), click to reset to default one');
+ }
+ */
+ });
+ $(elem).bind('mousedown', function(e) {
+ var obj = $(this).data('owner');
+ // jquery seems to always return word-spacing in px
+ // but just in case, try to handle em as well
+ // assume px for font-size
+ var font_size = parseFloat($(obj).css('font-size'));
+ if ($(obj).css('word-spacing').substr(-2) == 'em') {
+ var orig_val = parseFloat($(obj).css('word-spacing'))*font_size;
+ } else if ($(obj).css('word-spacing').substr(-2) == 'px') {
+ var orig_val = parseFloat($(obj).css('word-spacing'));
+ if ($(obj).css('word-spacing').substr(-2) == 'em') {
+ $(that).attr('title', 'change word spacing ('+$(obj).css('word-spacing')+'), click to reset to default one');
+ } else if ($(obj).css('word-spacing').substr(-2) == 'px') {
+ $(that).attr('title', 'change word spacing ('+parseFloat($(obj).css('word-spacing'))/parseFloat($(obj).css('font-size'))+'em), click to reset to default one');