From bd9c80ad94d6af65532bb876f508197b90947029 Mon Sep 17 00:00:00 2001 From: benweet Date: Mon, 26 Aug 2013 12:47:31 +0100 Subject: [PATCH] Upgrade to Bootstrap 3 --- cache.manifest | 2 +- res-min/main.js | 31 +++++++++++++++++-------------- res/extensions/documentPanel.js | 4 ++++ 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/cache.manifest b/cache.manifest index e5e75d1c..dfc1b7a3 100644 --- a/cache.manifest +++ b/cache.manifest @@ -87,7 +87,7 @@ lib/MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/SuppMathOperators.js #dynamic -# Mon 26 Aug 2013 12:32:03 WEST +# Mon 26 Aug 2013 12:46:43 WEST res-min/font/fontello.eot res-min/font/fontello.svg res-min/font/fontello.ttf diff --git a/res-min/main.js b/res-min/main.js index 5121dbf1..0a1d5b24 100644 --- a/res-min/main.js +++ b/res-min/main.js @@ -5381,8 +5381,8 @@ define("config", function() {}), define("settings", [ "underscore", "config" ], }), i; }), define("extensions/documentPanel", [ "jquery", "underscore", "utils", "classes/Extension", "folderList", "fileSystem" ], function(e, t, n, i, o, r) { function s(n) { - if (n != b) { - if (b = n, v.scrollTop = 0, !n) return g.addClass("hide"), f.removeClass("hide"), + if (n != y) { + if (y = n, b.scrollTop = 0, !n) return g.addClass("hide"), f.removeClass("hide"), void 0; var i = n.toLowerCase().split(/\s+/); t.each(h.querySelectorAll(".file"), function(n) { @@ -5397,14 +5397,15 @@ define("config", function() {}), define("settings", [ "underscore", "config" ], a.onFileMgrCreated = function(e) { l = e; }; - var c = [ '', '
', " <%= _.size(folderDesc.fileList) %>", "
", ' <%= folderDesc.name %>', "
", '
', " <%= fileListHtml %>", "
" ].join(""), u = [ '"', ' data-file-index="<%= fileDesc.fileIndex %>"', ' data-toggle="collapse"', ' data-target=".document-panel">', " <%= fileDesc.composeTitle() %>", "" ].join(""), d = void 0, p = void 0, f = void 0, h = void 0, g = void 0, m = function() { + var c = [ '', '
', " <%= _.size(folderDesc.fileList) %>", "
", ' <%= folderDesc.name %>', "
", '
', " <%= fileListHtml %>", "
" ].join(""), u = [ '"', ' data-file-index="<%= fileDesc.fileIndex %>"', ' data-toggle="collapse"', ' data-target=".document-panel">', " <%= fileDesc.composeTitle() %>", "" ].join(""), d = void 0, p = void 0, f = void 0, h = void 0, g = void 0, m = void 0, v = function() { var n = t.filter(r, function(e) { return void 0 === e.folder; }), i = t.chain(n).sortBy(function(e) { return e.title.toLowerCase(); }).reduce(function(e, n) { return e + "
  • " + t.template(u, { - fileDesc: n + fileDesc: n, + selectedFileDesc: m }) + "
  • "; }, "").value(); i = i && '", t.chain(o).sortBy(function(e) { @@ -5414,7 +5415,8 @@ define("config", function() {}), define("settings", [ "underscore", "config" ], return e.title.toLowerCase(); }).reduce(function(e, n) { return e + "
  • " + t.template(u, { - fileDesc: n + fileDesc: n, + selectedFileDesc: m }) + "
  • "; }, "").value(); n = n && '", i += t.template(c, { @@ -5427,32 +5429,33 @@ define("config", function() {}), define("settings", [ "underscore", "config" ], return e.title.toLowerCase(); }).reduce(function(e, n) { return e + "
  • " + t.template(u, { - fileDesc: n + fileDesc: n, + selectedFileDesc: m }) + "
  • "; }, "").value(); s = '", h.innerHTML = s, t.each(p.querySelectorAll(".file"), function(t) { var n = e(t); n.click(function() { var e = r[n.data("fileIndex")]; - e && e !== selectedFileDesc && l.selectFile(e); + e && e !== m && l.selectFile(e); }); }); }; a.onFileSelected = function(e) { - selectedFileDesc = e, m(); - }, a.onFileCreated = m, a.onFileDeleted = m, a.onTitleChanged = m, a.onSyncExportSuccess = m, - a.onSyncRemoved = m, a.onNewPublishSuccess = m, a.onPublishRemoved = m, a.onFoldersChanged = m; - var v = void 0, b = ""; + m = e, v(); + }, a.onFileCreated = v, a.onFileDeleted = v, a.onTitleChanged = v, a.onSyncExportSuccess = v, + a.onSyncRemoved = v, a.onNewPublishSuccess = v, a.onPublishRemoved = v, a.onFoldersChanged = v; + var b = void 0, y = ""; return a.onReady = function() { - d = document.querySelector(".document-panel"), v = d.querySelector(".panel-content"), + d = document.querySelector(".document-panel"), b = d.querySelector(".panel-content"), p = d.querySelector(".document-list"), f = e(p), h = d.querySelector(".document-list-filtered"), g = e(h), e(d).on("show.bs.collapse", function(t) { if (t.target === d) { - var n = selectedFileDesc.folder; + var n = m.folder; void 0 !== n && e(d.querySelector(".file-list." + n.folderIndex.replace(".", ""))).collapse("show"); } }).on("shown.bs.collapse", function(e) { - e.target === d && (t.val(""), s(""), v.scrollTop += p.querySelector(".file.active").getBoundingClientRect().top - 120); + e.target === d && (t.val(""), s(""), b.scrollTop += p.querySelector(".file.active").getBoundingClientRect().top - 120); }); var t = e(d.querySelector(".search-bar .form-control")); t.bind("propertychange keyup input paste", function() { diff --git a/res/extensions/documentPanel.js b/res/extensions/documentPanel.js index 98cb501c..cfa671d9 100644 --- a/res/extensions/documentPanel.js +++ b/res/extensions/documentPanel.js @@ -44,6 +44,7 @@ define([ var $documentListElt = undefined; var documentListFilteredElt = undefined; var $documentListFilteredElt = undefined; + var selectedFileDesc = undefined; var refreshPanel = function() { // List orphan documents @@ -57,6 +58,7 @@ define([ }).reduce(function(result, fileDesc) { return result + '
  • ' + _.template(documentEltTmpl, { fileDesc: fileDesc, + selectedFileDesc: selectedFileDesc }) + '
  • '; }, '').value(); documentListHtml = documentListHtml && ''; @@ -70,6 +72,7 @@ define([ }).reduce(function(result, fileDesc) { return result + '
  • ' + _.template(documentEltTmpl, { fileDesc: fileDesc, + selectedFileDesc: selectedFileDesc }) + '
  • '; }, '').value(); fileListHtml = fileListHtml && ''; @@ -88,6 +91,7 @@ define([ }).reduce(function(result, fileDesc) { return result + '
  • ' + _.template(documentEltTmpl, { fileDesc: fileDesc, + selectedFileDesc: selectedFileDesc }) + '
  • '; }, '').value(); documentListFilteredHtml = '';