client configuration for reply-to-self

also: move data-isso-* configuration to app/config
legacy/0.5
Martin Zimmermann 11 years ago
parent 64c0d770c6
commit edafc5f88f

@ -143,6 +143,10 @@ You can configure the client (the JS part) via `data-` attributes:
<script src="..." data-isso-css="false"></script>
```
* data-isso-reply-to-self
Set to `true` when spam guard is configured with `reply-to-self = true`.
### Webserver configuration
* nginx configuration to run Isso on `/isso`:

@ -205,6 +205,8 @@ reply-to-self
the comment. After the editing timeframe is gone, commenters can reply to
their own comments anyways.
Do not forget to configure the client.
Appendum
---------

@ -6,9 +6,6 @@ define(["q"], function(Q) {
Q.longStackSupport = true;
var salt = "Eech7co8Ohloopo9Ol6baimi",
config = {
"css": true
},
location = window.location.pathname;
var rules = {
@ -48,16 +45,6 @@ define(["q"], function(Q) {
} else if (js[i].src.match("require\\.js$")) {
endpoint = js[i].dataset.main.replace(/\/js\/(embed|count)$/, "");
}
[].forEach.call(js[i].attributes, function(attr) {
if (/^data-isso-/.test(attr.name)) {
try {
config[attr.name.substring(10)] = JSON.parse(attr.value);
} catch (ex) {
config[attr.name.substring(10)] = attr.value;
}
}
});
}
if (! endpoint) {
@ -194,7 +181,6 @@ define(["q"], function(Q) {
return {
endpoint: endpoint,
salt: salt,
config: config,
remote_addr: remote_addr,

@ -0,0 +1,25 @@
define(function() {
"use strict";
var config = {
"css": true,
"reply-to-self": false
};
var js = document.getElementsByTagName("script");
for (var i = 0; i < js.length; i++) {
[].forEach.call(js[i].attributes, function(attr) {
if (/^data-isso-/.test(attr.name)) {
try {
config[attr.name.substring(10)] = JSON.parse(attr.value);
} catch (ex) {
config[attr.name.substring(10)] = attr.value;
}
}
});
}
return config;
});

@ -1,7 +1,7 @@
/* Isso Ich schrei sonst!
*/
define(["app/text/html", "app/dom", "app/utils", "app/api", "app/markup", "app/i18n", "app/lib", "app/fancy"],
function(templates, $, utils, api, Mark, i18n, lib, fancy) {
define(["app/text/html", "app/dom", "app/utils", "app/config", "app/api", "app/markup", "app/i18n", "app/lib", "app/fancy"],
function(templates, $, utils, config, api, Mark, i18n, lib, fancy) {
"use strict";
@ -275,7 +275,7 @@ define(["app/text/html", "app/dom", "app/utils", "app/api", "app/markup", "app/i
}
};
if (utils.cookie("isso-" + comment.id)) {
if (! config["reply-to-self"] && utils.cookie("isso-" + comment.id)) {
show($("a.reply", footer).detach());
}
};

@ -3,13 +3,13 @@
* Distributed under the MIT license
*/
require(["ready", "app/api", "app/isso", "app/count", "app/dom", "app/markup", "app/text/css"], function(domready, api, isso, count, $, Mark, css) {
require(["ready", "app/config", "app/api", "app/isso", "app/count", "app/dom", "app/markup", "app/text/css"], function(domready, config, api, isso, count, $, Mark, css) {
"use strict";
domready(function() {
if (api.config["css"]) {
if (config["css"]) {
var style = $.new("style");
style.type = "text/css";
style.textContent = css.inline;

Loading…
Cancel
Save