Skip to content

Commit

Permalink
Merge pull request #356 from Edirom/fix/TEI-sourceView
Browse files Browse the repository at this point in the history
Fix TEI FacsimileView
  • Loading branch information
bwbohl authored Feb 19, 2024
2 parents ef60527 + 9d8cd11 commit a4f7652
Show file tree
Hide file tree
Showing 2 changed files with 325 additions and 157 deletions.
86 changes: 48 additions & 38 deletions app/controller/window/text/FacsimileView.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,75 +16,85 @@
* You should have received a copy of the GNU General Public License
* along with Edirom Online. If not, see <http://www.gnu.org/licenses/>.
*/
Ext.define('EdiromOnline.controller.window.text.FacsimileView', {
Ext.define("EdiromOnline.controller.window.text.FacsimileView", {
extend: "Ext.app.Controller",

extend: 'Ext.app.Controller',
views: ["window.text.FacsimileView"],

views: [
'window.text.FacsimileView'
],

init: function() {
init: function () {
this.control({
'facsimileView': {
afterlayout : this.onAfterLayout,
single: true
}
facsimileView: {
afterlayout: this.onAfterLayout,
single: true,
},
});
},

onAfterLayout: function(view) {

onAfterLayout: function (view) {
var me = this;

if(view.initialized) return;
if (view.initialized) return;
view.initialized = true;

view.on('gotoChapter', me.onGotoChapter, me);
view.on("gotoChapter", me.onGotoChapter, me);

var uri = view.uri;

window.doAJAXRequest('data/xql/getPages.xql',
'GET',
window.doAJAXRequest(
"data/xql/getPages.xql",
"GET",
{
uri: uri
uri: uri,
},
Ext.bind(function(response){
Ext.bind(function (response) {
var data = response.responseText;

var pages = Ext.create('Ext.data.Store', {
fields: ['id', 'name', 'path', 'width', 'height', 'measures', 'annotations'],
data: Ext.JSON.decode(data)
var pages = Ext.create("Ext.data.Store", {
fields: [
"id",
"name",
"path",
"width",
"height",
"measures",
"annotations",
],
data: Ext.JSON.decode(data),
});

view.setImageSet(pages);
}, this)
me.pagesLoaded(pages, view);
}, this),
);

window.doAJAXRequest('data/xql/getChapters.xql',
'GET',

window.doAJAXRequest(
"data/xql/getChapters.xql",
"GET",
{
uri: view.uri,
mode: 'pageMode'
mode: "pageMode",
},
Ext.bind(function(response){
Ext.bind(function (response) {
var data = response.responseText;

var chapters = Ext.create('Ext.data.Store', {
fields: ['id', 'name', 'pageId'],
data: Ext.JSON.decode(data)
var chapters = Ext.create("Ext.data.Store", {
fields: ["id", "name", "pageId"],
data: Ext.JSON.decode(data),
});

me.chaptersLoaded(chapters, view);
}, this)
}, this),
);
},

chaptersLoaded: function(chapters, view) {

pagesLoaded: function (pages, view) {
view.setImageSet(pages);
},

chaptersLoaded: function (chapters, view) {
view.setChapters(chapters);
},
onGotoChapter: function(view, pageId) {

onGotoChapter: function (view, pageId) {
view.gotoPage(pageId);
}
},
});
Loading

0 comments on commit a4f7652

Please sign in to comment.