/*
This file is part of LONCAPA-Daxe.
LONCAPA-Daxe is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
LONCAPA-Daxe is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Daxe. If not, see <http://www.gnu.org/licenses/>.
*/
part of loncapa_daxe;
/**
* Extension of DNFile to handle LON-CAPA absolute paths.
* Display type: 'lcdfile'.
*/
class LCDFile extends DNFile {
LCDFile.fromRef(x.Element elementRef) : super.fromRef(elementRef) {
}
LCDFile.fromNode(x.Node node, DaxeNode parent) : super.fromNode(node, parent) {
}
@override
String fixSrcPath(List<String> segments, Uri imgUri) {
// make path relative to the XML file if this is not a /res path
if (imgUri.path.startsWith('/daxeopen/res/'))
return imgUri.path.substring('/daxeopen'.length);
else
return super.fixSrcPath(segments, imgUri);
}
}
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>