Commit 9db81b35 authored by Matthieu Le Corre's avatar Matthieu Le Corre
Browse files

Auto-refresh option


Signed-off-by: Matthieu Le Corre's avatarMatthieu Le Corre <matthieu.lecorre@univ-nantes.fr>
parent ee729154
......@@ -13,6 +13,8 @@
- Allow HTML direct rendering (dangerous option, mind the consequences)
- Dynamic loading of plugins via webpack
- Ability to choose the names of the file to be rendered.
- Auto-refresh option to refresh the content of HEADER / FOOTER whenever the files changes.
[#5](https://gitlab.univ-nantes.fr/uncloud/files_readmemd/issues/5#)
## 1.0.4 03-05-2019
### Fixed
......
!function(e){var n={};function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:o})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(t.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)t.d(o,r,function(n){return e[n]}.bind(null,r));return o},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=26)}({26:function(e,n){
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var c=t[r]={i:r,l:!1,exports:{}};return e[r].call(c.exports,c,c.exports,n),c.l=!0,c.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)n.d(r,c,function(t){return e[t]}.bind(null,c));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=26)}({26:function(e,t){
/**
* @author Matthieu Le Corre <matthieu.lecorre@univ-nantes.fr>
*
......@@ -18,5 +18,5 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
$(document).ready(function(){$("#readmeMD-appearance-txt").click(function(e){$.post(OC.generateUrl("apps/files_readmemd/config"),{key:"show_title",value:e.target.checked}).success(function(e){console.log(e)})}),$("#readmeMD-appearance-color").click(function(e){$.post(OC.generateUrl("apps/files_readmemd/config"),{key:"yellow_back",value:e.target.checked}).success(function(e){console.log(e)})}),$("#readmeMD-engine-asciidoc").click(function(e){$.post(OC.generateUrl("apps/files_readmemd/config"),{key:"show_asciidoc",value:e.target.checked}).success(function(e){console.log(e)})}),$("#readmeMD-engine-html").click(function(e){$.post(OC.generateUrl("apps/files_readmemd/config"),{key:"show_html",value:e.target.checked}).success(function(e){console.log(e)})})})}});
$(document).ready(function(){$("#readmeMD-appearance-txt").click(function(e){$.post(OC.generateUrl("apps/files_readmemd/config"),{key:"show_title",value:e.target.checked}).success(function(e){})}),$("#readmeMD-appearance-color").click(function(e){$.post(OC.generateUrl("apps/files_readmemd/config"),{key:"yellow_back",value:e.target.checked}).success(function(e){})}),$("#readmeMD-appearance-refresh").click(function(e){$.post(OC.generateUrl("apps/files_readmemd/config"),{key:"auto_refresh",value:e.target.checked}).success(function(e){})}),$("#readmeMD-engine-asciidoc").click(function(e){$.post(OC.generateUrl("apps/files_readmemd/config"),{key:"show_asciidoc",value:e.target.checked}).success(function(e){})}),$("#readmeMD-engine-html").click(function(e){$.post(OC.generateUrl("apps/files_readmemd/config"),{key:"show_html",value:e.target.checked}).success(function(e){})})})}});
//# sourceMappingURL=config.js.map
\ No newline at end of file
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/config.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","$","document","ready","click","Event","post","OC","generateUrl","target","checked","success","json","console","log"],"mappings":"aACA,IAAAA,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,GAAA,CACAG,EAAAH,EACAI,GAAA,EACAH,QAAA,IAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QAKAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,EAAA,CAA0CK,YAAA,EAAAC,IAAAL,KAK1CZ,EAAAkB,EAAA,SAAAhB,GACA,oBAAAiB,eAAAC,aACAN,OAAAC,eAAAb,EAAAiB,OAAAC,YAAA,CAAwDC,MAAA,WAExDP,OAAAC,eAAAb,EAAA,cAAiDmB,OAAA,KAQjDrB,EAAAsB,EAAA,SAAAD,EAAAE,GAEA,GADA,EAAAA,IAAAF,EAAArB,EAAAqB,IACA,EAAAE,EAAA,OAAAF,EACA,KAAAE,GAAA,iBAAAF,QAAAG,WAAA,OAAAH,EACA,IAAAI,EAAAX,OAAAY,OAAA,MAGA,GAFA1B,EAAAkB,EAAAO,GACAX,OAAAC,eAAAU,EAAA,WAAyCT,YAAA,EAAAK,UACzC,EAAAE,GAAA,iBAAAF,EAAA,QAAAM,KAAAN,EAAArB,EAAAU,EAAAe,EAAAE,EAAA,SAAAA,GAAgH,OAAAN,EAAAM,IAAqBC,KAAA,KAAAD,IACrI,OAAAF,GAIAzB,EAAA6B,EAAA,SAAA1B,GACA,IAAAS,EAAAT,KAAAqB,WACA,WAA2B,OAAArB,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAH,EAAAU,EAAAE,EAAA,IAAAA,GACAA,GAIAZ,EAAAa,EAAA,SAAAiB,EAAAC,GAAsD,OAAAjB,OAAAkB,UAAAC,eAAA1B,KAAAuB,EAAAC,IAGtD/B,EAAAkC,EAAA,GAIAlC,IAAAmC,EAAA;;;;;;;;;;;;;;;;;;;;AC9DAC,EAAAC,UAAAC,MAAA,WAEAF,EAAA,4BAAAG,MAAA,SAAAC,GACAJ,EAAAK,KAAAC,GAAAC,YAAA,+BAA6DhB,IAAA,aAAAN,MAAAmB,EAAAI,OAAAC,UAC7DC,QAAA,SAAAC,GACAC,QAAAC,IAAAF,OAIAX,EAAA,8BAAAG,MAAA,SAAAC,GACAJ,EAAAK,KAAAC,GAAAC,YAAA,+BAA6DhB,IAAA,cAAAN,MAAAmB,EAAAI,OAAAC,UAC7DC,QAAA,SAAAC,GACAC,QAAAC,IAAAF,OAIAX,EAAA,6BAAAG,MAAA,SAAAC,GACAJ,EAAAK,KAAAC,GAAAC,YAAA,+BAA6DhB,IAAA,gBAAAN,MAAAmB,EAAAI,OAAAC,UAC7DC,QAAA,SAAAC,GACAC,QAAAC,IAAAF,OAIAX,EAAA,yBAAAG,MAAA,SAAAC,GACAJ,EAAAK,KAAAC,GAAAC,YAAA,+BAA6DhB,IAAA,YAAAN,MAAAmB,EAAAI,OAAAC,UAC7DC,QAAA,SAAAC,GACAC,QAAAC,IAAAF","file":"config.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 26);\n","/**\n * @author Matthieu Le Corre <matthieu.lecorre@univ-nantes.fr>\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\n $(document).ready(function () {\n\n $(\"#readmeMD-appearance-txt\").click(function(Event){\n $.post(OC.generateUrl(\"apps/files_readmemd/config\"),{key: \"show_title\", value: Event.target.checked})\n .success(function (json) {\n console.log(json) ;\n })\n }) ;\n\n $(\"#readmeMD-appearance-color\").click(function(Event){\n $.post(OC.generateUrl(\"apps/files_readmemd/config\"),{key: \"yellow_back\", value: Event.target.checked})\n .success(function (json) {\n console.log(json) ;\n })\n }) ;\n\n $(\"#readmeMD-engine-asciidoc\").click(function(Event){\n $.post(OC.generateUrl(\"apps/files_readmemd/config\"),{key: \"show_asciidoc\", value: Event.target.checked})\n .success(function (json) {\n console.log(json) ;\n })\n }) ;\n\n $(\"#readmeMD-engine-html\").click(function(Event){\n $.post(OC.generateUrl(\"apps/files_readmemd/config\"),{key: \"show_html\", value: Event.target.checked})\n .success(function (json) {\n console.log(json) ;\n })\n }) ;\n\n }) ;"],"sourceRoot":""}
\ No newline at end of file
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/config.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","$","document","ready","click","Event","post","OC","generateUrl","target","checked","success","json"],"mappings":"aACA,IAAAA,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,GAAA,CACAG,EAAAH,EACAI,GAAA,EACAH,QAAA,IAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QAKAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,EAAA,CAA0CK,YAAA,EAAAC,IAAAL,KAK1CZ,EAAAkB,EAAA,SAAAhB,GACA,oBAAAiB,eAAAC,aACAN,OAAAC,eAAAb,EAAAiB,OAAAC,YAAA,CAAwDC,MAAA,WAExDP,OAAAC,eAAAb,EAAA,cAAiDmB,OAAA,KAQjDrB,EAAAsB,EAAA,SAAAD,EAAAE,GAEA,GADA,EAAAA,IAAAF,EAAArB,EAAAqB,IACA,EAAAE,EAAA,OAAAF,EACA,KAAAE,GAAA,iBAAAF,QAAAG,WAAA,OAAAH,EACA,IAAAI,EAAAX,OAAAY,OAAA,MAGA,GAFA1B,EAAAkB,EAAAO,GACAX,OAAAC,eAAAU,EAAA,WAAyCT,YAAA,EAAAK,UACzC,EAAAE,GAAA,iBAAAF,EAAA,QAAAM,KAAAN,EAAArB,EAAAU,EAAAe,EAAAE,EAAA,SAAAA,GAAgH,OAAAN,EAAAM,IAAqBC,KAAA,KAAAD,IACrI,OAAAF,GAIAzB,EAAA6B,EAAA,SAAA1B,GACA,IAAAS,EAAAT,KAAAqB,WACA,WAA2B,OAAArB,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAH,EAAAU,EAAAE,EAAA,IAAAA,GACAA,GAIAZ,EAAAa,EAAA,SAAAiB,EAAAC,GAAsD,OAAAjB,OAAAkB,UAAAC,eAAA1B,KAAAuB,EAAAC,IAGtD/B,EAAAkC,EAAA,GAIAlC,IAAAmC,EAAA;;;;;;;;;;;;;;;;;;;;AC9DAC,EAAAC,UAAAC,MAAA,WAEAF,EAAA,4BAAAG,MAAA,SAAAC,GACAJ,EAAAK,KAAAC,GAAAC,YAAA,+BAA6DhB,IAAA,aAAAN,MAAAmB,EAAAI,OAAAC,UAC7DC,QAAA,SAAAC,QAKAX,EAAA,8BAAAG,MAAA,SAAAC,GACAJ,EAAAK,KAAAC,GAAAC,YAAA,+BAA6DhB,IAAA,cAAAN,MAAAmB,EAAAI,OAAAC,UAC7DC,QAAA,SAAAC,QAKAX,EAAA,gCAAAG,MAAA,SAAAC,GACAJ,EAAAK,KAAAC,GAAAC,YAAA,+BAA6DhB,IAAA,eAAAN,MAAAmB,EAAAI,OAAAC,UAC7DC,QAAA,SAAAC,QAKAX,EAAA,6BAAAG,MAAA,SAAAC,GACAJ,EAAAK,KAAAC,GAAAC,YAAA,+BAA6DhB,IAAA,gBAAAN,MAAAmB,EAAAI,OAAAC,UAC7DC,QAAA,SAAAC,QAKAX,EAAA,yBAAAG,MAAA,SAAAC,GACAJ,EAAAK,KAAAC,GAAAC,YAAA,+BAA6DhB,IAAA,YAAAN,MAAAmB,EAAAI,OAAAC,UAC7DC,QAAA,SAAAC","file":"config.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 26);\n","/**\n * @author Matthieu Le Corre <matthieu.lecorre@univ-nantes.fr>\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\n $(document).ready(function () {\n\n $(\"#readmeMD-appearance-txt\").click(function(Event){\n $.post(OC.generateUrl(\"apps/files_readmemd/config\"),{key: \"show_title\", value: Event.target.checked})\n .success(function (json) {\n //console.log(json) ;\n })\n }) ;\n\n $(\"#readmeMD-appearance-color\").click(function(Event){\n $.post(OC.generateUrl(\"apps/files_readmemd/config\"),{key: \"yellow_back\", value: Event.target.checked})\n .success(function (json) {\n //console.log(json) ;\n })\n }) ;\n\n $(\"#readmeMD-appearance-refresh\").click(function(Event){\n $.post(OC.generateUrl(\"apps/files_readmemd/config\"),{key: \"auto_refresh\", value: Event.target.checked})\n .success(function (json) {\n //console.log(json) ;\n })\n }) ;\n\n $(\"#readmeMD-engine-asciidoc\").click(function(Event){\n $.post(OC.generateUrl(\"apps/files_readmemd/config\"),{key: \"show_asciidoc\", value: Event.target.checked})\n .success(function (json) {\n //console.log(json) ;\n })\n }) ;\n\n $(\"#readmeMD-engine-html\").click(function(Event){\n $.post(OC.generateUrl(\"apps/files_readmemd/config\"),{key: \"show_html\", value: Event.target.checked})\n .success(function (json) {\n //console.log(json) ;\n })\n }) ;\n\n }) ;"],"sourceRoot":""}
\ No newline at end of file
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -38,7 +38,8 @@ class ConfigController extends Controller {
"show_asciidoc" => $this->config->getAppValue("show_asciidoc"),
"show_html" => $this->config->getAppValue("show_html") ,
"yellow_back" => $this->config->getAppValue("yellow_back") ,
"show_title" => $this->config->getAppValue("show_title")
"show_title" => $this->config->getAppValue("show_title") ,
"auto_refresh" => $this->config->getAppValue("auto_refresh") ,
];
return $params ;
}
......
......@@ -54,6 +54,10 @@ class Config {
$this->setAppValue('yellow_back','true') ;
}
if (null == $this->getAppValue('auto_refresh') ) {
$this->setAppValue('yellow_back','false') ;
}
}
public function getAppValue($key) {
......
......@@ -63,11 +63,13 @@ class Appareance implements ISettings {
public function getForm() {
$show_title = $this->config->getAppValue('show_title') ;
$yellow_back = $this->config->getAppValue('yellow_back') ;
$yellow_back = $this->config->getAppValue('yellow_back') ;
$auto_refresh = $this->config->getAppValue('auto_refresh') ;
$parameters = [
'show_title' => $show_title,
'yellow_back' => $yellow_back
'yellow_back' => $yellow_back,
'auto_refresh' => $auto_refresh
];
return new TemplateResponse('files_readmemd', 'Appareance', $parameters);
......
......@@ -64,6 +64,8 @@ class Filelist implements ISettings {
$filesList = $this->config->getFilesList() ;
$filesList = array("README.md") ;
return new TemplateResponse('files_readmemd', 'Filelist', $filesList);
}
......
......@@ -23,28 +23,35 @@
$("#readmeMD-appearance-txt").click(function(Event){
$.post(OC.generateUrl("apps/files_readmemd/config"),{key: "show_title", value: Event.target.checked})
.success(function (json) {
console.log(json) ;
//console.log(json) ;
})
}) ;
$("#readmeMD-appearance-color").click(function(Event){
$.post(OC.generateUrl("apps/files_readmemd/config"),{key: "yellow_back", value: Event.target.checked})
.success(function (json) {
console.log(json) ;
//console.log(json) ;
})
}) ;
$("#readmeMD-appearance-refresh").click(function(Event){
$.post(OC.generateUrl("apps/files_readmemd/config"),{key: "auto_refresh", value: Event.target.checked})
.success(function (json) {
//console.log(json) ;
})
}) ;
$("#readmeMD-engine-asciidoc").click(function(Event){
$.post(OC.generateUrl("apps/files_readmemd/config"),{key: "show_asciidoc", value: Event.target.checked})
.success(function (json) {
console.log(json) ;
//console.log(json) ;
})
}) ;
$("#readmeMD-engine-html").click(function(Event){
$.post(OC.generateUrl("apps/files_readmemd/config"),{key: "show_html", value: Event.target.checked})
.success(function (json) {
console.log(json) ;
//console.log(json) ;
})
}) ;
......
......@@ -91,6 +91,7 @@ OCA.ReadmeMD.App = {
self.show_asciidoc = json.show_asciidoc ;
self.show_html = json.show_html ;
self.auto_refresh = json.auto_refresh ;
if ( json.show_title == "false") {
self.readme.container.addClass("no-before") ;
......@@ -237,13 +238,18 @@ OCA.ReadmeMD.App = {
this.readme.filenames = this.generateFileNames("readme") ;
//list file from current dir and check
var foundHD = null ;
//var foundHD = null ;
var foundRM = null ;
this.header.filename = null ;
this.readme.filename = null ;
for (var activFile in this.header.filenames ) {
for (var filenum in FL) {
if ( FL[filenum].name == this.header.filenames[activFile] ) {
foundHD = FL[filenum].name ;
this.header.filename = FL[filenum].name ;
this.header.mtime = FL[filenum].mtime ;
this.header.filenum= filenum ;
} ;
} ;
} ;
......@@ -251,38 +257,56 @@ OCA.ReadmeMD.App = {
for (var activFile in this.readme.filenames ) {
for (var filenum in FL) {
if ( FL[filenum].name == this.readme.filenames[activFile] ) {
foundRM = FL[filenum].name ;
this.readme.filename = FL[filenum].name ;
this.readme.mtime = FL[filenum].mtime ;
this.readme.filenum= filenum ;
} ;
} ;
} ;
if (foundHD !== null ) {
this.header.filename = foundHD ;
if (this.header.filename !== null ) {
this.header.container.removeClass("hidden") ;
this.fillContainer(this.header) ;
// clear setInterval and force a new one
//clearInterval(this.header.interval)
//this.header.interval = setInterval(function() { refreshContent(this.header) ; } ,10000) ;
if (this.auto_refresh == "true") {
// clear setInterval and force a new one
clearInterval(this.header.interval)
this.header.interval = setInterval(function() { self.refreshContent(self.header) ; } ,1000) ;
} ;
} ;
if (foundRM !== null ) {
this.readme.filename = foundRM ;
if (this.readme.filename !== null ) {
this.readme.container.removeClass("hidden") ;
this.fillContainer(this.readme) ;
} ;
this.fillContainer(this.readme) ;
if (this.auto_refresh == "true") {
// clear setInterval and force a new one
clearInterval(this.readme.interval)
this.readme.interval = setInterval(function() { self.refreshContent(self.readme) ; } ,1000) ;
} ;
} ;
},
/**
*
* try auto refresh
* auto refresh file content if enable
*/
refreshContent: function(zone) {
if (this.mode == "public") {
var FL = OCA.Sharing.PublicApp.fileList.files ;
}else {
var FL = OCA.Files.App.fileList.files ;
}
if (zone.mtime != FL[zone.filenum].mtime) {
zone.mtime = FL[zone.filenum].mtime ;
this.fillContainer(zone) ;
} ;
},
/**
......
......@@ -35,11 +35,20 @@ script("files_readmemd","config") ;
type="checkbox" class="checkbox " value="1" <?php if ($_['show_title'] == 'true'): ?> checked="checked"<?php endif; ?>
/>
<label for="readmeMD-appearance-txt"><?php p($l->t("Show \"README.md\" text before content")) ; ?></label>
</p><p>
</p>
<p>
<input id="readmeMD-appearance-color" name="readmeMD-appearance-color"
type="checkbox" class="checkbox " value="1" <?php if ($_['yellow_back'] == 'true'): ?> checked="checked"<?php endif; ?>
/>
<label for="readmeMD-appearance-color"><?php p($l->t("Show yellow background for README.md")) ; ?></label>
<label for="readmeMD-appearance-color"><?php p($l->t("Show yellow background for README.md")) ; ?></label>
</p>
<p>
<input id="readmeMD-appearance-refresh" name="readmeMD-appearance-refresh"
type="checkbox" class="checkbox " value="1" <?php if ($_['auto_refresh'] == 'true'): ?> checked="checked"<?php endif; ?>
/>
<label for="readmeMD-appearance-refresh"><?php p($l->t("Auto refresh (check every 1 sec.) of HEADER/FOOTER content whenever files contents change (maybe lower general performance)")) ; ?></label>
</p>
</div>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment