Skip to content

Commit

Permalink
v1.0.t
Browse files Browse the repository at this point in the history
  • Loading branch information
odungern committed Oct 3, 2021
1 parent a32e0b5 commit d960324
Show file tree
Hide file tree
Showing 37 changed files with 4,280 additions and 3,807 deletions.
Binary file modified .vs/SpecIF-Viewer/v16/.suo
Binary file not shown.
1 change: 1 addition & 0 deletions .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"\\src\\vendor\\assets\\javascripts",
"\\src\\vendor\\assets\\stylesheets"
],
"SelectedNode": "\\src\\vendor\\assets\\javascripts\\toXhtml.js",
"PreviewInSolutionExplorer": false
}
Binary file modified .vs/slnx.sqlite
Binary file not shown.
2 changes: 1 addition & 1 deletion src/check.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
document.body.appendChild(el)
}
let pend=4;
getScript( 'https://code.jquery.com/jquery-3.5.1.min.js' );
getScript('https://code.jquery.com/jquery-3.6.0.min.js');
getScript( './config/definitions.js?'+ Date.now().toString() ); // with cache-busting
getScript( './config/moduleManager.js?'+ Date.now().toString() );
getScript( './'+fileName+'.js?'+ Date.now().toString() );
Expand Down
9 changes: 5 additions & 4 deletions src/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,11 @@ function checkSpecif():IApp {
self.logout
);
};
self.export = function() {
if( !self.cache.selectedProject || !self.cache.selectedProject.data.id )
message.show( i18n.MsgNoProjectLoaded, {severity:'warning', duration:CONFIG.messageDisplayTimeShort} );
self.cache.selectedProject.chooseFormatAndExport();
self.export = function (): void {
if (self.cache.selectedProject && self.cache.selectedProject.isLoaded())
self.cache.selectedProject.chooseFormatAndExport();
else
message.show(i18n.MsgNoProjectLoaded, { severity: 'warning', duration: CONFIG.messageDisplayTimeShort });
};
/* self.updateMe = function() {
self.me.beginUpdate();
Expand Down
25 changes: 16 additions & 9 deletions src/config/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
.. or even better as Github issue (https://github.com/GfSE/SpecIF-Viewer/issues)
*/
const CONFIG:any = {};
CONFIG.appVersion = "1.0.s",
CONFIG.appVersion = "1.0.t",
CONFIG.specifVersion = "1.0";
CONFIG.imgURL = './vendor/assets/images';
// CONFIG.userNameAnonymous = 'anonymous'; // as configured in the server
Expand Down Expand Up @@ -542,8 +542,8 @@ const vocabulary = {
case "specif_status": oT = "ReqIF.ForeignState"; break;
case "dcterms_author": // deprecated, for compatibility
case "dcterms_creator": oT = "ReqIF.ForeignCreatedBy"; break;
// case "specif_createdat":
// case "dcterms_modified": oT = "ReqIF.ForeignCreatedAt"; // exists?
// case "specif_createdat":
// case "dcterms_modified": oT = "ReqIF.ForeignCreatedAt"; // exists?
default: oT = iT;
};
return oT;
Expand Down Expand Up @@ -680,13 +680,20 @@ const RE:any = {};
// For example, the ARCWAY Cockpit export uses this pattern:
// <object data=\"files_and_images\\27420ffc0000c3a8013ab527ca1b71f5.svg\" name=\"27420ffc0000c3a8013ab527ca1b71f5.svg\" type=\"image/svg+xml\"/>
RE.tagA = new RegExp( '<a ([^>]+)>([\\s\\S]*?)</a>', 'g' );
RE.tagImg = new RegExp( '<img ([^>]+)/>', 'g' );
RE.tagImg = new RegExp('<img ([^>]+)/>', 'g');
RE.tagObject = /<object ([^>]+?)(\/>|>)/g;
RE.attrType = /type="([^"]+)"/;
RE.attrData = /data="([^"]+)"/;

const reSO = '<object ([^>]+)(/>|>([^<]*?)</object>)';
const reSO = '<object ([^>]+?)(/>|>([^<]*?)</object>)';
RE.tagSingleObject = new RegExp( reSO, 'g' );
RE.tagNestedObjects = new RegExp( '<object ([^>]+)>[\\s]*'+reSO+'([\\s\\S]*?)</object>', 'g' );
RE.tagNestedObjects = new RegExp( '<object ([^>]+?)>[\\s]*'+reSO+'([\\s\\S]*?)</object>', 'g' );
RE.inQuotes = /"(\S[^"]*?\S)"|'(\S[^']*?\S)'/i; // empty space in the middle allowed, but not as first and last character
RE.inBrackets = /\((\S[^\)]*?\S)\)|\[(\S[^\]]*?\S)\]/i; // empty space in the middle allowed, but not as first and last character

const inBr = "\\((\\S[^\\)]*?\\S)\\)|\\[(\\S[^\\]]*?\\S)\\]"; // empty space in the middle allowed, but not as first and last character
// RE.inBrackets = new RegExp( inBr, 'i');
RE.inBracketsAtEnd = new RegExp(inBr + "$", 'i');
RE.withoutBracketsAtEnd = /^(.*?)\s+(\(\S[^\)]*?\S\)|\[\S[^\]]*?\S\])$/i;

const tagStr = "(<\\/?)([a-z]{1,10}(?: [^<>]+)?\\/?>)";
RE.tag = new RegExp( tagStr, 'g' );
Expand All @@ -704,5 +711,5 @@ const tokenGroup = "(p|div|br|b|i|em|span|ul|ol|li|a|table|thead|tbody|tfoot|th|
// $3: any of the tokens listed in tokenGroup
// $4: the rest of the tag including '>' or '/>'

/////////////////
const nbsp = '&#160;'; // non-breakable space
RE.splitNamespace = /^(\w+:|\w+\.)?(\w+)$/;

2 changes: 2 additions & 0 deletions src/config/locales/iLaH-de.i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -524,11 +524,13 @@ function LanguageTextsDe() {
self.SpecIF_Origin = "Quelle"; // oder "Herkunft"
self.SpecIF_Source = self.LblSource;
self.SpecIF_Target = self.LblTarget;
self.SpecIF_DataObject = "Datenobjekt";
// self.SpecIF_Author = "Autor";
// self.SpecIF_Authors = "Autoren";
self.IREB_Stakeholder = "Stakeholder";
self.SpecIF_Responsible = "Verantwortlicher";
self.SpecIF_Responsibles = "Verantwortliche";
self.SpecIF_UserRole = "Nutzerrolle";
// attribute names used by the Interaction Room:
self.IR_Annotation = "Annotation";
self.IR_AnnotationDescription = "Eine Interaction-Room '"+self.IR_Annotation+"' weist auf einen Punkt besonderen Interesses hin. Hierzu gehören Werte, die Kundenbedürfnisse widerspiegeln oder positiven Effekt auf die Ziele der Organisation haben, Produkteigenschaften, deren Umsetzung Nutzen/Aufwand verursacht, und Herausforderungen, die während der Entwicklung zu berücksichtigen sind.";
Expand Down
2 changes: 2 additions & 0 deletions src/config/locales/iLaH-en.i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -524,11 +524,13 @@ function LanguageTextsEn() {
self.SpecIF_Origin = "Origin";
self.SpecIF_Source = self.LblSource;
self.SpecIF_Target = self.LblTarget;
self.SpecIF_DataObject = "Data-Object";
// self.SpecIF_Author = "Author";
// self.SpecIF_Authors = "Authors";
self.IREB_Stakeholder = "Stakeholder";
self.SpecIF_Responsible = "Responsible";
self.SpecIF_Responsibles = "Responsibles";
self.SpecIF_UserRole = "User-Role";
// attribute names used by the Interaction Room:
self.IR_Annotation = "Annotation";
self.IR_AnnotationDescription = "An Interaction-Room '"+self.IR_Annotation+"' indicates a point of special interest. Examples are customer or user value, product features with prominent benefit,effort or challenges during development.";
Expand Down
4 changes: 3 additions & 1 deletion src/config/locales/iLaH-fr.i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -523,12 +523,14 @@ function LanguageTextsFr() {
self.SpecIF_Instantiation = "Instanciation";
self.SpecIF_Origin = "Origine";
self.SpecIF_Source = self.LblSource;
self.SpecIF_Target = self.LblTarget;
self.SpecIF_Target = self.LblTarget;
self.SpecIF_DataObject = "Objet de Données";
// self.SpecIF_Author = "Auteur";
// self.SpecIF_Authors = "Auteurs";
self.IREB_Stakeholder = "Stakeholder";
self.SpecIF_Responsible = "Responsable";
self.SpecIF_Responsibles = "Responsables";
self.SpecIF_UserRole = "Rôle";
// attribute names used by the Interaction Room:
self.IR_Annotation = "Annotation";
self.IR_AnnotationDescription = "An Interaction-Room '"+self.IR_Annotation+"' indicates a point of special interest. Examples are customer or user value, product features with prominent benefit,effort or challenges during development.";
Expand Down
30 changes: 15 additions & 15 deletions src/config/moduleManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ var app:IApp,
setViewToLeaf( mo, params );
return;

function setViewFromRoot( le:IModule, pL ):void {
function setViewFromRoot( le:IModule, pL:any[] ):void {
// step up, if there is a parent view:
if( le.parent.selectedBy ) {
// all levels get access to the parameters besides view, if needed:
Expand All @@ -455,7 +455,7 @@ var app:IApp,
// set this level's view controller to choose the desired view:
le.parent.ViewControl.show( pL )
}
function setViewToLeaf(le: IModule, pL ):void {
function setViewToLeaf(le: IModule, pL: any[] ):void {
// step down, if there is a child view:
function findDefault(vL: IModule[]): IModule {
for( var i=vL.length-1; i>-1; i-- ) {
Expand Down Expand Up @@ -532,13 +532,13 @@ var app:IApp,
getScript( 'https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js' ); return true;
case "bootstrapDialog": getCss( "https://cdnjs.cloudflare.com/ajax/libs/bootstrap3-dialog/1.35.4/css/bootstrap-dialog.min.css" );
getScript( 'https://cdnjs.cloudflare.com/ajax/libs/bootstrap3-dialog/1.35.4/js/bootstrap-dialog.min.js' ); return true;
case "tree": getCss( "https://cdnjs.cloudflare.com/ajax/libs/jqtree/1.5.3/jqtree.css" );
getScript( 'https://cdnjs.cloudflare.com/ajax/libs/jqtree/1.5.3/tree.jquery.js' ); return true;
case "fileSaver": getScript( 'https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.4/FileSaver.min.js' ); return true;
case "zip": getScript( 'https://cdnjs.cloudflare.com/ajax/libs/jszip/3.6.0/jszip.min.js' ); return true;
case "tree": getCss( "https://cdnjs.cloudflare.com/ajax/libs/jqtree/1.6.1/jqtree.css" );
getScript( 'https://cdnjs.cloudflare.com/ajax/libs/jqtree/1.6.1/tree.jquery.js' ); return true;
case "fileSaver": getScript( 'https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.5/FileSaver.min.js' ); return true;
case "zip": getScript( 'https://cdnjs.cloudflare.com/ajax/libs/jszip/3.7.1/jszip.min.js' ); return true;
case "jsonSchema": getScript( 'https://cdnjs.cloudflare.com/ajax/libs/ajv/4.11.8/ajv.min.js' ); return true;
case "excel": getScript( 'https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.16.8/xlsx.full.min.js' ); return true;
case "bpmnViewer": getScript( 'https://unpkg.com/bpmn-js@7.2.1/dist/bpmn-viewer.production.min.js' ); return true;
case "excel": getScript( 'https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.2/xlsx.full.min.js' ); return true;
case "bpmnViewer": getScript( 'https://unpkg.com/bpmn-js@8.7.3/dist/bpmn-viewer.production.min.js' ); return true;
case "graphViz": // getCss( "https://cdnjs.cloudflare.com/ajax/libs/vis/4.20.1/vis-network.min.css" );
getScript( 'https://cdnjs.cloudflare.com/ajax/libs/vis/4.20.1/vis-network.min.js' ); return true;
// case "pouchDB": getScript( 'https://unpkg.com/browse/[email protected]/dist/pouchdb.min.js' ); return true;
Expand Down Expand Up @@ -641,7 +641,7 @@ var app:IApp,
// case CONFIG.files: getScript( loadPath+'modules/files-0.93.1.js'); return true;

default: console.warn( "Module loader: Module '"+mod+"' is unknown." ); return false;
}
};
};
return false;

Expand All @@ -652,7 +652,7 @@ var app:IApp,
// (third party libraries delivered by CDN have a version in the path);
// it must work for the regular app and the embedded app:
function bust(url: string): string {
return url + (url.startsWith(loadPath) ? "?" + CONFIG.appVersion : "")
return url + (url.startsWith(loadPath) ? "?" + CONFIG.appVersion : "");
}
function getCss( url:string ):void {
$('head').append('<link rel="stylesheet" type="text/css" href="'+bust(url)+'" />' );
Expand Down Expand Up @@ -694,7 +694,7 @@ var app:IApp,
callWhenReady()
else
throw Error("No callback provided to continue after module loading.");
}
};
}
}();
class State {
Expand All @@ -716,13 +716,13 @@ class State {
case undefined:
case true:
this.state = true;
this.hideWhenSet.forEach((v:string):void =>{
this.hideWhenSet.forEach((v: string): void => {
$(v).hide();
});
this.showWhenSet.forEach((v:string):void =>{
this.showWhenSet.forEach((v: string): void => {
$(v).show();
})
}
});
};
}
reset ():void {
this.state = false;
Expand Down
2 changes: 1 addition & 1 deletion src/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
document.body.appendChild(el)
}
let pend=4;
getScript( 'https://code.jquery.com/jquery-3.5.1.min.js' );
getScript( 'https://code.jquery.com/jquery-3.6.0.min.js' );
getScript( './config/definitions.js?'+ Date.now().toString() ); // with cache-busting
getScript( './config/moduleManager.js?'+ Date.now().toString() );
getScript( './'+fileName+'.js?'+ Date.now().toString() );
Expand Down
9 changes: 5 additions & 4 deletions src/edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,11 @@ function editSpecif():IApp {
self.logout
);
};
self.export = function() {
if( !self.cache.selectedProject || !self.cache.selectedProject.data.id )
message.show( i18n.MsgNoProjectLoaded, {severity:'warning', duration:CONFIG.messageDisplayTimeShort} );
self.cache.selectedProject.chooseFormatAndExport();
self.export = function (): void {
if (self.cache.selectedProject && self.cache.selectedProject.isLoaded())
self.cache.selectedProject.chooseFormatAndExport();
else
message.show(i18n.MsgNoProjectLoaded, { severity: 'warning', duration: CONFIG.messageDisplayTimeShort });
};
/* self.updateMe = function() {
self.me.beginUpdate();
Expand Down
8 changes: 4 additions & 4 deletions src/embedded.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function embeddedSpecif():IApp {
};
self.show = function() {
// data and type are valid, but it is necessary to indicate that the data is not zipped:
self.ioSpecif.init( {mediaTypeOf: attachment2mediaType} );
self.ioSpecif.init( {mediaTypeOf: Lib.attachment2mediaType} );
self.ioSpecif.verify( {name:'data.specif'} );

self.busy.set();
Expand All @@ -132,12 +132,12 @@ function embeddedSpecif():IApp {
CONFIG.showTimelag
);
})
.fail( stdError );
.fail( Lib.stdError );
},
stdError
Lib.stdError
);
})
.fail( stdError );
.fail( Lib.stdError );
};
self.logout = function() {
self.me.logout();
Expand Down
Loading

0 comments on commit d960324

Please sign in to comment.