Skip to content

Commit

Permalink
Add project
Browse files Browse the repository at this point in the history
  • Loading branch information
supuna97 committed Jun 15, 2022
1 parent 7650b26 commit ef8b0c6
Show file tree
Hide file tree
Showing 129 changed files with 56,197 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .idea/Wordcount.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .idea/deployment.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/webServers.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

210 changes: 210 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions ajax.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Author: Pierre-Henry Soria <[email protected]>
* Copyright: (c) 2012-2014, Pierre-Henry Soria. All Rights Reserved.
* License: GNU General Public License <http://www.gnu.org/licenses/gpl.html>
*/

$("#characters").keyup(function() {
countCharacters($(this).val())
});

function countCharacters(a) {
$.post("ajax.php", {
characters: a
}, function(a) {
$("#nb_characters").html(a)
})
};
30 changes: 30 additions & 0 deletions ajax.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/**
* @author Pierre-Henry Soria <[email protected]>
* @copyright (c) 2012-2014, Pierre-Henry Soria. All Rights Reserved.
* @license GNU General Public License <http://www.gnu.org/licenses/gpl.html>
*/

if(!function_exists('mb_strlen'))
exit('Please install the "mbstring" PHP module.');

require 'inc/functions.php';

$sText = (isset($_POST['characters'])) ? $_POST['characters'] : '';

$iText = mb_strlen($sText, PH7_ENCODING);
$iTextWithoutSpace = mb_strlen(strip_spaces($sText), PH7_ENCODING);
$iSpace = ($iText-$iTextWithoutSpace);
$iWord = str_word_count($sText);
$iSentence = sentence_count($sText);
$aReadingTime = reading_time($sText);

echo t('
<div class="col-12" style="margin-bottom: 30px; margin-top: 30px; text-align:center">
<button class="btn btn-color">%0% Characters</button>
<button class="btn btn-color">%2% spaces.</button>
<button class="btn btn-color">%3% Words</button>
<button class="btn btn-color">%4% sentences.</button>
<button class="btn btn-color">%5% min, %6% sec read time.</button>
</div>
', $iText, $iTextWithoutSpace, $iSpace, $iWord, $iSentence, $aReadingTime['min'], $aReadingTime['sec']);
Binary file added css/.DS_Store
Binary file not shown.
Empty file added css/_bootstrap-mincer.css
Empty file.
Loading

0 comments on commit ef8b0c6

Please sign in to comment.