forked from leocaseiro/jQuery-Plugin-stringToSlug
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4ed7fd4
commit 1bbdb4b
Showing
1 changed file
with
118 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml" lang="pt-br"> | ||
<head profile="http://gmpg.org/xfn/11"> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
<meta name="verify-v1" content="/4hjWiX0OOIdjoIXz+F3nBffA9iAQl+LgNOjmglfcdc=" /> | ||
<title>Samples jQuery Plugin stringToSlug | Leo Caseiro</title> | ||
<meta http-equiv="content-language" content="pt-br" /> | ||
|
||
<script type="text/javascript" src=" https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | ||
<script type="text/javascript" src="jquery.stringToSlug.js"></script> | ||
|
||
<script type="text/javascript"> | ||
$(document).ready( function() { | ||
$("#string").stringToSlug(); | ||
}); | ||
</script> | ||
<style> | ||
body{font-family:Verdana, Tahoma, sans-serif; font-size:14px;} | ||
.code{font-family:Courier, "Courier New", monospace;} | ||
</style> | ||
</head> | ||
<body> | ||
|
||
<div style="background-color:#fff000; padding:2px 10px;"> | ||
<h4>StringToSlug Demo</h4> | ||
<p><strong>Change:</strong> <input id="string" size="100" type="text" value="Change the content of this field! And view the text with red background Preview!" /> | ||
<p><strong>Preview:</strong> <span id="permalink" style="background-color:#880000; color:#fff; padding:3px;">change-the-content-of-this-field-and-view-the-text-with-red-background-preview</span></p> | ||
</div> | ||
|
||
<div class="sample"> | ||
<h4>Default Usage:</h4> | ||
<pre><div class="code"><em> | ||
/** | ||
* Default Events: Blur, KeyUp e KeyDown: | ||
* Default Get Put: #permalink | ||
* Default Space Replacement: - (hiphen) | ||
*/ | ||
</em> | ||
$(document).ready( function() { | ||
$("#string").stringToSlug(); | ||
}); | ||
</div> | ||
<br /> | ||
</pre> | ||
</div> | ||
|
||
<div class="sample"> | ||
<h4>The values Default at Plugin Usage:</h4> | ||
<pre class="brush: javascript"><div class="code"> | ||
$(document).ready( function() { | ||
$("#title").stringToSlug({ | ||
setEvents: 'keyup keydown blur', | ||
getPut: '#permalink', | ||
space: '-' | ||
}); | ||
}); | ||
</div> | ||
<br /> | ||
</pre> | ||
|
||
<div class="sample"> | ||
<h4>Other(s) Event(s) Usage:</h4> | ||
<p><small>To change the events, we must insert one or more events separated by space:</small></p> | ||
<pre class="brush: javascript"> | ||
<div class="code"> | ||
$(document).ready( function() { | ||
//Only Event Blur | ||
$("#only-blur-event").stringToSlug({ | ||
setEvents: "blur" | ||
); | ||
|
||
//2 Events or More | ||
//This sample, Usage Events: KeyUp and KeyDown | ||
$("#keyup-and-keydown-events").stringToSlug({ | ||
setEvents: "keyup keydown" | ||
|
||
); | ||
}); | ||
</div> | ||
<br /> | ||
</pre> | ||
</div> | ||
|
||
<div class="sample"> | ||
<h4>Other Get Put Preview Usage:</h4> | ||
<pre class="brush: javascript"><div class="code"> | ||
$(document).ready( function() { | ||
//Previem in all texarea | ||
$("input[name=string]").stringToSlug({ | ||
getPut: "textarea" | ||
); | ||
|
||
//Preview in all elements preview class | ||
$("#input[name=string]").stringToSlug({ | ||
getPut: ".class" | ||
|
||
); | ||
}); | ||
</div> | ||
<br /> | ||
</pre> | ||
</div> | ||
|
||
<div class="sample"> | ||
<h4>Replace hiphen by other char Usage:</h4> | ||
<pre class="brush: javascript"> | ||
$(document).ready( function() { | ||
//Replace by underscore | ||
$("#input[name=string]").stringToSlug({ | ||
space: "_" | ||
); | ||
}); | ||
</pre> | ||
</div> | ||
<br /><br /> | ||
<em><small>jQuery Plugin StringToSlug create by <a title="Create at Leo Caseiro" href="http://leocaseiro.com.br/">@leocaseiro</a></small></em> | ||
</body> | ||
</html> |