Commit ed28689d authored by Matthieu Le Corre's avatar Matthieu Le Corre
Browse files

internal var renaming + fix race condition for config load


Signed-off-by: Matthieu Le Corre's avatarMatthieu Le Corre <matthieu.lecorre@univ-nantes.fr>
parent 390eaccf
## 1.1.0 NOT RELEASED YET
## 1.1.0 02-07-2019
### Fixed
- Search result issue when result match both current and another folder
[#20](https://gitlab.univ-nantes.fr/uncloud/files_readmemd/issues/20#)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 26);
/******/ })
/************************************************************************/
/******/ ({
/***/ 26:
/***/ (function(module, exports) {
!function(e){var t={};function a(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=t,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=26)}({26:function(e,t){
/**
* @author Matthieu Le Corre <matthieu.lecorre@univ-nantes.fr>
*
......@@ -108,113 +18,5 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
$(document).ready(function () {
//Appearance
$("#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) ;
})
}) ;
$("#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) ;
})
}) ;
$("#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) ;
})
}) ;
//Engines
$("#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) ;
})
}) ;
$("#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) ;
})
}) ;
// Fileslists
// DELETE
$(".readmeMD-filelist_delete").on("click",function(Event){
var self =this ;
var fn = Event.target.dataset.filename ;
var zone = Event.target.dataset.zone ;
//console.log( "Deleting " + zone + " -> " + fn ) ;
$.ajax({
url:OC.generateUrl("apps/files_readmemd/config/filenames/" + zone + "/" + fn ),
type: 'DELETE',
success: function(data) {
$(self).parent().remove() ;
}
})
}) ;
//ADD
$("#readmeMD-filelist_submit-footer").on("click",function(Event){
var fn = $("#readmeMD-filelist_name-footer")[0].value ;
var zone = "footer" ;
$.ajax({
url:OC.generateUrl("apps/files_readmemd/config/filenames/" + zone + "/" + fn ),
type: 'PUT',
success: function(data) {
$("#readmeMD-filelist_footer").append(
'<li class="readmeMD-filelist" id="readmeMD-filelist-'+fn+'">'
+'<a data-zone="footer" data-filename="'+fn+'" class="readmeMD-filelist_delete icon-inline icon icon-delete"></a>'
+fn+'</li>')
}
})
}) ;
$("#readmeMD-filelist_submit-header").on("click",function(Event){
var fn = $("#readmeMD-filelist_name-header")[0].value ;
var zone = "header" ;
$.ajax({
url:OC.generateUrl("apps/files_readmemd/config/filenames/" + zone + "/" + fn ),
type: 'PUT',
success: function(data) {
$("#readmeMD-filelist_header").append(
'<li class="readmeMD-filelist" id="readmeMD-filelist-'+fn+'">'
+'<a data-zone="header" data-filename="'+fn+'" class="readmeMD-filelist_delete icon-inline icon icon-delete"></a>'
+fn+'</li>')
}
})
}) ;
});
/***/ })
/******/ });
$(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){})}),$(".readmeMD-filelist_delete").on("click",function(e){var t=this,a=e.target.dataset.filename,n=e.target.dataset.zone;$.ajax({url:OC.generateUrl("apps/files_readmemd/config/filenames/"+n+"/"+a),type:"DELETE",success:function(e){$(t).parent().remove()}})}),$("#readmeMD-filelist_submit-footer").on("click",function(e){var t=$("#readmeMD-filelist_name-footer")[0].value;$.ajax({url:OC.generateUrl("apps/files_readmemd/config/filenames/footer/"+t),type:"PUT",success:function(e){$("#readmeMD-filelist_footer").append('<li class="readmeMD-filelist" id="readmeMD-filelist-'+t+'"><a data-zone="footer" data-filename="'+t+'" class="readmeMD-filelist_delete icon-inline icon icon-delete"></a>'+t+"</li>")}})}),$("#readmeMD-filelist_submit-header").on("click",function(e){var t=$("#readmeMD-filelist_name-header")[0].value;$.ajax({url:OC.generateUrl("apps/files_readmemd/config/filenames/header/"+t),type:"PUT",success:function(e){$("#readmeMD-filelist_header").append('<li class="readmeMD-filelist" id="readmeMD-filelist-'+t+'"><a data-zone="header" data-filename="'+t+'" class="readmeMD-filelist_delete icon-inline icon icon-delete"></a>'+t+"</li>")}})})})}});
//# sourceMappingURL=config.js.map
\ No newline at end of file
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/config.js"],"names":[],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,6DAA6D,+CAA+C;AAC5G;AACA;AACA,iBAAiB;AACjB,KAAK;;AAEL;AACA,6DAA6D,gDAAgD;AAC7G;AACA;AACA,iBAAiB;AACjB,KAAK;;AAEL;AACA,6DAA6D,iDAAiD;AAC9G;AACA;AACA,iBAAiB;AACjB,KAAK;;;AAGL;;;AAGA;AACA,6DAA6D,kDAAkD;AAC/G;AACA;AACA,iBAAiB;AACjB,KAAK;;AAEL;AACA,6DAA6D,8CAA8C;AAC3G;AACA;AACA,iBAAiB;AACjB,KAAK;;;AAGL;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;;AAER,KAAK;;AAEL;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,qC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET,KAAK;;AAEL;;AAEA;AACA;;AAEA;AACA;AACA;AACA,qC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET,KAAK;;AAEL,EAAE,E","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 //Appearance\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\n //Engines\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\n // Fileslists\n\n // DELETE\n $(\".readmeMD-filelist_delete\").on(\"click\",function(Event){\n var self =this ;\n\n var fn = Event.target.dataset.filename ;\n var zone = Event.target.dataset.zone ;\n\n //console.log( \"Deleting \" + zone + \" -> \" + fn ) ;\n\n $.ajax({\n url:OC.generateUrl(\"apps/files_readmemd/config/filenames/\" + zone + \"/\" + fn ),\n type: 'DELETE',\n success: function(data) {\n $(self).parent().remove() ;\n }\n })\n\n }) ;\n\n //ADD\n\n $(\"#readmeMD-filelist_submit-footer\").on(\"click\",function(Event){\n \n var fn = $(\"#readmeMD-filelist_name-footer\")[0].value ;\n var zone = \"footer\" ;\n\n $.ajax({\n url:OC.generateUrl(\"apps/files_readmemd/config/filenames/\" + zone + \"/\" + fn ),\n type: 'PUT',\n success: function(data) { \n $(\"#readmeMD-filelist_footer\").append(\n '<li class=\"readmeMD-filelist\" id=\"readmeMD-filelist-'+fn+'\">'\n +'<a data-zone=\"footer\" data-filename=\"'+fn+'\" class=\"readmeMD-filelist_delete icon-inline icon icon-delete\"></a>'\n +fn+'</li>')\n }\n })\n\n }) ;\n\n $(\"#readmeMD-filelist_submit-header\").on(\"click\",function(Event){\n \n var fn = $(\"#readmeMD-filelist_name-header\")[0].value ;\n var zone = \"header\" ;\n\n $.ajax({\n url:OC.generateUrl(\"apps/files_readmemd/config/filenames/\" + zone + \"/\" + fn ),\n type: 'PUT',\n success: function(data) { \n $(\"#readmeMD-filelist_header\").append(\n '<li class=\"readmeMD-filelist\" id=\"readmeMD-filelist-'+fn+'\">'\n +'<a data-zone=\"header\" data-filename=\"'+fn+'\" class=\"readmeMD-filelist_delete icon-inline icon icon-delete\"></a>'\n +fn+'</li>')\n }\n })\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","on","self","this","fn","dataset","filename","zone","ajax","url","type","data","parent","remove","append"],"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,E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A,EAAA,uEACAA,EAAA","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 //Appearance\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\n //Engines\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\n // Fileslists\n\n // DELETE\n $(\".readmeMD-filelist_delete\").on(\"click\",function(Event){\n var self =this ;\n\n var fn = Event.target.dataset.filename ;\n var zone = Event.target.dataset.zone ;\n\n //console.log( \"Deleting \" + zone + \" -> \" + fn ) ;\n\n $.ajax({\n url:OC.generateUrl(\"apps/files_readmemd/config/filenames/\" + zone + \"/\" + fn ),\n type: 'DELETE',\n success: function(data) {\n $(self).parent().remove() ;\n }\n })\n\n }) ;\n\n //ADD\n\n $(\"#readmeMD-filelist_submit-footer\").on(\"click\",function(Event){\n \n var fn = $(\"#readmeMD-filelist_name-footer\")[0].value ;\n var zone = \"footer\" ;\n\n $.ajax({\n url:OC.generateUrl(\"apps/files_readmemd/config/filenames/\" + zone + \"/\" + fn ),\n type: 'PUT',\n success: function(data) { \n $(\"#readmeMD-filelist_footer\").append(\n '<li class=\"readmeMD-filelist\" id=\"readmeMD-filelist-'+fn+'\">'\n +'<a data-zone=\"footer\" data-filename=\"'+fn+'\" class=\"readmeMD-filelist_delete icon-inline icon icon-delete\"></a>'\n +fn+'</li>')\n }\n })\n\n }) ;\n\n $(\"#readmeMD-filelist_submit-header\").on(\"click\",function(Event){\n \n var fn = $(\"#readmeMD-filelist_name-header\")[0].value ;\n var zone = \"header\" ;\n\n $.ajax({\n url:OC.generateUrl(\"apps/files_readmemd/config/filenames/\" + zone + \"/\" + fn ),\n type: 'PUT',\n success: function(data) { \n $(\"#readmeMD-filelist_header\").append(\n '<li class=\"readmeMD-filelist\" id=\"readmeMD-filelist-'+fn+'\">'\n +'<a data-zone=\"header\" data-filename=\"'+fn+'\" class=\"readmeMD-filelist_delete icon-inline icon icon-delete\"></a>'\n +fn+'</li>')\n }\n })\n\n }) ;\n\n }); "],"sourceRoot":""}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
......@@ -29,39 +29,30 @@ OCA.ReadmeMD = {};
*/
OCA.ReadmeMD.App = {
/**
* Holds the MDs objects
*/
//header: null,
//readme: null,
/**
* Setup on page load
*/
initialize: function (header,readme,mode) {
initialize: function (header,footer,mode) {
var self = this ;
this.configReady = false ;
//this.appVisible = true ;
//public share or private view
this.mode = mode ;
// container creation
this.header = header;
this.readme = readme;
this.footer = footer;
this.createContainer(this.header) ;
this.createContainer(this.readme) ;
this.createContainer(this.footer) ;
// grab the config ;
this.getConfig() ;
//get the config
//then setup the trigger on filetable
this.getConfig()
.then(function() {
$("#filestable").on('updated',function() { self.checkMD() ; }) ;
}) ;
// trigger on filetable to check if README/HEADER are present
$("#filestable").on('updated',function() { self.checkMD() ; })
// Mutation observer to toogle readme visibility on hide or show
var hideContainerOnHideObserver = new MutationObserver(function(mutations) { self.callBackToggleContainer(mutations,"hide") }) ;
var hideContainerOnShowObserver = new MutationObserver(function(mutations) { self.callBackToggleContainer(mutations,"show") }) ;
......@@ -84,29 +75,29 @@ OCA.ReadmeMD.App = {
/**
* get the config from DB
*/
getConfig(key) {
getConfig() {
var self = this ;
$.get(OC.generateUrl("apps/files_readmemd/config"))
.done(function (json) {
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") ;
} ;
if ( json.yellow_back == "false") {
self.readme.container.removeClass("yellowish") ;
} ;
self.fileslist_header = json.fileslist_header ;
self.fileslist_footer = json.fileslist_footer ;
self.configReady = true ;
}) ;
return new Promise (function (resolve, reject) {
$.get(OC.generateUrl("apps/files_readmemd/config"))
.done(function (json) {
self.show_asciidoc = json.show_asciidoc ;
self.show_html = json.show_html ;
self.auto_refresh = json.auto_refresh ;
if ( json.show_title == "false") {
self.footer.container.addClass("no-before") ;
} ;
if ( json.yellow_back == "false") {
self.footer.container.removeClass("yellowish") ;
} ;
self.fileslist_header = json.fileslist_header ;
self.fileslist_footer = json.fileslist_footer ;
resolve() ;
}) ;
}) ;
},
/**
......@@ -120,15 +111,15 @@ OCA.ReadmeMD.App = {
//mode hide
if ($(mutation.target).hasClass("hidden") ) {
self.header.container.addClass("hidden") ;
self.readme.container.addClass("hidden") ;
self.footer.container.addClass("hidden") ;
$("#filestable > tfoot > tr").height("250px") ;
} else {
if (self.header.content !== null && window.location.search.indexOf("view") == -1) {
self.header.container.removeClass("hidden") ;
$("#filestable > tfoot > tr").height("auto") ;
} ;
if (self.readme.content !== null && window.location.search.indexOf("view") == -1) {
self.readme.container.removeClass("hidden") ;
if (self.footer.content !== null && window.location.search.indexOf("view") == -1) {
self.footer.container.removeClass("hidden") ;
$("#filestable > tfoot > tr").height("auto") ;
} ;
} ;
......@@ -139,13 +130,13 @@ OCA.ReadmeMD.App = {
self.header.container.removeClass("hidden") ;
$("#filestable > tfoot > tr").height("auto") ;
} ;
if (self.readme.content !== null) {
self.readme.container.removeClass("hidden") ;
if (self.footer.content !== null) {
self.footer.container.removeClass("hidden") ;
$("#filestable > tfoot > tr").height("auto") ;
} ;
} else {
self.header.container.addClass("hidden") ;
self.readme.container.addClass("hidden") ;
self.footer.container.addClass("hidden") ;
$("#filestable > tfoot > tr").height("250px") ;
} ;
}
......@@ -216,7 +207,7 @@ OCA.ReadmeMD.App = {
if (zone == "header") { return HFNames } ;
if (zone == "readme") { return FFNames } ;
if (zone == "footer") { return FFNames } ;
},
......@@ -232,9 +223,9 @@ OCA.ReadmeMD.App = {
this.header.container.children().remove() ;
this.header.content= null ;
this.readme.container.addClass("hidden") ;
this.readme.container.children().remove() ;
this.readme.content = null ;
this.footer.container.addClass("hidden") ;
this.footer.container.children().remove() ;
this.footer.content = null ;
if (this.mode == "public") {
var FL = OCA.Sharing.PublicApp.fileList.files ;
......@@ -243,14 +234,11 @@ OCA.ReadmeMD.App = {
}
this.header.filenames = this.generateFileNames("header") ;
this.readme.filenames = this.generateFileNames("readme") ;
//list file from current dir and check
//var foundHD = null ;
var foundRM = null ;
this.footer.filenames = this.generateFileNames("footer") ;
//list files from current dir and check
this.header.filename = null ;
this.readme.filename = null ;
this.footer.filename = null ;
for (var activFile in this.header.filenames ) {
for (var filenum in FL) {
......@@ -262,12 +250,12 @@ OCA.ReadmeMD.App = {
} ;
} ;
for (var activFile in this.readme.filenames ) {
for (var activFile in this.footer.filenames ) {
for (var filenum in FL) {
if ( FL[filenum].name == this.readme.filenames[activFile] ) {
this.readme.filename = FL[filenum].name ;
this.readme.mtime = FL[filenum].mtime ;
this.readme.filenum= filenum ;
if ( FL[filenum].name == this.footer.filenames[activFile] ) {
this.footer.filename = FL[filenum].name ;
this.footer.mtime = FL[filenum].mtime ;
this.footer.filenum= filenum ;
} ;
} ;
......@@ -285,14 +273,14 @@ OCA.ReadmeMD.App = {
} ;
} ;
if (this.readme.filename !== null ) {
this.readme.container.removeClass("hidden") ;
this.fillContainer(this.readme) ;
if (this.footer.filename !== null ) {
this.footer.container.removeClass("hidden") ;
this.fillContainer(this.footer) ;
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) ;
clearInterval(this.footer.interval)
this.footer.interval = setInterval(function() { self.refreshContent(self.footer) ; } ,1000) ;
} ;
} ;
},
......@@ -436,13 +424,7 @@ $(document).ready(function () {
container: $('<div id="app-content-headerMD" class="hidden markdown-body headermd"></div>'),
position : "before",
filename: null,
filenames : [
"HEADER.md",
"HEADER.markdown",
".HEADER.md",
".HEADER.markdown",
"HEADER.adoc"
],
filenames : null,
content : null
} ;
......@@ -450,12 +432,7 @@ $(document).ready(function () {
container: $('<div id="app-content-readmeMD" class="hidden markdown-body readmemd yellowish"></div>'),
position : "after",
filename: null,
filenames : [
"README.md",
"README.markdown",
".README.md",
".README.markdown"
],
filenames : null,
content : null
} ;
......
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