bug fixes idk

This commit is contained in:
Kevin Froman 2018-01-08 23:25:22 -06:00
parent 7b146a198e
commit 266251fbc4
No known key found for this signature in database
GPG Key ID: 0D414D0FE405B63B
4 changed files with 24 additions and 27 deletions

View File

@ -48,6 +48,7 @@
<p>Snow10 messages are meant to be embedded elsewhere, specifically within or by standard blocks of text.</p>
<p>Messages with the 'zero width characters' setting work in most places that accept unicode input.</p>
<p>Simply enter the message you want to hide <b>(waring: larger messages are more noticeable, and really massive messages may be dangerous/not work)</b></p>
<p>Optionally put a message in the "Text to hide inside" (this is the parent message that is <b>visible</b>).</p>
<p>You can uncheck 'use zero width characters' but this is more noticeable in some cases and is more likely to be stripped out.</p>
<p>Enable encryption to ensure your messages are protected (you must use a good password if you do so).</p>
<p>Press 'encode' and wait for the output window to show, then, press 'copy to clipboard'.</p>

View File

@ -62,7 +62,7 @@
</div>
<p class='center'><a href='help.html'>Help & Info</a></p>
<div id='dataArea'>
<textarea id='text' placeholder=''></textarea>
<textarea id='text' placeholder='Text to hide or unhide'></textarea>
</div>
<br>
<p class='center'>Bytes: <span id='countBytes'>0</span></p><br>
@ -73,7 +73,7 @@
<div class='center'>
<label>Use Zero-Width Characters <input type='checkbox' id='useZeroWidthCharacters' checked></label>
<br><br>
<label>Use Encryption <input type='checkbox' id='useEncrypt'></label>
<label>Use Encryption (slower) <input type='checkbox' id='useEncrypt'></label>
<br><br>
<span id='encryptArea'>
<input type='password' id='password' placeholder='Encryption password' class='dataItem'>

View File

@ -18,6 +18,8 @@ AndroidFunction.share($('#output').val());
$.bootstrapGrowl('shared', {type: 'success'})
});
function split2(str, delim) {
var parts=str.split(delim);
return [parts[0], parts.splice(1,parts.length).join(delim)];
@ -42,6 +44,9 @@ function byteCountt(s) {
$('#text').on('input', function(){
$('#countBytes').text(byteCountt($('#text').val()));
if ($('#countBytes').text() >= 25000){
showError('Warning: this message may cause issues due to its size.');
}
});
function showError(msg){
@ -187,11 +192,17 @@ function go(mode) {
output = textToBin(encodeURIComponent(input));
output = replaceAll(replaceAll(output.toString(), "1", one), "0", zero);
coverText = $('#visibleText').val();
if (zero == w_zero){
output = coverText + output;
}
else{
coverText = split2(coverText);
partOne = coverText[0];
partTwo = coverText[1];
$('#output').val(partOne + output + partTwo);
console.log(partOne + output + partTwo);
output = partOne + output + partTwo;
}
$('#output').text(output);
console.log('Output: ' + output);
}
else
{

View File

@ -27,22 +27,6 @@ public class MainActivity extends AppCompatActivity {
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
public class JavascriptInterface{
Context mContext;
JavascriptInterface(Context c) {
mContext = c;
}
public void share(String action){
Intent intent2 = new Intent(); intent2.setAction(Intent.ACTION_SEND);
intent2.setType("text/plain");
intent2.putExtra(Intent.EXTRA_TEXT, action );
startActivity(Intent.createChooser(intent2, "Share via"));
}
}
*/
public class JavaScriptInterface {
Context mContext;
@ -55,10 +39,11 @@ public class MainActivity extends AppCompatActivity {
/** Show a toast from the web page */
@JavascriptInterface
public void share(String action){
Intent intent2 = new Intent(); intent2.setAction(Intent.ACTION_SEND);
intent2.setType("text/plain");
intent2.putExtra(Intent.EXTRA_TEXT, action );
startActivity(Intent.createChooser(intent2, "Share via"));
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, action);
sendIntent.setType("text/plain");
startActivity(sendIntent);
}
}