phpslash-commit Mailing List for phpSlash (Page 31)
Brought to you by:
joestewart,
nhruby
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(11) |
Nov
(59) |
Dec
(60) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(52) |
Feb
(77) |
Mar
(118) |
Apr
(76) |
May
(106) |
Jun
(145) |
Jul
(9) |
Aug
(15) |
Sep
(78) |
Oct
(83) |
Nov
(105) |
Dec
(51) |
2003 |
Jan
(105) |
Feb
(100) |
Mar
(111) |
Apr
(149) |
May
(95) |
Jun
(56) |
Jul
(8) |
Aug
(2) |
Sep
|
Oct
(22) |
Nov
(117) |
Dec
(6) |
2004 |
Jan
(1) |
Feb
|
Mar
(3) |
Apr
(25) |
May
|
Jun
(11) |
Jul
(26) |
Aug
(85) |
Sep
(119) |
Oct
(312) |
Nov
(271) |
Dec
(5) |
2005 |
Jan
(6) |
Feb
|
Mar
|
Apr
(12) |
May
(7) |
Jun
(8) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Joe S. <joe...@us...> - 2004-08-30 15:28:00
|
Update of /cvsroot/phpslash/phpslash-dev/public_html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21355/phpslash-dev/public_html Modified Files: login.php Log Message: fix for [ 980974 ] Login Block Error Index: login.php =================================================================== RCS file: /cvsroot/phpslash/phpslash-dev/public_html/login.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** login.php 10 Nov 2003 19:33:59 -0000 1.3 --- login.php 30 Aug 2004 15:27:50 -0000 1.4 *************** *** 44,54 **** $HTTP_GET_VARS['logout'] = ''; } ! /* ! // old kludge for phplib to accept login from an external form such as the login block. Will be removed. jvs - 02/18/2003 if(isset($HTTP_POST_VARS['username'])) { // this would be present if a login is in progress $auth->auth["uid"]= "form"; // this is what auth seems to want $auth->start(); } ! */ $auth->login_if(!$perm->have_perm('user')); --- 44,55 ---- $HTTP_GET_VARS['logout'] = ''; } ! ! // old kludge for phplib to accept login from an external form such as the login block. Will be removed. jvs - 02/18/2003 - ! // If new auth had replaced existing phplib auth. 08/30/2004 if(isset($HTTP_POST_VARS['username'])) { // this would be present if a login is in progress $auth->auth["uid"]= "form"; // this is what auth seems to want $auth->start(); } ! $auth->login_if(!$perm->have_perm('user')); |
From: Joe S. <joe...@us...> - 2004-08-30 15:28:00
|
Update of /cvsroot/phpslash/phpslash-dev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21355/phpslash-dev Modified Files: CHANGES Log Message: fix for [ 980974 ] Login Block Error Index: CHANGES =================================================================== RCS file: /cvsroot/phpslash/phpslash-dev/CHANGES,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** CHANGES 28 Aug 2004 20:26:43 -0000 1.82 --- CHANGES 30 Aug 2004 15:27:48 -0000 1.83 *************** *** 13,16 **** --- 13,20 ---- 9 - Removal of something (kill -9 :) + 2004-August 30 Joe Stewart <joe...@us...> + [B] - login.php - uncommented kludge for login block. It was commented out on the + bad assumption that phplib would be changing the auth class. + 2004-August 28 Joe Stewart <joe...@us...> [E] - db_xfer.php.disabled, Block.class - rough upgrade script. Depends on |
From: Joe S. <joe...@us...> - 2004-08-29 12:01:47
|
Update of /cvsroot/phpslash/phpslash-dev/contrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11793/phpslash-dev/contrib Modified Files: db_xfer.php.disabled Log Message: admin header block Index: db_xfer.php.disabled =================================================================== RCS file: /cvsroot/phpslash/phpslash-dev/contrib/db_xfer.php.disabled,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** db_xfer.php.disabled 28 Aug 2004 20:26:43 -0000 1.1 --- db_xfer.php.disabled 29 Aug 2004 12:01:39 -0000 1.2 *************** *** 293,297 **** $section_id_ary = array(); $section_id_ary[] = $section->getId("About"); ! $section_id_ary[] = $section->getId("Admin"); $section_id_ary[] = $section->getId("features"); $section_id_ary[] = $section->getId("Glossary"); --- 293,297 ---- $section_id_ary = array(); $section_id_ary[] = $section->getId("About"); ! // $section_id_ary[] = $section->getId("Admin"); $section_id_ary[] = $section->getId("features"); $section_id_ary[] = $section->getId("Glossary"); *************** *** 309,312 **** --- 309,345 ---- $optionname[0] = "column"; $optionname[1] = "width"; + $optionname[2] = "box_type"; + // $optionname[3] = "tpl"; + + $optionval[0] = "top"; + $optionval[1] = "100%"; + $optionval[2] = "contentonly"; + // $optionval[3] = "slashHead-htmlarea3"; + + $ary['optionname'] = $optionname; + $ary['optionval'] = $optionval; + + $block->putBlock($ary); + $content .= getMessage($block->message); + + // Add the "Admin Page header" block + $content .= getMessage("Adding Admin Page Header Block"); + $db->query("SELECT id FROM psl_block_type where name = 'header'"); + $db->next_record(); + $ary['block_type'] = $db->Record['id']; + $ary['expire_length'] = ''; + $ary['block_title'] = 'Page - admin - header'; + $ary['location'] = ''; + $ary['source_url'] = ''; + $ary['cache_data'] = ''; + $ary['ordernum'] = '95'; + + $section_id_ary = array(); + $section_id_ary[] = $section->getId("Admin"); + + $ary['section_id_ary'] = $section_id_ary; + + $optionname[0] = "column"; + $optionname[1] = "width"; $optionname[2] = "tpl"; $optionname[3] = "box_type"; *************** *** 322,326 **** $block->putBlock($ary); $content .= getMessage($block->message); ! // Add the "Public Page footer" block $content .= getMessage("Adding Public Page Footer Block"); --- 355,359 ---- $block->putBlock($ary); $content .= getMessage($block->message); ! // Add the "Public Page footer" block $content .= getMessage("Adding Public Page Footer Block"); |
From: Joe S. <joe...@us...> - 2004-08-28 20:26:52
|
Update of /cvsroot/phpslash/phpslash-dev/include/modules/block In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6935/phpslash-dev/include/modules/block Modified Files: Block.class Log Message: rough upgrade script. Index: Block.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-dev/include/modules/block/Block.class,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Block.class 27 Aug 2004 17:14:56 -0000 1.9 --- Block.class 28 Aug 2004 20:26:43 -0000 1.10 *************** *** 376,380 **** // $this->message .= "Here's a preview...<br>\n"; logwrite("Block Addition", "Added block " . $block_array['block_id']); ! $this->message .= $this->doBlock($block_array["block_id"]); } else { $this->message .= pslgetText("Error adding block. Query returned multiple results."); --- 376,381 ---- // $this->message .= "Here's a preview...<br>\n"; logwrite("Block Addition", "Added block " . $block_array['block_id']); ! // $this->message .= $this->doBlock($block_array["block_id"]); ! $this->message .= $block_array["block_id"] ." block added"; } else { $this->message .= pslgetText("Error adding block. Query returned multiple results."); |
From: Joe S. <joe...@us...> - 2004-08-28 20:26:52
|
Update of /cvsroot/phpslash/phpslash-dev/contrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6935/phpslash-dev/contrib Added Files: db_xfer.php.disabled Log Message: rough upgrade script. --- NEW FILE: db_xfer.php.disabled --- <?php // $Id: dbxfer.php /* * Script to migrate a PHPSlash database from v 0.65 to 0.7. * See function usage() for help. * * NOTES/TO-DOs: * */ // don't cache this page $cachetimeout=-1; require("config.php"); AddClassRequirement("section",$_PSL['moduledir'] ."/section/Section.class"); AddClassRequirement("block",$_PSL['moduledir'] ."/". $_PSL['module']['Block'] ."/Block.class"); AddClassRequirement("block_i","block"); [...1016 lines suppressed...] // echo "xfer_authors<br>"; $content .= xfer_authors(); break; default: $content .= usage(); $content .= showlist(); break; } } if ( count($do_this) > 0 ) { $content .= "<a href=\"$PHP_SELF\"> Back to Migration Options </a><br>"; } $content .= getFooter(); echo $content; ?> |
From: Joe S. <joe...@us...> - 2004-08-28 20:26:51
|
Update of /cvsroot/phpslash/phpslash-dev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6935/phpslash-dev Modified Files: CHANGES Log Message: rough upgrade script. Index: CHANGES =================================================================== RCS file: /cvsroot/phpslash/phpslash-dev/CHANGES,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** CHANGES 27 Aug 2004 17:14:55 -0000 1.81 --- CHANGES 28 Aug 2004 20:26:43 -0000 1.82 *************** *** 13,16 **** --- 13,21 ---- 9 - Removal of something (kill -9 :) + 2004-August 28 Joe Stewart <joe...@us...> + [E] - db_xfer.php.disabled, Block.class - rough upgrade script. Depends on + correctly configured config.ini.php/config.php. There will + updates to the db that this script doesn't do yet. + 2004-August 27 Joe Stewart <joe...@us...> [W] - Block.class, Block_i.class - Ian Clydsdale's change to the block title |
From: Joe S. <joe...@us...> - 2004-08-27 17:19:45
|
Update of /cvsroot/phpslash/phpslash-skins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20624/phpslash-skins Modified Files: CHANGES Log Message: no border for topic image. Index: CHANGES =================================================================== RCS file: /cvsroot/phpslash/phpslash-skins/CHANGES,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** CHANGES 23 Aug 2004 16:50:46 -0000 1.12 --- CHANGES 27 Aug 2004 17:19:35 -0000 1.13 *************** *** 13,16 **** --- 13,19 ---- 9 - Removal of something (kill -9 :) + 2004-August 27 Joe Stewart <joe...@us...> + [T] - ShankZen/story.tpl - no border for topic image. + 2004-August 23 Joe Stewart <joe...@us...> [FT] - Upgraded htmlarea3 to have Image Manager upload. |
From: Joe S. <joe...@us...> - 2004-08-27 17:19:35
|
Update of /cvsroot/phpslash/phpslash-skins/include/templates/en/ShankZen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20576/phpslash-skins/include/templates/en/ShankZen Modified Files: story.tpl Log Message: no border for topic image. Index: story.tpl =================================================================== RCS file: /cvsroot/phpslash/phpslash-skins/include/templates/en/ShankZen/story.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** story.tpl 8 Apr 2003 21:12:33 -0000 1.1 --- story.tpl 27 Aug 2004 17:19:26 -0000 1.2 *************** *** 4,8 **** <span class="psl-additional"> <h5>Topics</h5> ! <a href="{ROOTDIR}/search.php3?topic_id={TOPIC_ID}"><img src="{IMAGEDIR}/topics/{TOPICIMAGE}" width="{TOPICWIDTH}" height="{TOPICHEIGHT}" title="{ALTTEXT}" hspace="0" vspace="10" /></a><br /> <!-- BEGIN alsotext --> <hr /> --- 4,8 ---- <span class="psl-additional"> <h5>Topics</h5> ! <a href="{ROOTDIR}/search.php?topic_id={TOPIC_ID}"><img src="{IMAGEDIR}/topics/{TOPICIMAGE}" border="0" width="{TOPICWIDTH}" height="{TOPICHEIGHT}" title="{ALTTEXT}" hspace="0" vspace="10" /></a><br /> <!-- BEGIN alsotext --> <hr /> |
From: Joe S. <joe...@us...> - 2004-08-27 17:15:11
|
Update of /cvsroot/phpslash/phpslash-dev/include/modules/block In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19685/phpslash-dev/include/modules/block Modified Files: Block.class Block_i.class Log Message: Replace preg with faster code in title substitution Index: Block.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-dev/include/modules/block/Block.class,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Block.class 13 Nov 2003 12:16:50 -0000 1.8 --- Block.class 27 Aug 2004 17:14:56 -0000 1.9 *************** *** 444,459 **** // Check to see if we have a dynamic title(like the calendar) ! #if (strlen($temptitle) < 1 || $temptitle[0] == "%") { ! # // Get the dynamic title from the parser for this block ! # $this->getParser($this->block_info["type"]); ! # $temptitle = $this->parser->getTitle(); ! #} ! ! if (preg_match("/\%\%/",$temptitle)) { // Get the dynamic title from the parser for this block ! $this->getParser($this->block_info["type"]); ! $temptitle = preg_replace("/\%\%/", $this->parser->getTitle(), $temptitle); ! } if ($this->block_info["location"]) { $link = $this->block_info["location"]; --- 444,457 ---- // Check to see if we have a dynamic title(like the calendar) ! // PERFORMANCE: remove preg_match, preg_replace where possible ! // if (preg_match("/\%\%/", $temptitle)) { ! if(!empty($temptitle) && strpos('%%',$temptitle)!==FALSE) { // Get the dynamic title from the parser for this block ! $this->getParser($this->block_info['type']); ! // $temptitle = preg_replace("/\%\%/", $this->parser->getTitle(), $temptitle); ! $temptitle = str_replace('%%', $this->parser->getTitle(), $temptitle); + } + if ($this->block_info["location"]) { $link = $this->block_info["location"]; Index: Block_i.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-dev/include/modules/block/Block_i.class,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Block_i.class 13 Nov 2003 12:16:50 -0000 1.3 --- Block_i.class 27 Aug 2004 17:14:57 -0000 1.4 *************** *** 112,119 **** // Check to see if we have a dynamic title(like the calendar) ! if (preg_match("/\%\%/",$temptitle)) { // Get the dynamic title from the parser for this block ! $this->getParser($ary["type"]); ! $temptitle = preg_replace("/\%\%/", $this->parser->getTitle(), $temptitle); } --- 112,121 ---- // Check to see if we have a dynamic title(like the calendar) ! // replacing preg_match with strpos is a massive speed improvement for ! // sites with huge numbers of blocks, like CUPE ! if(@strpos("%%",$temptitle)!==FALSE) { // Get the dynamic title from the parser for this block ! $this->getParser($ary['type']); ! $temptitle = str_replace("%%", $this->parser->getTitle(), $temptitle); } |
From: Joe S. <joe...@us...> - 2004-08-27 17:15:11
|
Update of /cvsroot/phpslash/phpslash-dev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19685/phpslash-dev Modified Files: CHANGES Log Message: Replace preg with faster code in title substitution Index: CHANGES =================================================================== RCS file: /cvsroot/phpslash/phpslash-dev/CHANGES,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** CHANGES 23 Aug 2004 16:29:03 -0000 1.80 --- CHANGES 27 Aug 2004 17:14:55 -0000 1.81 *************** *** 13,16 **** --- 13,20 ---- 9 - Removal of something (kill -9 :) + 2004-August 27 Joe Stewart <joe...@us...> + [W] - Block.class, Block_i.class - Ian Clydsdale's change to the block title + substitution. + 2004-August 23 Joe Stewart <joe...@us...> [FT] - htmlarea3, slashHead-htmlarea3.tpl, storyNew.tpl, config.php - Upgraded |
From: Luis M <le...@us...> - 2004-08-23 22:19:36
|
Update of /cvsroot/phpslash/phpslash-dev/include/templates/en/basic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29806 Modified Files: slashHead-htmlarea3.tpl Log Message: removed ugly DOS CR's from endlines Index: slashHead-htmlarea3.tpl =================================================================== RCS file: /cvsroot/phpslash/phpslash-dev/include/templates/en/basic/slashHead-htmlarea3.tpl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** slashHead-htmlarea3.tpl 23 Aug 2004 16:29:03 -0000 1.3 --- slashHead-htmlarea3.tpl 23 Aug 2004 22:19:23 -0000 1.4 *************** *** 1,255 **** ! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> ! <!-- START slashHead.tpl --> ! ! <html> ! <head> ! <title>{SITE_NAME} - {SECTION} {SITETITLE}</title> ! <!-- Enter Your Desired META Tags Below Here --> ! <!-- This Meta Tag is Defined In Each Page By Setting The Variable ! $xsiteobject = "HomePage"; to the page type HomePage, Glossary, ! Info, etc.. --> ! <meta name="object" content="{XSITEOBJECT}" /> ! <!-- Enter Your META Tags Above Here --> ! <!-- BEGIN each_metatag --> ! <meta name="{METANAME}" content="{METADESCRIPTION}" /> ! <!-- END each_metatag --> ! <link rel="alternate" type="application/rss+xml" title="RSS" href="{ROOTDIR}/backend.php" /> ! <link rel="stylesheet" type="text/css" href="{ROOTDIR}/styles/{SKIN}.css" /> ! <!-- BEGIN HTMLAREA3 Javascript --> ! ! ! <script type="text/javascript"> ! // the _editor_url is REQUIRED! don't forget to set it. ! _editor_url="{ROOTDIR}/scripts/htmlarea3/"; ! // implicit language will be "en", but let's set it for brevity ! _editor_lang = "en"; ! </script> ! <script type="text/javascript" src="{ROOTDIR}/scripts/htmlarea3/htmlarea.js"></script> ! ! <!-- load the plugins --> ! <script type="text/javascript"> ! // WARNING: using this interface to load plugin ! // will _NOT_ work if plugins do not have the language ! // loaded by HTMLArea. ! ! // In other words, this function generates SCRIPT tags ! // that load the plugin and the language file, based on the ! // global variable HTMLArea.I18N.lang (defined in the lang file, ! // in our case "lang/en.js" loaded above). ! ! // If this lang file is not found the plugin will fail to ! // load correctly and nothing will work. ! ! HTMLArea.loadPlugin("TableOperations"); ! // HTMLArea.loadPlugin("SpellChecker"); ! // HTMLArea.loadPlugin("FullPage"); ! // HTMLArea.loadPlugin("CSS"); ! HTMLArea.loadPlugin("ContextMenu"); ! // HTMLArea.loadPlugin("HtmlTidy"); ! // HTMLArea.loadPlugin("ListType"); ! HTMLArea.loadPlugin("ImageManager"); ! ! </script> ! ! <script type="text/javascript"> ! // this function will get called at body.onload ! function initEditor() { ! // cache these values as we need to pass it for both editors ! var css_plugin_args = { ! combos : [ ! { label: "Syntax", ! // menu text // CSS class ! options: { "None" : "", ! "Code" : "code", ! "String" : "string", ! "Comment" : "comment", ! "Variable name" : "variable-name", ! "Type" : "type", ! "Reference" : "reference", ! "Preprocessor" : "preprocessor", ! "Keyword" : "keyword", ! "Function name" : "function-name", ! "Html tag" : "html-tag", ! "Html italic" : "html-helper-italic", ! "Warning" : "warning", ! "Html bold" : "html-helper-bold" ! }, ! context: "pre" ! }, ! { label: "Info", ! options: { "None" : "", ! "Quote" : "quote", ! "Highlight" : "highlight", ! "Deprecated" : "deprecated" ! } ! } ! ] ! }; ! ! ! ! ! ! ! ! //--------------------------------------------------------------------- ! // GENERAL PATTERN ! // ! // 1. Instantitate an editor object. ! // 2. Register plugins (note, it's required to have them loaded). ! // 3. Configure any other items in editor.config. ! // 4. generate() the editor ! // ! // The above are steps that you use to create one editor. Nothing new ! // so far. In order to create more than one editor, you just have to ! // repeat those steps for each of one. Of course, you can register any ! // plugins you want (no need to register the same plugins for all ! // editors, and to demonstrate that we'll skip the TableOperations ! // plugin for the second editor). Just be careful to pass different ! // ID-s in the constructor (you don't want to _even try_ to create more ! // editors for the same TEXTAREA element ;-)). ! // ! // So much for the noise, see the action below. ! ! //--------------------------------------------------------------------- ! ! ! ! //--------------------------------------------------------------------- ! // CREATE FIRST EDITOR ! // ! var editor1 = new HTMLArea("intro_text"); ! ! // plugins must be registered _per editor_. Therefore, we register ! // plugins for the first editor here, and we will also do this for the ! // second editor. ! editor1.registerPlugin(TableOperations); ! // editor1.registerPlugin(SpellChecker); ! // editor1.registerPlugin(CSS, css_plugin_args); ! // editor1.registerPlugin(HtmlTidy); ! // editor1.registerPlugin(ListType); ! editor1.registerPlugin(ContextMenu); ! editor1.registerPlugin(ImageManager); ! ! // custom config must be done per editor. Here we're importing the ! // stylesheet used by the CSS plugin. ! // editor1.config.pageStyle = "@import url(custom.css);"; ! ! // generate first editor ! editor1.config.hideSomeButtons(" fontname fontsize formatblock "); ! editor1.generate(); ! ! //--------------------------------------------------------------------- ! ! ! ! //--------------------------------------------------------------------- ! // CREATE SECOND EDITOR ! // ! var editor2 = new HTMLArea("body_text"); ! ! // we are using the same plugins ! editor2.registerPlugin(TableOperations); ! // editor2.registerPlugin(SpellChecker); ! // editor2.registerPlugin(CSS, css_plugin_args); ! // editor2.registerPlugin(HtmlTidy); ! // editor2.registerPlugin(ListType); ! editor2.registerPlugin(ContextMenu); ! editor2.registerPlugin(ImageManager); ! ! // import the CSS plugin styles ! // editor2.config.pageStyle = "@import url(custom.css);"; ! ! // generate the second editor ! // IMPORTANT: if we don't give it a timeout, the first editor will ! // not function in Mozilla. Soon I'll think about starting to ! // implement some kind of event that will fire when the editor ! // finished creating, then we'll be able to chain the generate() ! // calls in an elegant way. But right now there's no other solution ! // than the following. ! setTimeout(function() { ! editor2.config.hideSomeButtons(" fontname fontsize formatblock "); ! editor2.generate(); ! }, 500); ! ! //--------------------------------------------------------------------- ! }; ! ! ! function insertHTML() { ! var html = prompt("Enter some HTML code here"); ! if (html) { ! editor.insertHTML(html); ! } ! } ! function highlight() { ! editor.surroundHTML('<span style="background-color: yellow">', '</span>'); ! } ! </script> ! ! <script type="text/javascript"> ! ! function PSL_chooseEditor(onLoad) { ! ! // if IE 5.5 or W3C/Moz 1.3+ - Can't combine the two due to problems with reload() & IE ! // if((document.all && document.designMode) || (document.designMode)) { ! ! // IE 5.5 - Eliminating reload() because it pulled down new form data ! if(document.all && document.designMode) { ! // HTML or htmlArea ! if (document.editNew.content_type[0].checked) { ! // HTMLArea.replace('en'); ! // HTMLArea.replaceAll(); ! initEditor(); ! } else { ! // how to remove in IE? ! } ! ! // W3C/Moz 1.3+ - reload() without adjusting form data ! } else if(document.designMode) { ! // HTML or htmlArea ! if (document.editNew.content_type[0].checked) { ! // HTMLArea.replace('en'); ! // HTMLArea.replaceAll(); ! initEditor(); ! } else { ! if(onLoad == 1) { ! onLoad = 2; ! window.location.reload(); ! } ! } ! } ! } ! ! </script> ! ! <!-- END HTMLAREA3 Javascript --> ! ! </head> ! <body onLoad="PSL_chooseEditor()"> ! ! <a name="top"></a> ! <div id="header"> ! <table width="100%" border="0" cellpadding="0" cellspacing="0"> ! <!-- START: Title and Search --> ! <tr> ! <td><a href="{ROOTDIR}"><img src="{IMAGEDIR}/new-logo.gif" border="0" alt="" /></a></td> ! <td width="50%" align="center"> ! <form method="get" action="{SEARCH_ACTION_URL}"> ! <input type="text" name=query value="" size="15" /> ! <input type="submit" value="Search" /> ! <input type="hidden" name="topic_id" value="" /> ! <input type="hidden" name="section_id" value="" /> ! <input type="hidden" name="author_id" value="" /> ! </form> ! </td> ! </tr> ! </table> ! <!-- END: Title and Search --> ! ! {TOPICBAR} ! {NAVBAR} ! ! </div> <!-- id="header" --> ! ! <!-- END slashHead.tpl --> --- 1,255 ---- ! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> ! <!-- START slashHead.tpl --> ! ! <html> ! <head> ! <title>{SITE_NAME} - {SECTION} {SITETITLE}</title> ! <!-- Enter Your Desired META Tags Below Here --> ! <!-- This Meta Tag is Defined In Each Page By Setting The Variable ! $xsiteobject = "HomePage"; to the page type HomePage, Glossary, ! Info, etc.. --> ! <meta name="object" content="{XSITEOBJECT}" /> ! <!-- Enter Your META Tags Above Here --> ! <!-- BEGIN each_metatag --> ! <meta name="{METANAME}" content="{METADESCRIPTION}" /> ! <!-- END each_metatag --> ! <link rel="alternate" type="application/rss+xml" title="RSS" href="{ROOTDIR}/backend.php" /> ! <link rel="stylesheet" type="text/css" href="{ROOTDIR}/styles/{SKIN}.css" /> ! <!-- BEGIN HTMLAREA3 Javascript --> ! ! ! <script type="text/javascript"> ! // the _editor_url is REQUIRED! don't forget to set it. ! _editor_url="{ROOTDIR}/scripts/htmlarea3/"; ! // implicit language will be "en", but let's set it for brevity ! _editor_lang = "en"; ! </script> ! <script type="text/javascript" src="{ROOTDIR}/scripts/htmlarea3/htmlarea.js"></script> ! ! <!-- load the plugins --> ! <script type="text/javascript"> ! // WARNING: using this interface to load plugin ! // will _NOT_ work if plugins do not have the language ! // loaded by HTMLArea. ! ! // In other words, this function generates SCRIPT tags ! // that load the plugin and the language file, based on the ! // global variable HTMLArea.I18N.lang (defined in the lang file, ! // in our case "lang/en.js" loaded above). ! ! // If this lang file is not found the plugin will fail to ! // load correctly and nothing will work. ! ! HTMLArea.loadPlugin("TableOperations"); ! // HTMLArea.loadPlugin("SpellChecker"); ! // HTMLArea.loadPlugin("FullPage"); ! // HTMLArea.loadPlugin("CSS"); ! HTMLArea.loadPlugin("ContextMenu"); ! // HTMLArea.loadPlugin("HtmlTidy"); ! // HTMLArea.loadPlugin("ListType"); ! HTMLArea.loadPlugin("ImageManager"); ! ! </script> ! ! <script type="text/javascript"> ! // this function will get called at body.onload ! function initEditor() { ! // cache these values as we need to pass it for both editors ! var css_plugin_args = { ! combos : [ ! { label: "Syntax", ! // menu text // CSS class ! options: { "None" : "", ! "Code" : "code", ! "String" : "string", ! "Comment" : "comment", ! "Variable name" : "variable-name", ! "Type" : "type", ! "Reference" : "reference", ! "Preprocessor" : "preprocessor", ! "Keyword" : "keyword", ! "Function name" : "function-name", ! "Html tag" : "html-tag", ! "Html italic" : "html-helper-italic", ! "Warning" : "warning", ! "Html bold" : "html-helper-bold" ! }, ! context: "pre" ! }, ! { label: "Info", ! options: { "None" : "", ! "Quote" : "quote", ! "Highlight" : "highlight", ! "Deprecated" : "deprecated" ! } ! } ! ] ! }; ! ! ! ! ! ! ! ! //--------------------------------------------------------------------- ! // GENERAL PATTERN ! // ! // 1. Instantitate an editor object. ! // 2. Register plugins (note, it's required to have them loaded). ! // 3. Configure any other items in editor.config. ! // 4. generate() the editor ! // ! // The above are steps that you use to create one editor. Nothing new ! // so far. In order to create more than one editor, you just have to ! // repeat those steps for each of one. Of course, you can register any ! // plugins you want (no need to register the same plugins for all ! // editors, and to demonstrate that we'll skip the TableOperations ! // plugin for the second editor). Just be careful to pass different ! // ID-s in the constructor (you don't want to _even try_ to create more ! // editors for the same TEXTAREA element ;-)). ! // ! // So much for the noise, see the action below. ! ! //--------------------------------------------------------------------- ! ! ! ! //--------------------------------------------------------------------- ! // CREATE FIRST EDITOR ! // ! var editor1 = new HTMLArea("intro_text"); ! ! // plugins must be registered _per editor_. Therefore, we register ! // plugins for the first editor here, and we will also do this for the ! // second editor. ! editor1.registerPlugin(TableOperations); ! // editor1.registerPlugin(SpellChecker); ! // editor1.registerPlugin(CSS, css_plugin_args); ! // editor1.registerPlugin(HtmlTidy); ! // editor1.registerPlugin(ListType); ! editor1.registerPlugin(ContextMenu); ! editor1.registerPlugin(ImageManager); ! ! // custom config must be done per editor. Here we're importing the ! // stylesheet used by the CSS plugin. ! // editor1.config.pageStyle = "@import url(custom.css);"; ! ! // generate first editor ! editor1.config.hideSomeButtons(" fontname fontsize formatblock "); ! editor1.generate(); ! ! //--------------------------------------------------------------------- ! ! ! ! //--------------------------------------------------------------------- ! // CREATE SECOND EDITOR ! // ! var editor2 = new HTMLArea("body_text"); ! ! // we are using the same plugins ! editor2.registerPlugin(TableOperations); ! // editor2.registerPlugin(SpellChecker); ! // editor2.registerPlugin(CSS, css_plugin_args); ! // editor2.registerPlugin(HtmlTidy); ! // editor2.registerPlugin(ListType); ! editor2.registerPlugin(ContextMenu); ! editor2.registerPlugin(ImageManager); ! ! // import the CSS plugin styles ! // editor2.config.pageStyle = "@import url(custom.css);"; ! ! // generate the second editor ! // IMPORTANT: if we don't give it a timeout, the first editor will ! // not function in Mozilla. Soon I'll think about starting to ! // implement some kind of event that will fire when the editor ! // finished creating, then we'll be able to chain the generate() ! // calls in an elegant way. But right now there's no other solution ! // than the following. ! setTimeout(function() { ! editor2.config.hideSomeButtons(" fontname fontsize formatblock "); ! editor2.generate(); ! }, 500); ! ! //--------------------------------------------------------------------- ! }; ! ! ! function insertHTML() { ! var html = prompt("Enter some HTML code here"); ! if (html) { ! editor.insertHTML(html); ! } ! } ! function highlight() { ! editor.surroundHTML('<span style="background-color: yellow">', '</span>'); ! } ! </script> ! ! <script type="text/javascript"> ! ! function PSL_chooseEditor(onLoad) { ! ! // if IE 5.5 or W3C/Moz 1.3+ - Can't combine the two due to problems with reload() & IE ! // if((document.all && document.designMode) || (document.designMode)) { ! ! // IE 5.5 - Eliminating reload() because it pulled down new form data ! if(document.all && document.designMode) { ! // HTML or htmlArea ! if (document.editNew.content_type[0].checked) { ! // HTMLArea.replace('en'); ! // HTMLArea.replaceAll(); ! initEditor(); ! } else { ! // how to remove in IE? ! } ! ! // W3C/Moz 1.3+ - reload() without adjusting form data ! } else if(document.designMode) { ! // HTML or htmlArea ! if (document.editNew.content_type[0].checked) { ! // HTMLArea.replace('en'); ! // HTMLArea.replaceAll(); ! initEditor(); ! } else { ! if(onLoad == 1) { ! onLoad = 2; ! window.location.reload(); ! } ! } ! } ! } ! ! </script> ! ! <!-- END HTMLAREA3 Javascript --> ! ! </head> ! <body onLoad="PSL_chooseEditor()"> ! ! <a name="top"></a> ! <div id="header"> ! <table width="100%" border="0" cellpadding="0" cellspacing="0"> ! <!-- START: Title and Search --> ! <tr> ! <td><a href="{ROOTDIR}"><img src="{IMAGEDIR}/new-logo.gif" border="0" alt="" /></a></td> ! <td width="50%" align="center"> ! <form method="get" action="{SEARCH_ACTION_URL}"> ! <input type="text" name=query value="" size="15" /> ! <input type="submit" value="Search" /> ! <input type="hidden" name="topic_id" value="" /> ! <input type="hidden" name="section_id" value="" /> ! <input type="hidden" name="author_id" value="" /> ! </form> ! </td> ! </tr> ! </table> ! <!-- END: Title and Search --> ! ! {TOPICBAR} ! {NAVBAR} ! ! </div> <!-- id="header" --> ! ! <!-- END slashHead.tpl --> |
From: Luis M <le...@us...> - 2004-08-23 21:57:18
|
Update of /cvsroot/phpslash/phpslash-dev/public_html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22212 Modified Files: config-dist.php Log Message: suppresses all ugly notices and warnings from the main page when index.php has error_reporting(E_ALL) before the line loading config.php Index: config-dist.php =================================================================== RCS file: /cvsroot/phpslash/phpslash-dev/public_html/config-dist.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** config-dist.php 23 Aug 2004 16:29:03 -0000 1.19 --- config-dist.php 23 Aug 2004 21:57:02 -0000 1.20 *************** *** 33,36 **** --- 33,38 ---- $varkey = ''; + $scriptkey = ''; // to avoid ugly warnings/notices + if (!empty($HTTP_COOKIE_VARS['slashSess'])) { $scriptkey = "-slashSess-". $HTTP_COOKIE_VARS['slashSess']; *************** *** 379,382 **** --- 381,386 ---- // cache invocation $varkey = ''; + $scriptkey = ''; // to avoid ugly warnings/notices + if (!empty($HTTP_COOKIE_VARS['slashSess'])) { // later - we check for login after page_open *************** *** 480,483 **** --- 484,489 ---- // cache invocation $varkey = ''; + $scriptkey = ''; // to avoid ugly warnnings/notices + if (!empty($HTTP_COOKIE_VARS['slashSess'])) { // later - we check for login after page_open *************** *** 850,854 **** $scriptkey .= "-slashSess-". $HTTP_COOKIE_VARS['slashSess']; } ! if(function_exists(jpcache_start)) { jpcache_start('',$scriptkey, $varkey); } --- 856,860 ---- $scriptkey .= "-slashSess-". $HTTP_COOKIE_VARS['slashSess']; } ! if ( function_exists( "jpcache_start" ) ) { jpcache_start('',$scriptkey, $varkey); } |
From: Joe S. <joe...@us...> - 2004-08-23 17:49:22
|
Update of /cvsroot/phpslash/phpslash-dev/public_html/scripts/htmlarea3/plugins/TableOperations/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6597/phpslash-dev/public_html/scripts/htmlarea3/plugins/TableOperations/lang Added Files: el.js he.js nl.js no.js Log Message: Upgraded htmlarea2 --- NEW FILE: el.js --- // I18N constants // LANG: "el", ENCODING: UTF-8 | ISO-8859-7 // Author: Dimitris Glezos, dim...@gl... TableOperations.I18N = { "Align": "ΣÏοίÏηÏη", "All four sides": "Îαι οι 4 ÏÎ»ÎµÏ ÏÎÏ", "Background": "ΦÏνÏο", "Baseline": "Baseline", "Border": "ΠεÏίγÏαμμα", "Borders": "ΠεÏιγÏάμμαÏα", "Bottom": "ÎάÏÏ Î¼ÎÏοÏ", "CSS Style": "ΣÏÏ Î» [CSS]", "Caption": "ÎεζάνÏα", "Cell Properties": "ÎδιÏÏηÏÎµÏ ÎελιοÏ", "Center": "ÎÎνÏÏο", "Char": "ΧαÏακÏήÏαÏ", "Collapsed borders": "Î£Ï Î¼ÏÏÏ Î³Î¼Îνα ÏεÏιγÏάμμαÏα", "Color": "ΧÏÏμα", "Description": "ΠεÏιγÏαÏή", "FG Color": "ΧÏÏμα ανÏικειμÎνÏν", "Float": "Float", "Frames": "Frames", "Height": "ÎÏοÏ", "How many columns would you like to merge?": "Î ÏÏÎµÏ ÏÏÎ®Î»ÎµÏ Î¸ÎλεÏε να ενÏÏεÏε;", "How many rows would you like to merge?": "Î ÏÏÎµÏ Î³ÏαμμÎÏ Î¸ÎλεÏε να ενÏÏεÏε;", "Image URL": "URL εικÏναÏ", "Justify": "ΠλήÏÎ·Ï ÏÏοίÏηÏη", "Layout": "ÎιάÏαξη", "Left": "ÎÏιÏÏεÏά", "Margin": "ΠεÏιθÏÏιο", "Middle": "ÎÎνÏÏο", "No rules": "ΧÏÏÎ¯Ï ÎÏαμμÎÏ", "No sides": "No sides", "None": "ΤίÏοÏα", "Padding": "ÎÏοÏή", "Please click into some cell": "ÎάνÏε κλικ μÎÏα Ïε κάÏοιο κελί", "Right": "Îεξιά", "Row Properties": "ÎδιÏÏηÏÎµÏ ÎÏαμμήÏ", "Rules will appear between all rows and columns": "ÎÏαμμÎÏ Î¸Î± εμÏανίζονÏαι μεÏÎ±Î¾Ï ÏλÏν ÏÏν γÏαμμÏν και ÏÏηλÏν", "Rules will appear between columns only": "ÎÏαμμÎÏ Î¸Î± εμÏανίζονÏαι μÏνο μεÏÎ±Î¾Ï ÏÏηλÏν", "Rules will appear between rows only": "ÎÏαμμÎÏ Î¸Î± εμÏανίζονÏαι μÏνο μεÏÎ±Î¾Ï Î³ÏαμμÏν", "Rules": "ÎÏαμμÎÏ", "Spacing and padding": "ÎÏοÏÏάÏÎµÎ¹Ï ÎºÎ±Î¹ εÏοÏÎÏ", "Spacing": "ÎÏοÏÏάÏειÏ", "Summary": "ΣÏνοÏη", "TO-cell-delete": "ÎιαγÏαÏή κελιοÏ", "TO-cell-insert-after": "ÎιÏαγÏγή ÎºÎµÎ»Î¹Î¿Ï Î¼ÎµÏά", "TO-cell-insert-before": "ÎιÏαγÏγή ÎºÎµÎ»Î¹Î¿Ï ÏÏιν", "TO-cell-merge": "Î£Ï Î³ÏÏÎ½ÎµÏ Ïη κελιÏν", "TO-cell-prop": "ÎδιÏÏηÏÎµÏ ÎºÎµÎ»Î¹Î¿Ï", "TO-cell-split": "ÎιαίÏεÏη κελιοÏ", "TO-col-delete": "ÎιαγÏαÏή ÏÏήληÏ", "TO-col-insert-after": "ÎιÏαγÏγή ÏÏÎ®Î»Î·Ï Î¼ÎµÏά", "TO-col-insert-before": "ÎιÏαγÏγή ÏÏÎ®Î»Î·Ï ÏÏιν", "TO-col-split": "ÎιαίÏεÏη ÏÏήληÏ", "TO-row-delete": "ÎιαγÏαÏή γÏαμμήÏ", "TO-row-insert-above": "ÎιÏαγÏγή γÏÎ±Î¼Î¼Î®Ï Î¼ÎµÏά", "TO-row-insert-under": "ÎιÏαγÏγή γÏÎ±Î¼Î¼Î®Ï ÏÏιν", "TO-row-prop": "ÎδιÏÏηÏÎµÏ Î³ÏαμμήÏ", "TO-row-split": "ÎιαίÏεÏη γÏαμμήÏ", "TO-table-prop": "ÎδιÏÏηÏÎµÏ Ïίνακα", "Table Properties": "ÎδιÏÏηÏÎµÏ Ïίνακα", "Text align": "ΣÏοίÏηÏη κειμÎÎ½Î¿Ï ", "The bottom side only": "ΠκάÏÏ ÏÎ»ÎµÏ Ïά μÏνο", "The left-hand side only": "ΠαÏιÏÏεÏή ÏÎ»ÎµÏ Ïά μÏνο", "The right and left sides only": "Îι δεξιÎÏ ÎºÎ±Î¹ αÏιÏÏεÏÎÏ ÏÎ»ÎµÏ ÏÎÏ Î¼Ïνο", "The right-hand side only": "Πδεξιά ÏÎ»ÎµÏ Ïά μÏνο", "The top and bottom sides only": "Îι ÏÎ¬Î½Ï ÎºÎ±Î¹ κάÏÏ ÏÎ»ÎµÏ ÏÎÏ Î¼Ïνο", "The top side only": "Î ÏÎ¬Î½Ï ÏÎ»ÎµÏ Ïά μÏνο", "Top": "ΠάνÏ", "Unset color": "ÎναίÏεÏη ÏÏÏμαÏοÏ", "Vertical align": "ÎαÏακÏÏÏ Ïη ÏÏοίÏηÏη", "Width": "ΠλάÏοÏ", "not-del-last-cell": "Îεν μÏοÏεί να διαγÏαÏεί Ïο ÏÎµÎ»ÎµÏ Ïαίο κελί Ïε μια γÏαμμή.", "not-del-last-col": "Îεν μÏοÏεί να διαγÏαÏεί η ÏÎµÎ»ÎµÏ Ïαία ÏÏήλη Ïε Îνα Ïίνακα.", "not-del-last-row": "Îεν μÏοÏεί να διαγÏαÏεί η ÏÎµÎ»ÎµÏ Ïαία γÏαμμή Ïε Îνα Ïίνακα.", "percent": "ÏÎ¿Î¹Ï ÎµÎºÎ±ÏÏν", "pixels": "pixels" }; --- NEW FILE: he.js --- // I18N constants // LANG: "he", ENCODING: UTF-8 // Author: Liron Newman, http://www.eesh.net, <plastish at ultinet dot org> // FOR TRANSLATORS: // // 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE // (at least a valid email address) // // 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; // (if this is not possible, please include a comment // that states what encoding is necessary.) TableOperations.I18N = { "Align": "×ש×ר", "All four sides": "×× ×ר×עת ×צ××××", "Background": "רקע", "Baseline": "×§× ×ס×ס", "Border": "××××", "Borders": "×××××ת", "Bottom": "ת×ת××", "CSS Style": "ס×× ×× [CSS]", "Caption": "××תרת", "Cell Properties": "××פ××× × ×ª×", "Center": "×ר××", "Char": "ת×", "Collapsed borders": "×××××ת ×§×רס××", "Color": "צ××¢", "Description": "ת×××ר", "FG Color": "צ××¢ ×§××××", "Float": "×ר××£", "Frames": "×ס×ר×ת", "Height": "××××", "How many columns would you like to merge?": "××× ××ר×× ×רצ×× × ××××?", "How many rows would you like to merge?": "××× ×©×ר×ת ×רצ×× × ××××?", "Image URL": "URL ×ת××× ×", "Justify": "×ש×ר", "Layout": "פר×ס×", "Left": "ש×××", "Margin": "ש×××××", "Middle": "××צע", "No rules": "××× ×§××××", "No sides": "××× ×¦××××", "None": "×××", "Padding": "ר×××× ×ש×××××", "Please click into some cell": "×× × ×××¥ ×¢× ×ª× ××ש××", "Right": "××××", "Row Properties": "××פ××× × ×©×ר×", "Rules will appear between all rows and columns": "×§×××× ××פ××¢× ××× ×× ×ש×ר×ת ××××ר××", "Rules will appear between columns only": "×§×××× ××פ××¢× ××× ××ר×× ××××", "Rules will appear between rows only": "×§×××× ××פ××¢× ××× ×©×ר×ת ××××", "Rules": "×§××××", "Spacing and padding": "ר×××× ×ש×××××", "Spacing": "ר××××", "Summary": "ס××××", "TO-cell-delete": "×××§ ת×", "TO-cell-insert-after": "××× ×¡ ×ª× ××ר×", "TO-cell-insert-before": "××× ×¡ ×ª× ××¤× ×", "TO-cell-merge": "××× ×ª×××", "TO-cell-prop": "××פ××× × ×ª×", "TO-cell-split": "×¤×¦× ×ª×", "TO-col-delete": "×××§ ××ר", "TO-col-insert-after": "××× ×¡ ××ר ××ר×", "TO-col-insert-before": "××× ×¡ ××ר ××¤× ×", "TO-col-split": "×¤×¦× ××ר", "TO-row-delete": "×××§ ש×ר×", "TO-row-insert-above": "××× ×¡ ש××¨× ××¤× ×", "TO-row-insert-under": "××× ×¡ ש××¨× ××ר×", "TO-row-prop": "××פ××× × ×©×ר×", "TO-row-split": "×¤×¦× ×©×ר×", "TO-table-prop": "××פ××× × ××××", "Table Properties": "××פ××× × ××××", "Text align": "×ש×ר ×קס×", "The bottom side only": "××¦× ×ת×ת×× ××××", "The left-hand side only": "××¦× ×ש×××× ××××", "The right and left sides only": "×צ×××× ×××× × ××ש×××× ××××", "The right-hand side only": "××¦× ×××× × ××××", "The top and bottom sides only": "×צ×××× ××¢×××× ××ת×ת×× ××××", "The top side only": "××¦× ××¢×××× ××××", "Top": "×¢××××", "Unset color": "צ××¢ ×× × ××ר", "Vertical align": "××ש×ר ×× ××", "Width": "ר×××", "not-del-last-cell": "HTMLArea ××¡×¨× ×פ××× ×ת ×××××§ ×ת ××ª× ×××ר×× ×ש×ר×.", "not-del-last-col": "HTMLArea ××¡×¨× ×פ××× ×ת ×××××§ ×ת ×××ר ×××ר×× ×××××.", "not-del-last-row": "HTMLArea ××¡×¨× ×פ××× ×ת ×××××§ ×ת ×ש××¨× ×××ר×× × ×××××.", "percent": "××××", "pixels": "פ×קס×××" }; --- NEW FILE: nl.js --- // I18N constants // LANG: "nl", ENCODING: UTF-8 | ISO-8859-1 // Author: Michel Weegeerink (in...@mm...), http://mmc-shop.nl // FOR TRANSLATORS: // // 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE // (at least a valid email address) // // 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; // (if this is not possible, please include a comment // that states what encoding is necessary.) TableOperations.I18N = { "Align": "Uitlijning", "All four sides": "Alle 4 zijden", "Background": "Achtergrond", "Baseline": "Basis", "Border": "Rand", "Borders": "Randen", "Bottom": "Onder", "CSS Style": "CSS Style", "Caption": "Opmerking", "Cell Properties": "Celeigenschappen", "Center": "Centreren", "Char": "Karakter", "Collapsed borders": "Geen randen", "Color": "Kleur", "Description": "Omschrijving", "FG Color": "Voorgrond", "Float": "Zwevend", "Frames": "Frames", "Height": "Hoogte", "How many columns would you like to merge?": "Hoeveel kolommen wilt u samenvoegen?", "How many rows would you like to merge?": "Hoeveel rijen wilt u samenvoegen?", "Image URL": "Afbeelding URL", "Justify": "Uitvullen", "Layout": "Opmaak", "Left": "Links", "Margin": "Marge", "Middle": "Midden", "No rules": "Geen regels", "No sides": "Geen zijlijnen", "None": "Geen", "Padding": "Celmarge", "Please click into some cell": "Klik in een cel a.u.b.", "Right": "Rechts", "Row Properties": "Rijeigenschappen", "Rules will appear between all rows and columns": "Regels verschijnen tussen alle rijen en kolommen", "Rules will appear between columns only": "Regels verschijnen enkel tussen de kolommen", "Rules will appear between rows only": "Regels verschijnen enkel tussen de rijen", "Rules": "Regels", "Spacing and padding": "Celmarge en afstand tussen cellen", "Spacing": "marge", "Summary": "Overzicht", "TO-cell-delete": "Cel verwijderen", "TO-cell-insert-after": "Voeg cel toe achter", "TO-cell-insert-before": "Voeg cel toe voor", "TO-cell-merge": "Cellen samenvoegen", "TO-cell-prop": "Celeigenschappen", "TO-cell-split": "Cel splitsen", "TO-col-delete": "Kolom verwijderen", "TO-col-insert-after": "Kolom invoegen achter", "TO-col-insert-before": "Kolom invoegen voor", "TO-col-split": "Kolom splitsen", "TO-row-delete": "Rij verwijderen", "TO-row-insert-above": "Rij invoegen boven", "TO-row-insert-under": "Rij invoegen onder", "TO-row-prop": "Rij eigenschappen", "TO-row-split": "Rij splitsen", "TO-table-prop": "Tabel eigenschappen", "Table Properties": "Tabel eigenschappen", "Text align": "Text uitlijning", "The bottom side only": "Enkel aan de onderkant", "The left-hand side only": "Enkel aan de linkerkant", "The right and left sides only": "Enkel aan de linker en rechterkant", "The right-hand side only": "Enkel aan de rechterkant", "The top and bottom sides only": "Enkel aan de bovenen onderkant", "The top side only": "Enkel aan de bovenkant", "Top": "Boven", "Unset color": "Wis kleur", "Vertical align": "Vertikale uitlijning", "Width": "Breedte", "not-del-last-cell": "HTMLArea kan de laatste cel in deze tabel niet verwijderen.", "not-del-last-col": "HTMLArea kan de laatste kolom in deze tabel niet verwijderen.", "not-del-last-row": "HTMLArea kan de laatste rij in deze tabel niet verwijderen.", "percent": "procent", "pixels": "pixels" }; --- NEW FILE: no.js --- // I18N constants // LANG: "en", ENCODING: UTF-8 | ISO-8859-1 // Author: Mihai Bazon, <mi...@in...> // translated into Norwegia: se...@on... 11.11.03 // FOR TRANSLATORS: // // 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE // (at least a valid email address) // // 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; // (if this is not possible, please include a comment // that states what encoding is necessary.) TableOperations.I18N = { "Align": "Juster", "All four sides": "Alle fire sider", "Background": "Bakgrund", "Baseline": "Grunnlinje", "Border": "Kantlinje", "Borders": "Kantlinjer", "Bottom": "Bunn", "CSS Style": "Stil [CSS]", "Caption": "Overskrift", "Cell Properties": "Celleegenskaper", "Center": "Sentrer", "Char": "Tegn", "Collapsed borders": "Fjern kantlinjer", "Color": "Farge", "Description": "Beskrivelse", "FG Color": "FG farge", "Float": "Flytende", "Frames": "rammer", "Height": "Høyde", "How many columns would you like to merge?": "Hvor mange kolonner vil du slå sammen?", "How many rows would you like to merge?": "Hvor mange rader vil du slå sammen?", "Image URL": "Bildets URL", "Justify": "Juster", "Layout": "Layout", "Left": "Venstre", "Margin": "Marg", "Middle": "Midten", "No rules": "Ingen linjal", "No sides": "Ingen sider", "None": "Ingen", "Padding": "Luft", "Please click into some cell": "Klikk i en eller annen celle", "Right": "Høyre", "Row Properties": "Egenskaper for rad", "Rules will appear between all rows and columns": "Linjer vil synes mellom alle rader og kolonner", "Rules will appear between columns only": "Linjer vil synes kun mellom kolonner", "Rules will appear between rows only": "Linjer vil synes kun mellom rader", "Rules": "Linjer", "Spacing and padding": "Luft", "Spacing": "Luft", "Summary": "Sammendrag", "TO-cell-delete": "Slett celle", "TO-cell-insert-after": "Sett inn celle etter", "TO-cell-insert-before": "Sett inn celle foran", "TO-cell-merge": "Slå sammen celler", "TO-cell-prop": "Egenskaper for celle", "TO-cell-split": "Del celle", "TO-col-delete": "Slett kolonne", "TO-col-insert-after": "Skyt inn kolonne etter", "TO-col-insert-before": "Skyt inn kolonne før", "TO-col-split": "Del kolonne", "TO-row-delete": "Slett rad", "TO-row-insert-above": "Skyt inn rad foran", "TO-row-insert-under": "Skyt inn rad etter", "TO-row-prop": "Egenskaper for rad", "TO-row-split": "Del rad", "TO-table-prop": "Tabellegenskaper", "Table Properties": "Tabellegenskaper", "Text align": "Juster tekst", "The bottom side only": "Bunnen kun", "The left-hand side only": "Venstresiden kun", "The right and left sides only": "Høyre- og venstresiden kun", "The right-hand side only": "Høyresiden kun", "The top and bottom sides only": "The top and bottom sides only", "The top side only": "Overkanten kun", "Top": "Overkant", "Unset color": "Ikke-bestemt farge", "Vertical align": "Vertikal justering", "Width": "Bredde", "not-del-last-cell": "HTMLArea nekter å slette siste cellen i tabellen.", "not-del-last-col": "HTMLArea nekter å slette siste kolonnen i tabellen.", "not-del-last-row": "HTMLArea nekter å slette siste raden i tabellen.", "percent": "prosent", "pixels": "billedpunkter" }; |
From: Joe S. <joe...@us...> - 2004-08-23 17:49:22
|
Update of /cvsroot/phpslash/phpslash-dev/public_html/scripts/htmlarea3/plugins/SpellChecker/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6597/phpslash-dev/public_html/scripts/htmlarea3/plugins/SpellChecker/lang Added Files: he.js Log Message: Upgraded htmlarea2 --- NEW FILE: he.js --- // I18N constants // LANG: "en", ENCODING: UTF-8 | ISO-8859-1 // Author: Mihai Bazon, http://dynarch.com/mishoo // FOR TRANSLATORS: // // 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE // (at least a valid email address) // // 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; // (if this is not possible, please include a comment // that states what encoding is necessary.) SpellChecker.I18N = { "CONFIRM_LINK_CLICK" : "×× × ×שר ש×רצ×× × ×פת×× ×§×ש×ר ××", "Cancel" : "×××××", "Dictionary" : "×××××", "Finished list of mispelled words" : "×סת×××× ×¨×©××ת ×××××× ×××××ת×ת ××××¤× ×©×××", "I will open it in a new page." : "×× × ××¤×ª× ×ת ×× ××××× ××ש.", "Ignore all" : "×תע×× ××××", "Ignore" : "×תע××", "NO_ERRORS" : "×× × ×צ×× ××××× ××××ת×ת ××××¤× ×©××× ×¢× ×××××× ×× ××ר.", "NO_ERRORS_CLOSING" : "×××קת ××××ת × ×¡×ª××××, ×× × ×צ×× ××××× ××××ת×ת ××××¤× ×©×××. × ×¡×ר ×עת...", "OK" : "××ש×ר", "Original word" : "××××× ×××§×ר×ת", "Please wait. Calling spell checker." : "×× × ××ת×. ×§××¨× ×××××§ ×××ת.", "Please wait: changing dictionary to" : "×× × ××ת×: ×××××£ ××××× ×-", "QUIT_CONFIRMATION" : "×× ×××× ×ת ×ש×× ×××× ×××¦× ×××××§ ××××ת. ×× × ×שר.", "Re-check" : "××××§ ×××ש", "Replace all" : "××××£ ×××", "Replace with" : "××××£ ×-", "Replace" : "××××£", "Revert" : "×××ר ש×× ××××", "SC-spell-check" : "×××קת ×××ת", "Suggestions" : "×צע×ת", "pliz weit ;-)" : "×¢× × ×××× ;-)" }; |
From: Joe S. <joe...@us...> - 2004-08-23 17:49:22
|
Update of /cvsroot/phpslash/phpslash-dev/public_html/scripts/htmlarea3/popups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6597/phpslash-dev/public_html/scripts/htmlarea3/popups Added Files: Thumbs.db link.html Log Message: Upgraded htmlarea2 --- NEW FILE: Thumbs.db --- ÐÏࡱá :}(¥þűÿ )¢òS÷÷Gñ ¢ò#ýê}ÑüCÒüõOûèSüè¿ç¢ßBçÅÿ ¤äªójXtK%Y (¤ ;Ò¯ÞZ)Ç¢ÿ àPjÍ¥ý ²5 ôB-gO˽w.rUä{QL«=QEÕ?ß_ýQÞ~ðúÑI ÅÍÕ½êúM5¼ÒJh~P¦.×ç :äæ5ÛÛÜk7 WdÁ ¨D1!P&Æâr®s¸°ÈÖont5û^ïþ=R¯s*d`~á eηLSæùÿ TùnMå+K¹Våc÷sxí\¼¾:Ò¦îîßÉO·Ù*ÄW 8a÷ãùN@#'4åXÀØÞTöëÈ%\u6ç r¢µýIî9¿w¨iç Ùº°ßCëÅG/Ä=7r°òõ+zfàá#¿É<c¢#0á&Â^¡§üÀÙ¹Ãúß)£ÄZ'ÐÀÔ4üã×þ>ºc¥4|HгBÄò®§aûßñóÓý?*hñ¦Àí»'åÿ ü¬oQòpÏQÒXô{iõ/·ê©û7!WÆìÃoË!/ e ;Ò¯ÞZ*4ú<â pGd .cD²¸Ä{°¥ (ûD?óÚ?ûèQçÅÿ <ø¿çªßB>ÑüöþúyñÏTÿ <ø¿çªßB>/ùê÷Т´Cÿ )ðãýl÷УÏþz§ýô(óâÿ +ÿÙ (ûD?óÚ?ûèQçÅÿ Ïþz§ýô*o>/ùê÷Т´Cÿ ëÃÞ!F¶.Ó¶«îèñ;±fùÀU£ORWZd§,-¶«îé»±fùÀU£ORWZ¤§,-¶«îé»±fùÀU£OR ]%´}´7ÚÝÝG¬×>J'à àU[4`È VÀ4WÿÙ 2=E-yðÿ 2=ESDs ucìsJ9éF(§QEQEQEQEQE (û-¿üðþø}Ûþ}áÿ (¢(¢(¢(¢(¢=>£ùÐ:ÑÞÞÓÿ gÉÆÁsWµº·*%¼ )¤yUË æÑáéïzö¢¸¾IÐ[èzÂ*Åá6Áȼó+`wÊõéξTy#ÎÃ^DUAö°|ªsûö-òàº:¼ÌÔUX¡²´ñ1 \ÜØg*¼þýapGÝO^ VÏJ²$4-"e,¢+XUÎrsáÑ»Ñk¦éF®e¤ÊÁ4$°<Ä`z7s-´ý*ÖA XéR²¶`8DV,1#=¹Î(«QÃ>gya b#!¶40& Ï?îcâèþ¶Ó9`¾$âp) ± ·Lß÷GNrU¿³Mò´2 ;ÉíÆ~µ¬¾ðZMØõÛÿ )´RÑEQEQEQEQEQEQEQEQEQG§Ô:Z;ÑU§Ôí aí[Ýdb}Ì Û#^ÃäE2âÞúu&£®@®¸Ã N¼ÀOæIªëRê'ìÚñY1@H¹cÛìÍ~óä#9ªk®Ë«·ÙµOf@[í±£"ñ»delÏW¨ëEZÊ|ÒRÝ·+VÙð{¢µÄÒ)K{xÛp;=¤öÆÖTË"ZFÁÇ1¦Ò{c?øÇI+¢ýæVKÇ2;Å4.÷ÙeRëÏ$w6ÓG$][ºG÷ÙfRêsÅÕee¬OB§ Ь®èêèÃ*ÈÁúNIXÖH¤I#at`Àb(¥¥§QEQEQEQG§Ô:Z;ÑXéÖÏ-ÂøÃ2Êñ)K¤+;É´.X0¥ºr?1#K¶îk¤ðçfãRSHVw|Ë # _¡'?ææÒå»é<9á¥xÔ¥ÔÒßräBHÂèIàâ%Jè,ÆÆÜÛÚ_-º7î¡´5E\v8ïÒ·àÆÎ%·²¸[;hÀX¡µDDQpܽ«n(l¬Ñmì¦v± Xá´DDQ8n^ÔTÿ 7Ãÿ á1ú(4׳4f[©d p®¨üÖ×_º>u>âý]ýZý´êuQEQEQEQEQEQEQEQEQEÙ>áúåLî¡þTÉÕ¡þTR¯ÝJTûô±ÿ <ø¿çªßB<è¿çªßB:/ùè÷УÏþz§ýô(£Îþz§ýô(ó¢ÿ <ø¿çªßB<è¿çªßB:/ùè÷УÏþz§ýô(£Îþz§ýô(ó¢ÿ <ø¿çªßB<è¿çªßB:/ùè÷УÏþz§ýô(£Îþz§ýô(ó¢ÿ <ø¿çªßB<è¿çªßB:/ùè÷УÏþz§ýô(£Îþz§ýô(ó¢ÿ <ø¿çªßB{mêØì¨æ%§ 4É®!XXùp:+ÿÙ )´RÑEQEQEQEQEQEQEQEQEQG§Ô:Z;ÑCIØÿ )PBÈåÏ, À#5ű|À|¡f-ß=;zàl|Ak}|m'äìv¸¶q&1ÐG+7~ëØç6â-BüÚ$M9Øíuk è±ÌÏß?w·8¢Þ\MoMíÉxqVpO"I<pÃ#U»Ë«kxE½ õÑZ< м»¹µ· mì/®ZÑà"`þõÔdÇ29À¢ª[[_Ë¢úóZ³euemEtüºò_&7äg8=1Þ³bÕ^Ùþשk¶,²S~4ýΣ¨_&7yΦ;Öe¨ÕÌ.õMvÅÔÔ`a|Ümçáºc½ñhÂæ9¿·rÙhX[ìqÏá¿":TÂ+¡sßð\VËBßgØã-Ãc·t©A¼1Ëÿ r^ Ûap³=} *³K©Q¶-¸Ë.¦ñ?Üc°ëÇ ïÇJÉ}OXG-ôí&xTG,º±;|ò½Î3ÇJÊTÖQäK}7JP#]BXþ@~à #ïsñÒX¾×§]Þ.ÇA.åiÒðÂÓÌGÞ©êÛ¨c¼¿±¸»þÎдHyÚhîä ¦ù"Âz2Ûªéu}esuý è±,Ó;´ÑÞIM#rdÔÜMynµI®'ßi¶Ð©ýÔÞi¤?y6 OÁ¯¦£©Íuqhgó¥¥#Âl8ûÍÖ¯¥þ¥5ÕÄl¶VÐ'0Ïö¦iFHå0~óu¢¤Î£ÿ )´RÑEQEQEQEQEQEQEQH̨»TwcéMy$/,eÉ÷ ~4Ée³KQ®y*'Ô?*?´ÛÏÌâUá0=y{ûBÀç ÿ Ò(î *ÅrJÍÉÀ¨Ööy$JÕ'G¼c²g ;OZ2"³tÂ4]ìævG$yïÚ@:å¥àãçNÛ×÷B&nFì}êEÃ.D²2Âv ÏÞ\µ'ýüoñ£oûrÿ ÈFB²Á HªèÀ«+(`ÀãÒ¡º·v²Û´vUF dë)Î1È=j½õ§Û¬f¶óåÌ]¦HÒ6`2 âEe9Æ9S××*tëgG¶²µ·tGÞ4eÄ.ESÓt;-2%¢É*ä,íor*>Pb --- NEW FILE: link.html --- <html> <head> <title>Insert/Modify Link</title> <script type="text/javascript" src="popup.js"></script> <script type="text/javascript"> window.resizeTo(400, 200); I18N = window.opener.HTMLArea.I18N.dialogs; function i18n(str) { return (I18N[str] || str); }; function onTargetChanged() { var f = document.getElementById("f_other_target"); if (this.value == "_other") { f.style.visibility = "visible"; f.select(); f.focus(); } else f.style.visibility = "hidden"; }; function Init() { __dlg_translate(I18N); __dlg_init(); var param = window.dialogArguments; var target_select = document.getElementById("f_target"); if (param) { document.getElementById("f_href").value = param["f_href"]; document.getElementById("f_title").value = param["f_title"]; comboSelectValue(target_select, param["f_target"]); if (target_select.value != param.f_target) { var opt = document.createElement("option"); opt.value = param.f_target; opt.innerHTML = opt.value; target_select.appendChild(opt); opt.selected = true; } } var opt = document.createElement("option"); opt.value = "_other"; opt.innerHTML = i18n("Other"); target_select.appendChild(opt); target_select.onchange = onTargetChanged; document.getElementById("f_href").focus(); document.getElementById("f_href").select(); }; function onOK() { var required = { // f_href shouldn't be required or otherwise removing the link by entering an empty // url isn't possible anymore. // "f_href": i18n("You must enter the URL where this link points to") }; for (var i in required) { var el = document.getElementById(i); if (!el.value) { alert(required[i]); el.focus(); return false; } } // pass data back to the calling window var fields = ["f_href", "f_title", "f_target" ]; var param = new Object(); for (var i in fields) { var id = fields[i]; var el = document.getElementById(id); param[id] = el.value; } if (param.f_target == "_other") param.f_target = document.getElementById("f_other_target").value; __dlg_close(param); return false; }; function onCancel() { __dlg_close(null); return false; }; </script> <style type="text/css"> html, body { background: ButtonFace; color: ButtonText; font: 11px Tahoma,Verdana,sans-serif; margin: 0px; padding: 0px; } body { padding: 5px; } table { font: 11px Tahoma,Verdana,sans-serif; } select, input, button { font: 11px Tahoma,Verdana,sans-serif; } button { width: 70px; } table .label { text-align: right; width: 8em; } .title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px; border-bottom: 1px solid black; letter-spacing: 2px; } #buttons { margin-top: 1em; border-top: 1px solid #999; padding: 2px; text-align: right; } </style> </head> <body onload="Init()"> <div class="title">Insert/Modify Link</div> <table border="0" style="width: 100%;"> <tr> <td class="label">URL:</td> <td><input type="text" id="f_href" style="width: 100%" /></td> </tr> <tr> <td class="label">Title (tooltip):</td> <td><input type="text" id="f_title" style="width: 100%" /></td> </tr> <tr> <td class="label">Target:</td> <td><select id="f_target"> <option value="">None (use implicit)</option> <option value="_blank">New window (_blank)</option> <option value="_self">Same frame (_self)</option> <option value="_top">Top frame (_top)</option> </select> <input type="text" name="f_other_target" id="f_other_target" size="10" style="visibility: hidden" /> </td> </tr> </table> <div id="buttons"> <button type="button" name="ok" onclick="return onOK();">OK</button> <button type="button" name="cancel" onclick="return onCancel();">Cancel</button> </div> </body> </html> |
From: Joe S. <joe...@us...> - 2004-08-23 17:49:21
|
Update of /cvsroot/phpslash/phpslash-dev/public_html/scripts/htmlarea3/plugins/ImageManager/assets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6597/phpslash-dev/public_html/scripts/htmlarea3/plugins/ImageManager/assets Added Files: EditorContent.js ImageEditor.css dialog.js editor.css editor.js editorFrame.css editorFrame.js hover.htc imagelist.css images.js manager.css manager.js popup.js slider.js wz_jsgraphics.js Log Message: Upgraded htmlarea2 --- NEW FILE: EditorContent.js --- /*********************************************************************** ** Title.........: Online Image Editor Interface ** Version.......: 1.0 ** Author........: Xiang Wei ZHUO <we...@zh...> ** Filename......: EditorContents.js ** Last changed..: 31 Mar 2004 ** Notes.........: Handles most of the interface routines for the ImageEditor. * * Added: 29 Mar 2004 - Constrainted resizing/scaling **/ function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } var pic_x, pic_y; function P7_Snap() { //v2.62 by PVII var x,y,ox,bx,oy,p,tx,a,b,k,d,da,e,el,args=P7_Snap.arguments;a=parseInt(a); for (k=0; k<(args.length-3); k+=4) if ((g=MM_findObj(args[k]))!=null) { el=eval(MM_findObj(args[k+1])); a=parseInt(args[k+2]);b=parseInt(args[k+3]); x=0;y=0;ox=0;oy=0;p="";tx=1;da="document.all['"+args[k]+"']"; if(document.getElementById) { d="document.getElementsByName('"+args[k]+"')[0]"; if(!eval(d)) {d="document.getElementById('"+args[k]+"')";if(!eval(d)) {d=da;}} }else if(document.all) {d=da;} if (document.all || document.getElementById) { while (tx==1) {p+=".offsetParent"; if(eval(d+p)) {x+=parseInt(eval(d+p+".offsetLeft"));y+=parseInt(eval(d+p+".offsetTop")); }else{tx=0;}} ox=parseInt(g.offsetLeft);oy=parseInt(g.offsetTop);var tw=x+ox+y+oy; if(tw==0 || (navigator.appVersion.indexOf("MSIE 4")>-1 && navigator.appVersion.indexOf("Mac")>-1)) { ox=0;oy=0;if(g.style.left){x=parseInt(g.style.left);y=parseInt(g.style.top); }else{var w1=parseInt(el.style.width);bx=(a<0)?-5-w1:-10; a=(Math.abs(a)<1000)?0:a;b=(Math.abs(b)<1000)?0:b; //alert(event.clientX); if (event == null) x=document.body.scrollLeft + bx; else x=document.body.scrollLeft + event.clientX + bx; if (event == null) y=document.body.scrollTop; else y=document.body.scrollTop + event.clientY;}} }else if (document.layers) {x=g.x;y=g.y;var q0=document.layers,dd=""; for(var s=0;s<q0.length;s++) {dd='document.'+q0[s].name; if(eval(dd+'.document.'+args[k])) {x+=eval(dd+'.left');y+=eval(dd+'.top');break;}}} if(el) {e=(document.layers)?el:el.style; var xx=parseInt(x+ox+a),yy=parseInt(y+oy+b); //alert(xx+":"+yy); if(navigator.appName=="Netscape" && parseInt(navigator.appVersion)>4){xx+="px";yy+="px";} if(navigator.appVersion.indexOf("MSIE 5")>-1 && navigator.appVersion.indexOf("Mac")>-1){ xx+=parseInt(document.body.leftMargin);yy+=parseInt(document.body.topMargin); xx+="px";yy+="px";}e.left=xx;e.top=yy;} pic_x = parseInt(xx); pic_y = parseInt(yy); //alert(xx+":"+yy); } } var ie=document.all var ns6=document.getElementById&&!document.all var dragapproved=false var z,x,y,status, ant, canvas, content, pic_width, pic_height, image, resizeHandle, oa_w, oa_h, oa_x, oa_y, mx2, my2; function init_resize() { if(mode == "scale") { P7_Snap('theImage','ant',0,0); if (canvas == null) canvas = MM_findObj("imgCanvas"); if (pic_width == null || pic_height == null) { image = MM_findObj("theImage"); pic_width = image.width; pic_height = image.height; } if (ant == null) ant = MM_findObj("ant"); ant.style.left = pic_x; ant.style.top = pic_y; ant.style.width = pic_width; ant.style.height = pic_height; ant.style.visibility = "visible"; drawBoundHandle(); jg_doc.paint(); } } initEditor = function () { init_crop(); init_resize(); var markerImg = MM_findObj('markerImg', window.top.document); if (markerImg.src.indexOf("img/t_white.gif")>0) toggleMarker() ; } function init_crop() { //if(mode == "crop") { P7_Snap('theImage','ant',0,0); //} } function setMode(newMode) { mode = newMode; reset(); } function reset() { if (ant == null) ant = MM_findObj("ant"); ant.style.visibility = "hidden"; ant.style.left = 0; ant.style.top = 0; ant.style.width = 0; ant.style.height = 0; mx2 = null; my2 = null; jg_doc.clear(); if(mode != 'measure') showStatus(); if(mode == "scale") { init_resize(); } P7_Snap('theImage','ant',0,0); } function toggleMarker() { //alert("Toggle"); if (ant == null) ant = MM_findObj("ant"); if(ant.className=="selection") ant.className="selectionWhite"; else ant.className="selection"; if (jg_doc.getColor() == "#000000") jg_doc.setColor("#FFFFFF"); else jg_doc.setColor("#000000"); drawBoundHandle jg_doc.paint(); } function move(e) { if (dragapproved) { //z.style.left=ns6? temp1+e.clientX-x: temp1+event.clientX-x //z.style.top=ns6? temp2+e.clientY-y : temp2+event.clientY-y var w = ns6? temp1+e.clientX - x : temp1+event.clientX - x; var h = ns6? temp2+e.clientY - y : temp2+event.clientY - y; //alert(canvas.style.left); /*if (status !=null) { status.innerHTML = "x:"+x+" y:"+y+" w:"+w+" h:"+h+" can_h:"+pic_height; status.innerHTML += " can_w:"+pic_width+" px:"+pic_x+" py:"+pic_y; status.innerHTML += " pix:"+image.style.left+" piy:"+image.style.top+" obj:"+obj.id; }*/ /*jg_doc.clear(); jg_doc.fillRectPattern(0,0,Math.abs(w),Math.abs(h),pattern); jg_doc.paint(); */ if (ant != null) { if (w >= 0) { ant.style.left = x; ant.style.width = w; } else { ant.style.left = x+w; ant.style.width = -1*w; } if (h >= 0) { ant.style.top = y; ant.style.height = h; } else { ant.style.top = y+h; ant.style.height = -1*h } } showStatus(); return false } } function moveContent(e) { if (dragapproved) { var dx =ns6? oa_x + e.clientX-x: oa_x + event.clientX-x var dy =ns6? oa_y + e.clientY-y : oa_y + event.clientY-y /*if (status !=null) { status.innerHTML = "x:"+x+" y:"+y+" dx:"+dx+" dy:"+dy; }*/ ant.style.left = dx; ant.style.top = dy; showStatus(); return false; } } //Code add for constraints by Frédéric Klee <fk...@is...> function moveHandle(e) { if (dragapproved) { var w = ns6? e.clientX - x : event.clientX - x; var h = ns6? e.clientY - y : event.clientY - y; var constrained = MM_findObj('constProp', window.top.document); var orginal_height = document.theImage.height ; var orginal_width = document.theImage.width ; rapp = orginal_width/orginal_height ; rapp_inv = orginal_height / orginal_width ; switch(resizeHandle) { case "s-resize": if (oa_h + h >= 0) { ant.style.height = oa_h + h; if(constrained.checked) { ant.style.width = rapp * (oa_h + h) ; ant.style.left = oa_x - rapp * h/2; } } break; case "e-resize": if(oa_w + w >= 0) { ant.style.width = oa_w + w; if(constrained.checked) { ant.style.height = rapp_inv * (oa_w + w) ; ant.style.top = oa_y - rapp_inv * w/2; } } break; case "n-resize": if (oa_h - h >= 0) { ant.style.top = oa_y + h; ant.style.height = oa_h - h; if(constrained.checked) { ant.style.width = rapp * (oa_h - h) ; ant.style.left = oa_x + rapp * h/2; } } break; case "w-resize": if(oa_w - w >= 0) { ant.style.left = oa_x + w; ant.style.width = oa_w - w; if(constrained.checked) { ant.style.height = rapp_inv * (oa_w - w) ; ant.style.top = oa_y + rapp_inv * w/2; } }break; case "nw-resize": if(oa_h - h >= 0 && oa_w - w >= 0) { ant.style.left = oa_x + w; ant.style.width = oa_w - w; ant.style.top = oa_y + h; if(constrained.checked) ant.style.height = rapp_inv * (oa_w - w) ; else ant.style.height = oa_h - h; } break; case "ne-resize": if (oa_h - h >= 0 && oa_w + w >= 0){ ant.style.top = oa_y + h; ant.style.width = oa_w + w; if(constrained.checked) ant.style.height = rapp_inv * (oa_w + w) ; else ant.style.height = oa_h - h; } break; case "se-resize": if (oa_h + h >= 0 && oa_w + w >= 0) { ant.style.width = oa_w + w; if(constrained.checked) ant.style.height = rapp_inv * (oa_w + w) ; else ant.style.height = oa_h + h; } break; case "sw-resize": if (oa_h + h >= 0 && oa_w - w >= 0) { ant.style.left = oa_x + w; ant.style.width = oa_w - w; if(constrained.checked) ant.style.height = rapp_inv * (oa_w - w) ; else ant.style.height = oa_h + h; } } showStatus(); return false; } } function drags(e) { if (!ie&&!ns6) return var firedobj=ns6? e.target : event.srcElement var topelement=ns6? "HTML" : "BODY" while (firedobj.tagName!=topelement&& !(firedobj.className=="crop" || firedobj.className=="handleBox" || firedobj.className=="selection" || firedobj.className=="selectionWhite")) { firedobj=ns6? firedobj.parentNode : firedobj.parentElement } if(firedobj.className=="handleBox") { if(content != null) { if(content.width != null && content.height != null) { content.width = 0; content.height = 0; } //alert(content.width+":"+content.height); } resizeHandle = firedobj.id; /*if(status!=null) { status.innerHTML = " obj:"+firedobj.id; }*/ x=ns6? e.clientX: event.clientX y=ns6? e.clientY: event.clientY oa_w = parseInt(ant.style.width); oa_h = parseInt(ant.style.height); oa_x = parseInt(ant.style.left); oa_y = parseInt(ant.style.top); dragapproved=true document.onmousemove=moveHandle; return false; } else if((firedobj.className == "selection" || firedobj.className=="selectionWhite")&& mode == "crop") { x=ns6? e.clientX: event.clientX y=ns6? e.clientY: event.clientY oa_x = parseInt(ant.style.left); oa_y = parseInt(ant.style.top); dragapproved=true document.onmousemove=moveContent; return false; } else if (firedobj.className=="crop" && mode == "crop") { if(content != null) { if(content.width != null && content.height != null) { content.width = 0; content.height = 0; } //alert(content.width+":"+content.height); } if (status == null) status = MM_findObj("status"); if (ant == null) ant = MM_findObj("ant"); if (canvas == null) canvas = MM_findObj("imgCanvas"); if(content == null) { content = MM_findObj("cropContent"); } if (pic_width == null || pic_height == null) { image = MM_findObj("theImage"); pic_width = image.width; pic_height = image.height; } ant.style.visibility = "visible"; obj = firedobj; dragapproved=true z=firedobj temp1=parseInt(z.style.left+0) temp2=parseInt(z.style.top+0) x=ns6? e.clientX: event.clientX y=ns6? e.clientY: event.clientY document.onmousemove=move return false } else if(firedobj.className=="crop" && mode == "measure") { if (ant == null) ant = MM_findObj("ant"); if (canvas == null) canvas = MM_findObj("imgCanvas"); x=ns6? e.clientX: event.clientX y=ns6? e.clientY: event.clientY //jg_doc.draw dragapproved=true document.onmousemove=measure return false } } function measure(e) { if (dragapproved) { mx2 = ns6? e.clientX : event.clientX; my2 = ns6? e.clientY : event.clientY; jg_doc.clear(); jg_doc.setStroke(Stroke.DOTTED); jg_doc.drawLine(x,y,mx2,my2); jg_doc.paint(); showStatus(); return false; } } function setMarker(nx,ny,nw,nh) { if (ant == null) ant = MM_findObj("ant"); if (canvas == null) canvas = MM_findObj("imgCanvas"); if(content == null) { content = MM_findObj("cropContent"); } if (pic_width == null || pic_height == null) { image = MM_findObj("theImage"); pic_width = image.width; pic_height = image.height; } ant.style.visibility = "visible"; nx = pic_x + nx; ny = pic_y + ny; if (nw >= 0) { ant.style.left = nx; ant.style.width = nw; } else { ant.style.left = nx+nw; ant.style.width = -1*nw; } if (nh >= 0) { ant.style.top = ny; ant.style.height = nh; } else { ant.style.top = ny+nh; ant.style.height = -1*nh } } function max(x,y) { if(y > x) return x; else return y; } function drawBoundHandle() { if(ant == null || ant.style == null) return false; var ah = parseInt(ant.style.height); var aw = parseInt(ant.style.width); var ax = parseInt(ant.style.left); var ay = parseInt(ant.style.top); jg_doc.drawHandle(ax-15,ay-15,30,30,"nw-resize"); //upper left jg_doc.drawHandle(ax-15,ay+ah-15,30,30,"sw-resize"); //lower left jg_doc.drawHandle(ax+aw-15,ay-15,30,30,"ne-resize"); //upper right jg_doc.drawHandle(ax+aw-15,ay+ah-15,30,30,"se-resize"); //lower right jg_doc.drawHandle(ax+max(15,aw/10),ay-8,aw-2*max(15,aw/10),8,"n-resize"); //top middle jg_doc.drawHandle(ax+max(15,aw/10),ay+ah,aw-2*max(15,aw/10),8,"s-resize"); //bottom middle jg_doc.drawHandle(ax-8, ay+max(15,ah/10),8,ah-2*max(15,ah/10),"w-resize"); //left middle jg_doc.drawHandle(ax+aw, ay+max(15,ah/10),8,ah-2*max(15,ah/10),"e-resize"); //right middle jg_doc.drawHandleBox(ax-4,ay-4,8,8,"nw-resize"); //upper left jg_doc.drawHandleBox(ax-4,ay+ah-4,8,8,"sw-resize"); //lower left jg_doc.drawHandleBox(ax+aw-4,ay-4,8,8,"ne-resize"); //upper right jg_doc.drawHandleBox(ax+aw-4,ay+ah-4,8,8,"se-resize"); //lower right jg_doc.drawHandleBox(ax+aw/2-4,ay-4,8,8,"n-resize"); //top middle jg_doc.drawHandleBox(ax+aw/2-4,ay+ah-4,8,8,"s-resize"); //bottom middle jg_doc.drawHandleBox(ax-4, ay+ah/2-4,8,8,"w-resize"); //left middle jg_doc.drawHandleBox(ax+aw-4, ay+ah/2-4,8,8,"e-resize"); //right middle //jg_doc.paint(); } function showStatus() { if(ant == null || ant.style == null) { return false; } if(mode == "measure") { //alert(pic_x); mx1 = x - pic_x; my1 = y - pic_y; mw = mx2 - x; mh = my2 - y; md = parseInt(Math.sqrt(mw*mw + mh*mh)*100)/100; ma = (Math.atan(-1*mh/mw)/Math.PI)*180; if(mw < 0 && mh < 0) ma = ma+180; if (mw <0 && mh >0) ma = ma - 180; ma = parseInt(ma*100)/100; if (m_sx != null && !isNaN(mx1)) m_sx.value = mx1+"px"; if (m_sy != null && !isNaN(my1)) m_sy.value = my1+"px"; if(m_w != null && !isNaN(mw)) m_w.value = mw + "px"; if(m_h != null && !isNaN(mh)) m_h.value = mh + "px"; if(m_d != null && !isNaN(md)) m_d.value = md + "px"; if(m_a != null && !isNaN(ma)) m_a.value = ma + ""; if(r_ra != null &&!isNaN(ma)) r_ra.value = ma; //alert("mx1:"+mx1+" my1"+my1); return false; } var ah = parseInt(ant.style.height); var aw = parseInt(ant.style.width); var ax = parseInt(ant.style.left); var ay = parseInt(ant.style.top); var cx = ax-pic_x<0?0:ax-pic_x; var cy = ay-pic_y<0?0:ay-pic_y; cx = cx>pic_width?pic_width:cx; cy = cy>pic_height?pic_height:cy; var cw = ax-pic_x>0?aw:aw-(pic_x-ax); var ch = ay-pic_y>0?ah:ah-(pic_y-ay); ch = ay+ah<pic_y+pic_height?ch:ch-(ay+ah-pic_y-pic_height); cw = ax+aw<pic_x+pic_width?cw:cw-(ax+aw-pic_x-pic_width); ch = ch<0?0:ch; cw = cw<0?0:cw; if (ant.style.visibility == "hidden") { cx = ""; cy = ""; cw=""; ch=""; } if(mode == 'crop') { if(t_cx != null) t_cx.value = cx; if (t_cy != null) t_cy.value = cy; if(t_cw != null) t_cw.value = cw; if (t_ch != null) t_ch.value = ch; } else if(mode == 'scale') { var sw = aw, sh = ah; if (s_sw.value.indexOf('%')>0 && s_sh.value.indexOf('%')>0) { sw = cw/pic_width; sh = ch/pic_height; } if (s_sw != null) s_sw.value = sw; if (s_sh != null) s_sh.value = sh; } } function dragStopped() { dragapproved=false; if(ant == null || ant.style == null) { return false; } if(mode == "measure") { jg_doc.drawLine(x-4,y,x+4,y); jg_doc.drawLine(x,y-4,x,y+4); jg_doc.drawLine(mx2-4,my2,mx2+4,my2); jg_doc.drawLine(mx2,my2-4,mx2,my2+4); jg_doc.paint(); showStatus(); return false; } var ah = parseInt(ant.style.height); var aw = parseInt(ant.style.width); var ax = parseInt(ant.style.left); var ay = parseInt(ant.style.top); jg_doc.clear(); if(content != null) { if(content.width != null && content.height != null) { content.width = aw-1; content.height = ah-1; } //alert(content.width+":"+content.height); } if(mode == "crop") { //alert(pic_y); jg_doc.fillRectPattern(pic_x,pic_y,pic_width,ay-pic_y,pattern); var h1 = ah; var y1 = ay; if (ah+ay >= pic_height+pic_y) h1 = pic_height+pic_y-ay; else if (ay <= pic_y) { h1 = ay+ah-pic_y; y1 = pic_y; } jg_doc.fillRectPattern(pic_x,y1,ax-pic_x,h1,pattern); jg_doc.fillRectPattern(ax+aw,y1,pic_x+pic_width-ax-aw,h1,pattern); jg_doc.fillRectPattern(pic_x,ay+ah,pic_width,pic_height+pic_y-ay-ah,pattern); } else if(mode == "scale") { //alert("Resizing: iw:"+image.width+" nw:"+aw); document.theImage.height = ah; document.theImage.width = aw; document.theImage.style.height = ah+" px"; document.theImage.style.width = aw+" px"; P7_Snap('theImage','ant',0,0); //alert("After Resizing: iw:"+image.width+" nw:"+aw); } drawBoundHandle(); jg_doc.paint(); showStatus(); return false; } document.onmousedown=drags document.onmouseup=dragStopped; --- NEW FILE: ImageEditor.css --- .icons { font: 11px Tahoma,Verdana,sans-serif; color: #666699; text-align: center; text-decoration: none; border: 1px solid #EEEEFF; -Moz-Border-Radius: 6px 6px 6px 6px; } body, td, p { font: 11px Tahoma,Verdana,sans-serif; } .iconsOver { font: 11px Tahoma,Verdana,sans-serif; color: #666699; text-align: center; text-decoration: none; background-color: #F9F9FF; border: 1px solid #666699; -Moz-Border-Radius: 6px 6px 6px 6px; } .topBar { font: 11px Tahoma,Verdana,sans-serif; color: #666699; } .iconsSel { font: 11px Tahoma,Verdana,sans-serif; color: #666699; text-align: center; text-decoration: none; border: 1px solid #666699; -Moz-Border-Radius: 6px 6px 6px 6px; } .iconText { font: 11px Tahoma,Verdana,sans-serif; color: #666699; text-decoration: none; text-align: center; } .measureStats{ width: 50px; } #slidercasing { /*border:1px solid #CCCCCC; background-color:#FFFFFF;*/ width:100px; height:5px; position:relative; z-index:4; padding:10px; } #slidertrack { position:relative; border:1px solid #CCCCCC; background-color:#FFFFCC; z-index:5; height:5px; } #sliderbar { position:absolute; z-index:6; border:1px solid #CCCCCC; background-color:#DDDDDD; width:15px; padding:0px; height:20px; cursor: pointer; top:2px; } select, input, button { font: 11px Tahoma,Verdana,sans-serif; } --- NEW FILE: dialog.js --- // Dialog v3.0 - Copyright (c) 2003-2004 interactivetools.com, inc. // This copyright notice MUST stay intact for use (see license.txt). // // Portions (c) dynarch.com, 2003-2004 // // A free WYSIWYG editor replacement for <textarea> fields. // For full source code and docs, visit http://www.interactivetools.com/ // // Version 3.0 developed by Mihai Bazon. // http://dynarch.com/mishoo // // $Id: dialog.js,v 1.1 2004/08/23 17:49:00 joestewart Exp $ // Though "Dialog" looks like an object, it isn't really an object. Instead // it's just namespace for protecting global symbols. function Dialog(url, action, init) { if (typeof init == "undefined") { init = window; // pass this window object by default } Dialog._geckoOpenModal(url, action, init); }; Dialog._parentEvent = function(ev) { setTimeout( function() { if (Dialog._modal && !Dialog._modal.closed) { Dialog._modal.focus() } }, 50); if (Dialog._modal && !Dialog._modal.closed) { Dialog._stopEvent(ev); } }; // should be a function, the return handler of the currently opened dialog. Dialog._return = null; // constant, the currently opened dialog Dialog._modal = null; // the dialog will read it's args from this variable Dialog._arguments = null; Dialog._geckoOpenModal = function(url, action, init) { //var urlLink = "hadialog"+url.toString(); var myURL = "hadialog"+url; var regObj = /\W/g; myURL = myURL.replace(regObj,'_'); var dlg = window.open(url, myURL, "toolbar=no,menubar=no,personalbar=no,width=10,height=10," + "scrollbars=no,resizable=yes,modal=yes,dependable=yes"); Dialog._modal = dlg; Dialog._arguments = init; // capture some window's events function capwin(w) { Dialog._addEvent(w, "click", Dialog._parentEvent); Dialog._addEvent(w, "mousedown", Dialog._parentEvent); Dialog._addEvent(w, "focus", Dialog._parentEvent); }; // release the captured events function relwin(w) { Dialog._removeEvent(w, "click", Dialog._parentEvent); Dialog._removeEvent(w, "mousedown", Dialog._parentEvent); Dialog._removeEvent(w, "focus", Dialog._parentEvent); }; capwin(window); // capture other frames for (var i = 0; i < window.frames.length; capwin(window.frames[i++])); // make up a function to be called when the Dialog ends. Dialog._return = function (val) { if (val && action) { action(val); } relwin(window); // capture other frames for (var i = 0; i < window.frames.length; relwin(window.frames[i++])); Dialog._modal = null; }; }; // event handling Dialog._addEvent = function(el, evname, func) { if (Dialog.is_ie) { el.attachEvent("on" + evname, func); } else { el.addEventListener(evname, func, true); } }; Dialog._removeEvent = function(el, evname, func) { if (Dialog.is_ie) { el.detachEvent("on" + evname, func); } else { el.removeEventListener(evname, func, true); } }; Dialog._stopEvent = function(ev) { if (Dialog.is_ie) { ev.cancelBubble = true; ev.returnValue = false; } else { ev.preventDefault(); ev.stopPropagation(); } }; Dialog.agt = navigator.userAgent.toLowerCase(); Dialog.is_ie = ((Dialog.agt.indexOf("msie") != -1) && (Dialog.agt.indexOf("opera") == -1)); --- NEW FILE: editor.css --- body { margin: 0; padding: 0; font: 11px Tahoma,Verdana,sans-serif; } select, input, button { font: 11px Tahoma,Verdana,sans-serif; } #indicator { width: 25px; height: 20px; background-color: #eef; padding: 15px 20px; position: absolute; left: 0; top: 0; } * html #indicator { padding: 14px 22px; } #tools { width: 600px; height: 50px; background-color: #eef; padding: 0; position: absolute; left: 63px; border-left: 1px solid white; border-bottom: 1px solid white; } #toolbar { width: 53px; height: 435px; background-color: #eef; float: left; text-align: center; padding: 5px; position: absolute; top: 50px; border-top: 1px solid white; border-right: 1px solid white; } #contents { width: 600px; height: 445px; position: absolute; left: 64px; top: 51px; } #editor { width: 600px; height: 445px; } #toolbar a { padding: 5px; width: 40px; display: block; border: 1px solid #eef; text-align: center; text-decoration: none; color: #669; margin: 5px 0; } #toolbar a:hover { background-color: #F9F9FF; border-color: #669; } #toolbar a.iconActive { border-color: #669; } #toolbar a span { display: block; text-decoration: none; } #toolbar a img { border: 0 none; } #tools .textInput { width: 3em; vertical-align: 0px; } * html #tools .textInput { vertical-align: middle; } #tools .measureStats { width: 4.5em; border: 0 none; background-color: #eef; vertical-align: 0px; } * html #tools .measureStats { vertical-align: middle; } #tools label { margin: 0 2px 0 5px; } #tools input { vertical-align: middle; } #tools #tool_inputs { padding-top: 10px; float: left; } #tools .div { vertical-align: middle; margin: 0 5px; } #tools img { border: 0 none; } #tools a.buttons { margin-top: 10px; border: 1px solid #eef; display: block; float: left; } #tools a.buttons:hover { background-color: #F9F9FF; border-color: #669; } #slidercasing { /*border:1px solid #CCCCCC; background-color:#FFFFFF;*/ width:100px; height:5px; position:relative; z-index:4; padding:10px; top: 6px; margin: 0 -5px 0 -10px; } #slidertrack { position:relative; border:1px solid #CCCCCC; background-color:#FFFFCC; z-index:5; height:5px; } #sliderbar { position:absolute; z-index:6; border:1px solid #CCCCCC; background-color:#DDDDDD; width:15px; padding:0px; height:20px; cursor: pointer; top:2px; } * html #slidercasing { top:0; } #bottom { position: relative; top: 490px; } --- NEW FILE: editor.js --- /** * Functions for the ImageEditor interface, used by editor.php only * @author $Author: joestewart $ * @version $Id: editor.js,v 1.1 2004/08/23 17:49:00 joestewart Exp $ * @package ImageManager */ var current_action = null; var actions = ['crop', 'scale', 'rotate', 'measure', 'save']; var orginal_width = null, orginal_height=null; function toggle(action) { if(current_action != action) { for (var i in actions) { if(actions[i] != action) { var tools = document.getElementById('tools_'+actions[i]); tools.style.display = 'none'; var icon = document.getElementById('icon_'+actions[i]); icon.className = ''; } } current_action = action; var tools = document.getElementById('tools_'+action); tools.style.display = 'block'; var icon = document.getElementById('icon_'+action); icon.className = 'iconActive'; var indicator = document.getElementById('indicator_image'); indicator.src = 'img/'+action+'.gif'; editor.setMode(current_action); //constraints on the scale, //code by Frédéric Klee <fk...@is...> if(action == 'scale') { var theImage = editor.window.document.getElementById('theImage'); orginal_width = theImage.width ; orginal_height = theImage.height; var w = document.getElementById('sw'); w.value = orginal_width ; var h = document.getElementById('sh') ; h.value = orginal_height ; } } } function toggleMarker() { var marker = document.getElementById("markerImg"); if(marker != null && marker.src != null) { if(marker.src.indexOf("t_black.gif") >= 0) marker.src = "img/t_white.gif"; else marker.src = "img/t_black.gif"; editor.toggleMarker(); } } //Togggle constraints, by Frédéric Klee <fk...@is...> function toggleConstraints() { var lock = document.getElementById("scaleConstImg"); var checkbox = document.getElementById("constProp"); if(lock != null && lock.src != null) { if(lock.src.indexOf("unlocked2.gif") >= 0) { lock.src = "img/islocked2.gif"; checkbox.checked = true; checkConstrains('width'); } else { lock.src = "img/unlocked2.gif"; checkbox.checked = false; } } } //check the constraints, by Frédéric Klee <fk...@is...> function checkConstrains(changed) { var constrained = document.getElementById('constProp'); if(constrained.checked) { var w = document.getElementById('sw') ; var width = w.value ; var h = document.getElementById('sh') ; var height = h.value ; if(orginal_width > 0 && orginal_height > 0) { if(changed == 'width' && width > 0) h.value = parseInt((width/orginal_width)*orginal_height); else if(changed == 'height' && height > 0) w.value = parseInt((height/orginal_height)*orginal_width); } } updateMarker('scale') ; } function updateMarker(mode) { if (mode == 'crop') { var t_cx = document.getElementById('cx'); var t_cy = document.getElementById('cy'); var t_cw = document.getElementById('cw'); var t_ch = document.getElementById('ch'); editor.setMarker(parseInt(t_cx.value), parseInt(t_cy.value), parseInt(t_cw.value), parseInt(t_ch.value)); } else if(mode == 'scale') { var s_sw = document.getElementById('sw'); var s_sh = document.getElementById('sh'); editor.setMarker(0, 0, parseInt(s_sw.value), parseInt(s_sh.value)); } } function rotatePreset(selection) { var value = selection.options[selection.selectedIndex].value; if(value.length > 0 && parseInt(value) != 0) { var ra = document.getElementById('ra'); ra.value = parseInt(value); } } function updateFormat(selection) { var selected = selection.options[selection.selectedIndex].value; var values = selected.split(","); if(values.length >1) { updateSlider(parseInt(values[1])); } } function addEvent(obj, evType, fn) { if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; } } init = function() { var bottom = document.getElementById('bottom'); if(window.opener) { __dlg_init(bottom); __dlg_translate(I18N); } } addEvent(window, 'load', init); --- NEW FILE: editorFrame.css --- body { margin: 0; padding: 0; background-color: #eee; } table { width: 100%; } table td { text-align: center; } .crop{cursor:crosshair;} .selection { border: dotted 1px #000000; position:absolute; width: 0px; height: 1px; z-index:5; } .selectionWhite{ border: dotted 1px #FFFFFF; position:absolute; width: 0px; height: 1px; z-index:5; } .handleBox{ z-index:105; } .error { font-size:large; font-weight:bold; color:#c00; font-family: Helvetica, sans-serif; } --- NEW FILE: editorFrame.js --- /** * Javascript used by the editorFrame.php, it basically initializes the frame. * @author $Author: joestewart $ * @version $Id: editorFrame.js,v 1.1 2004/08/23 17:49:00 joestewart Exp $ * @package ImageManager */ var topDoc = window.top.document; var t_cx = topDoc.getElementById('cx'); var t_cy = topDoc.getElementById('cy'); var t_cw = topDoc.getElementById('cw'); var t_ch = topDoc.getElementById('ch'); var m_sx = topDoc.getElementById('sx'); var m_sy = topDoc.getElementById('sy'); var m_w = topDoc.getElementById('mw'); var m_h = topDoc.getElementById('mh'); var m_a = topDoc.getElementById('ma'); var m_d = topDoc.getElementById('md'); var s_sw = topDoc.getElementById('sw'); var s_sh = topDoc.getElementById('sh'); var r_ra = topDoc.getElementById('ra'); var pattern = "img/2x2.gif"; function doSubmit(action) { if (action == 'crop') { var url = "editorFrame.php?img="+currentImageFile+"&action=crop¶ms="+parseInt(t_cx.value)+','+parseInt(t_cy.value)+','+ parseInt(t_cw.value)+','+parseInt(t_ch.value); //alert(url); location.href = url; //location.reload(); } else if (action == 'scale') { var url = "editorFrame.php?img="+currentImageFile+"&action=scale¶ms="+parseInt(s_sw.value)+','+parseInt(s_sh.value); //alert(url); location.href = url; } else if (action == 'rotate') { var flip = topDoc.getElementById('flip'); if(flip.value == 'hoz' || flip.value == 'ver') location.href = "editorFrame.php?img="+currentImageFile+"&action=flip¶ms="+flip.value; else if (isNaN(parseFloat(r_ra.value))==false) location.href = "editorFrame.php?img="+currentImageFile+"&action=rotate¶ms="+parseFloat(r_ra.value); } else if(action == 'save') { var s_file = topDoc.getElementById('save_filename'); var s_format = topDoc.getElementById('save_format'); var s_quality = topDoc.getElementById('quality'); var format = s_format.value.split(","); if(s_file.value.length <= 0) { alert(i18n('Please enter a filename to save.')); } else { var filename = encodeURI(s_file.value); var quality = parseInt(s_quality.value); var url = "editorFrame.php?img="+currentImageFile+"&action=save¶ms="+format[0]+","+quality+"&file="+filename; //alert(url); location.href = url; } } } function addEvent(obj, evType, fn) { if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; } } var jg_doc init = function() { jg_doc = new jsGraphics("imgCanvas"); // draw directly into document jg_doc.setColor("#000000"); // black initEditor(); } addEvent(window, 'load', init); --- NEW FILE: hover.htc --- <attach event="onmouseover" handler="hoverRollOver" /> <attach event="onmouseout" handler="hoverRollOff" /> <script type="text/javascript"> // // Simple behaviour for IE5+ to emulate :hover CSS pseudo-class. // Experimental ver 0.1 // // This is an experimental version! Handle with care! // Manual at: http://www.hszk.bme.hu/~hj130/css/list_menu/hover/ // function hoverRollOver() { element.origClassName = element.className; // backup origonal className var tempClassStr = element.className; tempClassStr += "Hover"; // convert name+'Hover' the last class name to emulate tag.class:hover tempClassStr = tempClassStr.replace(/\s/g,"Hover "); //convert name+'Hover' the others to emulate tag.class:hover tempClassStr += " hover"; // add simple 'hover' class name to emulate tag:hover element.className = element.className + " " + tempClassStr; //alert(element.className); //window.status = element.className; // only for TEST } function hoverRollOff() { element.className = element.origClassName; } </script> --- NEW FILE: imagelist.css --- body { margin: 0; padding: 0; } .block { height: 98px; width: 98px; border: 1px solid threedface; text-align: center; behavior: url(hover.htc ); } .block a img { border: 0 none; } .block:hover, .block.hover{ background-color: #ffc; } .edit { font-size: 9pt; font-family: "MS Sans Serif", Geneva, sans-serif; padding-top: 3px;} .edit a { border: 1px solid white; padding: 3px; } .edit a:hover { border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; background-color: #ffc; } .edit a img { border: 0 none; vertical-align: bottom; } .noResult { font-size:large; font-weight:bold; color:#ccc; font-family: Helvetica, sans-serif; text-align: center; padding-top: 60px; } .error { color:#c00; font-weight:bold; font-size: medium; font-family: Helvetica, sans-serif; text-align: center; padding-top: 65px;} --- NEW FILE: images.js --- /** * Functions for the image listing, used by images.php only * @author $Author: joestewart $ * @version $Id: images.js,v 1.1 2004/08/23 17:49:00 joestewart Exp $ * @package ImageManager */ function i18n(str) { if(I18N) return (I18N[str] || str); else return str; }; function changeDir(newDir) { showMessage('Loading'); location.href = "images.php?dir="+newDir; } function newFolder(dir, newDir) { location.href = "images.php?dir="+dir+"&newDir="+newDir; } //update the dir list in the parent window. function updateDir(newDir) { var selection = window.top.document.getElementById('dirPath'); if(selection) { for(var i = 0; i < selection.length; i++) { var thisDir = selection.options[i].text; if(thisDir == newDir) { selection.selectedIndex = i; showMessage('Loading'); break; } } } } function selectImage(filename, alt, width, height) { var topDoc = window.top.document; var obj = topDoc.getElementById('f_url'); obj.value = filename; var obj = topDoc.getElementById('f_width'); obj.value = width; var obj = topDoc.getElementById('f_width'); obj.value = width; var obj = topDoc.getElementById('f_height'); obj.value = height; var obj = topDoc.getElementById('f_alt'); obj.value = alt; var obj = topDoc.getElementById('orginal_width'); obj.value = width; var obj = topDoc.getElementById('orginal_height'); obj.value = height; } function showMessage(newMessage) { var topDoc = window.top.document; var message = topDoc.getElementById('message'); var messages = topDoc.getElementById('messages'); if(message && messages) { if(message.firstChild) message.removeChild(message.firstChild); message.appendChild(topDoc.createTextNode(i18n(newMessage))); messages.style.display = "block"; } } function addEvent(obj, evType, fn) { if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; } } function confirmDeleteFile(file) { if(confirm(i18n("Delete file?"))) return true; return false; } function confirmDeleteDir(dir, count) { if(count > 0) { alert(i18n("Please delete all files/folders inside the folder you wish to delete first.")); return; } if(confirm(i18n("Delete folder?"))) return true; return false; } addEvent(window, 'load', init); --- NEW FILE: manager.css --- html, body { background-color: ButtonFace; color: ButtonText; font: 11px Tahoma,Verdana,sans-serif; margin: 0; padding: 0;} body { padding: 5px; } fieldset { padding: 0;} .title { background-color: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px; border-bottom: 1px solid black; letter-spacing: 2px;} form { padding: 0px; margin: 0 auto; width: 550px;} .dirWidth { width: 70%; } a { padding: 5px; border: 1px solid ButtonFace; } a img { border: 0; } a:hover { border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; } .dirs { padding: 1em; } .imageFrame { width: 525px; height: 145px; margin: 0 auto; margin-top: 1em; background-color: White;} .smallWidth{ width: 4em; } .largelWidth{ width: 22em; } .inputTable { margin: 1em auto; } select, input, button { font: 11px Tahoma,Verdana,sans-serif; } .buttons { width: 70px; text-align: center; } .clearboth{ clear: both; } #messages { position: relative; left: 175px; top: 115px; background-color: white; width:200px; float: left; margin-top: -52px; border: 1px solid #ccc; text-align: center; padding: 15px; } #message { font-size: 15px; font-weight: bold; color: #69c; } --- NEW FILE: manager.js --- /** * Functions for the ImageManager, used by manager.php only * @author $Author: joestewart $ * @version $Id: manager.js,v 1.1 2004/08/23 17:49:00 joestewart Exp $ * @package ImageManager */ //Translation function i18n(str) { if(I18N) return (I18N[str] || str); else return str; }; //set the alignment options function setAlign(align) { var selection = document.getElementById('f_align'); for(var i = 0; i < selection.length; i++) { if(selection.options[i].value == align) { selection.selectedIndex = i; break; } } } //initialise the form init = function () { __dlg_init(); if(I18N) __dlg_translate(I18N); var uploadForm = document.getElementById('uploadForm'); if(uploadForm) uploadForm.target = 'imgManager'; var param = window.dialogArguments; if (param) { document.getElementById("f_url").value = param["f_url"]; document.getElementById("f_alt").value = param["f_alt"]; document.getElementById("f_border").value = param["f_border"]; document.getElementById("f_vert").value = param["f_vert"]; document.getElementById("f_horiz").value = param["f_horiz"]; document.getElementById("f_width").value = param["f_width"]; document.getElementById("f_height").value = param["f_height"]; setAlign(param["f_align"]); } document.getElementById("f_url").focus(); } function onCancel() { __dlg_close(null); return false; }; function onOK() { // pass data back to the calling window var fields = ["f_url", "f_alt", "f_align", "f_border", "f_horiz", "f_vert", "f_height", "f_width"]; var param = new Object(); for (var i in fields) { var id = fields[i]; var el = document.getElementById(id); if(id == "f_url" && el.value.indexOf('://') < 0 ) param[id] = makeURL(base_url,el.value); else param[id] = el.value; } __dlg_close(param); return false; }; //similar to the Files::makeFile() in Files.php function makeURL(pathA, pathB) { if(pathA.substring(pathA.length-1) != '/') pathA += '/'; if(pathB.charAt(0) == '/'); pathB = pathB.substring(1); return pathA+pathB; } function updateDir(selection) { var newDir = selection.options[selection.selectedIndex].value; changeDir(newDir); } function goUpDir() { var selection = document.getElementById('dirPath'); var currentDir = selection.options[selection.selectedIndex].text; if(currentDir.length < 2) return false; var dirs = currentDir.split('/'); var search = ''; for(var i = 0; i < dirs.length - 2; i++) { search += dirs[i]+'/'; } for(var i = 0; i < selection.length; i++) { var thisDir = selection.options[i].text; if(thisDir == search) { selection.selectedIndex = i; var newDir = selection.options[i].value; changeDir(newDir); break; } } } function changeDir(newDir) { if(typeof imgManager != 'undefined') imgManager.changeDir(newDir); } function toggleConstrains(constrains) { var lockImage = document.getElementById('imgLock'); var constrains = document.getElementById('constrain_prop'); if(constrains.checked) { lockImage.src = "img/locked.gif"; checkConstrains('width') } else { lockImage.src = "img/unlocked.gif"; } } function checkConstrains(changed) { //alert(document.form1.constrain_prop); var constrains = document.getElementById('constrain_prop'); if(constrains.checked) { var obj = document.getElementById('orginal_width'); var orginal_width = parseInt(obj.value); var obj = document.getElementById('orginal_height'); var orginal_height = parseInt(obj.value); var widthObj = document.getElementById('f_width'); var heightObj = document.getElementById('f_height'); var width = parseInt(widthObj.value); var height = parseInt(heightObj.value); if(orginal_width > 0 && orginal_height > 0) { if(changed == 'width' && width > 0) { heightObj.value = parseInt((width/orginal_width)*orginal_height); } if(changed == 'height' && height > 0) { widthObj.value = parseInt((height/orginal_height)*orginal_width); } } } } function showMessage(newMessage) { var message = document.getElementById('message'); var messages = document.getElementById('messages'); if(message.firstChild) message.removeChild(message.firstChild); message.appendChild(document.createTextNode(i18n(newMessage))); messages.style.display = "block"; } function addEvent(obj, evType, fn) { if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; } } function doUpload() { var uploadForm = document.getElementById('uploadForm'); if(uploadForm) showMessage('Uploading'); } function refresh() { var selection = document.getElementById('dirPath'); updateDir(selection); } function newFolder() { var selection = document.getElementById('dirPath'); var dir = selection.options[selection.selectedIndex].value; Dialog("newFolder.html", function(param) { if (!param) // user must have pressed Cancel return false; else { var folder = param['f_foldername']; if(folder == thumbdir) { alert(i18n('Invalid folder name, please choose another folder name.')); return false; } if (folder && folder != '' && typeof imgManager != 'undefined') imgManager.newFolder(dir, encodeURI(folder)); } }, null); } addEvent(window, 'load', init); --- NEW FILE: popup.js --- // htmlArea v3.0 - Copyright (c) 2002, 2003 interactivetools.com, inc. // This copyright notice MUST stay intact for use (see license.txt). // // Portions (c) dynarch.com, 2003 // // A free WYSIWYG editor replacement for <textarea> fields. // For full source code and docs, visit http://www.interactivetools.com/ // // Version 3.0 developed by Mihai Bazon. // http://dynarch.com/mishoo // // $Id: popup.js,v 1.1 2004/08/23 17:49:00 joestewart Exp $ // Slightly modified for the ImageManager, window resizing is done only // by each window's script. Added translation for a few other HTML elements. function getAbsolutePos(el) { var r = { x: el.offsetLeft, y: el.offsetTop }; if (el.offsetParent) { var tmp = getAbsolutePos(el.offsetParent); r.x += tmp.x; r.y += tmp.y; } return r; }; function comboSelectValue(c, val) { var ops = c.getElementsByTagName("option"); for (var i = ops.length; --i >= 0;) { var op = ops[i]; op.selected = (op.value == val); } c.value = val; }; function __dlg_onclose() { if(opener.Dialog._return) opener.Dialog._return(null); }; function __dlg_init(bottom) { var body = document.body; var body_height = 0; if (typeof bottom == "undefined") { var div = document.createElement("div"); body.appendChild(div); var pos = getAbsolutePos(div); body_height = pos.y; } else { var pos = getAbsolutePos(bottom); body_height = pos.y + bottom.offsetHeight; } if(opener && opener.Dialog && opener.Dialog._arguments) window.dialogArguments = opener.Dialog._arguments; if (!document.all) { //window.sizeToContent(); //window.sizeToContent(); // for reasons beyond understanding, // only if we call it twice we get the // correct size. window.addEventListener("unload", __dlg_onclose, true); // center on parent var x = opener.screenX + (opener.outerWidth - window.outerWidth) / 2; var y = opener.screenY + (opener.outerHeight - window.outerHeight) / 2; window.moveTo(x, y); //window.innerWidth = body.offsetWidth + 5; //window.innerHeight = body_height + 2; } else { // window.dialogHeight = body.offsetHeight + 50 + "px"; // window.dialogWidth = body.offsetWidth + "px"; //window.resizeTo(body.offsetWidth, body_height); var ch = body.clientHeight; var cw = body.clientWidth; //window.resizeBy(body.offsetWidth - cw, body_height - ch); var W = body.offsetWidth; var H = 2 * body_height - ch; if(ch <= 0) H = body_height; var x = (screen.availWidth - W) / 2; var y = (screen.availHeight - H) / 2; window.moveTo(x, y); } document.body.onkeypress = __dlg_close_on_esc; }; function __dlg_translate(i18n) { var types = ["span", "option", "td", "button", "div", "label", "a","img", "legend"]; for (var type in types) { var spans = document.getElementsByTagName(types[type]); for (var i = spans.length; --i >= 0;) { var span = spans[i]; if (span.firstChild && span.firstChild.data) { var txt = i18n[span.firstChild.data]; if (txt) span.firstChild.data = txt; } if(span.title){ var txt = i18n[span.title]; if(txt) span.title = txt; } if(span.alt){ var txt = i18n[span.alt]; if(txt) span.alt = txt; } } } var txt = i18n[document.title]; if (txt) document.title = txt; }; // closes the dialog and passes the return info upper. function __dlg_close(val) { opener.Dialog._return(val); window.close(); }; function __dlg_close_on_esc(ev) { ev || (ev = window.event); if (ev.keyCode == 27) { window.close(); return false; } return true; }; --- NEW FILE: slider.js --- /*********************************************************************** ** Title.........: Simple Lite Slider for Image Editor ** Version.......: 1.1 ** Author........: Xiang Wei ZHUO <we...@zh...> ** Filename......: slider.js ** Last changed..: 31 Mar 2004 ** Notes.........: Works in IE and Mozilla **/ var ie=document.all var ns6=document.getElementById&&!document.all document.onmouseup = captureStop; var currentSlider = null,sliderField = null; var rangeMin = null, rangeMax= null, sx = -1, sy = -1, initX=0; function getMouseXY(e) { //alert('hello'); x = ns6? e.clientX: event.clientX y = ns6? e.clientY: event.clientY if (sx < 0) sx = x; if (sy < 0) sy = y; var dx = initX +(x-sx); if (dx <= rangeMin) dx = rangeMin; else if (dx >= rangeMax) dx = rangeMax; var range = (dx-rangeMin)/(rangeMax - rangeMin)*100; if (currentSlider != null) currentSlider.style.left = dx+"px"; if (sliderField != null) { sliderField.value = parseInt(range); } return false; } function initSlider() { if (currentSlider == null) currentSlider = document.getElementById('sliderbar'); if (sliderField == null) sliderField = document.getElementById('quality'); if (rangeMin == null) rangeMin = 3 if (rangeMax == null) { var track = document.getElementById('slidertrack'); rangeMax = parseInt(track.style.width); } } function updateSlider(value) { initSlider(); var newValue = parseInt(value)/100*(rangeMax-rangeMin); if (newValue <= rangeMin) newValue = rangeMin; else if (newValue >= rangeMax) newValue = rangeMax; if (currentSlider != null) currentSlider.style.left = newValue+"px"; var range = newValue/(rangeMax - rangeMin)*100; if (sliderField != null) sliderField.value = parseInt(range); } function captureStart() { initSlider(); initX = parseInt(currentSlider.style.left); if (initX > rangeMax) initX = rangeMax; else if (initX < rangeMin) initX = rangeMin; document.onmousemove = getMouseXY; return false; } function captureStop() { sx = -1; sy = -1; document.onmousemove = null; return false; } --- NEW FILE: wz_jsgraphics.js --- /*********************************************************************** ** Title.........: Javascript Graphics ** Version.......: 1.0 ** Author........: Xiang Wei ZHUO <we...@zh...> ** Filename......: wz_jsgraphics.js ** Last changed..: 31 Aug 2003 ** Notes.........: Modified for Image Editor, added extra commands **/ /* This notice must be untouched at all times. wz_jsgraphics.js v. 2.03 The latest version is available at http://www.walterzorn.com or http://www.devira.com or http://www.walterzorn.de Copyright (c) 2002-2003 Walter Zorn. All rights reserved. Created 3. 11. 2002 by Walter Zorn <wa...@kr...> Last modified: 11. 6. 2003 High Performance JavaScript Graphics Library. Provides methods - to draw lines, rectangles, ellipses, polygons with specifiable line thickness, - to fill rectangles and ellipses - to draw text. NOTE: Operations, functions and branching have rather been optimized to efficiency and speed than to shortness of source code. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License at http://www.gnu.org/copyleft/gpl.html for more details. */ var jg_ihtm, jg_ie, jg_dom, jg_n4 = (document.layers && typeof document.classes != "undefined"); function chkDHTM(x, i) { x = document.body || null; jg_ie = (x && typeof x.insertAdjacentHTML != "undefined"); jg_dom = (x && !jg_ie && typeof x.appendChild != "undefined" && typeof document.createRange != "undefined" && typeof (i = document.createRange()).setStartBefore != "undefined" && typeof i.createContextualFragment != "undefined"); jg_ihtm = (!jg_ie && !jg_dom && x && typeof x.innerHTML != "undefined"); } function pntDoc() { this.wnd.document.write(this.htm); this.htm = ''; } function pntCnvDom() { var x = document.createRange(); x.setStartBefore(this.cnv); x = x.createContextualFragment(this.htm); this.cnv.appendChild(x); this.htm = ''; } function pntCnvIe() { this.cnv.insertAdjacentHTML("BeforeEnd", this.htm); this.htm = ''; } function pntCnvIhtm() { this.cnv.innerHTML += this.htm; this.htm = ''; } function pntCnv() { this.htm = ''; } function mkDiv(x, y, w, h) { this.htm += '<div style="position:absolute;'+ 'left:' + x + 'px;'+ 'top:' + y + 'px;'+ 'width:' + w + 'px;'+ 'height:' + h + 'px;'+ 'clip:rect(0,'+w+'px,'+h+'px,0);'+ 'overflow:hidden;background-color:' + this.color + ';'+ '"><\/div>'; //alert(this.htm); } function mkDivPrint(x, y, w, h) { this.htm += '<div style="position:absolute;'+ 'border-left:' + w + 'px solid ' + this.color + ';'+ 'left:' + x + 'px;'+ 'top:' + y + 'px;'+ 'width:' + w + 'px;'+ 'height:' + h + 'px;'+ 'clip:rect(0,'+w+'px,'+h+'px,0);'+ 'overflow:hidden;background-color:' + this.color + ';'+ '"><\/div>'; } function mkLyr(x, y, w, h) { this.htm += '<layer '+ 'left="' + x + '" '+ 'top="' + y + '" '+ 'width="' + w + '" '+ 'height="' + h + '" '+ 'bgcolor="' + this.color + '"><\/layer>\n'; } function mkLbl(txt, x, y) { this.htm += '<div style="position:absolute;white-space:nowrap;'+ 'left:' + x + 'px;'+ 'top:' + y + 'px;'+ 'font-family:' + this.ftFam + ';'+ 'font-size:' + this.ftSz + ';'+ 'color:' + this.color + ';' + this.ftSty + '">'+ txt + '<\/div>'; } function mkLin(x1, y1, x2, y2) { if (x1 > x2) { var _x2 = x2; var _y2 = y2; x2 = x1; y2 = y1; x1 = _x2; y1 = _y2; } var dx = x2-x1, dy = Math.abs(y2-y1), x = x1, y = y1, yIncr = (y1 > y2)? -1 : 1; if (dx >= dy) { var pr = dy<<1, pru = pr - (dx<<1), p = pr-dx, ox = x; while ((dx--) > 0) { ++x; if (p > 0) { this.mkDiv(ox, y, x-ox, 1); y += yIncr; p += pru; ox = x; } else p += pr; } this.mkDiv(ox, y, x2-ox+1, 1); } else { var pr = dx<<1, pru = pr - (dy<<1), p = pr-dy, oy = y; if (y2 <= y1) { while ((dy--) > 0) { if (p > 0) { this.mkDiv(x++, y, 1, oy-y+1); y += yIncr; p += pru; oy = y; } else { y += yIncr; p += pr; } } this.mkDiv(x2, y2, 1, oy-y2+1); } else { while ((dy--) > 0) { y += yIncr; if (p > 0) { this.mkDiv(x++, oy, 1, y-oy); p += pru; oy = y; } else p += pr; } this.mkDiv(x2, oy, 1, y2-oy+1); } } } function mkLin2D(x1, y1, x2, y2) { if (x1 > x2) { var _x2 = x2; var _y2 = y2; x2 = x1; y2 = y1; ... [truncated message content] |
Update of /cvsroot/phpslash/phpslash-dev/public_html/scripts/htmlarea3/plugins/ImageManager/img In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6597/phpslash-dev/public_html/scripts/htmlarea3/plugins/ImageManager/img Added Files: 2x2.gif 2x2_w.gif Thumbs.db btnFolderNew.gif btnFolderUp.gif btn_cancel.gif btn_ok.gif crop.gif default.gif div.gif dots.gif edit_active.gif edit_pencil.gif edit_trash.gif folder.gif hand.gif islocked2.gif locked.gif measure.gif noimages.gif rotate.gif save.gif scale.gif spacer.gif t_black.gif t_white.gif unlocked.gif unlocked2.gif Log Message: Upgraded htmlarea2 --- NEW FILE: 2x2.gif --- GIF89ad )âðè2*æòÉpJЪt%Z·Ç¬÷Æ ó¾äø,+«Ièöj ϸ碸]BÏoî| þÑ×H HXXxxÈ·ø×øi7W©w¹ ·9×I÷Yª6ÚVêvúJ¶zÖöë5V+v;µ»ÕËõë|U\uÌ4¼ÜLÕ¼=ôì<u=V´-Ýýó®=vVî³Þ^ó¯>ovÿVO³ÿßOÅ¿KPßÁ 6D¸ðC --- NEW FILE: 2x2_w.gif --- GIF89ad )âðè2*æòÉpJЪt%Z·Ç¬÷Æ ó¾äø,+«Ièöj ϸ碸]BÏoî| þÑ×H HXXxxÈ·ø×øi7W©w¹ ·9×I÷Yª6ÚVêvúJ¶zÖöë5V+v;µ»ÕËõë|U\uÌ4¼ÜLÕ¼=ôì<u=V´-Ýýó®=vVî³Þ^ó¯>ovÿVO³ÿßOÅ¿KPßÁ 6D¸ðC --- NEW FILE: Thumbs.db --- ÐÏࡱá +åÏ¿òWµßûwÿ øGQÿ 8W øGQÿ C¬lHpv¨` 6YôW¨k²ëú^²n4§¸¼IÊ,fhÄRíB8ÜÈÛP0³Â#Õ5Éu½3T{-îo¬²¥ÍP#µ ¯ÏõÔè:öâ]"3 HÝå§Ür*îö=e;¬fÒe½RòºK[T<²rUb>cFà`ÜãÞ<#UÛjÓÚÇLmÏÁïéßRH ï8¸ ¹¼µåÏÿ >ÝwÞóÚÎHÿ ª0 ÍÊðÈѰúívÁìpy«o]GrW3F¶O ÅIúªþUqâk¨îJæhÑ£VÉáX©#U_Ê®5¼MuÉ\Í4jÙ<+$cê«ùQTÛCÓ("òGKEÀh×¢8çQÏ Éõ9¦ÚÑAÂ8bXB,®F½À?:xlO©Í6Ðôæ¼ÃÂep5èùÔsÃdr}NJ/ô¡}¢Ö6¼´û)}¤?'ó0;òxÁ¥èµÞ±µå§ÙKí$¨ùù<àñ߯ý(_E¨¦õ¯->Ê_i%GÏÉç|çü0T·z]ì¢IãbÛv°YDý× Ý¾ë¹dxÃHг¹È©#Hq¹7ãAI ݾë¹dxÃHг¹È©#Hq¹7ãAI ݾë¹dxÃHг¹È©#Hq?N]LYhÆå®ZV½ç,I>YYoáp9«FôåÔÅnZå¥kÙrÄå¦þø*¸8`?N]LYhÆå®ZV½ç,I>YYoáp9«FZ,Kc+Hìì.îT98¸è 02NIúIüh8âR±¢¢,B~¤)ÔêuQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEÿÙ ¨24^nÑÀÉU¸Ïô8Ì× Ö´==¯µæ xç ~HþM¿êå{xäÿ :{cðÿ ?Ïùÿ ?Ïùÿ ?Ïùÿ ?Ïùÿ ?Ïùÿ =±øcùzN° =±øcùzN° töÇáþÓ§l ?Ïùÿ ,?ämÿ +ÿÙ í´ò?¼zþBñ{XÕõX(m#³{ÞµÌG/PÛiäxõü =âö±«ê±4PÚGföÿ mNIÀ®4H.|KÚ'û\b`så-¡%ÏV¨ÆÑÔä +ÿÙ ÆÎJvÀÀǵzçôù´Ý¡YK\M"+FrTc¶ÕëÓæÓtSÊÊZâiX`ª3£°¤{Q[Õ¹[Wÿ ;z±#ÁySçú}ãHímr¢;¤ûËzPÎ O§ê ;½ÒobÆø9 1à³W{£å^1¶¼³LarÒÈÿ ±VªÕ¶ðÌñ¼hÎTßä~ TÙ[\˳B®ð¶ä'±àþ#!NuSÔ ÊÚæXew ·!=ñ p{ª Tµ=OEÿÙ [üÌÚ8ëüÉ *Z§¢(¢(¢¿ÿÙ æô?ëÀd¾Ó¦AQ4´¾cí$ ã;G'ü(®§J¹ïJ¶¸$°03]æ y.¡¡XÞO·Íö+¼Ð¯%Ô4+Éöù³Â²>Ñ3ÅJï-¯,;ÝRec$;uTt¬@³øµ-|É+·_-Ê1P·n ȧ¥×ª**ÌöwNâÒ 0ÇÕ˽'M¿Ky§Ú\Hhy¡W zd¹w¤é·òo4ûKí4*äLÓEEý¦Ð:Óþü/øTðh_ôÓ¿ð? ÿ §ÿ §ð,áQ\Ëä[I)þÍÎø{@;ö;¯^úì®éb>fgêPËñÍs¾Ðãý¢æ+ÄW¾»+ºdú'òüsT£.âêª94Sþ Ák¦i1øÏO)ݼ²F1çÄÎªÈØë}©ÿ \A$2£©R=¨®6ÛÅÇÂ:|z_íæb_)oR)× <rGPGø6ÛÅÇÂ:|z_íæb_)oR)× <rGPGøYît¨Òî5ùRhÆr;dzÑ\ùÓ¯üq¨¦¥%Ôóã¹[¨eÂùQçRpz ¸úÏ:ÿ ö --- NEW FILE: btnFolderNew.gif --- GIF89a " O'VYQ>//+R+#<à8NJ)õ/ OG8Q;ÌСÉ!T(`cÀA"2e'02´ --- NEW FILE: btnFolderUp.gif --- GIF89a DL&&U0> Wy(·GG@:[^R d7·zi]7 =AoP'·HUh/TeV$p·"&CC# JB:DD?:ð ³!Ì×49³$À --- NEW FILE: btn_cancel.gif --- GIF89a ÄEMn¨¨/á 40DLdàKaª ,ÔdQ° É0 --- NEW FILE: btn_ok.gif --- GIF89a ×Pç¤ ÐUµÁCzgF9ÝÞ\¡0DzupM)-B '{ N%0+ S"|V --- NEW FILE: crop.gif --- GIF89a --- NEW FILE: default.gif --- GIF89aa Ä¢ñL*̦ó J§ÔªõÍjg --- NEW FILE: div.gif --- GIF89a --- NEW FILE: dots.gif --- GIF89a --- NEW FILE: edit_active.gif --- GIF89a ©¤¼t: --- NEW FILE: edit_pencil.gif --- GIF89a --- NEW FILE: edit_trash.gif --- GIF89a --- NEW FILE: folder.gif --- GIF89aP _\ ¼'_!'l?^5ÈÉ*#BB==,,uLBP.?G|a 3@×Î[IùúIM#V%J "ÐéfÆÌÿZf£»÷ïà½kSDʪB0 4 X)q¬ñ ÂJr¦À jè¡j À¶òQ¤Ð¤Vjé¥*:G ®ÀC¤*j7 ðY§ 謶êê«°¾z®¨*¸æªë®¼æjjf¼0Å¡)`BÈ&«ì²Ë¡jA¼pG,èJ*Ëì¶9hp_( 7¼³ÓÎñ¯jÔAÁ³¢Â{ëF¾ã{î>A~Öà«/¹þ¢«.Á' gðk1ÀThÌ164@Å(#`ÀÆ ´K´! D°rÇOWmõÕXgõÖ\wíõ×`-öØdmöÙh§v --- NEW FILE: hand.gif --- GIF89a --- NEW FILE: islocked2.gif --- GIF89a s A --- NEW FILE: locked.gif --- GIF89a M&$xMi¦"WY $»!À&«Ç¸M $ §È%½¤ÈedâGbäæâèeêcìaLCoðîNA --- NEW FILE: measure.gif --- GIF89a --- NEW FILE: noimages.gif --- GIF89a¸ À º[¬o²ÅZ^½Îűͣ[ÎÆ {°£{éì Åî é£#ÅGðµ¶våáÔâ>»VºåÞo3¤¢ëqò£Ï«jÛ©GÍP¼/;Ú¦U HxýíÑzÁWÁxVUôQSw_çÑ6G[ÄT ÊÐB>Öí ¶AtYw»åH#.d_ Xµ@__ä`C#JB2Hdl hÂT.° ͧtBহ¤@w ÄUùç _µ"&*È(êè£F*é¤Vjé¥fªé¦vêé§ *ꨤR --- NEW FILE: rotate.gif --- GIF89a --- NEW FILE: save.gif --- GIF89a --- NEW FILE: scale.gif --- GIF89a --- NEW FILE: spacer.gif --- GIF89a --- NEW FILE: t_black.gif --- GIF89a #h²Ò/~z÷à#Â$æÀ.ܪfì¬:¼úMù>!¯j(Ì --- NEW FILE: t_white.gif --- GIF89a #h²Ò/~z÷@å$Jæãz"/,´ÁÛ @ºÜ«Q?ñci(Ë --- NEW FILE: unlocked.gif --- GIF89a --- NEW FILE: unlocked2.gif --- GIF89a |
From: Joe S. <joe...@us...> - 2004-08-23 17:49:21
|
Update of /cvsroot/phpslash/phpslash-dev/public_html/scripts/htmlarea3/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6597/phpslash-dev/public_html/scripts/htmlarea3/tests Added Files: display-none.html Log Message: Upgraded htmlarea2 --- NEW FILE: display-none.html --- <html> <head> <script> function breakit(){ elem = document.getElementById('page1'); elem.style.display = 'none' elem.style.display = 'block' if (HTMLArea.is_gecko) { editor._doc.designMode = 'off'; editor._doc.designMode = 'on'; editor.focusEditor(); } } _editor_url = '/htmlarea/'; _editor_lang = 'en'; </script> <script type="text/javascript" src="/htmlarea/htmlarea.js"></script> </head> <body> <button onclick='breakit();'>Break It</button> <div id="page1" class="pagetext"> <textarea class="inputbox" cols="50" rows="20" name="introtext" id="introtext"></textarea> </div> <script language="JavaScript1.2" defer="defer"> var editor = new HTMLArea("introtext"); editor.generate('introtext'); </script> </body> </html> |
From: Joe S. <joe...@us...> - 2004-08-23 17:49:21
|
Update of /cvsroot/phpslash/phpslash-dev/public_html/scripts/htmlarea3/plugins/ListType/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6597/phpslash-dev/public_html/scripts/htmlarea3/plugins/ListType/lang Added Files: en.js makefile.xml Log Message: Upgraded htmlarea2 --- NEW FILE: en.js --- // I18N constants // LANG: "en", ENCODING: UTF-8 | ISO-8859-1 // Author: Mihai Bazon, http://dynarch.com/mishoo // FOR TRANSLATORS: // // 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE // (at least a valid email address) // // 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; // (if this is not possible, please include a comment // that states what encoding is necessary.) ListType.I18N = { "Decimal" : "Decimal numbers", "Lower roman" : "Lower roman numbers", "Upper roman" : "Upper roman numbers", "Lower latin" : "Lower latin letters", "Upper latin" : "Upper latin letters", "Lower greek" : "Lower greek letters", "ListStyleTooltip" : "Choose list style type (for ordered lists)" }; --- NEW FILE: makefile.xml --- <files> <file name="*.js" /> </files> |
From: Joe S. <joe...@us...> - 2004-08-23 17:49:21
|
Update of /cvsroot/phpslash/phpslash-dev/public_html/scripts/htmlarea3/plugins/ListType In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6597/phpslash-dev/public_html/scripts/htmlarea3/plugins/ListType Added Files: list-type.js makefile.xml Log Message: Upgraded htmlarea2 --- NEW FILE: list-type.js --- // ListType Plugin for HTMLArea-3.0 // Sponsored by MEdTech Unit - Queen's University // Implementation by Mihai Bazon, http://dynarch.com/mishoo/ // // (c) dynarch.com 2003. // Distributed under the same terms as HTMLArea itself. // This notice MUST stay intact for use (see license.txt). // // $Id: list-type.js,v 1.1 2004/08/23 17:49:00 joestewart Exp $ function ListType(editor) { this.editor = editor; var cfg = editor.config; var toolbar = cfg.toolbar; var self = this; var i18n = ListType.I18N; var options = {}; options[i18n["Decimal"]] = "decimal"; options[i18n["Lower roman"]] = "lower-roman"; options[i18n["Upper roman"]] = "upper-roman"; options[i18n["Lower latin"]] = "lower-alpha"; options[i18n["Upper latin"]] = "upper-alpha"; if (!HTMLArea.is_ie) // IE doesn't support this property; even worse, it complains // with a gross error message when we tried to select it, // therefore let's hide it from the damn "browser". options[i18n["Lower greek"]] = "lower-greek"; var obj = { id : "ListType", tooltip : i18n["ListStyleTooltip"], options : options, action : function(editor) { self.onSelect(editor, this); }, refresh : function(editor) { self.updateValue(editor, this); }, context : "ol" }; cfg.registerDropdown(obj); var a, i, j, found = false; for (i = 0; !found && i < toolbar.length; ++i) { a = toolbar[i]; for (j = 0; j < a.length; ++j) { if (a[j] == "unorderedlist") { found = true; break; } } } if (found) a.splice(j, 0, "space", "ListType", "space"); }; ListType._pluginInfo = { name : "ListType", version : "1.0", developer : "Mihai Bazon", developer_url : "http://dynarch.com/mishoo/", c_owner : "dynarch.com", sponsor : "MEdTech Unit - Queen's University", sponsor_url : "http://www.queensu.ca/", license : "htmlArea" }; ListType.prototype.onSelect = function(editor, combo) { var tbobj = editor._toolbarObjects[combo.id].element; var parent = editor.getParentElement(); while (!/^ol$/i.test(parent.tagName)) { parent = parent.parentNode; } parent.style.listStyleType = tbobj.value; }; ListType.prototype.updateValue = function(editor, combo) { var tbobj = editor._toolbarObjects[combo.id].element; var parent = editor.getParentElement(); while (parent && !/^ol$/i.test(parent.tagName)) { parent = parent.parentNode; } if (!parent) { tbobj.selectedIndex = 0; return; } var type = parent.style.listStyleType; if (!type) { tbobj.selectedIndex = 0; } else { for (var i = tbobj.firstChild; i; i = i.nextSibling) { i.selected = (type.indexOf(i.value) != -1); } } }; --- NEW FILE: makefile.xml --- <files> <file name="*.{js,html,cgi,css}" /> <dir name="lang" /> </files> |
From: Joe S. <joe...@us...> - 2004-08-23 17:49:18
|
Update of /cvsroot/phpslash/phpslash-dev/public_html/scripts/htmlarea3/plugins/ImageManager/Classes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6597/phpslash-dev/public_html/scripts/htmlarea3/plugins/ImageManager/Classes Added Files: Files.php GD.php IM.php ImageEditor.php ImageManager.php NetPBM.php Thumbnail.php Transform.php Log Message: Upgraded htmlarea2 --- NEW FILE: Files.php --- <? /** * File Utilities. * @author $Author: joestewart $ * @version $Id: Files.php,v 1.1 2004/08/23 17:48:59 joestewart Exp $ * @package ImageManager */ define('FILE_ERROR_NO_SOURCE', 100); define('FILE_ERROR_COPY_FAILED', 101); define('FILE_ERROR_DST_DIR_FAILED', 102); define('FILE_COPY_OK', 103); /** * File Utilities * @author $Author: joestewart $ * @version $Id: Files.php,v 1.1 2004/08/23 17:48:59 joestewart Exp $ * @package ImageManager * @subpackage files */ class Files { /** * Copy a file from source to destination. If unique == true, then if * the destination exists, it will be renamed by appending an increamenting * counting number. * @param string $source where the file is from, full path to the files required * @param string $destination_file name of the new file, just the filename * @param string $destination_dir where the files, just the destination dir, * e.g., /www/html/gallery/ * @param boolean $unique create unique destination file if true. * @return string the new copied filename, else error if anything goes bad. */ function copyFile($source, $destination_dir, $destination_file, $unique=true) { if(!(file_exists($source) && is_file($source))) return FILE_ERROR_NO_SOURCE; $destination_dir = Files::fixPath($destination_dir); if(!is_dir($destination_dir)) Return FILE_ERROR_DST_DIR_FAILED; $filename = Files::escape($destination_file); if($unique) { $dotIndex = strrpos($destination_file, '.'); $ext = ''; if(is_int($dotIndex)) { $ext = substr($destination_file, $dotIndex); $base = substr($destination_file, 0, $dotIndex); } $counter = 0; while(is_file($destination_dir.$filename)) { $counter++; $filename = $base.'_'.$counter.$ext; } } if (!copy($source, $destination_dir.$filename)) return FILE_ERROR_COPY_FAILED; //verify that it copied, new file must exists if (is_file($destination_dir.$filename)) Return $filename; else return FILE_ERROR_COPY_FAILED; } /** * Create a new folder. * @param string $newFolder specifiy the full path of the new folder. * @return boolean true if the new folder is created, false otherwise. */ function createFolder($newFolder) { mkdir ($newFolder, 0777); return chmod($newFolder, 0777); } /** * Escape the filenames, any non-word characters will be * replaced by an underscore. * @param string $filename the orginal filename * @return string the escaped safe filename */ function escape($filename) { Return preg_replace('/[^\w\._]/', '_', $filename); } /** * Delete a file. * @param string $file file to be deleted * @return boolean true if deleted, false otherwise. */ function delFile($file) { if(is_file($file)) Return unlink($file); else Return false; } /** * Delete folder(s), can delete recursively. * @param string $folder the folder to be deleted. * @param boolean $recursive if true, all files and sub-directories * are delete. If false, tries to delete the folder, can throw * error if the directory is not empty. * @return boolean true if deleted. */ function delFolder($folder, $recursive=false) { $deleted = true; if($recursive) { $d = dir($folder); while (false !== ($entry = $d->read())) { if ($entry != '.' && $entry != '..') { $obj = Files::fixPath($folder).$entry; //var_dump($obj); if (is_file($obj)) { $deleted &= Files::delFile($obj); } else if(is_dir($obj)) { $deleted &= Files::delFolder($obj, $recursive); } } } $d->close(); } //$folder= $folder.'/thumbs'; //var_dump($folder); if(is_dir($folder)) $deleted &= rmdir($folder); else $deleted &= false; Return $deleted; } /** * Append a / to the path if required. * @param string $path the path * @return string path with trailing / */ function fixPath($path) { //append a slash to the path if it doesn't exists. if(!(substr($path,-1) == '/')) $path .= '/'; Return $path; } /** * Concat two paths together. Basically $pathA+$pathB * @param string $pathA path one * @param string $pathB path two * @return string a trailing slash combinded path. */ function makePath($pathA, $pathB) { $pathA = Files::fixPath($pathA); if(substr($pathB,0,1)=='/') $pathB = substr($pathB,1); Return Files::fixPath($pathA.$pathB); } /** * Similar to makePath, but the second parameter * is not only a path, it may contain say a file ending. * @param string $pathA the leading path * @param string $pathB the ending path with file * @return string combined file path. */ function makeFile($pathA, $pathB) { $pathA = Files::fixPath($pathA); if(substr($pathB,0,1)=='/') $pathB = substr($pathB,1); Return $pathA.$pathB; } /** * Format the file size, limits to Mb. * @param int $size the raw filesize * @return string formated file size. */ function formatSize($size) { if($size < 1024) return $size.' bytes'; else if($size >= 1024 && $size < 1024*1024) return sprintf('%01.2f',$size/1024.0).' Kb'; else return sprintf('%01.2f',$size/(1024.0*1024)).' Mb'; } } ?> --- NEW FILE: GD.php --- <?php /*********************************************************************** ** Title.........: GD Driver ** Version.......: 1.0 ** Author........: Xiang Wei ZHUO <we...@zh...> ** Filename......: GD.php ** Last changed..: 30 Aug 2003 ** Notes.........: Orginal is from PEAR **/ // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2002 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.02 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | li...@ph... so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Authors: Peter Bowyer <pe...@ma...> | // | Alan Knowles <al...@ak...> | // +----------------------------------------------------------------------+ // // Usage : // $img = new Image_Transform_GD(); // $angle = -78; // $img->load('magick.png'); // // if($img->rotate($angle,array('autoresize'=>true,'color_mask'=>array(255,0,0)))){ // $img->addText(array('text'=>"Rotation $angle",'x'=>0,'y'=>100,'font'=>'/usr/share/fonts/default/TrueType/cogb____.ttf')); // $img->display(); // } else { // echo "Error"; // } // // // $Id: GD.php,v 1.1 2004/08/23 17:48:59 joestewart Exp $ // // Image Transformation interface using the GD library // require_once "Transform.php"; Class Image_Transform_Driver_GD extends Image_Transform { /** * Holds the image file for manipulation */ var $imageHandle = ''; /** * Holds the original image file */ var $old_image = ''; /** * Check settings * * @return mixed true or or a PEAR error object on error * * @see PEAR::isError() */ function Image_Transform_GD() { return; } // End function Image /** * Load image * * @param string filename * * @return mixed none or a PEAR error object on error * @see PEAR::isError() */ function load($image) { $this->uid = md5($_SERVER['REMOTE_ADDR']); $this->image = $image; $this->_get_image_details($image); $functionName = 'ImageCreateFrom' . $this->type; if(function_exists($functionName)) { $this->imageHandle = $functionName($this->image); } } // End load /** * addText * * @param array options Array contains options * array( * 'text' The string to draw * 'x' Horizontal position * 'y' Vertical Position * 'Color' Font color * 'font' Font to be used * 'size' Size of the fonts in pixel * 'resize_first' Tell if the image has to be resized * before drawing the text * ) * * @return none * @see PEAR::isError() */ function addText($params) { $default_params = array( 'text' => 'This is Text', 'x' => 10, 'y' => 20, 'color' => array(255,0,0), 'font' => 'Arial.ttf', 'size' => '12', 'angle' => 0, 'resize_first' => false // Carry out the scaling of the image before annotation? Not used for GD ); $params = array_merge($default_params, $params); extract($params); if( !is_array($color) ){ if ($color[0]=='#'){ $this->colorhex2colorarray( $color ); } else { include_once('Image/Transform/Driver/ColorsDefs.php'); $color = isset($colornames[$color])?$colornames[$color]:false; } } $c = imagecolorresolve ($this->imageHandle, $color[0], $color[1], $color[2]); if ('ttf' == substr($font, -3)) { ImageTTFText($this->imageHandle, $size, $angle, $x, $y, $c, $font, $text); } else { ImagePSText($this->imageHandle, $size, $angle, $x, $y, $c, $font, $text); } return true; } // End addText /** * Rotate image by the given angle * Uses a fast rotation algorythm for custom angles * or lines copy for multiple of 90 degrees * * @param int $angle Rotation angle * @param array $options array( 'autoresize'=>true|false, * 'color_mask'=>array(r,g,b), named color or #rrggbb * ) * @author Pierre-Alain Joye * @return mixed none or a PEAR error object on error * @see PEAR::isError() */ function rotate($angle, $options=null) { if(function_exists('imagerotate')) { $white = imagecolorallocate ($this->imageHandle, 255, 255, 255); $this->imageHandle = imagerotate($this->imageHandle, $angle, $white); return true; } if ( $options==null ){ $autoresize = true; $color_mask = array(255,255,0); } else { extract( $options ); } while ($angle <= -45) { $angle += 360; } while ($angle > 270) { $angle -= 360; } $t = deg2rad($angle); if( !is_array($color_mask) ){ if ($color[0]=='#'){ $this->colorhex2colorarray( $color_mask ); } else { include_once('Image/Transform/Driver/ColorDefs.php'); $color = isset($colornames[$color_mask])?$colornames[$color_mask]:false; } } // Do not round it, too much lost of quality $cosT = cos($t); $sinT = sin($t); $img =& $this->imageHandle; $width = $max_x = $this->img_x; $height = $max_y = $this->img_y; $min_y = 0; $min_x = 0; $x1 = round($max_x/2,0); $y1 = round($max_y/2,0); if ( $autoresize ){ $t = abs($t); $a = round($angle,0); switch((int)($angle)){ case 0: $width2 = $width; $height2 = $height; break; case 90: $width2 = $height; $height2 = $width; break; case 180: $width2 = $width; $height2 = $height; break; case 270: $width2 = $height; $height2 = $width; break; default: $width2 = (int)(abs(sin($t) * $height + cos($t) * $width)); $height2 = (int)(abs(cos($t) * $height+sin($t) * $width)); } $width2 -= $width2%2; $height2 -= $height2%2; $d_width = abs($width - $width2); $d_height = abs($height - $height2); $x_offset = $d_width/2; $y_offset = $d_height/2; $min_x2 = -abs($x_offset); $min_y2 = -abs($y_offset); $max_x2 = $width2; $max_y2 = $height2; } $img2 = @imagecreate($width2,$height2); if ( !is_resource($img2) ){ return false;/*PEAR::raiseError('Cannot create buffer for the rotataion.', null, PEAR_ERROR_TRIGGER, E_USER_NOTICE);*/ } $this->img_x = $width2; $this->img_y = $height2; imagepalettecopy($img2,$img); $mask = imagecolorresolve($img2,$color_mask[0],$color_mask[1],$color_mask[2]); // use simple lines copy for axes angles switch((int)($angle)){ case 0: imagefill ($img2, 0, 0,$mask); for ($y=0; $y < $max_y; $y++) { for ($x = $min_x; $x < $max_x; $x++){ $c = @imagecolorat ( $img, $x, $y); imagesetpixel($img2,$x+$x_offset,$y+$y_offset,$c); } } break; case 90: imagefill ($img2, 0, 0,$mask); for ($x = $min_x; $x < $max_x; $x++){ for ($y=$min_y; $y < $max_y; $y++) { $c = imagecolorat ( $img, $x, $y); imagesetpixel($img2,$max_y-$y-1,$x,$c); } } break; case 180: imagefill ($img2, 0, 0,$mask); for ($y=0; $y < $max_y; $y++) { for ($x = $min_x; $x < $max_x; $x++){ $c = @imagecolorat ( $img, $x, $y); imagesetpixel($img2, $max_x2-$x-1, $max_y2-$y-1, $c); } } break; case 270: imagefill ($img2, 0, 0,$mask); for ($y=0; $y < $max_y; $y++) { for ($x = $max_x; $x >= $min_x; $x--){ $c = @imagecolorat ( $img, $x, $y); imagesetpixel($img2,$y,$max_x-$x-1,$c); } } break; // simple reverse rotation algo default: $i=0; for ($y = $min_y2; $y < $max_y2; $y++){ // Algebra :) $x2 = round((($min_x2-$x1) * $cosT) + (($y-$y1) * $sinT + $x1),0); $y2 = round((($y-$y1) * $cosT - ($min_x2-$x1) * $sinT + $y1),0); for ($x = $min_x2; $x < $max_x2; $x++){ // Check if we are out of original bounces, if we are // use the default color mask if ( $x2>=0 && $x2<$max_x && $y2>=0 && $y2<$max_y ){ $c = imagecolorat ( $img, $x2, $y2); } else { $c = $mask; } imagesetpixel($img2,$x+$x_offset,$y+$y_offset,$c); // round verboten! $x2 += $cosT; $y2 -= $sinT; } } break; } $this->old_image = $this->imageHandle; $this->imageHandle = $img2; return true; } /** * Resize Action * * For GD 2.01+ the new copyresampled function is used * It uses a bicubic interpolation algorithm to get far * better result. * * @param $new_x int new width * @param $new_y int new height * * @return true on success or pear error * @see PEAR::isError() */ function _resize($new_x, $new_y) { if ($this->resized === true) { return false; /*PEAR::raiseError('You have already resized the image without saving it. Your previous resizing will be overwritten', null, PEAR_ERROR_TRIGGER, E_USER_NOTICE);*/ } if(function_exists('ImageCreateTrueColor')){ $new_img =ImageCreateTrueColor($new_x,$new_y); } else { $new_img =ImageCreate($new_x,$new_y); } if(function_exists('ImageCopyResampled')){ ImageCopyResampled($new_img, $this->imageHandle, 0, 0, 0, 0, $new_x, $new_y, $this->img_x, $this->img_y); } else { ImageCopyResized($new_img, $this->imageHandle, 0, 0, 0, 0, $new_x, $new_y, $this->img_x, $this->img_y); } $this->old_image = $this->imageHandle; $this->imageHandle = $new_img; $this->resized = true; $this->new_x = $new_x; $this->new_y = $new_y; return true; } /** * Crop the image * * @param int $crop_x left column of the image * @param int $crop_y top row of the image * @param int $crop_width new cropped image width * @param int $crop_height new cropped image height */ function crop($new_x, $new_y, $new_width, $new_height) { if(function_exists('ImageCreateTrueColor')){ $new_img =ImageCreateTrueColor($new_width,$new_height); } else { $new_img =ImageCreate($new_width,$new_height); } if(function_exists('ImageCopyResampled')){ ImageCopyResampled($new_img, $this->imageHandle, 0, 0, $new_x, $new_y,$new_width,$new_height,$new_width,$new_height); } else { ImageCopyResized($new_img, $this->imageHandle, 0, 0, $new_x, $new_y, $new_width,$new_height,$new_width,$new_height); } $this->old_image = $this->imageHandle; $this->imageHandle = $new_img; $this->resized = true; $this->new_x = $new_x; $this->new_y = $new_y; return true; } /** * Flip the image horizontally or vertically * * @param boolean $horizontal true if horizontal flip, vertical otherwise */ function flip($horizontal) { if(!$horizontal) { $this->rotate(180); } $width = imagesx($this->imageHandle); $height = imagesy($this->imageHandle); for ($j = 0; $j < $height; $j++) { $left = 0; $right = $width-1; while ($left < $right) { //echo " j:".$j." l:".$left." r:".$right."\n<br>"; $t = imagecolorat($this->imageHandle, $left, $j); imagesetpixel($this->imageHandle, $left, $j, imagecolorat($this->imageHandle, $right, $j)); imagesetpixel($this->imageHandle, $right, $j, $t); $left++; $right--; } } return true; } /** * Adjust the image gamma * * @param float $outputgamma * * @return none */ function gamma($outputgamma=1.0) { ImageGammaCorrect($this->imageHandle, 1.0, $outputgamma); } /** * Save the image file * * @param $filename string the name of the file to write to * @param $quality int output DPI, default is 85 * @param $types string define the output format, default * is the current used format * * @return none */ function save($filename, $type = '', $quality = 85) { $type = $type==''? $this->type : $type; $functionName = 'image' . $type; if(function_exists($functionName)) { $this->old_image = $this->imageHandle; if($type=='jpeg') $functionName($this->imageHandle, $filename, $quality); else $functionName($this->imageHandle, $filename); $this->imageHandle = $this->old_image; $this->resized = false; } } // End save /** * Display image without saving and lose changes * * @param string type (JPG,PNG...); * @param int quality 75 * * @return none */ function display($type = '', $quality = 75) { if ($type != '') { $this->type = $type; } $functionName = 'Image' . $this->type; if(function_exists($functionName)) { header('Content-type: image/' . strtolower($this->type)); $functionName($this->imageHandle, '', $quality); $this->imageHandle = $this->old_image; $this->resized = false; ImageDestroy($this->old_image); $this->free(); } } /** * Destroy image handle * * @return none */ function free() { if ($this->imageHandle){ ImageDestroy($this->imageHandle); } } } // End class ImageGD ?> --- NEW FILE: IM.php --- <?php /*********************************************************************** ** Title.........: ImageMagick Driver ** Version.......: 1.0 ** Author........: Xiang Wei ZHUO <we...@zh...> ** Filename......: IM.php ** Last changed..: 30 Aug 2003 ** Notes.........: Orginal is from PEAR **/ // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2002 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.02 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | li...@ph... so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Authors: Peter Bowyer <pe...@ma...> | // +----------------------------------------------------------------------+ // // $Id: IM.php,v 1.1 2004/08/23 17:48:59 joestewart Exp $ // // Image Transformation interface using command line ImageMagick // require_once "Transform.php"; Class Image_Transform_Driver_IM extends Image_Transform { /** * associative array commands to be executed * @var array */ var $command = array(); /** * * */ function Image_Transform_Driver_IM() { return true; } // End Image_IM /** * Load image * * @param string filename * * @return mixed none or a PEAR error object on error * @see PEAR::isError() */ function load($image) { $this->uid = md5($_SERVER['REMOTE_ADDR']); /*if (!file_exists($image)) { return PEAR::raiseError('The image file ' . $image . ' does\'t exist', true); }*/ $this->image = $image; $this->_get_image_details($image); } // End load /** * Resize Action * * @param int new_x new width * @param int new_y new height * * @return none * @see PEAR::isError() */ function _resize($new_x, $new_y) { /*if (isset($this->command['resize'])) { return PEAR::raiseError("You cannot scale or resize an image more than once without calling save or display", true); }*/ $this->command['resize'] = "-geometry ${new_x}x${new_y}!"; $this->new_x = $new_x; $this->new_y = $new_y; } // End resize /** * Crop the image * * @param int $crop_x left column of the image * @param int $crop_y top row of the image * @param int $crop_width new cropped image width * @param int $crop_height new cropped image height */ function crop($crop_x, $crop_y, $crop_width, $crop_height) { $this->command['crop'] = "-crop {$crop_width}x{$crop_height}+{$crop_x}+{$crop_y}"; } /** * Flip the image horizontally or vertically * * @param boolean $horizontal true if horizontal flip, vertical otherwise */ function flip($horizontal) { if($horizontal) $this->command['flop'] = "-flop"; else $this->command['flip'] = "-flip"; } /** * rotate * * @param int angle rotation angle * @param array options no option allowed * */ function rotate($angle, $options=null) { if ('-' == $angle{0}) { $angle = 360 - substr($angle, 1); } $this->command['rotate'] = "-rotate $angle"; } // End rotate /** * addText * * @param array options Array contains options * array( * 'text' The string to draw * 'x' Horizontal position * 'y' Vertical Position * 'Color' Font color * 'font' Font to be used * 'size' Size of the fonts in pixel * 'resize_first' Tell if the image has to be resized * before drawing the text * ) * * @return none * @see PEAR::isError() */ function addText($params) { $default_params = array( 'text' => 'This is Text', 'x' => 10, 'y' => 20, 'color' => 'red', 'font' => 'Arial.ttf', 'resize_first' => false // Carry out the scaling of the image before annotation? ); $params = array_merge($default_params, $params); extract($params); if (true === $resize_first) { // Set the key so that this will be the last item in the array $key = 'ztext'; } else { $key = 'text'; } $this->command[$key] = "-font $font -fill $color -draw 'text $x,$y \"$text\"'"; // Producing error: gs: not found gs: not found convert: Postscript delegate failed [No such file or directory]. } // End addText /** * Adjust the image gamma * * @param float $outputgamma * * @return none */ function gamma($outputgamma=1.0) { $this->command['gamma'] = "-gamma $outputgamma"; } /** * Save the image file * * @param $filename string the name of the file to write to * @param $quality quality image dpi, default=75 * @param $type string (JPG,PNG...) * * @return none */ function save($filename, $type='', $quality = 85) { $type == '' ? $this->type : $type; $cmd = '' . IMAGE_TRANSFORM_LIB_PATH . 'convert '; $cmd .= implode(' ', $this->command) . " -quality $quality "; $cmd .= '"'.($this->image) . '" "' . ($filename) . '" 2>&1'; //$cmd = str_replace('/', '\\', $cmd); //echo($cmd.'<br>'); exec($cmd,$retval); //error_log('IM '.print_r($retval,true)); } // End save /** * Display image without saving and lose changes * * @param string type (JPG,PNG...); * @param int quality 75 * * @return none */ function display($type = '', $quality = 75) { if ($type == '') { header('Content-type: image/' . $this->type); passthru(IMAGE_TRANSFORM_LIB_PATH . 'convert ' . implode(' ', $this->command) . " -quality $quality " . escapeshellarg($this->image) . ' ' . strtoupper($this->type) . ":-"); } else { header('Content-type: image/' . $type); passthru(IMAGE_TRANSFORM_LIB_PATH . 'convert ' . implode(' ', $this->command) . " -quality $quality " . escapeshellarg($this->image) . ' ' . strtoupper($type) . ":-"); } } /** * Destroy image handle * * @return none */ function free() { return true; } } // End class ImageIM ?> --- NEW FILE: ImageEditor.php --- <? /** * Image Editor. Editing tools, crop, rotate, scale and save. * @author $Author: joestewart $ * @version $Id: ImageEditor.php,v 1.1 2004/08/23 17:48:59 joestewart Exp $ * @package ImageManager */ require_once('Transform.php'); /** * Handles the basic image editing capbabilities. * @author $Author: joestewart $ * @version $Id: ImageEditor.php,v 1.1 2004/08/23 17:48:59 joestewart Exp $ * @package ImageManager * @subpackage Editor */ class ImageEditor { /** * ImageManager instance. */ var $manager; /** * user based on IP address */ var $_uid; /** * tmp file storage time. */ var $lapse_time =900; //15 mins var $filesaved = 0; /** * Create a new ImageEditor instance. Editing requires a * tmp file, which is saved in the current directory where the * image is edited. The tmp file is assigned by md5 hash of the * user IP address. This hashed is used as an ID for cleaning up * the tmp files. In addition, any tmp files older than the * the specified period will be deleted. * @param ImageManager $manager the image manager, we need this * for some file and path handling functions. */ function ImageEditor($manager) { $this->manager = $manager; $this->_uid = md5($_SERVER['REMOTE_ADDR']); } /** * Did we save a file? * @return int 1 if the file was saved sucessfully, * 0 no save operation, -1 file save error. */ function isFileSaved() { Return $this->filesaved; } /** * Process the image, if not action, just display the image. * @return array with image information, empty array if not an image. * <code>array('src'=>'url of the image', 'dimensions'=>'width="xx" height="yy"', * 'file'=>'image file, relative', 'fullpath'=>'full path to the image');</code> */ function processImage() { if(isset($_GET['img'])) $relative = rawurldecode($_GET['img']); else Return array(); //$relative = '/Series2004NoteFront.jpg'; $imgURL = $this->manager->getFileURL($relative); $fullpath = $this->manager->getFullPath($relative); $imgInfo = @getImageSize($fullpath); if(!is_array($imgInfo)) Return array(); $action = $this->getAction(); if(!is_null($action)) { $image = $this->processAction($action, $relative, $fullpath); } else { $image['src'] = $imgURL; $image['dimensions'] = $imgInfo[3]; $image['file'] = $relative; $image['fullpath'] = $fullpath; } Return $image; } /** * Process the actions, crop, scale(resize), rotate, flip, and save. * When ever an action is performed, the result is save into a * temporary image file, see createUnique on the filename specs. * It does not return the saved file, alway returning the tmp file. * @param string $action, should be 'crop', 'scale', 'rotate','flip', or 'save' * @param string $relative the relative image filename * @param string $fullpath the fullpath to the image file * @return array with image information * <code>array('src'=>'url of the image', 'dimensions'=>'width="xx" height="yy"', * 'file'=>'image file, relative', 'fullpath'=>'full path to the image');</code> */ function processAction($action, $relative, $fullpath) { $params = ''; if(isset($_GET['params'])) $params = $_GET['params']; $values = explode(',',$params,4); $saveFile = $this->getSaveFileName($values[0]); $img = Image_Transform::factory(IMAGE_CLASS); $img->load($fullpath); switch ($action) { case 'crop': $img->crop(intval($values[0]),intval($values[1]), intval($values[2]),intval($values[3])); break; case 'scale': $img->resize(intval($values[0]),intval($values[1])); break; case 'rotate': $img->rotate(floatval($values[0])); break; case 'flip': if ($values[0] == 'hoz') $img->flip(true); else if($values[0] == 'ver') $img->flip(false); break; case 'save': if(!is_null($saveFile)) { $quality = intval($values[1]); if($quality <0) $quality = 85; $newSaveFile = $this->makeRelative($relative, $saveFile); $newSaveFile = $this->getUniqueFilename($newSaveFile); //get unique filename just returns the filename, so //we need to make the relative path once more. $newSaveFile = $this->makeRelative($relative, $newSaveFile); $newSaveFullpath = $this->manager->getFullPath($newSaveFile); $img->save($newSaveFullpath, $values[0], $quality); if(is_file($newSaveFullpath)) $this->filesaved = 1; else $this->filesaved = -1; } break; } //create the tmp image file $filename = $this->createUnique($fullpath); $newRelative = $this->makeRelative($relative, $filename); $newFullpath = $this->manager->getFullPath($newRelative); $newURL = $this->manager->getFileURL($newRelative); //save the file. $img->save($newFullpath); $img->free(); //get the image information $imgInfo = @getimagesize($newFullpath); $image['src'] = $newURL; $image['dimensions'] = $imgInfo[3]; $image['file'] = $newRelative; $image['fullpath'] = $newFullpath; Return $image; } /** * Get the file name base on the save name * and the save type. * @param string $type image type, 'jpeg', 'png', or 'gif' * @return string the filename according to save type */ function getSaveFileName($type) { if(!isset($_GET['file'])) Return null; $filename = Files::escape(rawurldecode($_GET['file'])); $index = strrpos($filename,'.'); $base = substr($filename,0,$index); $ext = strtolower(substr($filename,$index+1,strlen($filename))); if($type == 'jpeg' && !($ext=='jpeg' || $ext=='jpg')) { Return $base.'.jpeg'; } if($type=='png' && $ext != 'png') Return $base.'.png'; if($type=='gif' && $ext != 'gif') Return $base.'.gif'; Return $filename; } /** * Get the default save file name, used by editor.php. * @return string a suggestive filename, this should be unique */ function getDefaultSaveFile() { if(isset($_GET['img'])) $relative = rawurldecode($_GET['img']); else Return null; Return $this->getUniqueFilename($relative); } /** * Get a unique filename. If the file exists, the filename * base is appended with an increasing integer. * @param string $relative the relative filename to the base_dir * @return string a unique filename in the current path */ function getUniqueFilename($relative) { $fullpath = $this->manager->getFullPath($relative); $pathinfo = pathinfo($fullpath); $path = Files::fixPath($pathinfo['dirname']); $file = Files::escape($pathinfo['basename']); $filename = $file; $dotIndex = strrpos($file, '.'); $ext = ''; if(is_int($dotIndex)) { $ext = substr($file, $dotIndex); $base = substr($file, 0, $dotIndex); } $counter = 0; while(is_file($path.$filename)) { $counter++; $filename = $base.'_'.$counter.$ext; } Return $filename; } /** * Specifiy the original relative path, a new filename * and return the new filename with relative path. * i.e. $pathA (-filename) + $file * @param string $pathA the relative file * @param string $file the new filename * @return string relative path with the new filename */ function makeRelative($pathA, $file) { $index = strrpos($pathA,'/'); if(!is_int($index)) Return $file; $path = substr($pathA, 0, $index); Return Files::fixPath($path).$file; } /** * Get the action GET parameter * @return string action parameter */ function getAction() { $action = null; if(isset($_GET['action'])) $action = $_GET['action']; Return $action; } /** * Generate a unique string based on md5(microtime()). * Well not so uniqe, as it is limited to 6 characters * @return string unique string. */ function uniqueStr() { return substr(md5(microtime()),0,6); } /** * Create unique tmp image file name. * The filename is based on the tmp file prefix * specified in config.inc.php plus * the UID (basically a md5 of the remote IP) * and some random 6 character string. * This function also calls to clean up the tmp files. * @param string $file the fullpath to a file * @return string a unique filename for that path * NOTE: it only returns the filename, path no included. */ function createUnique($file) { $pathinfo = pathinfo($file); $path = Files::fixPath($pathinfo['dirname']); $imgType = $this->getImageType($file); $unique_str = $this->manager->getTmpPrefix().$this->_uid.'_'.$this->uniqueStr().".".$imgType; //make sure the the unique temp file does not exists while (file_exists($path.$unique_str)) { $unique_str = $this->manager->getTmpPrefix().$this->_uid.'_'.$this->uniqueStr().".".$imgType; } $this->cleanUp($path,$pathinfo['basename']); Return $unique_str; } /** * Delete any tmp image files. * @param string $path the full path * where the clean should take place. */ function cleanUp($path,$file) { $path = Files::fixPath($path); if(!is_dir($path)) Return false; $d = @dir($path); $tmp = $this->manager->getTmpPrefix(); $tmpLen = strlen($tmp); $prefix = $tmp.$this->_uid; $len = strlen($prefix); while (false !== ($entry = $d->read())) { //echo $entry."<br>"; if(is_file($path.$entry) && $this->manager->isTmpFile($entry)) { if(substr($entry,0,$len)==$prefix && $entry != $file) Files::delFile($path.$entry); else if(substr($entry,0,$tmpLen)==$tmp && $entry != $file) { if(filemtime($path.$entry)+$this->lapse_time < time()) Files::delFile($path.$entry); } } } $d->close(); } /** * Get the image type base on an image file. * @param string $file the full path to the image file. * @return string of either 'gif', 'jpeg', 'png' or 'bmp' * otherwise it will return null. */ function getImageType($file) { $imageInfo = @getImageSize($file); if(!is_array($imageInfo)) Return null; switch($imageInfo[2]) { case 1: Return 'gif'; case 2: Return 'jpeg'; case 3: Return 'png'; case 6: Return 'bmp'; } Return null; } /** * Check if the specified image can be edit by GD * mainly to check that GD can read and save GIFs * @return int 0 if it is not a GIF file, 1 is GIF is editable, -1 if not editable. */ function isGDEditable() { if(isset($_GET['img'])) $relative = rawurldecode($_GET['img']); else Return 0; if(IMAGE_CLASS != 'GD') Return 0; $fullpath = $this->manager->getFullPath($relative); $type = $this->getImageType($fullpath); if($type != 'gif') Return 0; if(function_exists('ImageCreateFrom'+$type) && function_exists('image'+$type)) Return 1; else Return -1; } /** * Check if GIF can be edit by GD. * @return int 0 if it is not using the GD library, 1 is GIF is editable, -1 if not editable. */ function isGDGIFAble() { if(IMAGE_CLASS != 'GD') Return 0; if(function_exists('ImageCreateFromGif') && function_exists('imagegif')) Return 1; else Return -1; } } ?> --- NEW FILE: ImageManager.php --- <? /** * ImageManager, list images, directories, and thumbnails. * @author $Author: joestewart $ * @version $Id: ImageManager.php,v 1.1 2004/08/23 17:48:59 joestewart Exp $ * @package ImageManager */ require_once('Files.php'); /** * ImageManager Class. * @author $Author: joestewart $ * @version $Id: ImageManager.php,v 1.1 2004/08/23 17:48:59 joestewart Exp $ */ class ImageManager { /** * Configuration array. */ var $config; /** * Array of directory information. */ var $dirs; /** * Constructor. Create a new Image Manager instance. * @param array $config configuration array, see config.inc.php */ function ImageManager($config) { $this->config = $config; } /** * Get the base directory. * @return string base dir, see config.inc.php */ function getBaseDir() { Return $this->config['base_dir']; } /** * Get the base URL. * @return string base url, see config.inc.php */ function getBaseURL() { Return $this->config['base_url']; } function isValidBase() { return is_dir($this->getBaseDir()); } /** * Get the tmp file prefix. * @return string tmp file prefix. */ function getTmpPrefix() { Return $this->config['tmp_prefix']; } /** * Get the sub directories in the base dir. * Each array element contain * the relative path (relative to the base dir) as key and the * full path as value. * @return array of sub directries * <code>array('path name' => 'full directory path', ...)</code> */ function getDirs() { if(is_null($this->dirs)) { $dirs = $this->_dirs($this->getBaseDir(),'/'); ksort($dirs); $this->dirs = $dirs; } return $this->dirs; } /** * Recursively travese the directories to get a list * of accessable directories. * @param string $base the full path to the current directory * @param string $path the relative path name * @return array of accessiable sub-directories * <code>array('path name' => 'full directory path', ...)</code> */ function _dirs($base, $path) { $base = Files::fixPath($base); $dirs = array(); if($this->isValidBase() == false) return $dirs; $d = @dir($base); while (false !== ($entry = $d->read())) { //If it is a directory, and it doesn't start with // a dot, and if is it not the thumbnail directory if(is_dir($base.$entry) && substr($entry,0,1) != '.' && $this->isThumbDir($entry) == false) { $relative = Files::fixPath($path.$entry); $fullpath = Files::fixPath($base.$entry); $dirs[$relative] = $fullpath; $dirs = array_merge($dirs, $this->_dirs($fullpath, $relative)); } } $d->close(); Return $dirs; } /** * Get all the files and directories of a relative path. * @param string $path relative path to be base path. * @return array of file and path information. * <code>array(0=>array('relative'=>'fullpath',...), 1=>array('filename'=>fileinfo array(),...)</code> * fileinfo array: <code>array('url'=>'full url', * 'relative'=>'relative to base', * 'fullpath'=>'full file path', * 'image'=>imageInfo array() false if not image, * 'stat' => filestat)</code> */ function getFiles($path) { $files = array(); $dirs = array(); if($this->isValidBase() == false) return array($files,$dirs); $path = Files::fixPath($path); $base = Files::fixPath($this->getBaseDir()); $fullpath = Files::makePath($base,$path); $d = @dir($fullpath); while (false !== ($entry = $d->read())) { //not a dot file or directory if(substr($entry,0,1) != '.') { if(is_dir($fullpath.$entry) && $this->isThumbDir($entry) == false) { $relative = Files::fixPath($path.$entry); $full = Files::fixPath($fullpath.$entry); $count = $this->countFiles($full); $dirs[$relative] = array('fullpath'=>$full,'entry'=>$entry,'count'=>$count); } else if(is_file($fullpath.$entry) && $this->isThumb($entry)==false && $this->isTmpFile($entry) == false) { $img = $this->getImageInfo($fullpath.$entry); if(!(!is_array($img)&&$this->config['validate_images'])) { $file['url'] = Files::makePath($this->config['base_url'],$path).$entry; $file['relative'] = $path.$entry; $file['fullpath'] = $fullpath.$entry; $file['image'] = $img; $file['stat'] = stat($fullpath.$entry); $files[$entry] = $file; } } } } $d->close(); ksort($dirs); ksort($files); Return array($dirs, $files); } /** * Count the number of files and directories in a given folder * minus the thumbnail folders and thumbnails. */ function countFiles($path) { $total = 0; if(is_dir($path)) { $d = @dir($path); while (false !== ($entry = $d->read())) { //echo $entry."<br>"; if(substr($entry,0,1) != '.' && $this->isThumbDir($entry) == false && $this->isTmpFile($entry) == false && $this->isThumb($entry) == false) { $total++; } } $d->close(); } return $total; } /** * Get image size information. * @param string $file the image file * @return array of getImageSize information, * false if the file is not an image. */ function getImageInfo($file) { Return @getImageSize($file); } /** * Check if the file contains the thumbnail prefix. * @param string $file filename to be checked * @return true if the file contains the thumbnail prefix, false otherwise. */ function isThumb($file) { $len = strlen($this->config['thumbnail_prefix']); if(substr($file,0,$len)==$this->config['thumbnail_prefix']) Return true; else Return false; } /** * Check if the given directory is a thumbnail directory. * @param string $entry directory name * @return true if it is a thumbnail directory, false otherwise */ function isThumbDir($entry) { if($this->config['thumbnail_dir'] == false || strlen(trim($this->config['thumbnail_dir'])) == 0) Return false; else Return ($entry == $this->config['thumbnail_dir']); } /** * Check if the given file is a tmp file. * @param string $file file name * @return boolean true if it is a tmp file, false otherwise */ function isTmpFile($file) { $len = strlen($this->config['tmp_prefix']); if(substr($file,0,$len)==$this->config['tmp_prefix']) Return true; else Return false; } /** * For a given image file, get the respective thumbnail filename * no file existence check is done. * @param string $fullpathfile the full path to the image file * @return string of the thumbnail file */ function getThumbName($fullpathfile) { $path_parts = pathinfo($fullpathfile); $thumbnail = $this->config['thumbnail_prefix'].$path_parts['basename']; if($this->config['safe_mode'] == true || strlen(trim($this->config['thumbnail_dir'])) == 0) { Return Files::makeFile($path_parts['dirname'],$thumbnail); } else { if(strlen(trim($this->config['thumbnail_dir'])) > 0) { $path = Files::makePath($path_parts['dirname'],$this->config['thumbnail_dir']); if(!is_dir($path)) Files::createFolder($path); Return Files::makeFile($path,$thumbnail); } else //should this ever happen? { //error_log('ImageManager: Error in creating thumbnail name'); } } } /** * Similar to getThumbName, but returns the URL, base on the * given base_url in config.inc.php * @param string $relative the relative image file name, * relative to the base_dir path * @return string the url of the thumbnail */ function getThumbURL($relative) { $path_parts = pathinfo($relative); $thumbnail = $this->config['thumbnail_prefix'].$path_parts['basename']; if($path_parts['dirname']=='\\') $path_parts['dirname']='/'; if($this->config['safe_mode'] == true || strlen(trim($this->config['thumbnail_dir'])) == 0) { Return Files::makeFile($this->getBaseURL(),$thumbnail); } else { if(strlen(trim($this->config['thumbnail_dir'])) > 0) { $path = Files::makePath($path_parts['dirname'],$this->config['thumbnail_dir']); $url_path = Files::makePath($this->getBaseURL(), $path); Return Files::makeFile($url_path,$thumbnail); } else //should this ever happen? { //error_log('ImageManager: Error in creating thumbnail url'); } } } /** * Check if the given path is part of the subdirectories * under the base_dir. * @param string $path the relative path to be checked * @return boolean true if the path exists, false otherwise */ function validRelativePath($path) { $dirs = $this->getDirs(); if($path == '/') Return true; //check the path given in the url against the //list of paths in the system. for($i = 0; $i < count($dirs); $i++) { $key = key($dirs); //we found the path if($key == $path) Return true; next($dirs); } Return false; } /** * Process uploaded files, assumes the file is in * $_FILES['upload'] and $_POST['dir'] is set. * The dir must be relative to the base_dir and exists. * If 'validate_images' is set to true, only file with * image dimensions will be accepted. * @return null */ function processUploads() { if($this->isValidBase() == false) return; $relative = null; if(isset($_POST['dir'])) $relative = rawurldecode($_POST['dir']); else return; //check for the file, and must have valid relative path if(isset($_FILES['upload']) && $this->validRelativePath($relative)) { $this->_processFiles($relative, $_FILES['upload']); } } /** * Process upload files. The file must be an * uploaded file. If 'validate_images' is set to * true, only images will be processed. Any duplicate * file will be renamed. See Files::copyFile for details * on renaming. * @param string $relative the relative path where the file * should be copied to. * @param array $file the uploaded file from $_FILES * @return boolean true if the file was processed successfully, * false otherwise */ function _processFiles($relative, $file) { if($file['error']!=0) { Return false; } if(!is_file($file['tmp_name'])) { Return false; } if(!is_uploaded_file($file['tmp_name'])) { Files::delFile($file['tmp_name']); Return false; } if($this->config['validate_images'] == true) { $imgInfo = @getImageSize($file['tmp_name']); if(!is_array($imgInfo)) { Files::delFile($file['tmp_name']); Return false; } } //now copy the file $path = Files::makePath($this->getBaseDir(),$relative); $result = Files::copyFile($file['tmp_name'], $path, $file['name']); //no copy error if(!is_int($result)) { Files::delFile($file['tmp_name']); Return true; } //delete tmp files. Files::delFile($file['tmp_name']); Return false; } /** * Get the URL of the relative file. * basically appends the relative file to the * base_url given in config.inc.php * @param string $relative a file the relative to the base_dir * @return string the URL of the relative file. */ function getFileURL($relative) { Return Files::makeFile($this->getBaseURL(),$relative); } /** * Get the fullpath to a relative file. * @param string $relative the relative file. * @return string the full path, .ie. the base_dir + relative. */ function getFullPath($relative) { Return Files::makeFile($this->getBaseDir(),$relative);; } /** * Get the default thumbnail. * @return string default thumbnail, empty string if * the thumbnail doesn't exist. */ function getDefaultThumb() { if(is_file($this->config['default_thumbnail'])) Return $this->config['default_thumbnail']; else Return ''; } /** * Get the thumbnail url to be displayed. * If the thumbnail exists, and it is up-to-date * the thumbnail url will be returns. If the * file is not an image, a default image will be returned. * If it is an image file, and no thumbnail exists or * the thumbnail is out-of-date (i.e. the thumbnail * modified time is less than the original file) * then a thumbs.php?img=filename.jpg is returned. * The thumbs.php url will generate a new thumbnail * on the fly. If the image is less than the dimensions * of the thumbnails, the image will be display instead. * @param string $relative the relative image file. * @return string the url of the thumbnail, be it * actually thumbnail or a script to generate the * thumbnail on the fly. */ function getThumbnail($relative) { $fullpath = Files::makeFile($this->getBaseDir(),$relative); //not a file??? if(!is_file($fullpath)) Return $this->getDefaultThumb(); $imgInfo = @getImageSize($fullpath); //not an image if(!is_array($imgInfo)) Return $this->getDefaultThumb(); //the original image is smaller than thumbnails, //so just return the url to the original image. if ($imgInfo[0] <= $this->config['thumbnail_width'] && $imgInfo[1] <= $this->config['thumbnail_height']) Return $this->getFileURL($relative); $thumbnail = $this->getThumbName($fullpath); //check for thumbnails, if exists and // it is up-to-date, return the thumbnail url if(is_file($thumbnail)) { if(filemtime($thumbnail) >= filemtime($fullpath)) Return $this->getThumbURL($relative); } //well, no thumbnail was found, so ask the thumbs.php //to generate the thumbnail on the fly. Return 'thumbs.php?img='.rawurlencode($relative); } /** * Delete and specified files. * @return boolean true if delete, false otherwise */ function deleteFiles() { if(isset($_GET['delf'])) $this->_delFile(rawurldecode($_GET['delf'])); } /** * Delete and specified directories. * @return boolean true if delete, false otherwise */ function deleteDirs() { if(isset($_GET['deld'])) return $this->_delDir(rawurldecode($_GET['deld'])); else Return false; } /** * Delete the relative file, and any thumbnails. * @param string $relative the relative file. * @return boolean true if deleted, false otherwise. */ function _delFile($relative) { $fullpath = Files::makeFile($this->getBaseDir(),$relative); //check that the file is an image if($this->config['validate_images'] == true) { if(!is_array($this->getImageInfo($fullpath))) return false; //hmmm not an Image!!??? } $thumbnail = $this->getThumbName($fullpath); if(Files::delFile($fullpath)) Return Files::delFile($thumbnail); else Return false; } /** * Delete directories recursively. * @param string $relative the relative path to be deleted. * @return boolean true if deleted, false otherwise. */ function _delDir($relative) { $fullpath = Files::makePath($this->getBaseDir(),$relative); if($this->countFiles($fullpath) <= 0) return Files::delFolder($fullpath,true); //delete recursively. else Return false; } /** * Create new directories. * If in safe_mode, nothing happens. * @return boolean true if created, false otherwise. */ function processNewDir() { if($this->config['safe_mode'] == true) Return false; if(isset($_GET['newDir']) && isset($_GET['dir'])) { $newDir = rawurldecode($_GET['newDir']); $dir = rawurldecode($_GET['dir']); $path = Files::makePath($this->getBaseDir(),$dir); $fullpath = Files::makePath($path, Files::escape($newDir)); if(is_dir($fullpath)) Return false; Return Files::createFolder($fullpath); } } } ?> --- NEW FILE: NetPBM.php --- <?php /*********************************************************************** ** Title.........: NetPBM Driver ** Version.......: 1.0 ** Author........: Xiang Wei ZHUO <we...@zh...> ** Filename......: NetPBM.php ** Last changed..: 30 Aug 2003 ** Notes.........: Orginal is from PEAR **/ // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2002 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.02 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | li...@ph... so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Authors: Peter Bowyer <pe...@ma...> | // +----------------------------------------------------------------------+ // // $Id: NetPBM.php,v 1.1 2004/08/23 17:48:59 joestewart Exp $ // // Image Transformation interface using command line NetPBM require_once "Transform.php"; Class Image_Transform_Driver_NetPBM extends Image_Transform { /** * associative array commands to be executed * @var array */ var $command = array(); /** * Class Constructor */ function Image_Transform_Driver_NetPBM() { $this->uid = md5($_SERV... [truncated message content] |
From: Joe S. <joe...@us...> - 2004-08-23 17:49:18
|
Update of /cvsroot/phpslash/phpslash-dev/public_html/scripts/htmlarea3/plugins/ImageManager In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6597/phpslash-dev/public_html/scripts/htmlarea3/plugins/ImageManager Added Files: README.txt config.inc.php editor.php editorFrame.php image-manager.js images.php manager.php newFolder.html thumbs.php Log Message: Upgraded htmlarea2 --- NEW FILE: README.txt --- This is a plug-in for HTMLArea 3.0 The PHP ImageManager + Editor provides an interface to browser for image files on your web server. The Editor allows some basic image manipulations such as, cropping, rotation, flip, and scaling. Further and up-to-date documentation can be found at http://www.zhuo.org/htmlarea/docs/index.html Cheer, Wei --- NEW FILE: config.inc.php --- <? /** * Image Manager configuration file. * @author $Author: joestewart $ * @version $Id: config.inc.php,v 1.1 2004/08/23 17:48:59 joestewart Exp $ * @package ImageManager */ /* File system path to the directory you want to manage the images for multiple user systems, set it dynamically. NOTE: This directory requires write access by PHP. That is, PHP must be able to create files in this directory. Able to create directories is nice, but not necessary. */ $IMConfig['base_dir'] = '../../../../images/'; /* The URL to the above path, the web browser needs to be able to see it. It can be protected via .htaccess on apache or directory permissions on IIS, check you web server documentation for futher information on directory protection If this directory needs to be publicly accessiable, remove scripting capabilities for this directory (i.e. disable PHP, Perl, CGI). We only want to store assets in this directory and its subdirectories. */ $IMConfig['base_url'] = '/images'; /* Possible values: true, false TRUE - If PHP on the web server is in safe mode, set this to true. SAFE MODE restrictions: directory creation will not be possible, only the GD library can be used, other libraries require Safe Mode to be off. FALSE - Set to false if PHP on the web server is not in safe mode. */ $IMConfig['safe_mode'] = false; /* Possible values: 'GD', 'IM', or 'NetPBM' The image manipulation library to use, either GD or ImageMagick or NetPBM. If you have safe mode ON, or don't have the binaries to other packages, your choice is 'GD' only. Other packages require Safe Mode to be off. */ define('IMAGE_CLASS', 'IM'); /* After defining which library to use, if it is NetPBM or IM, you need to specify where the binary for the selected library are. And of course your server and PHP must be able to execute them (i.e. safe mode is OFF). GD does not require the following definition. */ define('IMAGE_TRANSFORM_LIB_PATH', '/usr/sbin/'); /* ============== OPTIONAL SETTINGS ============== */ /* The prefix for thumbnail files, something like .thumb will do. The thumbnails files will be named as "prefix_imagefile.ext", that is, prefix + orginal filename. */ $IMConfig['thumbnail_prefix'] = '.'; /* Thumbnail can also be stored in a directory, this directory will be created by PHP. If PHP is in safe mode, this parameter is ignored, you can not create directories. If you do not want to store thumbnails in a directory, set this to false or empty string ''; */ $IMConfig['thumbnail_dir'] = '.thumbs'; /* Possible values: true, false TRUE - Allow the user to create new sub-directories in the $IMConfig['base_dir']. FALSE - No directory creation. NOTE: If $IMConfig['safe_mode'] = true, this parameter is ignored, you can not create directories */ $IMConfig['allow_new_dir'] = true; /* Possible values: true, false TRUE - Allow the user to upload files. FALSE - No uploading allowed. */ $IMConfig['allow_upload'] = true; /* Possible values: true, false TRUE - If set to true, uploaded files will be validated based on the function getImageSize, if we can get the image dimensions then I guess this should be a valid image. Otherwise the file will be rejected. FALSE - All uploaded files will be processed. NOTE: If uploading is not allowed, this parameter is ignored. */ $IMConfig['validate_images'] = true; /* The default thumbnail if the thumbnails can not be created, either due to error or bad image file. */ $IMConfig['default_thumbnail'] = 'scripts/htmlarea3/plugins/ImageManager/img/default.gif'; /* Thumbnail dimensions. */ $IMConfig['thumbnail_width'] = 96; $IMConfig['thumbnail_height'] = 96; /* Image Editor temporary filename prefix. */ $IMConfig['tmp_prefix'] = '.editor_'; ?> --- NEW FILE: editor.php --- <? /** * The PHP Image Editor user interface. * @author $Author: joestewart $ * @version $Id: editor.php,v 1.1 2004/08/23 17:48:59 joestewart Exp $ * @package ImageManager */ require_once('config.inc.php'); require_once('Classes/ImageManager.php'); require_once('Classes/ImageEditor.php'); $manager = new ImageManager($IMConfig); $editor = new ImageEditor($manager); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title></title> <link href="assets/editor.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="assets/slider.js"></script> <script type="text/javascript" src="assets/popup.js"></script> <script type="text/javascript"> /*<![CDATA[*/ window.resizeTo(673, 531); if(window.opener) I18N = window.opener.I18N; /*]]>*/ </script> <script type="text/javascript" src="assets/editor.js"></script> </head> <body> <div id="indicator"> <img src="img/spacer.gif" id="indicator_image" height="20" width="20" alt="" /> </div> <div id="tools"> <div id="tools_crop" style="display:none;"> <div id="tool_inputs"> <label for="cx">Start X:</label><input type="text" id="cx" class="textInput" onchange="updateMarker('crop')"/> <label for="cy">Start Y:</label><input type="text" id="cy" class="textInput" onchange="updateMarker('crop')"/> <label for="cw">Width:</label><input type="text" id="cw" class="textInput" onchange="updateMarker('crop')"/> <label for="ch">Height:</label><input type="text" id="ch" class="textInput" onchange="updateMarker('crop')"/> <img src="img/div.gif" height="30" width="2" class="div" alt="|" /> </div> <a href="javascript: editor.doSubmit('crop');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a> <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a> </div> <div id="tools_scale" style="display:none;"> <div id="tool_inputs"> <label for="sw">Width:</label><input type="text" id="sw" class="textInput" onchange="checkConstrains('width')"/> <a href="javascript:toggleConstraints();" title="Lock"><img src="img/islocked2.gif" id="scaleConstImg" height="14" width="8" alt="Lock" class="div" /></a><label for="sh">Height:</label> <input type="text" id="sh" class="textInput" onchange="checkConstrains('height')"/> <input type="checkbox" id="constProp" value="1" checked="checked" onclick="toggleConstraints()"/> <label for="constProp">Constrain Proportions</label> <img src="img/div.gif" height="30" width="2" class="div" alt="|" /> </div> <a href="javascript: editor.doSubmit('scale');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a> <a href="javascript: editor.reset();" class="buttons" title="Cancle"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a> </div> <div id="tools_rotate" style="display:none;"> <div id="tool_inputs"> <select id="flip" name="flip" style="margin-left: 10px; vertical-align: middle;"> <option selected>Flip Image</option> <option>-----------------</option> <option value="hoz">Flip Horizontal</option> <option value="ver">Flip Virtical</option> </select> <select name="rotate" onchange="rotatePreset(this)" style="margin-left: 20px; vertical-align: middle;"> <option selected>Rotate Image</option> <option>-----------------</option> <option value="180">Rotate 180 °</option> <option value="90">Rotate 90 ° CW</option> <option value="-90">Rotate 90 ° CCW</option> </select> <label for="ra">Angle:</label><input type="text" id="ra" class="textInput" /> <img src="img/div.gif" height="30" width="2" class="div" alt="|" /> </div> <a href="javascript: editor.doSubmit('rotate');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a> <a href="javascript: editor.reset();" class="buttons" title="Cancle"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a> </div> <div id="tools_measure" style="display:none;"> <div id="tool_inputs"> <label>X:</label><input type="text" class="measureStats" id="sx" /> <label>Y:</label><input type="text" class="measureStats" id="sy" /> <img src="img/div.gif" height="30" width="2" class="div" alt="|" /> <label>W:</label><input type="text" class="measureStats" id="mw" /> <label>H:</label><input type="text" class="measureStats" id="mh" /> <img src="img/div.gif" height="30" width="2" class="div" alt="|" /> <label>A:</label><input type="text" class="measureStats" id="ma" /> <label>D:</label><input type="text" class="measureStats" id="md" /> <img src="img/div.gif" height="30" width="2" class="div" alt="|" /> <button type="button" onclick="editor.reset();" >Clear</button> </div> </div> <div id="tools_save" style="display:none;"> <div id="tool_inputs"> <label for="save_filename">Filename:</label><input type="text" id="save_filename" value="<? echo $editor->getDefaultSaveFile();?>"/> <select name="format" id="save_format" style="margin-left: 10px; vertical-align: middle;" onchange="updateFormat(this)"> <option value="" selected>Image Format</option> <option value="">---------------------</option> <option value="jpeg,85">JPEG High</option> <option value="jpeg,60">JPEG Medium</option> <option value="jpeg,35">JPEG Low</option> <option value="png">PNG</option> <? if($editor->isGDGIFAble() != -1) { ?> <option value="gif">GIF</option> <? } ?> </select> <label>Quality:</label> <table style="display: inline; vertical-align: middle;" cellpadding="0" cellspacing="0"> <tr> <td> <div id="slidercasing"> <div id="slidertrack" style="width:100px"><img src="img/spacer.gif" width="1" height="1" border="0" alt="track"></div> <div id="sliderbar" style="left:85px" onmousedown="captureStart();"><img src="img/spacer.gif" width="1" height="1" border="0" alt="track"></div> </div> </td> </tr> </table> <input type="text" id="quality" onchange="updateSlider(this.value)" style="width: 2em;" value="85"/> <img src="img/div.gif" height="30" width="2" class="div" alt="|" /> </div> <a href="javascript: editor.doSubmit('save');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a> <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a> </div> </div> <div id="toolbar"> <a href="javascript:toggle('crop')" id="icon_crop" title="Crop"><img src="img/crop.gif" height="20" width="20" alt="Crop" /><span>Crop</span></a> <a href="javascript:toggle('scale')" id="icon_scale" title="Resize"><img src="img/scale.gif" height="20" width="20" alt="Resize" /><span>Resize</span></a> <a href="javascript:toggle('rotate')" id="icon_rotate" title="Rotate"><img src="img/rotate.gif" height="20" width="20" alt="Rotate" /><span>Rotate</span></a> <a href="javascript:toggle('measure')" id="icon_measure" title="Measure"><img src="img/measure.gif" height="20" width="20" alt="Measure" /><span>Measure</span></a> <a href="javascript: toggleMarker();" title="Marker"><img id="markerImg" src="img/t_black.gif" height="20" width="20" alt="Marker" /><span>Marker</span></a> <a href="javascript:toggle('save')" id="icon_save" title="Save"><img src="img/save.gif" height="20" width="20" alt="Save" /><span>Save</span></a> </div> <div id="contents"> <iframe src="editorFrame.php?img=<? if(isset($_GET['img'])) echo rawurlencode($_GET['img']); ?>" name="editor" id="editor" scrolling="auto" title="Image Editor" frameborder="0"></iframe> </div> <div id="bottom"></div> </body> </html> --- NEW FILE: editorFrame.php --- <? /** * The frame that contains the image to be edited. * @author $Author: joestewart $ * @version $Id: editorFrame.php,v 1.1 2004/08/23 17:48:59 joestewart Exp $ * @package ImageManager */ require_once('config.inc.php'); require_once('Classes/ImageManager.php'); require_once('Classes/ImageEditor.php'); $manager = new ImageManager($IMConfig); $editor = new ImageEditor($manager); $imageInfo = $editor->processImage(); ?> <html> <head> <title></title> <link href="assets/editorFrame.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="assets/wz_jsgraphics.js"></script> <script type="text/javascript" src="assets/EditorContent.js"></script> <script type="text/javascript"> if(window.top) I18N = window.top.I18N; function i18n(str) { if(I18N) return (I18N[str] || str); else return str; }; var mode = "<? echo $editor->getAction(); ?>" //crop, scale, measure var currentImageFile = "<? if(count($imageInfo)>0) echo rawurlencode($imageInfo['file']); ?>"; <? if ($editor->isFileSaved() == 1) { ?> alert(i18n('File saved.')); <? } else if ($editor->isFileSaved() == -1) { ?> alert(i18n('File was not saved.')); <? } ?> </script> <script type="text/javascript" src="assets/editorFrame.js"></script> </head> <body> <div id="status"></div> <div id="ant" class="selection" style="visibility:hidden"><img src="img/spacer.gif" width="0" height="0" border="0" alt="" id="cropContent"></div> <? if ($editor->isGDEditable() == -1) { ?> <div style="text-align:center; padding:10px;"><span class="error">GIF format is not supported, image editing not supported.</span></div> <? } ?> <table height="100%" width="100%"> <tr> <td> <? if(count($imageInfo) > 0 && is_file($imageInfo['fullpath'])) { ?> <span id="imgCanvas" class="crop"><img src="<? echo $imageInfo['src']; ?>" <? echo $imageInfo['dimensions']; ?> alt="" id="theImage" name="theImage"></span> <? } else { ?> <span class="error">No Image Available</span> <? } ?> </td> </tr> </table> </body> </html> --- NEW FILE: image-manager.js --- /** * The ImageManager plugin javascript. * @author $Author: joestewart $ * @version $Id: image-manager.js,v 1.1 2004/08/23 17:48:59 joestewart Exp $ * @package ImageManager */ /** * To Enable the plug-in add the following line before HTMLArea is initialised. * * HTMLArea.loadPlugin("ImageManager"); * * Then configure the config.inc.php file, that is all. * For up-to-date documentation, please visit http://www.zhuo.org/htmlarea/ */ /** * It is pretty simple, this file over rides the HTMLArea.prototype._insertImage * function with our own, only difference is the popupDialog url * point that to the php script. */ function ImageManager(editor) { var tt = ImageManager.I18N; }; ImageManager._pluginInfo = { name : "ImageManager", version : "1.0", developer : "Xiang Wei Zhuo", developer_url : "http://www.zhuo.org/htmlarea/", license : "htmlArea" }; // Over ride the _insertImage function in htmlarea.js. // Open up the ImageManger script instead. HTMLArea.prototype._insertImage = function(image) { var editor = this; // for nested functions var outparam = null; if (typeof image == "undefined") { image = this.getParentElement(); if (image && !/^img$/i.test(image.tagName)) image = null; } if (image) outparam = { f_url : HTMLArea.is_ie ? image.src : image.getAttribute("src"), f_alt : image.alt, f_border : image.border, f_align : image.align, f_vert : image.vspace, f_horiz : image.hspace, f_width : image.width, f_height : image.height }; var manager = _editor_url + 'plugins/ImageManager/manager.php'; Dialog(manager, function(param) { if (!param) { // user must have pressed Cancel return false; } var img = image; if (!img) { var sel = editor._getSelection(); var range = editor._createRange(sel); editor._doc.execCommand("insertimage", false, param.f_url); if (HTMLArea.is_ie) { img = range.parentElement(); // wonder if this works... if (img.tagName.toLowerCase() != "img") { img = img.previousSibling; } } else { img = range.startContainer.previousSibling; } } else { img.src = param.f_url; } for (field in param) { var value = param[field]; switch (field) { case "f_alt" : img.alt = value; break; case "f_border" : img.border = parseInt(value || "0"); break; case "f_align" : img.align = value; break; case "f_vert" : img.vspace = parseInt(value || "0"); break; case "f_horiz" : img.hspace = parseInt(value || "0"); break; case "f_width" : img.width = parseInt(value || "0"); break; case "f_height" : img.height = parseInt(value || "0"); break; } } }, outparam); }; --- NEW FILE: images.php --- <? /** * Show a list of images in a long horizontal table. * @author $Author: joestewart $ * @version $Id: images.php,v 1.1 2004/08/23 17:48:59 joestewart Exp $ * @package ImageManager */ require_once('config.inc.php'); require_once('Classes/ImageManager.php'); //default path is / $relative = '/'; $manager = new ImageManager($IMConfig); //process any file uploads $manager->processUploads(); $manager->deleteFiles(); $refreshDir = false; //process any directory functions if($manager->deleteDirs() || $manager->processNewDir()) $refreshDir = true; //check for any sub-directory request //check that the requested sub-directory exists //and valid if(isset($_REQUEST['dir'])) { $path = rawurldecode($_REQUEST['dir']); if($manager->validRelativePath($path)) $relative = $path; } $manager = new ImageManager($IMConfig); //get the list of files and directories $list = $manager->getFiles($relative); /* ================= OUTPUT/DRAW FUNCTIONS ======================= */ /** * Draw the files in an table. */ function drawFiles($list, &$manager) { global $relative; foreach($list as $entry => $file) { ?> <td><table width="100" cellpadding="0" cellspacing="0"><tr><td class="block"> <a href="javascript:;" onclick="selectImage('<? echo $file['relative'];?>', '<? echo $entry; ?>', <? echo $file['image'][0];?>, <? echo $file['image'][1]; ?>);"title="<? echo $entry; ?> - <? echo Files::formatSize($file['stat']['size']); ?>"><img src="<? echo $manager->getThumbnail($file['relative']); ?>" alt="<? echo $entry; ?> - <? echo Files::formatSize($file['stat']['size']); ?>"/></a> </td></tr><tr><td class="edit"> <a href="images.php?dir=<? echo $relative; ?>&delf=<? echo rawurlencode($file['relative']);?>" title="Trash" onclick="return confirmDeleteFile('<? echo $entry; ?>');"><img src="img/edit_trash.gif" height="15" width="15" alt="Trash"/></a><a href="javascript:;" title="Edit" onclick="editImage('<? echo rawurlencode($file['relative']);?>');"><img src="img/edit_pencil.gif" height="15" width="15" alt="Edit"/></a> <? if($file['image']){ echo $file['image'][0].'x'.$file['image'][1]; } else echo $entry;?> </td></tr></table></td> <? }//foreach }//function drawFiles /** * Draw the directory. */ function drawDirs($list, &$manager) { global $relative; foreach($list as $path => $dir) { ?> <td><table width="100" cellpadding="0" cellspacing="0"><tr><td class="block"> <a href="images.php?dir=<? echo rawurlencode($path); ?>" onclick="updateDir('<? echo $path; ?>')" title="<? echo $dir['entry']; ?>"><img src="img/folder.gif" height="80" width="80" alt="<? echo $dir['entry']; ?>" /></a> </td></tr><tr> <td class="edit"> <a href="images.php?dir=<? echo $relative; ?>&deld=<? echo rawurlencode($path); ?>" title="Trash" onclick="return confirmDeleteDir('<? echo $dir['entry']; ?>', <? echo $dir['count']; ?>);"><img src="img/edit_trash.gif" height="15" width="15" alt="Trash"/></a> <? echo $dir['entry']; ?> </td> </tr></table></td> <? } //foreach }//function drawDirs /** * No directories and no files. */ function drawNoResults() { ?> <table width="100%"> <tr> <td class="noResult">No Images Found</td> </tr> </table> <? } /** * No directories and no files. */ function drawErrorBase(&$manager) { ?> <table width="100%"> <tr> <td class="error">Invalid base directory: <? echo $manager->config['base_dir']; ?></td> </tr> </table> <? } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Image List</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="assets/imagelist.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="assets/dialog.js"></script> <script type="text/javascript"> /*<![CDATA[*/ if(window.top) I18N = window.top.I18N; function hideMessage() { var topDoc = window.top.document; var messages = topDoc.getElementById('messages'); if(messages) messages.style.display = "none"; } init = function() { hideMessage(); var topDoc = window.top.document; <? //we need to refesh the drop directory list //save the current dir, delete all select options //add the new list, re-select the saved dir. if($refreshDir) { $dirs = $manager->getDirs(); ?> var selection = topDoc.getElementById('dirPath'); var currentDir = selection.options[selection.selectedIndex].text; while(selection.length > 0) { selection.remove(0); } selection.options[selection.length] = new Option("/","<? echo rawurlencode('/'); ?>"); <? foreach($dirs as $relative=>$fullpath) { ?> selection.options[selection.length] = new Option("<? echo $relative; ?>","<? echo rawurlencode($relative); ?>"); <? } ?> for(var i = 0; i < selection.length; i++) { var thisDir = selection.options[i].text; if(thisDir == currentDir) { selection.selectedIndex = i; break; } } <? } ?> } function editImage(image) { var url = "editor.php?img="+image; Dialog(url, function(param) { if (!param) // user must have pressed Cancel return false; else { return true; } }, null); } /*]]>*/ </script> <script type="text/javascript" src="assets/images.js"></script> </head> <body> <? if ($manager->isValidBase() == false) { drawErrorBase($manager); } elseif(count($list[0]) > 0 || count($list[1]) > 0) { ?> <table> <tr> <? drawDirs($list[0], $manager); ?> <? drawFiles($list[1], $manager); ?> </tr> </table> <? } else { drawNoResults(); } ?> </body> </html> --- NEW FILE: manager.php --- <? /** * The main GUI for the ImageManager. * @author $Author: joestewart $ * @version $Id: manager.php,v 1.1 2004/08/23 17:48:59 joestewart Exp $ * @package ImageManager */ require_once('config.inc.php'); require_once('Classes/ImageManager.php'); $manager = new ImageManager($IMConfig); $dirs = $manager->getDirs(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Insert Image</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="assets/manager.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="assets/popup.js"></script> <script type="text/javascript" src="assets/dialog.js"></script> <script type="text/javascript"> /*<![CDATA[*/ window.resizeTo(600, 460); if(window.opener) I18N = window.opener.ImageManager.I18N; var thumbdir = "<? echo $IMConfig['thumbnail_dir']; ?>"; var base_url = "<? echo $manager->getBaseURL(); ?>"; /*]]>*/ </script> <script type="text/javascript" src="assets/manager.js"></script> </head> <body> <div class="title">Insert Image</div> <form action="images.php" id="uploadForm" method="post" enctype="multipart/form-data"> <fieldset><legend>Image Manager</legend> <div class="dirs"> <label for="dirPath">Directory</label> <select name="dir" class="dirWidth" id="dirPath" onchange="updateDir(this)"> <option value="/">/</option> <? foreach($dirs as $relative=>$fullpath) { ?> <option value="<? echo rawurlencode($relative); ?>"><? echo $relative; ?></option> <? } ?> </select> <a href="#" onclick="javascript: goUpDir();" title="Directory Up"><img src="img/btnFolderUp.gif" height="15" width="15" alt="Directory Up" /></a> <? if($IMConfig['safe_mode'] == false && $IMConfig['allow_new_dir']) { ?> <a href="#" onclick="newFolder();" title="New Folder"><img src="img/btnFolderNew.gif" height="15" width="15" alt="New Folder" /></a> <? } ?> <div id="messages" style="display: none;"><span id="message"></span><img SRC="img/dots.gif" width="22" height="12" alt="..." /></div> <iframe src="images.php" name="imgManager" id="imgManager" class="imageFrame" scrolling="auto" title="Image Selection" frameborder="0"></iframe> </div> </fieldset> <!-- image properties --> <table class="inputTable"> <tr> <td align="right"><label for="f_url">Image File</label></td> <td><input type="text" id="f_url" class="largelWidth" value="" /></td> <td rowspan="3" align="right"> </td> <td align="right"><label for="f_width">Width</label></td> <td><input type="text" id="f_width" class="smallWidth" value="" onchange="javascript:checkConstrains('width');"/></td> <td rowspan="2" align="right"><img src="img/locked.gif" id="imgLock" width="25" height="32" alt="Constrained Proportions" /></td> <td rowspan="3" align="right"> </td> <td align="right"><label for="f_vert">V Space</label></td> <td><input type="text" id="f_vert" class="smallWidth" value="" /></td> </tr> <tr> <td align="right"><label for="f_alt">Alt</label></td> <td><input type="text" id="f_alt" class="largelWidth" value="" /></td> <td align="right"><label for="f_height">Height</label></td> <td><input type="text" id="f_height" class="smallWidth" value="" onchange="javascript:checkConstrains('height');"/></td> <td align="right"><label for="f_horiz">H Space</label></td> <td><input type="text" id="f_horiz" class="smallWidth" value="" /></td> </tr> <tr> <? if($IMConfig['allow_upload'] == true) { ?> <td align="right"><label for="upload">Upload</label></td> <td> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td><input type="file" name="upload" id="upload"/></td> <td> <button type="submit" name="submit" onclick="doUpload();"/>Upload</button></td> </tr> </table> </td> <? } else { ?> <td colspan="2"></td> <? } ?> <td align="right"><label for="f_align">Align</label></td> <td colspan="2"> <select size="1" id="f_align" title="Positioning of this image"> <option value="" >Not Set</option> <option value="left" >Left</option> <option value="right" >Right</option> <option value="texttop" >Texttop</option> <option value="absmiddle" >Absmiddle</option> <option value="baseline" selected="selected" >Baseline</option> <option value="absbottom" >Absbottom</option> <option value="bottom" >Bottom</option> <option value="middle" >Middle</option> <option value="top" >Top</option> </select> </td> <td align="right"><label for="f_border">Border</label></td> <td><input type="text" id="f_border" class="smallWidth" value="" /></td> </tr> <tr> <td colspan="4" align="right"> <input type="hidden" id="orginal_width" /> <input type="hidden" id="orginal_height" /> <input type="checkbox" id="constrain_prop" checked="checked" onclick="javascript:toggleConstrains(this);" /> </td> <td colspan="5"><label for="constrain_prop">Constrain Proportions</label></td> </tr> </table> <!--// image properties --> <div style="text-align: right;"> <hr /> <button type="button" class="buttons" onclick="return refresh();">Refresh</button> <button type="button" class="buttons" onclick="return onOK();">OK</button> <button type="button" class="buttons" onclick="return onCancel();">Cancel</button> </div> </form> </body> </html> --- NEW FILE: newFolder.html --- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>New Folder</title> <style type="text/css"> /*<![CDATA[*/ html, body { background-color: ButtonFace; color: ButtonText; font: 11px Tahoma,Verdana,sans-serif; margin: 0; padding: 0;} body { padding: 5px; } .title { background-color: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px; border-bottom: 1px solid black; letter-spacing: 2px;} select, input, button { font: 11px Tahoma,Verdana,sans-serif; } .buttons { width: 70px; text-align: center; } form { padding: 0px; margin: 0;} form .elements{ padding: 10px; text-align: center; } /*]]>*/ </style> <script type="text/javascript" src="assets/popup.js"></script> <script type="text/javascript"> /*<![CDATA[*/ window.resizeTo(300, 160); if(window.opener) I18N = window.opener.I18N; init = function () { __dlg_init(); __dlg_translate(I18N); document.getElementById("f_foldername").focus(); } function onCancel() { __dlg_close(null); return false; } function onOK() { // pass data back to the calling window var fields = ["f_foldername"]; var param = new Object(); for (var i in fields) { var id = fields[i]; var el = document.getElementById(id); param[id] = el.value; } __dlg_close(param); return false; } function addEvent(obj, evType, fn) { if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; } } addEvent(window, 'load', init); //--> </script> </head> <body > <div class="title">New Folder</div> <form action=""> <div class="elements"> <label for="f_foldername">Folder Name:</label> <input type="text" id="f_foldername" /> </div> <div style="text-align: right;"> <hr /> <button type="button" class="buttons" onclick="return onOK();">OK</button> <button type="button" class="buttons" onclick="return onCancel();">Cancel</button> </div> </form> </body> </html> --- NEW FILE: thumbs.php --- <? /** * On the fly Thumbnail generation. * Creates thumbnails given by thumbs.php?img=/relative/path/to/image.jpg * relative to the base_dir given in config.inc.php * @author $Author: joestewart $ * @version $Id: thumbs.php,v 1.1 2004/08/23 17:48:59 joestewart Exp $ * @package ImageManager */ require_once('config.inc.php'); require_once('Classes/ImageManager.php'); require_once('Classes/Thumbnail.php'); //check for img parameter in the url if(!isset($_GET['img'])) exit(); $manager = new ImageManager($IMConfig); //get the image and the full path to the image $image = rawurldecode($_GET['img']); $fullpath = Files::makeFile($manager->getBaseDir(),$image); //not a file, so exit if(!is_file($fullpath)) exit(); $imgInfo = @getImageSize($fullpath); //Not an image, send default thumbnail if(!is_array($imgInfo)) { //show the default image, otherwise we quit! $default = $manager->getDefaultThumb(); if($default) { header('Location: '.$default); exit(); } } //if the image is less than the thumbnail dimensions //send the original image as thumbnail if ($imgInfo[0] <= $IMConfig['thumbnail_width'] && $imgInfo[1] <= $IMConfig['thumbnail_height']) { header('Location: '.$manager->getFileURL($image)); exit(); } //Check for thumbnails $thumbnail = $manager->getThumbName($fullpath); if(is_file($thumbnail)) { //if the thumbnail is newer, send it if(filemtime($thumbnail) >= filemtime($fullpath)) { header('Location: '.$manager->getThumbURL($image)); exit(); } } //creating thumbnails $thumbnailer = new Thumbnail($IMConfig['thumbnail_width'],$IMConfig['thumbnail_height']); $thumbnailer->createThumbnail($fullpath, $thumbnail); //Check for NEW thumbnails if(is_file($thumbnail)) { //send the new thumbnail header('Location: '.$manager->getThumbURL($image)); exit(); } else { //show the default image, otherwise we quit! $default = $manager->getDefaultThumb(); if($default) header('Location: '.$default); } ?> |
From: Joe S. <joe...@us...> - 2004-08-23 17:49:17
|
Update of /cvsroot/phpslash/phpslash-dev/public_html/scripts/htmlarea3/plugins/ImageManager/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6597/phpslash-dev/public_html/scripts/htmlarea3/plugins/ImageManager/lang Added Files: en.js Log Message: Upgraded htmlarea2 --- NEW FILE: en.js --- // I18N constants // LANG: "en", ENCODING: UTF-8 | ISO-8859-1 // Author: Xiang Wei Zhuo, http://www.zhuo.org // FOR TRANSLATORS: // // 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE // (at least a valid email address) // // 2. PLEASE TRY TO USE UTF-8 FOR ENCODING; // (if this is not possible, please include a comment // that states what encoding is necessary.) ImageManager.I18N = { "Image Manager" : "Image Manager", "Crop" : "Crop" }; /* */ |
From: Joe S. <joe...@us...> - 2004-08-23 17:49:17
|
Update of /cvsroot/phpslash/phpslash-dev/public_html/scripts/htmlarea3/plugins/SpellChecker/img In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6597/phpslash-dev/public_html/scripts/htmlarea3/plugins/SpellChecker/img Added Files: he-spell-check.gif Log Message: Upgraded htmlarea2 --- NEW FILE: he-spell-check.gif --- GIF89a |
Update of /cvsroot/phpslash/phpslash-dev/public_html/scripts/htmlarea3/plugins/HtmlTidy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6597/phpslash-dev/public_html/scripts/htmlarea3/plugins/HtmlTidy Added Files: README html-tidy-config.cfg html-tidy-logic.php html-tidy.js makefile.xml Log Message: Upgraded htmlarea2 --- NEW FILE: README --- // Plugin for htmlArea to run code through the server's HTML Tidy // By Adam Wright, for The University of Western Australia // // Email: ze...@uc... // Homepage: http://blog.hipikat.org/ // // Distributed under the same terms as HTMLArea itself. // This notice MUST stay intact for use (see license.txt). // // Version: 0.5 // Released to the outside world: 04/03/04 HtmlTidy is a plugin for the popular cross-browser TTY WYSIWYG editor, htmlArea (http://www.interactivetools.com/products/htmlarea/). HtmlTidy basically queries HTML Tidy (http://tidy.sourceforge.net/) on the server side, getting it to make-html-nice, instead of relying on masses of javascript, which the client would have to download. Hi, this is a quick explanation of how to install HtmlTidy. Much better documentation is probably required, and you're welcome to write it :) * The HtmlTidy directory you should have found this file in should include the following: - README This file, providing help installing the plugin. - html-tidy-config.cfg This file contains the configuration options HTML Tidy uses to clean html, and can be modified to suit your organizations requirements. - html-tidy-logic.php This is the php script, which is queried with dirty html and is responsible for invoking HTML Tidy, getting nice new html and returning it to the client. - html-tidy.js The main htmlArea plugin, providing functionality to tidy html through the htmlArea interface. - htmlarea.js.onmode_event.diff At the time of publishing, an extra event handler was required inside the main htmlarea.js file. htmlarea.js may be patched against this file to make the changes reuquired, but be aware that the event handler may either now be in the core or htmlarea.js may have changed enough to invalidate the patch. UPDATE: now it exists in the official htmlarea.js; applying this patch is thus no longer necessary. - img/html-tidy.gif The HtmlTidy icon, for the htmlArea toolbar. Created by Dan Petty for The University of Western Australia. - lang/en.js English language file. Add your own language files here and please contribute back into the htmlArea community! The HtmlArea directory should be extracted to your htmlarea/plugins/ directory. * Make sure the onMode event handler mentioned above, regarding htmlarea.js.onmode_event.diff, exists in your htmlarea.js * html-tidy-logic.php should be executable, and your web server should be configured to execute php scripts in the directory html-tidy-logic.php exists in. * HTML Tidy needs to be installed on your server, and 'tidy' should be an alias to it, lying in the PATH known to the user executing such web scripts. * In your htmlArea configuration, do something like this: HTMLArea.loadPlugin("HtmlTidy"); editor = new HTMLArea("doc"); editor.registerPlugin("HtmlTidy"); * Then, in your htmlArea toolbar configuration, use: - "HT-html-tidy" This will create the 'tidy broom' icon on the toolbar, which will attempt to tidy html source when clicked, and; - "HT-auto-tidy" This will create an "Auto Tidy" / "Don't Tidy" dropdown, to select whether the source should be tidied automatically when entering source view. On by default, if you'd like it otherwise you can do so programatically after generating the toolbar :) (Or just hack it to be otherwise...) Thank you. Any bugs you find can be emailed to ze...@uc... --- NEW FILE: html-tidy-config.cfg --- // Default configuration file for the htmlArea, HtmlTidy plugin // By Adam Wright, for The University of Western Australia // // Evertything you always wanted to know about HTML Tidy * // can be found at http://tidy.sourceforge.net/, and a // quick reference to the configuration options exists at // http://tidy.sourceforge.net/docs/quickref.html // // * But were afraid to ask // // Distributed under the same terms as HTMLArea itself. // This notice MUST stay intact for use (see license.txt). word-2000: yes clean: no drop-font-tags: yes doctype: auto drop-empty-paras: yes drop-proprietary-attributes: yes enclose-block-text: yes enclose-text: yes escape-cdata: yes logical-emphasis: yes indent: auto indent-spaces: 2 break-before-br: yes output-xhtml: yes force-output: yes --- NEW FILE: html-tidy-logic.php --- <? ################################################################### ## ## Plugin for htmlArea, to run code through the server's HTML Tidy ## By Adam Wright, for The University of Western Australia ## This is the server-side script, which dirty code is run through. ## ## Distributed under the same terms as HTMLArea itself. ## This notice MUST stay intact for use (see license.txt). ## // Get the original source $source = $_POST['htisource_name']; $source = stripslashes($source); // Open a tidy process - I hope it's installed! $descriptorspec = array( 0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("file", "/dev/null", "a") ); $process = proc_open("tidy -config html-tidy-config.cfg", $descriptorspec, $pipes); // Make sure the program started and we got the hooks... // Either way, get some source code into $source if (is_resource($process)) { // Feed untidy source into the stdin fwrite($pipes[0], $source); fclose($pipes[0]); // Read clean source out to the browser while (!feof($pipes[1])) { //echo fgets($pipes[1], 1024); $newsrc .= fgets($pipes[1], 1024); } fclose($pipes[1]); // Clean up after ourselves proc_close($process); } else { // Better give them back what they came with, so they don't lose it all... $newsrc = "<body>\n" .$source. "\n</body>"; } // Split our source into an array by lines $srcLines = explode("\n",$newsrc); // Get only the lines between the body tags $startLn = 0; while ( strpos( $srcLines[$startLn++], '<body' ) === false && $startLn < sizeof($srcLines) ); $endLn = $startLn; while ( strpos( $srcLines[$endLn++], '</body' ) === false && $endLn < sizeof($srcLines) ); $srcLines = array_slice( $srcLines, $startLn, ($endLn - $startLn - 1) ); // Create a set of javascript code to compile a new source string foreach ($srcLines as $line) { $jsMakeSrc .= "\tns += '" . str_replace("'","\'",$line) . "\\n';\n"; } ?> <html> <head> <script type="text/javascript"> function setNewHtml() { var htRef = window.parent._editorRef.plugins['HtmlTidy']; htRef.instance.processTidied(tidyString()); } function tidyString() { var ns = '\n'; <?=$jsMakeSrc;?> return ns; } </script> </head> <body id="htiNewBody" onload="setNewHtml()"> </body> </html> --- NEW FILE: html-tidy.js --- // Plugin for htmlArea to run code through the server's HTML Tidy // By Adam Wright, for The University of Western Australia // // Distributed under the same terms as HTMLArea itself. // This notice MUST stay intact for use (see license.txt). function HtmlTidy(editor) { this.editor = editor; var cfg = editor.config; var tt = HtmlTidy.I18N; var bl = HtmlTidy.btnList; var self = this; this.onMode = this.__onMode; // register the toolbar buttons provided by this plugin var toolbar = []; for (var i in bl) { var btn = bl[i]; if (btn == "html-tidy") { var id = "HT-html-tidy"; cfg.registerButton(id, tt[id], editor.imgURL(btn[0] + ".gif", "HtmlTidy"), true, function(editor, id) { // dispatch button press event self.buttonPress(editor, id); }, btn[1]); toolbar.push(id); } else if (btn == "html-auto-tidy") { var ht_class = { id : "HT-auto-tidy", options : { "Auto-Tidy" : "auto", "Don't Tidy" : "noauto" }, action : function (editor) { self.__onSelect(editor, this); }, refresh : function (editor) { }, context : "body" }; cfg.registerDropdown(ht_class); } } for (var i in toolbar) { cfg.toolbar[0].push(toolbar[i]); } }; HtmlTidy._pluginInfo = { name : "HtmlTidy", version : "1.0", developer : "Adam Wright", developer_url : "http://blog.hipikat.org/", sponsor : "The University of Western Australia", sponsor_url : "http://www.uwa.edu.au/", license : "htmlArea" }; HtmlTidy.prototype.__onSelect = function(editor, obj) { // Get the toolbar element object var elem = editor._toolbarObjects[obj.id].element; // Set our onMode event appropriately if (elem.value == "auto") this.onMode = this.__onMode; else this.onMode = null; }; HtmlTidy.prototype.__onMode = function(mode) { if ( mode == "textmode" ) { this.buttonPress(this.editor, "HT-html-tidy"); } }; HtmlTidy.btnList = [ null, // separator ["html-tidy"], ["html-auto-tidy"] ]; HtmlTidy.prototype.onGenerateOnce = function() { var editor = this.editor; var ifr = document.createElement("iframe"); ifr.name = "htiframe_name"; var s = ifr.style; s.position = "absolute"; s.width = s.height = s.border = s.left = s.top = s.padding = s.margin = "0px"; document.body.appendChild(ifr); var frm = '<form id="htiform_id" name="htiform_name" method="post" target="htiframe_name" action="'; frm += _editor_url + 'plugins/HtmlTidy/html-tidy-logic.php'; frm += '"><textarea name="htisource_name" id="htisource_id">'; frm += '</textarea></form>'; var newdiv = document.createElement('div'); newdiv.style.display = "none"; newdiv.innerHTML = frm; document.body.appendChild(newdiv); }; HtmlTidy.prototype.buttonPress = function(editor, id) { var i18n = HtmlTidy.I18N; switch (id) { case "HT-html-tidy": var oldhtml = editor.getHTML(); // Ask the server for some nice new html, based on the old... var myform = document.getElementById('htiform_id'); var txtarea = document.getElementById('htisource_id'); txtarea.value = editor.getHTML(); // Apply the 'meanwhile' text, e.g. "Tidying HTML, please wait..." editor.setHTML(i18n['tidying']); // The returning tidying processing script needs to find the editor window._editorRef = editor; // ...And send our old source off for processing! myform.submit(); break; } }; HtmlTidy.prototype.processTidied = function(newSrc) { editor = this.editor; editor.setHTML(newSrc); }; --- NEW FILE: makefile.xml --- <files> <file name="*.{html,js,cgi,php,css,cfg}" /> <file name="README" /> <dir name="lang" /> <dir name="img" /> </files> |