Skip to content
Snippets Groups Projects
Commit be13330a authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

remove doc dir from error msg

parent ce54b7d4
No related branches found
No related tags found
No related merge requests found
...@@ -79,7 +79,7 @@ public class AboutActivity extends Activity{ ...@@ -79,7 +79,7 @@ public class AboutActivity extends Activity{
catch (IOException e) { catch (IOException e) {
} }
String code = text.toString().replace("<", "&lt;"); String code = text.toString().replace("<", "&lt;");
code = code.toString().replace(">", "&gt;"); code = code.replace(">", "&gt;");
String js = "!function(a,b){\"function\"==typeof define&&define.amd?define([\"exports\"],b):b(\"undefined\"!=typeof exports?exports:a.microlight={})}(this,function(a){var k,l,m,b=window,c=document,d=\"appendChild\",e=\"test\",g=\"opacity:.\",n=function(a){for(l=c.getElementsByClassName(a||\"microlight\"),k=0;m=l[k++];){var n,o,r,s,t,f=m.textContent,h=0,i=f[0],j=1,p=m.innerHTML=\"\",q=0,u=/(\\d*\\, \\d*\\, \\d*)(, ([.\\d]*))?/g.exec(b.getComputedStyle(m).color);for(\"px rgba(\"+u[1]+\",\",u[3]||1;o=n,n=q<7&&\"\\\\\"==n?1:j;){if(j=i,i=f[++h],s=p.length>1,!j||q>8&&\"\\n\"==j||[/\\S/[e](j),1,1,!/[$\\w]/[e](j),(\"/\"==n||\"\\n\"==n)&&s,\'\"\'==n&&s,\"\'\"==n&&s,f[h-4]+o+n==\"-->\",o+n==\"*/\"][q])for(p&&(m[d](t=c.createElement(\"span\")).setAttribute(\"style\",[\"\",\"font-weight:bold;color:#00c;\",g+6,\"color: #a08;\"+g+8,\"font-style:italic;color: #b00;\"+g+8][q?q<3?2:q>6?4:q>3?3:+/^(If|Else|ElseIf|EndIf|Include|For|EndFor|Include|Macro|Return)$/[e](p):0]),t[d](c.createTextNode(p))),r=q&&q<7?q:r,p=\"\",q=11;![1,/[\\/{}[(\\-+*=<>:;|\\\\.,?!&@~]/[e](j),/[\\])]/[e](j),/[$\\w]/[e](j),\"/\"==j&&r<2&&\"<\"!=n,\'\"\'==j,\"\'\"==j,j+i+f[h+1]+f[h+2]==\"<!--\",j+i==\"/*\",j+i==\"//\",j+i==\"//\"][--q];);p+=j}}};a.reset=n,\"complete\"==c.readyState?n():b.addEventListener(\"load\",function(){n()},0)});"; String js = "!function(a,b){\"function\"==typeof define&&define.amd?define([\"exports\"],b):b(\"undefined\"!=typeof exports?exports:a.microlight={})}(this,function(a){var k,l,m,b=window,c=document,d=\"appendChild\",e=\"test\",g=\"opacity:.\",n=function(a){for(l=c.getElementsByClassName(a||\"microlight\"),k=0;m=l[k++];){var n,o,r,s,t,f=m.textContent,h=0,i=f[0],j=1,p=m.innerHTML=\"\",q=0,u=/(\\d*\\, \\d*\\, \\d*)(, ([.\\d]*))?/g.exec(b.getComputedStyle(m).color);for(\"px rgba(\"+u[1]+\",\",u[3]||1;o=n,n=q<7&&\"\\\\\"==n?1:j;){if(j=i,i=f[++h],s=p.length>1,!j||q>8&&\"\\n\"==j||[/\\S/[e](j),1,1,!/[$\\w]/[e](j),(\"/\"==n||\"\\n\"==n)&&s,\'\"\'==n&&s,\"\'\"==n&&s,f[h-4]+o+n==\"-->\",o+n==\"*/\"][q])for(p&&(m[d](t=c.createElement(\"span\")).setAttribute(\"style\",[\"\",\"font-weight:bold;color:#00c;\",g+6,\"color: #a08;\"+g+8,\"font-style:italic;color: #b00;\"+g+8][q?q<3?2:q>6?4:q>3?3:+/^(If|Else|ElseIf|EndIf|Include|For|EndFor|Include|Macro|Return)$/[e](p):0]),t[d](c.createTextNode(p))),r=q&&q<7?q:r,p=\"\",q=11;![1,/[\\/{}[(\\-+*=<>:;|\\\\.,?!&@~]/[e](j),/[\\])]/[e](j),/[$\\w]/[e](j),\"/\"==j&&r<2&&\"<\"!=n,\'\"\'==j,\"\'\"==j,j+i+f[h+1]+f[h+2]==\"<!--\",j+i==\"/*\",j+i==\"//\",j+i==\"//\"][--q];);p+=j}}};a.reset=n,\"complete\"==c.readyState?n():b.addEventListener(\"load\",function(){n()},0)});";
_webview.loadDataWithBaseURL("", "<html><head><script>" + js + _webview.loadDataWithBaseURL("", "<html><head><script>" + js +
"</script></head><body><pre contenteditable=\"true\" class=microlight>" + "</script></head><body><pre contenteditable=\"true\" class=microlight>" +
......
...@@ -162,15 +162,6 @@ public class MainActivity extends Activity{ ...@@ -162,15 +162,6 @@ public class MainActivity extends Activity{
} }
} }
public String getRealPathFromURI(Uri contentUri)
{
String[] proj = { MediaStore.Images.Media.DATA };
Cursor cursor = managedQuery(contentUri, proj, null, null, null);
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst();
return cursor.getString(column_index);
}
private class Run extends AsyncTask<Void, Void, Integer[]> { private class Run extends AsyncTask<Void, Void, Integer[]> {
@Override @Override
protected void onPreExecute() protected void onPreExecute()
...@@ -202,10 +193,13 @@ public class MainActivity extends Activity{ ...@@ -202,10 +193,13 @@ public class MainActivity extends Activity{
private void showError(String msg) private void showError(String msg)
{ {
// show only first error
if(_errorDialog != null && _errorDialog.isShowing()) return; if(_errorDialog != null && _errorDialog.isShowing()) return;
// remove doc path from message
String str = msg.replace(this.getFilesDir().getAbsolutePath() + File.separator, "");
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this); AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this);
_errorDialog = dialogBuilder.setTitle("Error") _errorDialog = dialogBuilder.setTitle("Error")
.setMessage(msg) .setMessage(str)
.setPositiveButton("Dismiss", new DialogInterface.OnClickListener() { .setPositiveButton("Dismiss", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
dialog.dismiss(); dialog.dismiss();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment