html: include JQuery as an inline script to prevent file access errors. Fixes #501
This commit is contained in:
parent
793a74268c
commit
329d26149b
|
@ -161,13 +161,13 @@ namespace SparkleShare {
|
||||||
get {
|
get {
|
||||||
string resource_path = NSBundle.MainBundle.ResourcePath;
|
string resource_path = NSBundle.MainBundle.ResourcePath;
|
||||||
string html_path = Path.Combine (resource_path, "HTML", "event-log.html");
|
string html_path = Path.Combine (resource_path, "HTML", "event-log.html");
|
||||||
|
string html = File.ReadAllText (html_path);
|
||||||
|
|
||||||
StreamReader reader = new StreamReader (html_path);
|
string jquery_file_path = Path.Combine (NSBundle.MainBundle.ResourcePath,
|
||||||
string html = reader.ReadToEnd ();
|
"HTML", "jquery.js");
|
||||||
reader.Close ();
|
|
||||||
|
|
||||||
html = html.Replace ("<!-- $jquery-url -->", "file://" +
|
string jquery = File.ReadAllText (jquery_file_path);
|
||||||
Path.Combine (NSBundle.MainBundle.ResourcePath, "HTML", "jquery.js"));
|
html = html.Replace ("<!-- $jquery -->", jquery);
|
||||||
|
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
|
|
|
@ -175,13 +175,16 @@ namespace SparkleShare {
|
||||||
|
|
||||||
public override string EventLogHTML {
|
public override string EventLogHTML {
|
||||||
get {
|
get {
|
||||||
string path = new string [] {Defines.PREFIX,
|
string html_path = new string [] {Defines.PREFIX, "share",
|
||||||
"share", "sparkleshare", "html", "event-log.html"}.Combine ();
|
"sparkleshare", "html", "event-log.html"}.Combine ();
|
||||||
|
|
||||||
string html = String.Join (Environment.NewLine, File.ReadAllLines (path));
|
string html = File.ReadAllText (html_path);
|
||||||
|
|
||||||
html = html.Replace ("<!-- $jquery-url -->", "file://" +
|
string jquery_file_path = new string [] {Defines.PREFIX, "share",
|
||||||
new string [] {Defines.PREFIX, "share", "sparkleshare", "html", "jquery.js"}.Combine ());
|
"sparkleshare", "html", "jquery.js"}.Combine ()
|
||||||
|
|
||||||
|
string jquery = File.ReadAllText (jquery_file_path);
|
||||||
|
html = html.Replace ("<!-- $jquery -->", jquery);
|
||||||
|
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,10 @@
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>SparkleShare Event Log</title>
|
<title>SparkleShare Event Log</title>
|
||||||
<script type="text/javascript" src="<!-- $jquery-url -->"></script>
|
<script type="text/javascript">
|
||||||
|
<!-- $jquery -->
|
||||||
|
</script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue