Skip to content

Commit

Permalink
Merge branch 'develop' into fix/annot-tool-tip-layout
Browse files Browse the repository at this point in the history
  • Loading branch information
bwbohl authored Feb 19, 2024
2 parents c06e24b + a4f7652 commit a8ba641
Show file tree
Hide file tree
Showing 4 changed files with 341 additions and 164 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/checkout@v4

- name: Get short sha
uses: benjlevesque/short-sha@v2.2
uses: benjlevesque/short-sha@v3.0
id: short-sha
with:
length: 7
Expand All @@ -31,7 +31,7 @@ jobs:

- name: Upload Artifacts to action run
if: github.repository == 'Edirom/Edirom-Online'
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
# The name that the artifact will be made available under
name: EdiromOnline_${{ steps.short-sha.outputs.sha }}.zip
Expand Down
19 changes: 14 additions & 5 deletions add/data/xqm/source.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,29 @@ declare namespace mei="http://www.music-encoding.org/ns/mei";
import module namespace eutil="http://www.edirom.de/xquery/util" at "../xqm/util.xqm";

(:~
: Returns whether a document is a source or not
: Returns whether a document is a source or not. Generally this should work for MEI versions
: 2011-05 through 5.0
:
: @param $uri The URI of the document
: @return Is work or not
:
: @return xs:boolean indicating whether the document referenced by @param $uri
: is considered a music source or not.
:)
declare function source:isSource($uri as xs:string) as xs:boolean {
let $doc := eutil:getDoc($uri)
let $meiVersionRegex := '(([4-9])|(\d+[0-9]))\.\d+\.\d+(-dev)?'
let $meiVersion4To5Regex := '^[4-5](\.\d){1,2}(-dev)?(\+(anyStart|basic|CMN|Mensural|Neumes))?$'
(: 2010-05 pre camelCase :)
(: 2011-05 2012 :)
(: 2013 +meiversion.num 2.1.1:)
(: 3.0.0 :)
(:mei2 and ?3 :)
return
(exists($doc//mei:mei) and exists($doc//mei:source)) (:mei2 and ?3 :)
or
(matches($doc//mei:mei/@meiversion, $meiVersionRegex) and exists($doc//mei:manifestation[@singleton='true'])) (:mei4+ for manuscripts:)
(: MEI 4.0.1 and 5.0 with all dev and cutomization variants :)
(matches($doc//mei:mei/@meiversion, $meiVersion4To5Regex) and exists($doc//mei:manifestation[@singleton='true'])) (:mei4+ for manuscripts:)
or
(matches($doc//mei:mei/@meiversion, $meiVersionRegex) and exists($doc//mei:manifestation//mei:item)) (: mei4+ for prints :)
(matches($doc//mei:mei/@meiversion, $meiVersion4ToRegex) and exists($doc//mei:manifestation//mei:item)) (: mei4+ for prints :)
};

(:~
Expand Down
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 a8ba641

Please sign in to comment.