-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added version tags to ajax requests in web variant.
- Loading branch information
Showing
6 changed files
with
22 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/** | ||
* Javascript library for viewing and interactive editing of Page XMLs. | ||
* | ||
* @version $Version: 2021.02.17$ | ||
* @version $Version: 2021.02.22$ | ||
* @author Mauricio Villegas <[email protected]> | ||
* @copyright Copyright(c) 2015-present, Mauricio Villegas <[email protected]> | ||
* @license MIT License | ||
|
@@ -23,7 +23,7 @@ | |
'use strict'; | ||
|
||
var | ||
version = '$Version: 2021.02.17$'.replace(/^\$Version. (.*)\$/,'$1'); | ||
version = '$Version: 2021.02.22$'.replace(/^\$Version. (.*)\$/,'$1'); | ||
|
||
/// Set PageCanvas global object /// | ||
if ( ! global.PageCanvas ) | ||
|
@@ -421,7 +421,7 @@ | |
|
||
for ( n=0; n<xslt_import.length; n++ ) // jshint -W083 | ||
(function(idx) { | ||
$.ajax({ url: importSvgXsltHref[idx], async: async, dataType: 'xml' }) | ||
$.ajax({ url: self.util.addAjaxVersionTimestamp(importSvgXsltHref[idx]), async: async, dataType: 'xml' }) | ||
.fail( function () { self.throwError( 'Failed to retrieve '+importSvgXsltHref[idx] ); } ) | ||
.done( function ( data ) { | ||
xslt_import[idx] = new XSLTProcessor(); | ||
|
@@ -447,7 +447,7 @@ | |
|
||
for ( n=0; n<xslt_export.length; n++ ) // jshint -W083 | ||
(function(idx) { | ||
$.ajax({ url: exportSvgXsltHref[idx], async: async, dataType: 'xml' }) | ||
$.ajax({ url: self.util.addAjaxVersionTimestamp(exportSvgXsltHref[idx]), async: async, dataType: 'xml' }) | ||
.fail( function () { self.throwError( 'Failed to retrieve '+exportSvgXsltHref[idx] ); } ) | ||
.done( function ( data ) { | ||
xslt_export[idx] = new XSLTProcessor(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/** | ||
* Javascript library for viewing and interactive editing of SVGs. | ||
* | ||
* @version $Version: 2020.10.02$ | ||
* @version $Version: 2021.02.22$ | ||
* @author Mauricio Villegas <[email protected]> | ||
* @copyright Copyright(c) 2015-present, Mauricio Villegas <[email protected]> | ||
* @license MIT License | ||
|
@@ -23,7 +23,7 @@ | |
var | ||
sns = 'http://www.w3.org/2000/svg', | ||
xns = 'http://www.w3.org/1999/xlink', | ||
version = '$Version: 2020.10.02$'.replace(/^\$Version. (.*)\$/,'$1'); | ||
version = '$Version: 2021.02.22$'.replace(/^\$Version. (.*)\$/,'$1'); | ||
|
||
/// Set SvgCanvas global object /// | ||
if ( ! global.SvgCanvas ) | ||
|
@@ -77,6 +77,7 @@ | |
self.cfg.textFormatter = svgTextFormatter; | ||
self.cfg.textValidator = function () { return false; }; | ||
self.cfg.multilineText = true; | ||
self.cfg.ajaxVersionStamp = null; | ||
self.cfg.onSetConfig = []; | ||
self.cfg.onPanZoomChange = []; | ||
self.cfg.onMouseMove = []; | ||
|
@@ -823,6 +824,13 @@ | |
/// Import and export SVGs /// | ||
////////////////////////////// | ||
|
||
function addAjaxVersionTimestamp( url ) { | ||
if ( self.cfg.ajaxVersionStamp ) | ||
url += '?v='+self.cfg.ajaxVersionStamp; | ||
return url; | ||
} | ||
self.util.addAjaxVersionTimestamp = addAjaxVersionTimestamp; | ||
|
||
/** | ||
* Returns a clone of the SVG without all of the editor data. | ||
*/ | ||
|
@@ -914,7 +922,7 @@ | |
if ( typeof dragpointSvg === 'undefined' && | ||
self.cfg.dragpointHref && | ||
self.cfg.dragpointHref[0] !== '#' ) { | ||
$.ajax({ url: self.cfg.dragpointHref, dataType: 'xml' }) | ||
$.ajax({ url: addAjaxVersionTimestamp(self.cfg.dragpointHref), dataType: 'xml' }) | ||
.fail( function () { self.throwError( 'Failed to retrive '+self.cfg.dragpointHref ); } ) | ||
.done( function ( data ) { initDragpoint(data); } ); | ||
return; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
/** | ||
* App functionality for the web edition of nw-page-editor. | ||
* | ||
* @version $Version: 2020.11.16$ | ||
* @version $Version: 2021.02.22$ | ||
* @author Mauricio Villegas <[email protected]> | ||
* @copyright Copyright(c) 2015-present, Mauricio Villegas <[email protected]> | ||
* @license MIT License | ||
*/ | ||
|
||
$(window).on('load', function () { | ||
|
||
pageCanvas.cfg.ajaxVersionStamp = page_editor_version.replace(/^[^\d]*/, ''); | ||
|
||
/// Additional pageCanvas configuration /// | ||
pageCanvas.setConfig( | ||
{ importSvgXsltHref: [ '../xslt/page2svg.xslt', '../xslt/page_from_2010-03-19.xslt', '../xslt/page2page.xslt', '../xslt/alto_v2_to_page.xslt', '../xslt/alto_v3_to_page.xslt' ], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "nw-page-editor", | ||
"version": "2021.02.17", | ||
"version": "2021.02.22", | ||
"description": "Simple app for visual editing of Page XML files", | ||
"main": "./html/index.html#1", | ||
"author": "Mauricio Villegas <[email protected]>", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,13 +2,13 @@ | |
/** | ||
* Common code to be executed by other php scripts. | ||
* | ||
* @version $Version: 2021.02.17$ | ||
* @version $Version: 2021.02.22$ | ||
* @author Mauricio Villegas <[email protected]> | ||
* @copyright Copyright(c) 2017-present, Mauricio Villegas <[email protected]> | ||
* @license MIT License | ||
*/ | ||
|
||
$version = str_replace('Version: ','',"Version: 2021.02.17"); | ||
$version = str_replace('Version: ','',"Version: 2021.02.22"); | ||
$v = '?v='.$version; | ||
|
||
/// User authentication /// | ||
|