Revision history for AutoReplace


Revision [23338]

Last edited on 2016-05-20 07:38:47 by BrianKoontz [Replaces old-style internal links with new pipe-split links.]
Additions:
I like the simplicity of the automatic link creation when I type a new [[Docs:WikiWord | WikiWord]]. But I hate having to think about it all the time and as I naturally write "the wiki word" I would like the system to understand that for me. This is particularly enerving when typing people names: typing ""JohnDoe"" is not natural and it is also a pain for the eyes of a WikiStranger.
Such an action placed on this very WikiPage would then transform any string "auto replace" into ""[[AutoReplace | auto replace]]"".
Deletions:
I like the simplicity of the automatic link creation when I type a new [[Docs:WikiWord WikiWord]]. But I hate having to think about it all the time and as I naturally write "the wiki word" I would like the system to understand that for me. This is particularly enerving when typing people names: typing ""JohnDoe"" is not natural and it is also a pain for the eyes of a WikiStranger.
Such an action placed on this very WikiPage would then transform any string "auto replace" into ""[[AutoReplace auto replace]]"".


Revision [19645]

Edited on 2008-03-11 00:54:58 by BrianKoontz [Fixed broken link]
Additions:
I like the simplicity of the automatic link creation when I type a new [[Docs:WikiWord WikiWord]]. But I hate having to think about it all the time and as I naturally write "the wiki word" I would like the system to understand that for me. This is particularly enerving when typing people names: typing ""JohnDoe"" is not natural and it is also a pain for the eyes of a WikiStranger.
Deletions:
I like the simplicity of the automatic link creation when I type a new [[Docs:WikiWord]]. But I hate having to think about it all the time and as I naturally write "the wiki word" I would like the system to understand that for me. This is particularly enerving when typing people names: typing ""JohnDoe"" is not natural and it is also a pain for the eyes of a WikiStranger.


Revision [19644]

Edited on 2008-03-11 00:53:40 by BrianKoontz [Fixed broken link]
Additions:
I like the simplicity of the automatic link creation when I type a new [[Docs:WikiWord]]. But I hate having to think about it all the time and as I naturally write "the wiki word" I would like the system to understand that for me. This is particularly enerving when typing people names: typing ""JohnDoe"" is not natural and it is also a pain for the eyes of a WikiStranger.
Deletions:
I like the simplicity of the automatic link creation when I type a new WikiWord. But I hate having to think about it all the time and as I naturally write "the wiki word" I would like the system to understand that for me. This is particularly enerving when typing people names: typing ""JohnDoe"" is not natural and it is also a pain for the eyes of a WikiStranger.


Revision [18458]

Edited on 2008-01-28 00:11:41 by JavaWoman [Modified links pointing to docs server]

No Differences

Revision [8704]

Edited on 2005-05-29 14:25:10 by JavaWoman [minor]
Additions:
{{lastedit show="2"}}
====Automatic Replace of strings====
I like the simplicity of the automatic link creation when I type a new WikiWord. But I hate having to think about it all the time and as I naturally write "the wiki word" I would like the system to understand that for me. This is particularly enerving when typing people names: typing ""JohnDoe"" is not natural and it is also a pain for the eyes of a WikiStranger.
Those having a palm certainly like the capability to code small sequences so that they are transformed into long words as soon as typed. The same kind of thing exists in most of the word processors as well.
===A solution===
The simplest (and perfect?) solution is now at UrlBeautify.
===Another (complicated) solution===
Having a database used when saving (or editing?) the WikiPage to replace an Input Entry by the Output Entry to which it is linked.
This database would be fed by an appropriate action used in the code of the [[WikiPage]]s: ""{{equivalent words="auto replace*automatic replace" separator ="*" casematters="no" dissociated="no"}}"".
Such an action placed on this very WikiPage would then transform any string "auto replace" into ""[[AutoReplace auto replace]]"".
- This action would allow several strings to be entered in the parameter "word" separated by the content of the optional parameter "separator".
- This parameter "separator" must be present if there is more than one string to be replaced. It can be one single character or a chain.
- The optional parameter "casematters" defaulted to "yes" tells to the system whether the case matters or not; in the example above "aUto REPLace" would be transformed as well.
- The last optional parameter defaulted to "yes" tells to the system if the string to be replaced must be or not dissociated from other words; if dissociated="no" then "xxauto replacementsxx" would be transformed. In the other case, only the exact string in between spaces, commas, points, question marks... would be transformed.
Moreover the confort provided by such a functionality, it allows more consistency in the [[WikiPage]]s by reformating the content to ensure that the ""WikiLinks"" are generated even when the author forgot the ""NoSpaceInBetweenRule"".
----
CategoryUserContributions
Deletions:
{{lastedit show="2"}}

====Automatic Replace of strings====
I like the simplicity of the automatic link creation when I type a new WikiWord. But I hate having to think about it all the time and as I naturally write "the wiki word" I would like the system to understand that for me. This is particularly enerving when typing people names: typing ""JohnDoe"" is not natural and it is also a pain for the eyes of a WikiStranger.

Those having a palm certainly like the capability to code small sequences so that they are transformed into long words as soon as typed. The same kind of thing exists in most of the word processors as well.

===A solution===
The simplest (and perfect?) solution is now at UrlBeautify.

===Another (complicated) solution===
Having a database used when saving (or editing?) the WikiPage to replace an Input Entry by the Output Entry to which it is linked.
This database would be fed by an appropriate action used in the code of the WikiPage''s'': ""{{equivalent words="auto replace*automatic replace" separator ="*" casematters="no" dissociated="no"}}"".
Such an action placed on this very WikiPage would then transform any string "auto replace" into ""[[AutoReplace auto replace]]"".
- This action would allow several strings to be entered in the parameter "word" separated by the content of the optional parameter "separator".
- This parameter "separator" must be present if there is more than one string to be replaced. It can be one single character or a chain.
- The optional parameter "casematters" defaulted to "yes" tells to the system whether the case matters or not; in the example above "aUto REPLace" would be transformed as well.
- The last optional parameter defaulted to "yes" tells to the system if the string to be replaced must be or not dissociated from other words; if dissociated="no" then "xxauto replacementsxx" would be transformed. In the other case, only the exact string in between spaces, commas, points, question marks... would be transformed.

Moreover the confort provided by such a functionality, it allows more consistency in the WikiPage''s'' by reformating the content to ensure that the ""WikiLinks"" are generated even when the author forgott the ""NoSpaceInBetweenRule"".

----
CategoryUserContributions


Revision [4745]

Edited on 2005-01-17 14:39:31 by NilsLindenberg [cat. changed]
Additions:
CategoryUserContributions
Deletions:
CategoryDevelopment


Revision [4568]

Edited on 2005-01-12 23:22:37 by ChristianBarthelemy [UrlBeautify is the best way to achieve this]
Additions:
The simplest (and perfect?) solution is now at UrlBeautify.
Deletions:
I picked the ""ExpandedWikiWords"" idea from [[http://www.teamflux.com/ExpandedWikiWords Teamflux]] which is a commercial Wiki based on [[http://zwiki.org/ zwiki]]. The idea was [[http://zwiki.org/WikiLinkingIdeas already there]].
The solution consists in adding a space before any capital letter within a word (not including the first one) when this word isn't enclosed in brackets (we may want to add similar restrictions to double quote).
This solution is easier to implement, there is nothing to be done from the WikiEditor. The decision whether to use it or not should be taken by the user so it should be a new item in the UserSettings. The anonymous users shoud be have it by default and this decision could be part of the ConfigurationOptions.
===The code===
1) adding field to user table:
SQL-query:
%%(sql)
ALTER TABLE `wikka_users` ADD `space_camelcase` ENUM( 'Y', 'N' ) DEFAULT 'N' NOT NULL;
%%
2) adding a table row to show the status of the variable (to ##actions/usersettings.php##):
change
%%(html)
<tr>
<td align="right">Show comments by default:</td>
<td><input type="hidden" name="show_comments" value="N"><input type="checkbox" name="show_comments" value="Y" <?php echo $user["show_comments"] == "Y" ? "checked=\"checked\"" : "" ?> /></td>
</tr>
<tr>
<td align="right">RecentChanges display limit:</td>
<td><input name="changescount" value="<?php echo htmlspecialchars($user["changescount"]) ?>" size="40" /></td>
</tr>
%%
%%(html)
<tr>
<td align="right">Show comments by default:</td>
<td><input type="hidden" name="show_comments" value="N"><input type="checkbox" name="show_comments" value="Y" <?php echo $user["show_comments"] == "Y" ? "checked=\"checked\"" : "" ?> /></td>
</tr>
<tr>
<td align="right">Insert spaces in between WikiWords:</td>
<td><input type="hidden" name="space_camelcase" value="N"><input type="checkbox" name="space_camelcase" value="Y" <?php echo $user["space_camelcase"] == "Y" ? "checked=\"checked\"" : "" ?> /></td>
</tr>
<tr>
<td align="right">RecentChanges display limit:</td>
<td><input name="changescount" value="<?php echo htmlspecialchars($user["changescount"]) ?>" size="40" /></td>
</tr>
%%
3) added the user-table-update in ##actions/usersettings.php##:
change:
%%(php)
$this->Query("update ".$this->config["table_prefix"]."users set ".
"email = '".mysql_real_escape_string($_POST["email"])."', ".
"doubleclickedit = '".mysql_real_escape_string($_POST["doubleclickedit"])."', ".
"show_comments = '".mysql_real_escape_string($_POST["show_comments"])."', ".
"revisioncount = '".mysql_real_escape_string($_POST["revisioncount"])."', ".
"changescount = '".mysql_real_escape_string($_POST["changescount"])."' ".
"where name = '".$user["name"]."' limit 1");
%%
to
%%(php)
$this->Query("update ".$this->config['table_prefix']."users set ".
"email = '".mysql_real_escape_string($_POST['email'])."', ".
"doubleclickedit = '".mysql_real_escape_string($_POST['doubleclickedit'])."', ".
"show_comments = '".mysql_real_escape_string($_POST['show_comments'])."', ".
"space_camelcase = '".mysql_real_escape_string($_POST['space_camelcase'])."', ".
"revisioncount = '".mysql_real_escape_string($_POST['revisioncount'])."', ".
"changescount = '".mysql_real_escape_string($_POST['changescount'])."' ".
"where name = '".$user['name']."' limit 1");
%%
4) create the function ""addspaceincamelcase($camelcase)"" in ##formatters/wakka.php##:
%%(php)
if (!function_exists("wakka2callback"))
{

function addspaceincamelcase($camelcase)
{
$result = "";
preg_match_all('/[A-Z,ÄÖÜ]+[a-z,ßäöü,0-9]*/', $camelcase, $matches);
for ($i=0; $i<count($matches[0]); $i++) {
if ($i>0) $result .=" ";
$result .= $matches[0][$i];
}
return $result;
}
function wakka2callback($things)
%%
5) last update in ##formatters/wakka.php##:
change:
%%(php)
// wiki links!
else if (preg_match("/^[A-Z,ÄÖÜ]+[a-z,ßäöü]+[A-Z,0-9,ÄÖÜ][A-Z,a-z,0-9,ÄÖÜ,ßäöü]*$/s", $thing))
{
return $wakka->Link($thing);
}
%%
to:
%%(php)
// wiki links!
else if (preg_match("/^[A-Z,ÄÖÜ]+[a-z,ßäöü]+[A-Z,0-9,ÄÖÜ][A-Z,a-z,0-9,ÄÖÜ,ßäöü]*$/s", $thing))
{
$user=$_SESSION['user'];
$addspace = $user['space_camelcase'];
if ($addspace == 'N') {
return $wakka->Link($thing);
}
else return $wakka->Link($thing,"",addspaceincamelcase($thing));
}
%%


Revision [4023]

Edited on 2005-01-05 20:49:09 by ChristianBarthelemy [Refactoring]
Additions:
===A solution===
===Another (complicated) solution===
Deletions:
===My solution===
===A much simpler solution===


Revision [4022]

Edited on 2005-01-05 20:44:46 by ChristianBarthelemy [Display WikiWord as Wiki Word for guests and users who choose so]
Additions:
{{lastedit show="2"}}
===The code===
1) adding field to user table:
SQL-query:
%%(sql)
ALTER TABLE `wikka_users` ADD `space_camelcase` ENUM( 'Y', 'N' ) DEFAULT 'N' NOT NULL;
%%
2) adding a table row to show the status of the variable (to ##actions/usersettings.php##):
change
%%(html)
<tr>
<td align="right">Show comments by default:</td>
<td><input type="hidden" name="show_comments" value="N"><input type="checkbox" name="show_comments" value="Y" <?php echo $user["show_comments"] == "Y" ? "checked=\"checked\"" : "" ?> /></td>
</tr>
<tr>
<td align="right">RecentChanges display limit:</td>
<td><input name="changescount" value="<?php echo htmlspecialchars($user["changescount"]) ?>" size="40" /></td>
</tr>
%%
%%(html)
<tr>
<td align="right">Show comments by default:</td>
<td><input type="hidden" name="show_comments" value="N"><input type="checkbox" name="show_comments" value="Y" <?php echo $user["show_comments"] == "Y" ? "checked=\"checked\"" : "" ?> /></td>
</tr>
<tr>
<td align="right">Insert spaces in between WikiWords:</td>
<td><input type="hidden" name="space_camelcase" value="N"><input type="checkbox" name="space_camelcase" value="Y" <?php echo $user["space_camelcase"] == "Y" ? "checked=\"checked\"" : "" ?> /></td>
</tr>
<tr>
<td align="right">RecentChanges display limit:</td>
<td><input name="changescount" value="<?php echo htmlspecialchars($user["changescount"]) ?>" size="40" /></td>
</tr>
%%
3) added the user-table-update in ##actions/usersettings.php##:
change:
%%(php)
$this->Query("update ".$this->config["table_prefix"]."users set ".
"email = '".mysql_real_escape_string($_POST["email"])."', ".
"doubleclickedit = '".mysql_real_escape_string($_POST["doubleclickedit"])."', ".
"show_comments = '".mysql_real_escape_string($_POST["show_comments"])."', ".
"revisioncount = '".mysql_real_escape_string($_POST["revisioncount"])."', ".
"changescount = '".mysql_real_escape_string($_POST["changescount"])."' ".
"where name = '".$user["name"]."' limit 1");
%%
to
%%(php)
$this->Query("update ".$this->config['table_prefix']."users set ".
"email = '".mysql_real_escape_string($_POST['email'])."', ".
"doubleclickedit = '".mysql_real_escape_string($_POST['doubleclickedit'])."', ".
"show_comments = '".mysql_real_escape_string($_POST['show_comments'])."', ".
"space_camelcase = '".mysql_real_escape_string($_POST['space_camelcase'])."', ".
"revisioncount = '".mysql_real_escape_string($_POST['revisioncount'])."', ".
"changescount = '".mysql_real_escape_string($_POST['changescount'])."' ".
"where name = '".$user['name']."' limit 1");
%%
4) create the function ""addspaceincamelcase($camelcase)"" in ##formatters/wakka.php##:
%%(php)
if (!function_exists("wakka2callback"))
{

function addspaceincamelcase($camelcase)
{
$result = "";
preg_match_all('/[A-Z,ÄÖÜ]+[a-z,ßäöü,0-9]*/', $camelcase, $matches);
for ($i=0; $i<count($matches[0]); $i++) {
if ($i>0) $result .=" ";
$result .= $matches[0][$i];
}
return $result;
}
function wakka2callback($things)
%%
5) last update in ##formatters/wakka.php##:
change:
%%(php)
// wiki links!
else if (preg_match("/^[A-Z,ÄÖÜ]+[a-z,ßäöü]+[A-Z,0-9,ÄÖÜ][A-Z,a-z,0-9,ÄÖÜ,ßäöü]*$/s", $thing))
{
return $wakka->Link($thing);
}
%%
to:
%%(php)
// wiki links!
else if (preg_match("/^[A-Z,ÄÖÜ]+[a-z,ßäöü]+[A-Z,0-9,ÄÖÜ][A-Z,a-z,0-9,ÄÖÜ,ßäöü]*$/s", $thing))
{
$user=$_SESSION['user'];
$addspace = $user['space_camelcase'];
if ($addspace == 'N') {
return $wakka->Link($thing);
}
else return $wakka->Link($thing,"",addspaceincamelcase($thing));
}
%%
Deletions:
===So what?===
I don't think I can write this code yet so I rely on your expertise if the idea looks interesting.


Revision [2986]

Edited on 2004-12-08 22:29:39 by ChristianBarthelemy [Simpler solution detailed]
Additions:
===A much simpler solution===
I picked the ""ExpandedWikiWords"" idea from [[http://www.teamflux.com/ExpandedWikiWords Teamflux]] which is a commercial Wiki based on [[http://zwiki.org/ zwiki]]. The idea was [[http://zwiki.org/WikiLinkingIdeas already there]].
The solution consists in adding a space before any capital letter within a word (not including the first one) when this word isn't enclosed in brackets (we may want to add similar restrictions to double quote).
This solution is easier to implement, there is nothing to be done from the WikiEditor. The decision whether to use it or not should be taken by the user so it should be a new item in the UserSettings. The anonymous users shoud be have it by default and this decision could be part of the ConfigurationOptions.


Revision [2839]

Edited on 2004-12-04 14:46:00 by NilsLindenberg [header changed, cat. added]
Additions:
====Automatic Replace of strings====
===My solution===
===So what?===
----
CategoryDevelopment
Deletions:
====The problem====
====My solution====
====So what?====


Revision [2812]

Edited on 2004-12-03 19:28:02 by ChristianBarthelemy [header changed, cat. added]
Additions:
I like the simplicity of the automatic link creation when I type a new WikiWord. But I hate having to think about it all the time and as I naturally write "the wiki word" I would like the system to understand that for me. This is particularly enerving when typing people names: typing ""JohnDoe"" is not natural and it is also a pain for the eyes of a WikiStranger.
Moreover the confort provided by such a functionality, it allows more consistency in the WikiPage''s'' by reformating the content to ensure that the ""WikiLinks"" are generated even when the author forgott the ""NoSpaceInBetweenRule"".
Deletions:
I like the simplicity of the automatic link creation when I type a new WikiWord. But I hate having to think about it all the time and as I naturally write "the wiki word" I would like the system to understand that for me. This is particularly enerving when typing people names: typing JohnDoe is not natural and it is also a pain for the eyes of a WikiStranger.
Moreover the confort provided by such a functionality, it allows more consistency in the WikiPage''s'' by reformating the content to ensure that the WikiLinks are generated even when the author forgott the ''NoSpaceInBetweenRule''.


Revision [2811]

Edited on 2004-12-03 19:27:13 by ChristianBarthelemy [header changed, cat. added]
Additions:
I like the simplicity of the automatic link creation when I type a new WikiWord. But I hate having to think about it all the time and as I naturally write "the wiki word" I would like the system to understand that for me. This is particularly enerving when typing people names: typing JohnDoe is not natural and it is also a pain for the eyes of a WikiStranger.
Moreover the confort provided by such a functionality, it allows more consistency in the WikiPage''s'' by reformating the content to ensure that the WikiLinks are generated even when the author forgott the ''NoSpaceInBetweenRule''.
Deletions:
I like the simplicity of the automatic link creation when I type a new WikiWord. But I hate having to think about it all the time and as I naturally write "the wiki word" I would like the system to understand that for me.


Revision [2809]

The oldest known version of this page was created on 2004-12-03 19:21:57 by ChristianBarthelemy [header changed, cat. added]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki