mirror of
https://github.com/TangentFoxy/memex.git
synced 2024-11-22 04:54:23 +00:00
Fix write add functionality breaking web version.
This commit is contained in:
parent
8d2eed7f3c
commit
28b3f2db29
@ -1,7 +1,9 @@
|
||||
const { ipcRenderer } = nodeRequire('electron');
|
||||
|
||||
function Add()
|
||||
if (window.showAdd != undefined && window.showAdd)
|
||||
{
|
||||
const { ipcRenderer } = nodeRequire('electron');
|
||||
|
||||
function Add()
|
||||
{
|
||||
this.overlay = null;
|
||||
this.display = null;
|
||||
this.grid = null;
|
||||
@ -255,14 +257,14 @@ function Add()
|
||||
this.enabledOverlay = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String.prototype.toProperCase = function () {
|
||||
String.prototype.toProperCase = function () {
|
||||
return this.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
|
||||
};
|
||||
};
|
||||
|
||||
document.onkeydown = function(evt)
|
||||
{
|
||||
document.onkeydown = function(evt)
|
||||
{
|
||||
evt = evt || window.event;
|
||||
if (!evt.ctrlKey)
|
||||
{
|
||||
@ -291,4 +293,5 @@ document.onkeydown = function(evt)
|
||||
main.load('add');
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
@ -13,7 +13,8 @@ function Main()
|
||||
{
|
||||
var client = new XMLHttpRequest();
|
||||
client.open('GET', FILELOCATION);
|
||||
client.onreadystatechange = function()
|
||||
client.overrideMimeType("text/plain");
|
||||
client.onreadystatechange = function(req, res)
|
||||
{
|
||||
if (client.responseText.trim() != '')
|
||||
{
|
||||
@ -30,14 +31,17 @@ function Main()
|
||||
this.db.install(data);
|
||||
this.view = new View();
|
||||
this.view.install();
|
||||
|
||||
if (window.showAdd != undefined && window.showAdd)
|
||||
{
|
||||
this.add = new Add();
|
||||
this.add.install();
|
||||
|
||||
var escape = document.getElementById("escape");
|
||||
escape.onclick = function()
|
||||
{
|
||||
main.load(main.queryPrev);
|
||||
}
|
||||
}
|
||||
|
||||
this.start();
|
||||
}
|
||||
|
@ -48,8 +48,11 @@ function View()
|
||||
}
|
||||
|
||||
this.display = function(db)
|
||||
{
|
||||
if (window.showAdd != undefined && window.showAdd)
|
||||
{
|
||||
main.add.setOverlay(false);
|
||||
}
|
||||
|
||||
// BUILD
|
||||
this.grid.innerHTML = '';
|
||||
|
@ -2,3 +2,5 @@ window.nodeRequire = require;
|
||||
delete window.require;
|
||||
delete window.exports;
|
||||
delete window.module;
|
||||
|
||||
// window.showAdd = true;
|
Loading…
Reference in New Issue
Block a user