cvs: pearweb / package.php package.xml /public_html/javascript pear_editor.js /public_html/pepr pepr-proposal-edit.php
| From: | Greg Beaver | Date: | Tue, 31 Oct 2006 21:38:17 +0000 |
| Subject: | cvs: pearweb / package.php package.xml /public_html/javascript pear_editor.js /public_html/pepr pepr-proposal-edit.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-5146@lists.php.net to get a copy of this message | ||
cellog Tue Oct 31 21:38:17 2006 UTC
Added files:
/pearweb/public_html/javascript pear_editor.js
Modified files:
/pearweb package.php package.xml
/pearweb/public_html/pepr pepr-proposal-edit.php
Log:
* implement Request #9118: Added new feature to pepr
http://cvs.php.net/viewvc.cgi/pearweb/package.php?r1=1.19&r2=1.20&diff_format=u Index: pearweb/package.php diff -u pearweb/package.php:1.19 pearweb/package.php:1.20 --- pearweb/package.php:1.19 Tue Oct 31 21:27:04 2006 +++ pearweb/package.php Tue Oct 31 21:38:16 2006 @@ -23,6 +23,7 @@ * fix Bug #5340: User details are overescaped * fix Bug #8842: package.xml package name need not match case and must * implement Request #7828: PEAR Bug Summary Report + * implement Request #9118: Added new feature to pepr '); $a->resetUsesrole(); $a->addUsesRole('web', 'Role_Web', 'pearified.com'); http://cvs.php.net/viewvc.cgi/pearweb/package.xml?r1=1.47&r2=1.48&diff_format=u Index: pearweb/package.xml diff -u pearweb/package.xml:1.47 pearweb/package.xml:1.48 --- pearweb/package.xml:1.47 Tue Oct 31 21:27:04 2006 +++ pearweb/package.xml Tue Oct 31 21:38:16 2006 @@ -53,7 +53,7 @@ <active>no</active> </developer> <date>2006-10-31</date> - <time>16:26:48</time> + <time>16:37:56</time> <version> <release>1.0.0RC2</release> <api>0.1.1</api> @@ -69,6 +69,7 @@ * fix Bug #5340: User details are overescaped * fix Bug #8842: package.xml package name need not match case and must * implement Request #7828: PEAR Bug Summary Report + * implement Request #9118: Added new feature to pepr </notes> <contents> <dir baseinstalldir="/" name="/"> @@ -875,6 +876,7 @@ * fix Bug #5340: User details are overescaped * fix Bug #8842: package.xml package name need not match case and must * implement Request #7828: PEAR Bug Summary Report + * implement Request #9118: Added new feature to pepr </notes> </release> </changelog> http://cvs.php.net/viewvc.cgi/pearweb/public_html/pepr/pepr-proposal-edit.php?r1=1.48&r2=1.49&diff_format=u Index: pearweb/public_html/pepr/pepr-proposal-edit.php diff -u pearweb/public_html/pepr/pepr-proposal-edit.php:1.48 pearweb/public_html/pepr/pepr-proposal-edit.php:1.49 --- pearweb/public_html/pepr/pepr-proposal-edit.php:1.48 Tue Oct 31 03:06:01 2006 +++ pearweb/public_html/pepr/pepr-proposal-edit.php Tue Oct 31 21:38:17 2006 @@ -20,7 +20,7 @@ * @author Daniel Convissor <danielc@php.net> * @copyright Copyright (c) 1997-2005 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License - * @version $Id: pepr-proposal-edit.php,v 1.48 2006/10/31 03:06:01 cellog Exp $ + * @version $Id: pepr-proposal-edit.php,v 1.49 2006/10/31 21:38:17 cellog Exp $ */ auth_require('pear.pepr'); @@ -70,6 +70,9 @@ $proposal = null; } +?> +<script language="javascript" src="/javascript/pear_editor.js"></script> +<?php include_once 'HTML/QuickForm.php'; $form =& new HTML_QuickForm('proposal_edit', 'post', 'pepr-proposal-edit.php?id=' . $id); @@ -113,7 +116,35 @@ $form->addElement('text', 'pkg_name', 'Package name:'); $form->addElement('select', 'pkg_license', 'License:', $possibleLicenses); -$form->addElement('textarea', 'pkg_describtion', 'Package description:', array('rows' => 20, 'cols' => '80')); +/** + * Easy codes. makes it easier for people to put + * bb codes + */ +$bbhelpers[] = HTML_QuickForm::createElement('link', null, '_blank', '#', 'Bold', + array('onclick' => + "insertTags('pkg_description', '[b]', '[/b]','bold')")); + +$bbhelpers[] = HTML_QuickForm::createElement('link', null, '_blank', '#', 'Italic', + array('onclick' => + "insertTags('pkg_description', '[i]', '[/i]','italic')")); + +$bbhelpers[] = HTML_QuickForm::createElement('link', null, '_blank', '#', 'Underline', + array('onclick' => + "insertTags('pkg_description', '[u]', '[/u]','underline')")); +$bbhelpers[] = HTML_QuickForm::createElement('link', null, '_blank', '#', 'Red Txt', + array('onclick' => + "insertTags('pkg_description', '[color=red]', '[/color]','red text')")); +$bbhelpers[] = HTML_QuickForm::createElement('link', null, '_blank', '#', 'PHPCode', + array('onclick' => + "insertTags('pkg_description', '[code=php]', '[/code]','print \'php code\';')")); +$bbhelpers[] = HTML_QuickForm::createElement('link', null, '_blank', '#', 'List', + array('onclick' => + "insertTags('pkg_description', '[list]\\n[*]', '\\n[/list]','list')")); + +$form->addGroup($bbhelpers, 'markup_help', 'BB Helpers (beta)', ' | '); + + +$form->addElement('textarea', 'pkg_description', 'Package description:', array('rows' => 20, 'cols' => '80', 'id' => 'pkg_description')); $form->addElement('select', 'markup', 'Markup', array('bbcode' => 'BBCode', 'wiki' => 'Wiki')); $helpLinks[] =& HTML_QuickForm::createElement('link', 'help_bbcode', '_blank', 'pepr-bbcode-help.php', 'You can use BBCode inside your description', array('target' => '_blank')); @@ -149,7 +180,7 @@ if ($proposal != null) { $defaults = array('pkg_name' => $proposal->pkg_name, 'pkg_license' => $proposal->pkg_license, - 'pkg_describtion' => $proposal->pkg_describtion, + 'pkg_description' => $proposal->pkg_description, 'pkg_deps' => $proposal->pkg_deps, 'markup' => $proposal->markup); if (isset($mapCategories[$proposal->pkg_category])) { @@ -201,13 +232,13 @@ $form->applyFilter('pkg_name', 'trim'); -$form->applyFilter('pkg_describtion', 'trim'); +$form->applyFilter('pkg_description', 'trim'); $form->applyFilter('pkg_deps', 'trim'); $form->addRule('pkg_category', 'You have to select a package category!', 'required', '', 'client'); $form->addRule('pkg_name', 'You have to select a package name!', 'required', '', 'client'); $form->addRule('pkg_license', 'you have to specify the license of your package!', 'required', '', 'client'); -$form->addRule('pkg_describtion', 'You have to enter a package description!', 'required', '', 'client'); +$form->addRule('pkg_description', 'You have to enter a package description!', 'required', '', 'client'); function checkLinkTypeAndUrl($link, $linkCount) { list($key, $type) = each($link); http://cvs.php.net/viewvc.cgi/pearweb/public_html/javascript/pear_editor.js?view=markup&rev=1.1 Index: pearweb/public_html/javascript/pear_editor.js +++ pearweb/public_html/javascript/pear_editor.js /** * apply tagOpen/tagClose to selection in textarea, use sampleText instead * of selection if there is none copied and adapted from phpBB */ function insertTags(txtarea, tagOpen, tagClose, sampleText) { txtarea = document.getElementById(txtarea); // IE if(document.selection && !is_gecko) { var theSelection = document.selection.createRange().text; if(!theSelection) { theSelection=sampleText;} txtarea.focus(); if(theSelection.charAt(theSelection.length - 1) == " "){// exclude ending space char, if any theSelection = theSelection.substring(0, theSelection.length - 1); document.selection.createRange().text = tagOpen + theSelection + tagClose + " "; } else { document.selection.createRange().text = tagOpen + theSelection + tagClose; } // Mozilla } else if(txtarea.selectionStart || txtarea.selectionStart == '0') { var startPos = txtarea.selectionStart; var endPos = txtarea.selectionEnd; var scrollTop=txtarea.scrollTop; var myText = (txtarea.value).substring(startPos, endPos); if(!myText) { myText=sampleText;} if(myText.charAt(myText.length - 1) == " "){ // exclude ending space char, if any subst = tagOpen + myText.substring(0, (myText.length - 1)) + tagClose + " "; } else { subst = tagOpen + myText + tagClose; } txtarea.value = txtarea.value.substring(0, startPos) + subst + txtarea.value.substring(endPos, txtarea.value.length); txtarea.focus(); var cPos=startPos+(tagOpen.length+myText.length+tagClose.length); txtarea.selectionStart=cPos; txtarea.selectionEnd=cPos; txtarea.scrollTop=scrollTop; // All others } else { var myText = (txtarea.value).substring(startPos, endPos); if(!myText) { myText=sampleText;} if(myText.charAt(myText.length - 1) == " "){ // exclude ending space char, if any subst = tagOpen + myText.substring(0, (myText.length - 1)) + tagClose + " "; } else { subst = tagOpen + myText + tagClose; } txtarea.value = txtarea.value.substring(0, startPos) + subst + txtarea.value.substring(endPos, txtarea.value.length); txtarea.focus(); var cPos=startPos+(tagOpen.length+myText.length+tagClose.length); txtarea.selectionStart=cPos; txtarea.selectionEnd=cPos; txtarea.scrollTop=scrollTop; } if (txtarea.createTextRange) txtarea.caretPos = document.selection.createRange().duplicate(); }
http://cvs.php.net/viewvc.cgi/pearweb/package.php?r1=1.19&r2=1.20&diff_format=u Index: pearweb/package.php diff -u pearweb/package.php:1.19 pearweb/package.php:1.20 --- pearweb/package.php:1.19 Tue Oct 31 21:27:04 2006 +++ pearweb/package.php Tue Oct 31 21:38:16 2006 @@ -23,6 +23,7 @@ * fix Bug #5340: User details are overescaped * fix Bug #8842: package.xml package name need not match case and must * implement Request #7828: PEAR Bug Summary Report + * implement Request #9118: Added new feature to pepr '); $a->resetUsesrole(); $a->addUsesRole('web', 'Role_Web', 'pearified.com'); http://cvs.php.net/viewvc.cgi/pearweb/package.xml?r1=1.47&r2=1.48&diff_format=u Index: pearweb/package.xml diff -u pearweb/package.xml:1.47 pearweb/package.xml:1.48 --- pearweb/package.xml:1.47 Tue Oct 31 21:27:04 2006 +++ pearweb/package.xml Tue Oct 31 21:38:16 2006 @@ -53,7 +53,7 @@ <active>no</active> </developer> <date>2006-10-31</date> - <time>16:26:48</time> + <time>16:37:56</time> <version> <release>1.0.0RC2</release> <api>0.1.1</api> @@ -69,6 +69,7 @@ * fix Bug #5340: User details are overescaped * fix Bug #8842: package.xml package name need not match case and must * implement Request #7828: PEAR Bug Summary Report + * implement Request #9118: Added new feature to pepr </notes> <contents> <dir baseinstalldir="/" name="/"> @@ -875,6 +876,7 @@ * fix Bug #5340: User details are overescaped * fix Bug #8842: package.xml package name need not match case and must * implement Request #7828: PEAR Bug Summary Report + * implement Request #9118: Added new feature to pepr </notes> </release> </changelog> http://cvs.php.net/viewvc.cgi/pearweb/public_html/pepr/pepr-proposal-edit.php?r1=1.48&r2=1.49&diff_format=u Index: pearweb/public_html/pepr/pepr-proposal-edit.php diff -u pearweb/public_html/pepr/pepr-proposal-edit.php:1.48 pearweb/public_html/pepr/pepr-proposal-edit.php:1.49 --- pearweb/public_html/pepr/pepr-proposal-edit.php:1.48 Tue Oct 31 03:06:01 2006 +++ pearweb/public_html/pepr/pepr-proposal-edit.php Tue Oct 31 21:38:17 2006 @@ -20,7 +20,7 @@ * @author Daniel Convissor <danielc@php.net> * @copyright Copyright (c) 1997-2005 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License - * @version $Id: pepr-proposal-edit.php,v 1.48 2006/10/31 03:06:01 cellog Exp $ + * @version $Id: pepr-proposal-edit.php,v 1.49 2006/10/31 21:38:17 cellog Exp $ */ auth_require('pear.pepr'); @@ -70,6 +70,9 @@ $proposal = null; } +?> +<script language="javascript" src="/javascript/pear_editor.js"></script> +<?php include_once 'HTML/QuickForm.php'; $form =& new HTML_QuickForm('proposal_edit', 'post', 'pepr-proposal-edit.php?id=' . $id); @@ -113,7 +116,35 @@ $form->addElement('text', 'pkg_name', 'Package name:'); $form->addElement('select', 'pkg_license', 'License:', $possibleLicenses); -$form->addElement('textarea', 'pkg_describtion', 'Package description:', array('rows' => 20, 'cols' => '80')); +/** + * Easy codes. makes it easier for people to put + * bb codes + */ +$bbhelpers[] = HTML_QuickForm::createElement('link', null, '_blank', '#', 'Bold', + array('onclick' => + "insertTags('pkg_description', '[b]', '[/b]','bold')")); + +$bbhelpers[] = HTML_QuickForm::createElement('link', null, '_blank', '#', 'Italic', + array('onclick' => + "insertTags('pkg_description', '[i]', '[/i]','italic')")); + +$bbhelpers[] = HTML_QuickForm::createElement('link', null, '_blank', '#', 'Underline', + array('onclick' => + "insertTags('pkg_description', '[u]', '[/u]','underline')")); +$bbhelpers[] = HTML_QuickForm::createElement('link', null, '_blank', '#', 'Red Txt', + array('onclick' => + "insertTags('pkg_description', '[color=red]', '[/color]','red text')")); +$bbhelpers[] = HTML_QuickForm::createElement('link', null, '_blank', '#', 'PHPCode', + array('onclick' => + "insertTags('pkg_description', '[code=php]', '[/code]','print \'php code\';')")); +$bbhelpers[] = HTML_QuickForm::createElement('link', null, '_blank', '#', 'List', + array('onclick' => + "insertTags('pkg_description', '[list]\\n[*]', '\\n[/list]','list')")); + +$form->addGroup($bbhelpers, 'markup_help', 'BB Helpers (beta)', ' | '); + + +$form->addElement('textarea', 'pkg_description', 'Package description:', array('rows' => 20, 'cols' => '80', 'id' => 'pkg_description')); $form->addElement('select', 'markup', 'Markup', array('bbcode' => 'BBCode', 'wiki' => 'Wiki')); $helpLinks[] =& HTML_QuickForm::createElement('link', 'help_bbcode', '_blank', 'pepr-bbcode-help.php', 'You can use BBCode inside your description', array('target' => '_blank')); @@ -149,7 +180,7 @@ if ($proposal != null) { $defaults = array('pkg_name' => $proposal->pkg_name, 'pkg_license' => $proposal->pkg_license, - 'pkg_describtion' => $proposal->pkg_describtion, + 'pkg_description' => $proposal->pkg_description, 'pkg_deps' => $proposal->pkg_deps, 'markup' => $proposal->markup); if (isset($mapCategories[$proposal->pkg_category])) { @@ -201,13 +232,13 @@ $form->applyFilter('pkg_name', 'trim'); -$form->applyFilter('pkg_describtion', 'trim'); +$form->applyFilter('pkg_description', 'trim'); $form->applyFilter('pkg_deps', 'trim'); $form->addRule('pkg_category', 'You have to select a package category!', 'required', '', 'client'); $form->addRule('pkg_name', 'You have to select a package name!', 'required', '', 'client'); $form->addRule('pkg_license', 'you have to specify the license of your package!', 'required', '', 'client'); -$form->addRule('pkg_describtion', 'You have to enter a package description!', 'required', '', 'client'); +$form->addRule('pkg_description', 'You have to enter a package description!', 'required', '', 'client'); function checkLinkTypeAndUrl($link, $linkCount) { list($key, $type) = each($link); http://cvs.php.net/viewvc.cgi/pearweb/public_html/javascript/pear_editor.js?view=markup&rev=1.1 Index: pearweb/public_html/javascript/pear_editor.js +++ pearweb/public_html/javascript/pear_editor.js /** * apply tagOpen/tagClose to selection in textarea, use sampleText instead * of selection if there is none copied and adapted from phpBB */ function insertTags(txtarea, tagOpen, tagClose, sampleText) { txtarea = document.getElementById(txtarea); // IE if(document.selection && !is_gecko) { var theSelection = document.selection.createRange().text; if(!theSelection) { theSelection=sampleText;} txtarea.focus(); if(theSelection.charAt(theSelection.length - 1) == " "){// exclude ending space char, if any theSelection = theSelection.substring(0, theSelection.length - 1); document.selection.createRange().text = tagOpen + theSelection + tagClose + " "; } else { document.selection.createRange().text = tagOpen + theSelection + tagClose; } // Mozilla } else if(txtarea.selectionStart || txtarea.selectionStart == '0') { var startPos = txtarea.selectionStart; var endPos = txtarea.selectionEnd; var scrollTop=txtarea.scrollTop; var myText = (txtarea.value).substring(startPos, endPos); if(!myText) { myText=sampleText;} if(myText.charAt(myText.length - 1) == " "){ // exclude ending space char, if any subst = tagOpen + myText.substring(0, (myText.length - 1)) + tagClose + " "; } else { subst = tagOpen + myText + tagClose; } txtarea.value = txtarea.value.substring(0, startPos) + subst + txtarea.value.substring(endPos, txtarea.value.length); txtarea.focus(); var cPos=startPos+(tagOpen.length+myText.length+tagClose.length); txtarea.selectionStart=cPos; txtarea.selectionEnd=cPos; txtarea.scrollTop=scrollTop; // All others } else { var myText = (txtarea.value).substring(startPos, endPos); if(!myText) { myText=sampleText;} if(myText.charAt(myText.length - 1) == " "){ // exclude ending space char, if any subst = tagOpen + myText.substring(0, (myText.length - 1)) + tagClose + " "; } else { subst = tagOpen + myText + tagClose; } txtarea.value = txtarea.value.substring(0, startPos) + subst + txtarea.value.substring(endPos, txtarea.value.length); txtarea.focus(); var cPos=startPos+(tagOpen.length+myText.length+tagClose.length); txtarea.selectionStart=cPos; txtarea.selectionEnd=cPos; txtarea.scrollTop=scrollTop; } if (txtarea.createTextRange) txtarea.caretPos = document.selection.createRange().duplicate(); }