diff --git a/cluedo4KG-sources/.htaccess b/cluedo4KG-sources/.htaccess new file mode 100644 index 0000000000000000000000000000000000000000..970b7a36c50d34763f57b2adec03e79a5a4c5031 --- /dev/null +++ b/cluedo4KG-sources/.htaccess @@ -0,0 +1,47 @@ +# Turn off MultiViews +Options -MultiViews + +# Directive to ensure *.rdf files served as appropriate content type, +# if not present in main apache config +AddType application/rdf+xml .rdf +AddType application/rdf+xml .owl +AddType text/turtle .ttl +AddType application/n-triples .n3 +AddType application/ld+json .jsonld +# Rewrite engine setup +RewriteEngine On +#Change the path to the folder here +RewriteBase /recherches/MELODI/ontologies/cluedo4KG + +# Rewrite rule to serve HTML content from the vocabulary URI if requested +RewriteCond %{HTTP_ACCEPT} !application/rdf\+xml.*(text/html|application/xhtml\+xml) +RewriteCond %{HTTP_ACCEPT} text/html [OR] +RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml [OR] +RewriteCond %{HTTP_USER_AGENT} ^Mozilla/.* +RewriteRule ^$ index-en.html [R=303,L] + +# Rewrite rule to serve JSON-LD content from the vocabulary URI if requested +RewriteCond %{HTTP_ACCEPT} application/ld\+json +RewriteRule ^$ ontology.jsonld [R=303,L] + +# Rewrite rule to serve RDF/XML content from the vocabulary URI if requested +RewriteCond %{HTTP_ACCEPT} \*/\* [OR] +RewriteCond %{HTTP_ACCEPT} application/rdf\+xml +RewriteRule ^$ ontology.rdf [R=303,L] + +# Rewrite rule to serve N-Triples content from the vocabulary URI if requested +RewriteCond %{HTTP_ACCEPT} application/n-triples +RewriteRule ^$ ontology.nt [R=303,L] + +# Rewrite rule to serve TTL content from the vocabulary URI if requested +RewriteCond %{HTTP_ACCEPT} text/turtle [OR] +RewriteCond %{HTTP_ACCEPT} text/\* [OR] +RewriteCond %{HTTP_ACCEPT} \*/turtle +RewriteRule ^$ ontology.ttl [R=303,L] + +RewriteCond %{HTTP_ACCEPT} .+ +RewriteRule ^$ 406.html [R=406,L] +# Default response +# --------------------------- +# Rewrite rule to serve the RDF/XML content from the vocabulary URI by default +RewriteRule ^$ ontology.rdf [R=303,L] \ No newline at end of file diff --git a/cluedo4KG-sources/406.html b/cluedo4KG-sources/406.html new file mode 100644 index 0000000000000000000000000000000000000000..57f42ed75dceef599d3079c01208bf5bcc1dc63a --- /dev/null +++ b/cluedo4KG-sources/406.html @@ -0,0 +1,10 @@ +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> +<html><head> +<title>406 Not Acceptable</title> +</head> +<body> +<h1>Not Acceptable</h1> +<p>An appropriate representation of the requested resource could not be found on this server.</p> + Available variants:<ul><li><a href="index-en.html">html</a></li><li><a href="ontology.jsonld">JSON-LD</a></li><li><a href="ontology.rdf">RDF/XML</a></li><li><a href="ontology.nt">N-Triples</a></li><li><a href="ontology.ttl">TTL</a></li></ul> + +</body></html> \ No newline at end of file diff --git a/cluedo4KG-sources/README.md b/cluedo4KG-sources/README.md index 495f8ff4ac18bb43786835708d33677e346f0eaf..246eeba476a590953c4a75d4cd049d3879f83d9f 100644 --- a/cluedo4KG-sources/README.md +++ b/cluedo4KG-sources/README.md @@ -1,4 +1,34 @@ -The tutorials are available in a Web App. The code is in the folder cluedo4KG-App. +About Widoco output +=================== +The purpose of Widoco is to reuse and integrate existing tools for documentation, plus the set of features listed below: +* Separation of the sections of your html page so you can write them independently and replace only those needed. +* Automatic annotation in RDF-a of the html produced. +* Association of a provenance page which includes the history of your vocabulary (W3C PROV-O compliant). +* Metadata extraction from the ontology plus the means to complete it on the fly when generating your ontology. +* Guidelines on the main sections that your document should have and how to complete them. +Widoco will create 3 different folders: +| +|-provenance (a folder including an html and RDF serialization of how the documentation page was created) +|-resources (folder with the different resources) +|-sections (folder with the different sections of the documentation, separated for easy editing. Just edit one and the main page will be updated) -Specific ressources created for each of the tutorials are in dedicated folders. \ No newline at end of file +Completing ontology metadata. +=================== +Widoco uses the ontology metadata to update a configuration file. If you complete that configuration file (ended up widoco.conf), the tool will enhance your html with additional details, such as how to cite the document, previous revisions, icons with the licence, etc. + +Browser issues +========== +The result of executing Widoco is an html file. We have tested it in Mozilla, IE and Chrome, and when the page is stored in a server all the browsers work correctly. If you view the file locally, we recommend you to use Mozilla Firefox (or Internet Explorer, if you must). Google Chrome will not show the contents correctly, as it doesn't allow XMLHttpRequest without HTTP. If you want to view the page locally with Google Chrome you have two possibilities: + +a) Place the file in a server and access it via its URL (for example, put it in dropbox and access through its public url). + +b) Execute Chrome with the following commands : + +(WIN) chrome.exe --allow-file-access-from-files, + +(OSX) open /Applications/Google\ Chrome.app/ --args --allow-file-access-from-files + +(UNX) /usr/bin/google-chrome --allow-file-access-from-files + +Do you have a problem? open an issue at https://github.com/dgarijo/Widoco \ No newline at end of file diff --git a/cluedo4KG-sources/cluedo4KG b/cluedo4KG-sources/cluedo4KG new file mode 160000 index 0000000000000000000000000000000000000000..b1ce3a629f1f8fc213c21de2d13103b28d00560d --- /dev/null +++ b/cluedo4KG-sources/cluedo4KG @@ -0,0 +1 @@ +Subproject commit b1ce3a629f1f8fc213c21de2d13103b28d00560d diff --git a/cluedo4KG-sources/cluedo4KG-OWLuedo-resources/OWLuedo.zip b/cluedo4KG-sources/cluedo4KG-OWLuedo-resources/OWLuedo.zip deleted file mode 100644 index def4bd52ce96f2bc1fdb2083a3e222d0fb787776..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4KG-OWLuedo-resources/OWLuedo.zip and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4KG-OWLuedo-resources/OWLuedo_EN.pdf b/cluedo4KG-sources/cluedo4KG-OWLuedo-resources/OWLuedo_EN.pdf deleted file mode 100644 index 61c6268516bf7c61327df915c00dd9a150b7b5b2..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4KG-OWLuedo-resources/OWLuedo_EN.pdf and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4KG-OWLuedo-resources/README.md b/cluedo4KG-sources/cluedo4KG-OWLuedo-resources/README.md deleted file mode 100644 index 650fcc8b0a8b7f60e495f7c166f444cb4e79bee8..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4KG-OWLuedo-resources/README.md +++ /dev/null @@ -1,3 +0,0 @@ - -The OWLuedo_EN.pdf file contains the instructions of the tutorial. They are also provided in the cluedo4KG-App. -The OWLuedo.zip archive contains the files needed during the tutorial. \ No newline at end of file diff --git a/cluedo4KG-sources/cluedo4KG-SPARQLuedo-resources/README.md b/cluedo4KG-sources/cluedo4KG-SPARQLuedo-resources/README.md deleted file mode 100644 index 4d174f09a801bc8aa0bcc6d9957de9a5d1490c9c..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4KG-SPARQLuedo-resources/README.md +++ /dev/null @@ -1,3 +0,0 @@ -The cluedo4KG-onto.owl contains the turtle serialization of the ontology used in the cluedo4KG-SPARQLuedo tutorial. The ontology is also available online https://w3id.org/cluedo4KG/onto. - -The cluedo4KG-KG-pasSat.owl contains the turtle serialization of the knowledge graph describing the murder scene. It is also available from our SPARQL endpoint https://w3id.org/cluedo4KG/KG. diff --git a/cluedo4KG-sources/cluedo4KG-SPARQLuedo-resources/cluedo4KG-KG-pasSat.owl b/cluedo4KG-sources/cluedo4KG-SPARQLuedo-resources/cluedo4KG-KG-pasSat.owl deleted file mode 100644 index 346d12ab51a6f7c44ed1f177ab45cada9c24ed4a..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4KG-SPARQLuedo-resources/cluedo4KG-KG-pasSat.owl +++ /dev/null @@ -1,288 +0,0 @@ -@prefix : <https://w3id.org/cluedo4KG/KG#> . -@prefix owl: <http://www.w3.org/2002/07/owl#> . -@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . -@prefix xml: <http://www.w3.org/XML/1998/namespace> . -@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . -@prefix onto: <https://w3id.org/cluedo4KG/onto#> . -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . -@base <https://w3id.org/cluedo4KG/KG> . - -<https://w3id.org/cluedo4KG/KG> a owl:Ontology ; - owl:imports <https://w3id.org/cluedo4KG/onto> . -# -# -# ################################################################# -# # -# # Individuals -# # -# ################################################################# -# -# -# https://w3id.org/cluedo4KG/KG#AldoBermann - -:AldoBermann a owl:NamedIndividual , onto:Personne ; - onto:personneDansPiece :PieceTele ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Aldo Bermann" . -# -# https://w3id.org/cluedo4KG/KG#DustinTime - -:DustinTime a owl:NamedIndividual , onto:Personne ; - onto:personneDansPiece :Salon ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Dustin Time" . -# -# https://w3id.org/cluedo4KG/KG#PaigeTurner - -:PaigeTurner a owl:NamedIndividual , onto:Personne ; - onto:personneDansPiece :Bureau ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Paige Turner" . -# -# https://w3id.org/cluedo4KG/KG#Bureau - -:Bureau a owl:NamedIndividual , onto:Piece ; - onto:aPourPieceVoisine :Chambre , :Couloir , :Salon ; - onto:pieceDansMaison :LaMaisonDuMeurtre ; - rdfs:label "bureau"@fr, "office"@en . -# -# https://w3id.org/cluedo4KG/KG#Chambre - -:Chambre a owl:NamedIndividual , onto:Piece ; - onto:aPourPieceVoisine :Couloir , :SalleDeBain , :Toilette ; - onto:pieceDansMaison :LaMaisonDuMeurtre ; - rdfs:label "chambre"@fr, "bedroom"@en . -# -# https://w3id.org/cluedo4KG/KG#ChambreDEnfant - -:ChambreDEnfant a owl:NamedIndividual , onto:Piece ; - onto:pieceDansMaison :LaFakeMaison ; - rdfs:label "chambre"@fr, "bedroom"@en. -# -# https://w3id.org/cluedo4KG/KG#Chandelier - -:Chandelier a owl:NamedIndividual , onto:Objet ; - onto:objetDansPiece :Salon ; - rdfs:label "chandelier"@fr, "chandelier"@en . -# -# https://w3id.org/cluedo4KG/KG#Couloir - -:Couloir a owl:NamedIndividual , onto:Piece ; - onto:aPourPieceVoisine :Cuisine , :Salon , :Toilette ; - onto:pieceDansMaison :LaMaisonDuMeurtre ; - rdfs:label "couloir"@fr, "corridor"@en . -# -# https://w3id.org/cluedo4KG/KG#Couteau - -:Couteau a owl:NamedIndividual , onto:Objet ; - rdfs:label "couteau"@fr, "knife"@en . -# -# https://w3id.org/cluedo4KG/KG#Cuisine - -:Cuisine a owl:NamedIndividual , onto:Piece ; - onto:aPourPieceVoisine :SalleAManger , :SalleDeBain , :Salon ; - onto:pieceDansMaison :LaMaisonDuMeurtre ; - rdfs:label "cuisine"@fr, "kitchen"@en . -# -# https://w3id.org/cluedo4KG/KG#EauDeJavel - -:EauDeJavel a owl:NamedIndividual , onto:Objet ; - onto:objetDansPiece :Toilette ; - rdfs:label "eau de javel"@fr, "bleach"@en . -# -# https://w3id.org/cluedo4KG/KG#WillBury - -:WillBury a owl:NamedIndividual , onto:Personne ; - onto:personneDansPiece :Toilette ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Will Bury" . -# -# https://w3id.org/cluedo4KG/KG#ClaireVoyan - -:ClaireVoyan a owl:NamedIndividual , onto:Personne ; - onto:personneDansPiece :SalleDeBain ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Claire Voyan" . -# -# https://w3id.org/cluedo4KG/KG#AlBeback - -:AlBeback a owl:NamedIndividual , onto:Personne ; - onto:personneDansPiece :SalleDeJeu ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Al Beback" . -# -# https://w3id.org/cluedo4KG/KG#RickOShea - -:RickOShea a owl:NamedIndividual , onto:Personne ; - onto:personneDansPiece :SalleAManger ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Rick O'Shea" . -# -# https://w3id.org/cluedo4KG/KG#Hall - -:Hall a owl:NamedIndividual , onto:Piece ; - onto:aPourPieceVoisine :SalleAManger , :Salon ; - onto:pieceDansMaison :LaMaisonDuMeurtre ; - rdfs:label "hall"@fr, "entrance hall"@en . -# -# https://w3id.org/cluedo4KG/KG#JackPot - -:JackPot a owl:NamedIndividual , onto:Personne ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Jack Pot" . -# -# https://w3id.org/cluedo4KG/KG#LaFakeMaison - -:LaFakeMaison a owl:NamedIndividual , onto:Maison . -# -# https://w3id.org/cluedo4KG/KG#LaMaisonDuMeurtre - -:LaMaisonDuMeurtre a owl:NamedIndividual , onto:Maison ; - rdfs:label "la maison du meutre"@fr, "the murder house"@en . -# -# https://w3id.org/cluedo4KG/KG#Lacet - -:Lacet a owl:NamedIndividual , onto:Objet ; - onto:objetDansPiece :Toilette ; - rdfs:label "lacet"@fr, "shoelace"@en . -# -# https://w3id.org/cluedo4KG/KG#Livre - -:Livre a owl:NamedIndividual , onto:Objet ; - onto:objetDansPiece :Bureau ; - rdfs:label "livre"@fr, "book"@en . -# -# https://w3id.org/cluedo4KG/KG#AnitaBath - -:AnitaBath a owl:NamedIndividual , onto:Personne ; - onto:personneDansPiece :Salon ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Anita Bath" . -# -# https://w3id.org/cluedo4KG/KG#Marteau - -:Marteau a owl:NamedIndividual , onto:Objet ; - onto:objetDansPiece :Salon ; - rdfs:label "marteau"@fr, "hammer"@en . -# -# https://w3id.org/cluedo4KG/KG#MikeSir - -:MikeSir a owl:NamedIndividual , onto:Personne ; - onto:personneDansPiece :Toilette ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Mike Sir". - -# -# https://w3id.org/cluedo4KG/KG#MikeGod - -:MikeGod a owl:NamedIndividual , onto:Personne ; - onto:personneDansPiece :Toilette ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Mike God". - -# -# https://w3id.org/cluedo4KG/KG#Nokia3310 - -:Nokia3310 a owl:NamedIndividual , onto:Objet ; - onto:objetDansPiece :SalleAManger ; - rdfs:label "Nokia 3310"@fr, "Nokia 3310"@en . -# -# https://w3id.org/cluedo4KG/KG#Oreiller - -:Oreiller a owl:NamedIndividual , onto:Objet ; - onto:objetDansPiece :Chambre ; - rdfs:label "oreiller"@fr, "pillow"@en . -# -# https://w3id.org/cluedo4KG/KG#SueYu - -:SueYu a owl:NamedIndividual , onto:Personne ; - onto:personneDansPiece :SalleAManger ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Sue Yu" . -# -# https://w3id.org/cluedo4KG/KG#PicAGlace - -:PicAGlace a owl:NamedIndividual , onto:Objet ; - onto:objetDansPiece :Cuisine ; - rdfs:label "pic à glace"@fr, "ice pick"@en . -# -# https://w3id.org/cluedo4KG/KG#PieceTele - -:PieceTele a owl:NamedIndividual , onto:Piece ; - onto:pieceDansMaison :LaFakeMaison ; - rdfs:label "pièce télé"@fr, "TV room"@en . -# -# https://w3id.org/cluedo4KG/KG#Poignard - -:Poignard a owl:NamedIndividual , onto:Objet ; - onto:objetDansPiece :Chambre ; - rdfs:label "poignard"@fr, "dagger"@en . -# -# https://w3id.org/cluedo4KG/KG#Revolver - -:Revolver a owl:NamedIndividual , onto:Objet ; - onto:objetDansPiece :Bureau ; - rdfs:label "revolver"@fr,"revolver"@en . -# -# https://w3id.org/cluedo4KG/KG#WarrenPeace - -:WarrenPeace a owl:NamedIndividual , onto:Personne ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Warren Peace". -# -# https://w3id.org/cluedo4KG/KG#SalleAManger - -:SalleAManger a owl:NamedIndividual , onto:Piece ; - onto:aPourPieceVoisine :Cuisine , :Hall , :Salon ; - onto:pieceDansMaison :LaMaisonDuMeurtre ; - rdfs:label "salle à manger"@fr,"dining room"@en . -# -# https://w3id.org/cluedo4KG/KG#SalleDeBain - -:SalleDeBain a owl:NamedIndividual , onto:Piece ; - onto:aPourPieceVoisine :Chambre , :Couloir , :Cuisine , :Toilette ; - onto:pieceDansMaison :LaMaisonDuMeurtre ; - rdfs:label "salle de bain"@fr,"bathroom"@en . -# -# https://w3id.org/cluedo4KG/KG#SalleDeJeu - -:SalleDeJeu a owl:NamedIndividual , onto:Piece ; - onto:pieceDansMaison :LaFakeMaison ; - rdfs:label "salle de jeu"@fr,"games room"@en . -# -# https://w3id.org/cluedo4KG/KG#Salon - -:Salon a owl:NamedIndividual , onto:Piece ; - onto:aPourPieceVoisine :Couloir , :Cuisine , :Hall , :SalleAManger ; - onto:pieceDansMaison :LaMaisonDuMeurtre ; - rdfs:label "salon"@fr, "living room"@en . -# -# https://w3id.org/cluedo4KG/KG#BenDover - -:BenDover a owl:NamedIndividual , onto:Personne ; - onto:personneDansPiece :Hall ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Ben Dover" . -# -# https://w3id.org/cluedo4KG/KG#Toilette - -:Toilette a owl:NamedIndividual , onto:Piece ; - onto:aPourPieceVoisine :Couloir , :SalleDeBain ; - onto:pieceDansMaison :LaMaisonDuMeurtre ; - rdfs:label "toilette"@fr,"toilet"@en . -# -# https://w3id.org/cluedo4KG/KG#SueFlay - -:SueFlay a owl:NamedIndividual , onto:Personne ; - onto:personneDansPiece :Bureau ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Sue Flay" . -# -# https://w3id.org/cluedo4KG/KG#0c7gdr7 - -:0c7gdr7 a owl:NamedIndividual , onto:Personne ; - onto:personneDansPiece :Chambre ; - onto:estVivant "false"^^xsd:boolean ; - rdfs:label "Bud Luck". -# -# Generated by the OWL API (version 4.2.5.20160517-0735) https://github.com/owlcs/owlapi diff --git a/cluedo4KG-sources/cluedo4KG-SPARQLuedo-resources/cluedo4KG-onto.owl b/cluedo4KG-sources/cluedo4KG-SPARQLuedo-resources/cluedo4KG-onto.owl deleted file mode 100644 index 5f9ad4095b0564f4ae0daff863e104753399f486..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4KG-SPARQLuedo-resources/cluedo4KG-onto.owl +++ /dev/null @@ -1,121 +0,0 @@ -@prefix : <https://w3id.org/cluedo4KG/onto#> . -@prefix owl: <http://www.w3.org/2002/07/owl#> . -@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . -@prefix xml: <http://www.w3.org/XML/1998/namespace> . -@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . -@base <https://w3id.org/cluedo4KG/onto> . - -<https://w3id.org/cluedo4KG/onto> rdf:type owl:Ontology ; - rdfs:comment "Cette ontologie a été créée pour être utilisée dans le tutoriel SPARQLUEDO faisant partie de la ressource CLUEDO4KG"@fr, "This ontology was created for use in the SPARQLUEDO tutorial, which is part of the CLUEDO4KG resource."@en; - <http://creativecommons.org/ns#license> <http://creativecommons.org/licenses/by/4.0/> ; - <http://purl.org/dc/terms/creator> "Camille Pradel" , - "Nathalie Hernandez"; - <http://purl.org/dc/terms/issued> "2012-12-01"^^xsd:date ; - <http://purl.org/vocab/vann/preferredNamespacePrefix> "cluedonto"; - <http://purl.org/vocab/vann/preferredNamespaceUri> : ; . - -################################################################# -# Object Properties -################################################################# - -### https://w3id.org/cluedo4KG/onto#aPourPieceVoisine -:aPourPieceVoisine rdf:type owl:ObjectProperty , - owl:SymmetricProperty ; - rdfs:domain :Piece ; - rdfs:range :Piece ; - rdfs:label "a pour pièce voisine"@fr , - "has as neighbour room"@en . - - -### https://w3id.org/cluedo4KG/onto#maisonContientPiece -:maisonContientPiece rdf:type owl:ObjectProperty ; - owl:inverseOf :pieceDansMaison ; - rdfs:domain :Maison ; - rdfs:range :Piece ; - rdfs:label "house contains room"@en , - "maison contient pièce"@fr . - - -### https://w3id.org/cluedo4KG/onto#objetDansPiece -:objetDansPiece rdf:type owl:ObjectProperty ; - owl:inverseOf :pieceContientObjet ; - rdfs:label "object in room"@en , - "objet dans pièce"@fr . - - -### https://w3id.org/cluedo4KG/onto#personneDansPiece -:personneDansPiece rdf:type owl:ObjectProperty ; - owl:inverseOf :pieceContientPersonne ; - rdfs:label "person in room"@en , - "personne dans pièce"@fr . - - -### https://w3id.org/cluedo4KG/onto#pieceContientObjet -:pieceContientObjet rdf:type owl:ObjectProperty ; - rdfs:domain :Piece ; - rdfs:range :Objet ; - rdfs:label "pièce contient objet"@fr , - "room contains object"@en . - - -### https://w3id.org/cluedo4KG/onto#pieceContientPersonne -:pieceContientPersonne rdf:type owl:ObjectProperty ; - rdfs:domain :Piece ; - rdfs:range :Personne ; - rdfs:label "pièce contient personne"@fr , - "room contains person"@en . - - -### https://w3id.org/cluedo4KG/onto#pieceDansMaison -:pieceDansMaison rdf:type owl:ObjectProperty ; - rdfs:label "pièce dans maison"@fr , - "room in house"@en . - - -################################################################# -# Data properties -################################################################# - -### https://w3id.org/cluedo4KG/onto#estVivant -:estVivant rdf:type owl:DatatypeProperty ; - rdfs:domain :Personne ; - rdfs:range xsd:boolean ; - rdfs:comment "indicates whether a person is alive (True) or dead (False)"@en , - "indique si une personne est vivante (True) ou morte (False)"@fr ; - rdfs:label "est vivant"@fr , - "is alive"@en . - - -################################################################# -# Classes -################################################################# - -### https://w3id.org/cluedo4KG/onto#Maison -:Maison rdf:type owl:Class ; - rdfs:comment "house"@en ; - rdfs:label "maison"@fr . - - -### https://w3id.org/cluedo4KG/onto#Objet -:Objet rdf:type owl:Class ; - rdfs:subClassOf owl:Thing ; - rdfs:label "object"@en , - "objet"@fr . - - -### https://w3id.org/cluedo4KG/onto#Personne -:Personne rdf:type owl:Class ; - rdfs:subClassOf owl:Thing ; - rdfs:label "person"@en , - "personne"@fr . - - -### https://w3id.org/cluedo4KG/onto#Piece -:Piece rdf:type owl:Class ; - rdfs:subClassOf owl:Thing ; - rdfs:label "pièce"@fr , - "room"@en . - - -### Generated by the OWL API (version 4.2.5.20160517-0735) https://github.com/owlcs/owlapi diff --git a/cluedo4KG-sources/cluedo4kg-App/Owluedo/.DS_Store b/cluedo4KG-sources/cluedo4kg-App/Owluedo/.DS_Store deleted file mode 100644 index e7a4fc959480d1b20ee14bbcb64f38ea1cad58d0..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Owluedo/.DS_Store and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Owluedo/index-fr.html b/cluedo4KG-sources/cluedo4kg-App/Owluedo/index-fr.html deleted file mode 100644 index 2d3d0862d13903e5651644d215688056dfbc4ad6..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Owluedo/index-fr.html +++ /dev/null @@ -1,75 +0,0 @@ - <!DOCTYPE html> - <html lang="fr"> - <head> - <meta http-equiv="content-type" content="text/html; charset=utf-8" /> - <title>OWLUEDO</title> - <link rel="icon" href="media/ron_blood_038.png" /> - - - - <link rel="stylesheet" type="text/css" href="media/base.css" /> - <link rel="stylesheet" type="text/css" href="media/style.css" /> - - <script type="text/javascript" src="media/script.js" defer></script> - - </head> - - <body> - <p> <b id="lang">FR</b> | <a href="index.html">EN</a> </p> - <div id="consignes"> - <h1>OWLUEDO</h1> - <p>Construisons une ontologie pour résoudre un meurtre !</p> - <p>Dans le tutoriel précédent nous nous sommes intéressés au requêtage de graphes pour résoudre une énigme de type Cluedo. Dans ce TP nous allons nous concentrer sur l'usage de <a href="https://www.w3.org/TR/owl-ref/">OWL</a> pour créer une ontologie fournissant des possibilités de raisonnement qui permettront d'identifier l'assassin d'une nouvelle énigme. Vous utiliserez pour cela le logiciel <a href="http://protege.stanford.edu/">Protégé</a>.</p> - - <form> - <label for="binome1">Binôme 1 :</label> - <input type="text" id="binome1" placeholder="nom du binôme 1" size="30"> - <br> - <label for="binome2">Binôme 2 :</label> - <input type="text" id="binome2" placeholder="nom du binôme 2" size="30"> - <br> - </form> - - <button id="commencer">Commencer</button> - - </div> - - - <div id="enquete"> - - <h1>OWLUEDO</h1> - - <div id="intro"> - <p>Par une sombre nuit d'hiver, <span id="hero1">Pli</span> et <span id="hero2">Plo</span> affrontent le froid et le brouillard pour se rendre à la demeure du <b>Professeur Chabalet</b>. Ils ont été appelés d'urgence car un horrible drame est survenu. Tout ce qu'ils ont compris lors de la communication téléphonique avec le professeur affolé, c'est qu'un meurtre a été commis, et que l'assassin se trouve encore dans la maison.</p> - <p>Ils arrivent maintenant sur place pour élucider cette nouvelle affaire...</p> - </div> - - - <div id="questions"> - <div id="nav"> - <span id="questpred"><</span> <span id="questsuiv">></span> - <p>Question <span id="numquestion"></span> :</p> - </div> - <div id="infoquestion"> - <div id="partie"></div> - <div id="info"></div> - <div id="question"></div> - </div> - </div> - - <div id="ontology"> - - </div> - - - - </div> - - <section id="qui"> - - <p xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/"><a href="https://w3id.org/cluedo4KG/"><span property="dct:title">Cluedo4KG</span></a> by <span property="cc:attributionName">Camille Pradel, William Charles, <a href="https://www.irit.fr/~Nathalie.Hernandez">Nathalie Hernandez</a></span> is licensed under <a href="https://creativecommons.org/licenses/by-nc/4.0/?ref=chooser-v1" target="_blank" rel="license noopener noreferrer" style="display:inline-block;">CC BY-NC 4.0<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1" alt=""><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1" alt=""><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/nc.svg?ref=chooser-v1" alt=""></a></p> - <p>Don't hesitate to get in touch!</p> - </section> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Owluedo/index.html b/cluedo4KG-sources/cluedo4kg-App/Owluedo/index.html deleted file mode 100644 index 8e165ecbf1ed6c9111aa0daaa29c00cdd4b7058b..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Owluedo/index.html +++ /dev/null @@ -1,75 +0,0 @@ - <!DOCTYPE html> - <html lang="fr"> - <head> - <meta http-equiv="content-type" content="text/html; charset=utf-8" /> - <title>OWLUEDO</title> - <link rel="icon" href="media/ron_blood_038.png" /> - - - - <link rel="stylesheet" type="text/css" href="media/base.css" /> - <link rel="stylesheet" type="text/css" href="media/style.css" /> - - <script type="text/javascript" src="media/script.js" defer></script> - - </head> - - <body> - <p> <a href="index-fr.html">FR</a> | <b id="lang">EN</b> </p> - <div id="consignes"> - <h1>OWLUEDO</h1> - <p>Let's build an ontology to solve a murder!</p> - <p>In the previous tutorial we looked at graph querying to solve a Cluedo-type puzzle. In this tutorial we are going to concentrate on the use of <a href="https://www.w3.org/TR/owl-ref/">OWL</a> to create an ontology that provides reasoning capabilities for identifying the killer of a new enigma. You will use the <a href="http://protege.stanford.edu/">Protégé</a> software.</p> - - <form> - <label for="binome1">Name 1 :</label> - <input type="text" id="binome1" placeholder="name 1" size="30"> - <br> - <label for="binome2">Name 2 :</label> - <input type="text" id="binome2" placeholder="name 2" size="30"> - <br> - </form> - - <button id="commencer">Let's get started!</button> - - </div> - - - <div id="enquete"> - - <h1>OWLUEDO</h1> - - <div id="intro"> - <p>On a dark winter's night, <span id="hero1">Pli</span> et <span id="hero2">Plo</span> brave the cold and fog to get to <b>Professor Peace 's</b> house. They were called urgently because a horrible tragedy had occurred. All they understood from the telephone call to the distraught professor was that a murder had been committed, and that the killer was still in the house.</p> - <p>They are now arriving on the scene to solve this new case...</p> - </div> - - - <div id="questions"> - <div id="nav"> - <span id="questpred"><</span> <span id="questsuiv">></span> - <p>Question <span id="numquestion"></span> :</p> - </div> - <div id="infoquestion"> - <div id="partie"></div> - <div id="info"></div> - <div id="question"></div> - </div> - </div> - - <div id="ontology"> - - </div> - - - - </div> - - <section id="qui"> - - <p xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/"><a href="https://w3id.org/cluedo4KG/"><span property="dct:title">Cluedo4KG</span></a> by <span property="cc:attributionName">Camille Pradel, William Charles, <a href="https://www.irit.fr/~Nathalie.Hernandez">Nathalie Hernandez</a></span> is licensed under <a href="https://creativecommons.org/licenses/by-nc/4.0/?ref=chooser-v1" target="_blank" rel="license noopener noreferrer" style="display:inline-block;">CC BY-NC 4.0<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1" alt=""><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1" alt=""><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/nc.svg?ref=chooser-v1" alt=""></a></p> - <p>Don't hesitate to get in touch!</p> - </section> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Owluedo/materiels/OWLuedo.zip b/cluedo4KG-sources/cluedo4kg-App/Owluedo/materiels/OWLuedo.zip deleted file mode 100644 index def4bd52ce96f2bc1fdb2083a3e222d0fb787776..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Owluedo/materiels/OWLuedo.zip and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Owluedo/materiels/OWLuedo_EN.pdf b/cluedo4KG-sources/cluedo4kg-App/Owluedo/materiels/OWLuedo_EN.pdf deleted file mode 100644 index 61c6268516bf7c61327df915c00dd9a150b7b5b2..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Owluedo/materiels/OWLuedo_EN.pdf and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/.DS_Store b/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/.DS_Store deleted file mode 100644 index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/.DS_Store and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/base.css b/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/base.css deleted file mode 100644 index 29958c755474f51b2014f17ed7a1433039223614..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/base.css +++ /dev/null @@ -1,93 +0,0 @@ -/* --- STYLES DE BASE --- */ -/* inspiré de http://www.alsacreations.com/astuce/lire/654-feuille-de-styles-de-base.html */ - -/* Page */ -html { - font-size: 100%; /* Évite un bug d'IE 6-7. (1) */ -} -body { - margin: 0; - padding: 1em; /* Remettre à zéro si nécessaire. */ - /* Pensez à utiliser une collection de polices (2), par ex:*/ - font-family: Arial, Helvetica, sans-serif; - font-size: 1em; /* À adapter pour la police choisie. (3) */ - line-height: 1.4; /* À adapter au design. (4) */ - color: white; - /*background: url('ron_blood_032.png') repeat scroll 0 0 black;*/ - background: black; -} - -/* Titres */ -h1, h2, h3, h4, h5, h6 { - margin: 1em 0 .5em 0; /* Rapproche le titre du texte. (5) */ - line-height: 1.2; - font-weight: normal; /* Valeur par défaut. (6) */ - font-style: normal; - - font:30px/30px Georgia, "Times New Roman", Times, serif; - color:#777; -} -h1 { - font-size: 2.5em; -} -h2 { - font-size: 1.5em; -} -h3 { - font-size: 1.25em; -} -h4 { - font-size: 1em; -} - -/* Listes */ -ul, ol { - margin: .75em 0 .75em 32px; - padding: 0; -} - -/* Paragraphes */ -p { - margin: .75em 0; /* Marges plus faibles que par défaut. (7) */ -} -address { - margin: .75em 0; - font-style: normal; -} - -/* Liens */ -a { - text-decoration: underline; -} -a:link { - color: rgb(164, 164, 245); -} -a:visited { - color: rgb(167, 167, 218); -} -a:hover, a:focus, a:active { - color: rgb(176, 125, 228); -} - -/* Pas de bordure autour des images dans les liens */ -a img { - border: none; -} - -/* Divers éléments de type en-ligne (8) */ -em { - font-style: italic; -} -strong { - font-weight: bold; -} - -/* Formulaires */ -form, fieldset { - margin: 0; - padding: 0; - border: none; -} -input, button, select { - vertical-align: middle; /* Solution pb. d'alignement. (9) */ -} \ No newline at end of file diff --git a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/encrier-nom.jpg b/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/encrier-nom.jpg deleted file mode 100644 index 3dc1933b9e515c4a6d44511fe6c122c65216a347..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/encrier-nom.jpg and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/encrier.jpg b/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/encrier.jpg deleted file mode 100644 index 133cea3f4ab8dd1b30ddf489c6353c1c0be30e3b..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/encrier.jpg and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/loupe.png b/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/loupe.png deleted file mode 100644 index a2633b7a38f6258ae6478988b29fdf50e4e9fe54..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/loupe.png and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/loupe2.avif b/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/loupe2.avif deleted file mode 100644 index 80fa911d906e306fc62a1393a17443d84b72701d..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/loupe2.avif and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/ron_blood_014.png b/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/ron_blood_014.png deleted file mode 100644 index fb65be64ed9ee30de5cae3c384986212e243ba78..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/ron_blood_014.png and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/ron_blood_017.png b/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/ron_blood_017.png deleted file mode 100644 index 28577141cf5900ec2f1c5773fb861b03519f2f02..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/ron_blood_017.png and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/ron_blood_019.png b/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/ron_blood_019.png deleted file mode 100644 index 795ce5c920e8cedfb9be6545b0f32c8c136aa882..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/ron_blood_019.png and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/ron_blood_028.png b/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/ron_blood_028.png deleted file mode 100644 index 691b5f8e9bd245e04f7586dbd48ad65a2be455f2..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/ron_blood_028.png and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/ron_blood_032.png b/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/ron_blood_032.png deleted file mode 100644 index 0704a5a3f9e11df243073401fd7bbb550a3312e3..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/ron_blood_032.png and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/ron_blood_038.png b/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/ron_blood_038.png deleted file mode 100644 index f85fa1e021b57851fc3858690450271dadf93fc8..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/ron_blood_038.png and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/script.js b/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/script.js deleted file mode 100644 index 7ebac3b4f83394daedf9facbe6b9be501c24723e..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/script.js +++ /dev/null @@ -1,68 +0,0 @@ -let turtleArea; -let sparqlResult; -let sparqlEditor; -let currentQuestion = 0; -let prevPart = ""; -let pass = false; - -async function getQuestions(lang = document.querySelector("#lang").textContent) { - const quest = await fetch(`./questionsOWL-${lang}.json`); - return await quest.json(); -} - -getQuestions().then((questions) => { - document.querySelector("#commencer").addEventListener('click', () => { - document.querySelector('#hero1').innerHTML = '<em>' + (document.querySelector('#binome1').value? document.querySelector('#binome1').value:"Bibi")+ '</em>'; - document.querySelector('#hero2').innerHTML = '<em>' + (document.querySelector('#binome2').value?document.querySelector('#binome2').value:"Bibo") + '</em>'; - document.querySelector('#consignes').style.display = 'none'; - document.querySelector('#enquete').style.display = 'block'; - document.querySelector('body').style.background = "url('media/ron_blood_032.png') repeat scroll 0 0 black"; - - updateQuestion(currentQuestion,questions,true); - }); - - - document.querySelector('#questpred').addEventListener('click', () => { - if (currentQuestion > 0) { - currentQuestion--; - updateQuestion(currentQuestion,questions,false); - } - }); - document.querySelector('#questsuiv').addEventListener('click', () => { - if (currentQuestion < questions.length - 1) { - currentQuestion++; - updateQuestion(currentQuestion,questions,true); - } - }); - - //$(document).mousemove(function(e){ - /*document.querySelector('document').addEventListener('mouseover',() =>{ - $('body').css('background-position', '-'+e.pageX/10+'px -'+e.pageY/10+'px'); - }); - */ - -}); - -function updateQuestion(currentQuestion,questions,avance) { - - - if (questions[currentQuestion]["partie"]) { - prevPart = document.querySelector('#partie').innerHTML; - pass = true; - document.querySelector('#partie').innerHTML = questions[currentQuestion]["partie"]; - } - else {if (pass && !avance) document.querySelector('#partie').innerHTML = prevPart; - pass = false; - } - - - - document.querySelector('#numquestion').textContent = currentQuestion + 1; - document.querySelector('#info').innerHTML = questions[currentQuestion]["info"]; - document.querySelector('#question').innerHTML = questions[currentQuestion]["question"]; - document.querySelector('#ontology').innerHTML = (questions[currentQuestion]["image"] ? `<img src="${questions[currentQuestion]["image"]}" alt="protege"` : ""); - - -} - - diff --git a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/style.css b/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/style.css deleted file mode 100644 index 73d2b0fe5542e3a65c5c5931f354397f75226b11..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/style.css +++ /dev/null @@ -1,110 +0,0 @@ -#intro { - margin: 20px 20px 20px 60px; - font-style: italic; -} - -/*#executeSparqlButton{ - width: 1rem; -}*/ -label{ -color: rgb(248, 226, 245); -font-weight: bold; -} - -#home{ - text-align: right; -} - -#consignes,#qui { - width: 80%; - margin: 0 auto; - padding: 30px; - background-color: rgba(66, 22, 22, 0.85); - border-radius: 30px; -} - -#qui{ - margin-top: 1rem; - background-color: rgba(66, 22, 22, 0.85); -} - -#enquete { - display: none; - width: 80%; - margin: 0 auto; - padding: 30px; - background-color: rgba(66, 22, 22, 0.85); - border-radius: 30px; -} - -h1 { - font-family: Tahoma, Geneva, Kalimati, sans-serif; - font-weight: bold; -} - -#partie{ - font-size: larger; - color: bisque; -} - -#info { - padding-left: 10px; - border-left: solid 4px white; -} - -#questions { - vertical-align: top; - display: inline-block; - width: 55%; -} - -#nav p{ - font-size: 1.5em; - margin-top: 0; -} - -#questpred, #questsuiv { - font-size: 3em; - font-family: Tahoma, Geneva, Kalimati, sans-serif; -} - -#questpred:hover, #questsuiv:hover { - cursor: pointer; -} - -#question { - font-weight: bold; -} - -#ontology { - display: inline-block; - margin-left: 4%; - width: 40%; -} - -.CodeMirror { - background-color: #E4CA95; -} - -.CodeMirror { - /*border-top: 1px solid white; - border-bottom: 1px solid white;*/ - height: auto; -} - -.CodeMirror-scroll { - overflow-y: hidden; - overflow-x: auto; - max-height: 20rem; -} - -#sparqlquery .CodeMirror-scroll, #response .CodeMirror-scroll { - /* min-height: 200px;*/ -} - - - -.uri { - font-family: Monaco, "DejaVu Sans Mono", "Lucida Console", "Andale Mono", monospace; - font-size: .8em; -} \ No newline at end of file diff --git a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/tache-de-sang.gif b/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/tache-de-sang.gif deleted file mode 100644 index 5442fa6942b666fe6773013df9a0d58e002f0df6..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Owluedo/media/tache-de-sang.gif and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Owluedo/questionsOWL-EN.json b/cluedo4KG-sources/cluedo4kg-App/Owluedo/questionsOWL-EN.json deleted file mode 100644 index 7dc8cfd6117fd226e87d914e13a6158213bb92ac..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Owluedo/questionsOWL-EN.json +++ /dev/null @@ -1,293 +0,0 @@ -[{ - "partie":"Let's build an ontology to solve the murder !", - "info":"<p>In the previous tutorial we looked at graph querying to solve a Cluedo-like puzzle. In this tutorial, we'll be concentrating on using <a href=\"https://www.w3.org/TR/owl-ref/\">OWL</a> to create an ontology providing reasoning capabilities to identify the murderer of a new puzzle. You'll use the <a href=\"http://protege.stanford.edu/\">Protégé</a> software to do this.</p>", - "question":"<p> Start by downloading <a href=\"http://protege.stanford.edu/\">Protégé</a>, and <a href=\"materiels/OWLuedo.zip\">the tutorial resources</a>.</p>." -}, { - "partie":"Draft Ontology: creating classes", - "info":"<p>The ontology used in the previous tutorial (SPARQLuedo) is extremely lightweight, both in its taxonomy and in the reasoning properties described. The aim is to extend this ontology by modifying Owluedo.owl. Open this file in Protégé.</p>", - "question":"<p></p>" -}, -{ "info": "<p>You need to express the following knowledge as a class hierarchy.</p>", - "question": "<p>An object can be mobile or immobile</p>", - "image": "protege_subClass.jpg" -},{ "info": "<p>You need to express the following knowledge as a class hierarchy.</p>", -"question": "<p>There are five main types of moving object: blunt, sharp, soft, firearm and product</p>" -}, { "info": "<p>You need to express the following knowledge as a class hierarchy.</p>", -"question": "<p>Sharp objects, blunt objects and firearms are weapons, which are themselves considered mobile objects.</p>", -"image": "protege_dragClass.jpg" -}, { "info": "<p>You need to express the following knowledge as a class hierarchy.</p>", -"question": "<p>People can be victims, murderers or innocents.</p>" -}, { "info": "<p>You need to express the following knowledge as a class hierarchy.</p>", -"question": "<p>A house and a room are kinds of places</p>", -"image" : "protege_baseClass.png" -}, { "info": "<p>You need to express the following knowledge as a class hierarchy.</p>", -"question": "<p> Floor is a third kind of place</p>" -}, { "info": "<p>You need to express the following knowledge as a class hierarchy.</p>", -"question": "<p> A product is either a liquid or powder</p>" - - -}, { "info": "<p>You need to express the following knowledge as a class hierarchy.</p>", -"question": "<p> There are several causes of death, divided into injury, drowning and poisoning</p>" - -}, { "info": "<p>You need to express the following knowledge as a class hierarchy.</p>", -"question": "<p> An injury can be caused by a bullet, a sharp object or a blunt object, defining as many injury subclasses</p>" -} - -, { "info": "<p>You need to express the following knowledge in the class description.</p>", -"question": "<p> A murderer can be described alternatively as “killer” or “assassin”</p>", -"image" : "protege_label.png" -}, -{ "info": "<p>You need to express the following knowledge in the class description.</p>", -"question": "<p> In French, murderer is “meurtrier”</p>", -"image" : "protege_language.png" -} - -, { "info": "<p>You need to express the following knowledge as a class hierarchy.</p>", -"question": "<p> A room can contain zones, which are places</p>" -}, -{ - "partie":"Draft Ontology: creating properties", - "info":"<p>Add properties (and possibly additional concepts) to express the following relationships. Some properties will be owl:ObjectProperty, others owl:DatatypeProperty, depending on whether the property links two resources (class instances) or a resource to a literal value (e.g. an integer).</p>", - "question":"" -}, { "info": "<p>You need to define the property to express the following knowledge. Don't forget to define the domain and range.</p>", -"question": "<p> A place can be located in another place.</p>", -"image" : "protege_subProperties.jpg" -}, { "info": "<p>You need to define the property to express the following knowledge. Don't forget to define the domain and range.</p>", -"question": "<p> The roomInHouse property is a special case of a place being located in another place.</p>" -}, { "info": "<p>You need to define the property to express the following knowledge. Don't forget to define the domain and range.</p>", -"question": "<p> In particular, a room can be located on a floor, and a floor is located in a house</p>" -} - -, { "info": "<p>You need to define the property to express the following knowledge. Don't forget to define the domain and range.</p>", -"question": "<p> An area is organized around a stationary object</p>" -} - -, { "info": "<p>You need to define the property to express the following knowledge. Don't forget to define the domain and range.</p>", -"question": "<p> A victim has a cause of death</p>" -} - -, { "info": "<p>You need to define the property to express the following knowledge. Don't forget to define the domain and range.</p>", -"question": "<p> A cause of death is attributable to a moving object</p>" -} - -, { "info": "<p>You need to define the property to express the following knowledge. Don't forget to define the domain and range.</p>", -"question": "<p> An object can be or have been in someone's possession</p>" -}, { "info": "<p>You need to define the property to express the following knowledge. Don't forget to define the domain and range.</p>", -"question": "<p> In particular, it may still be in their possession.</p>" -} - -, { "info": "<p>You need to define the property to express the following knowledge. Don't forget to define the domain and range.</p>", -"question": "<p>A victim has been killed by a murderer</p>" -}, - - -{ "info": "<p>You need to define the property to express the following knowledge. Don't forget to define the domain and range.</p>", -"question": "<p>A person may be or have been in a room (in particular, they may be there now)</p>" -}, - -{ "info": "<p>You need to define the property to express the following knowledge. Don't forget to define the domain and range.</p>", -"question": "<p>A product has a density</p>" -}, - { "info": "<p>You need to define the property to express the following knowledge. Don't forget to define the domain and range.</p>", -"question": "<p>A person has been dead for a certain amount of time (in minutes) at the time of discovery.</p>" -}, -{ - "partie":"Creating and describing instances", - "info":"<p>You're going to describe some facts based on the ontology you've just built. After representing each of the following facts, run the Hermit reasoner, analyze the deductions made in your lab report. Make any necessary modifications to the ontology.</p>", - "question":"" -}, { "info": "", -"question": "<p>The scalpel is in the Greenhouse</p>", -"image" : "protege_individuals.jpg" -}, { "info": "", -"question": "<p>The scalpel and the scalpel are one and the same entity</p>" -}, { "info": "", -"question": "<p>Ana Conda is in the Library</p>" -}, { "info": "", -"question": "<p>The Library is on the second floor</p>" -}, { "info": "", -"question": "<p>Omar Tyr is no longer alive</p>" -}, { "info": "", -"question": "<p>Omar Tyr was discovered 3 minutes after his death</p>" -}, -{ - "partie":"Guided construction and instancing of the heavy ontology", - "info":"<p>As it stands, the ontology allows only a limited number of inferences. The next step is to add additional axioms relating to our classes and properties, in order to enable reasoning to identify the killer.</p>", - "question":"" -},{ "info": "<p>Using class properties, express the following knowledge.</p>", -"question": "<p> Any product is either liquid or powder</p>", -"image" : "union_classProperties.png" -},{ "info": "<p>Using class properties, express the following knowledge.</p>", -"question": "<p> A house cannot be a floor</p>", -"image" : "disjoint_classProperties.png" -},{ "info": "<p>Using class properties, express the following knowledge.</p>", -"question": "<p> A floor cannot be a room</p>" -},{ "info": "<p>Using class properties, express the following knowledge.</p>", -"question": "<p> People can be alternately victim, murderer or innocent</p>" -},{ "info": "<p>Using the characteristics of relations, express the following knowledge.</p>", -"question": "<p> A product can only have one density</p>", -"image" : "objecPropProperties.png" -},{ "info": "<p>Using the characteristics of relations, express the following knowledge.</p>", -"question": "<p> If location A is located in location B and location B is located in location C, then location A is located in location C (use the characteristics of the relation)</p>" -},{ "info": "<p>Using the characteristics of relations, express the following knowledge.</p>", -"question": "<p> A room cannot be its own neighbor</p>" -},{ "info": "<p>Using the characteristics of relations, express the following knowledge.</p>", -"question": "<p> If a room A is a neighbor of B, then B is a neighbor of A</p>" -}, - -{ "info": "<p>Describing class equivalences using <a href=\"http://www.w3.org/TR/owl2-manchester-syntax/\">Manchester syntax</a>, express the following knowledge (NB: it may be necessary to add intermediate classes)</p>", -"question": "<p> A victim is no longer alive</p>", -"image" : "manchesterValue.png" -}, - -{ "info": "<p>Describing class equivalences using <a href=\"http://www.w3.org/TR/owl2-manchester-syntax/\">Manchester syntax</a>, express the following knowledge (NB: it may be necessary to add intermediate classes)</p>", -"question": "<p> A murderer is someone who has killed at least one person</p>", -"image" : "manchesterSome.png" -}, - -{ "info": "<p>Describing class equivalences using <a href=\"http://www.w3.org/TR/owl2-manchester-syntax/\">Manchester syntax</a>, express the following knowledge (NB: it may be necessary to add intermediate classes)</p>", -"question": "<p> A victim has one and only one cause of death</p>", -"image" : "manchesterExactly.png" -}, - -{ "info": "<p>Describing class equivalences using <a href=\"http://www.w3.org/TR/owl2-manchester-syntax/\">Manchester syntax</a>, express the following knowledge (NB: it may be necessary to add intermediate classes)</p>", -"question": "<p>A cause of death by gunshot is due to a firearm</p>" -}, - -{ "info": "<p>Describing class equivalences using <a href=\"http://www.w3.org/TR/owl2-manchester-syntax/\">Manchester syntax</a>, express the following knowledge (NB: it may be necessary to add intermediate classes)</p>", -"question": "<p>A crime scene is a room in which a victim is found</p>" -}, - -{ "info": "<p>Describing class equivalences using <a href=\"http://www.w3.org/TR/owl2-manchester-syntax/\">Manchester syntax</a>, express the following knowledge (NB: it may be necessary to add intermediate classes)</p>", -"question": "<p>A murderer is a person who possessed the object responsible for the murder, and was present in the room where the crime took place</p>" -}, - -{ "info": "<p>Describing class equivalences using <a href=\"http://www.w3.org/TR/owl2-manchester-syntax/\">Manchester syntax</a>, express the following knowledge (NB: it may be necessary to add intermediate classes)</p>", -"question": "<p>A powdered product has a density greater than 2.5 (ua)</p>", -"image" : "manchesterDatatype.png" -}, - -{ "info": "<p>Describing class equivalences using <a href=\"http://www.w3.org/TR/owl2-manchester-syntax/\">Manchester syntax</a>, express the following knowledge (NB: it may be necessary to add intermediate classes)</p>", -"question": "<p>A liquid product has a density of less than 2.5</p>" -}, - -{ "info": "<p>Describing class equivalences using <a href=\"http://www.w3.org/TR/owl2-manchester-syntax/\">Manchester syntax</a>, express the following knowledge (NB: it may be necessary to add intermediate classes)</p>", -"question": "<p>A person shot to death is discovered in less than five minutes</p>" -}, - -{ "info": "<p>Describing class equivalences using <a href=\"http://www.w3.org/TR/owl2-manchester-syntax/\">Manchester syntax</a>, express the following knowledge (NB: it may be necessary to add intermediate classes)</p>", -"question": "<p>A person killed by other means is discovered in more than five minutes</p>" -} -, - -{ "info": "<p>Using property chains, fill in the axioms corresponding to the following assertions</p>", -"question": "<p>If a person is or has been in a place, he or she has been in any containing place</p>", -"image" : "composition.png" -}, - -{ "info": "<p>Using property chains, fill in the axioms corresponding to the following assertions</p>", -"question": "<p>If a room contains an area organized around an object, then it contains said object</p>" -}, - -{ "info": "<p>Using property chains, fill in the axioms corresponding to the following assertions</p>", -"question": "<p>Conversely, if an object is in a room, then the zone of which it is the center is also in the room</p>" -}, -{ "info": "<p>Using property chains, fill in the axioms corresponding to the following assertions</p>", -"question": "<p>If a person owns an object located in a room, that person is also in that room.</p>" -}, -{ "info": "<p>Before attempting to solve the riddle, let's add the following instance facts</p>", -"question": "<p>The greenhouse is a floor</p>" -}, - -{ "info": "<p>Before attempting to solve the riddle, let's add the following instance facts</p>", -"question": "<p>The greenhouse contains the room greenhouse</p>" -}, -{ - "partie":"Laucnhing the reasoner", - "info":"<p>Depending on your representation, you may then get an error when launching the reasoner. What is the source of this error? Suggest a solution.</p>", - "question":"" -}, -{ - "partie":"Populating the ontology with RML", - "info":"<p>We're now going to add a large number of individuals to our ontology, in order to test the reasoner's ability to solve a complex puzzle. You have three .csv files, containing information on people, objects and rooms respectively. To create suitable rdf data, we'll use a mapping. To create this mapping, we'll use the <a href=\"https://app.rml.io/rmleditor/\">RMLEditor graphical interface</a></p>", - "question":"" -}, - -{ "info": "<p> To create the mapping, proceed as follows</p>", -"question": "<p>Accept to add a basic URI. Add a new namespace, corresponding to your ontology's namespace (accessible from Protégé)</p>", -"image" : "RML1.png" -}, - -{ "info": "<p> To create the mapping, proceed as follows</p>", -"question": "<p>Import the .csv files</p>", -"image" : "RML2.png" -} -, - -{ "info": "<p> To create the mapping, proceed as follows</p>", -"question": "<p>For each file, drag and drop the headers of the various concepts. Remember to distinguish between entities (target of ObjectProperty) and literal values (target of DatatypeProperty)</p>", -"image" : "RML3.png" -}, - -{ "info": "<p> To create the mapping, proceed as follows</p>", -"question": "<p>If necessary, use functions on the values contained in the columns to obtain the desired URIs. In particular, make sure that the URIs produced for individuals already defined in the previous step match. Similarly, for objects, the type column corresponds to the object sub-type to which the object in question belongs. You must therefore ensure that the URIs also match.</p>", -"image" : "RML4.png" -}, - -{ "info": "<p> To create the mapping, proceed as follows</p>", -"question": "<p>Use the interface to specify the type of each entity/value. For entities, you can't use the search function, as your ontology isn't available online. Simply copy the class URIs from your ontology and paste them into the interface</p>", -"image" : "RML5.png" -}, - -{ "info": "<p> To create the mapping, proceed as follows</p>", -"question": "<p>Now that you've done that, add the relationships between the various components of the same file. For each, specify the name of the corresponding relationship in your ontology. For object typing, use rdf:type</p>", -"image" : "RML6.png" -}, - -{ "info": "<p> To create the mapping, proceed as follows</p>", -"question": "<p>Once the mapping is complete, start generating the results using the Play button on the right-hand side of the interface. View the results to check their consistency.</p>", -"image" : "RML7.png" -}, - -{ "info": "<p> To create the mapping, proceed as follows</p>", -"question": "<p>When the result is convincing, export it as a Turtle file.</p>", -"image" : "RML8.png" -}, - -{ "info": "<p> Open the resulting Turtle file. Based on what you observe, add the triples representing the following knowledge</p>", -"question": "<p>The Anteater Manor is a house, and it contains four floors (Ground floor, 1st floor, 2nd floor and the Greenhouse floor).</p>" -}, - -{ "info": "<p> Open the resulting Turtle file. Based on what you observe, add the triples representing the following knowledge. Having done this, copy the contents of the Turtle file, and add it manually to your ontology file. Once this has been done, open the file in Protégé.</p>", -"question": "<p>The scaffold for painting is organized around the mural painting</p>" -}, - -{ - "partie":"Puzzle solution", - "info":"<p>Run the reasoner, and observe the inferences. Despite everything we've represented, we still can't infer who the murderer is. This is due to the open-world assumption underlying OWL reasoning. This states that we cannot conclude on the truth of a fact that is not expressed in our knowledge base. In particular, nothing says that the entities described are the only ones to be considered. For example, there may be other firearms in the house that have not yet been discovered. To enable the reasoner to conclude that an individual is guilty, we'll need to add axioms that restrict us to our case study</p", - "question":"" -}, -{ "info": "", -"question": "<p>Declare that there is only one instance of cause of death, which we'll create as a new entity. Synchronize the reasoner, and observe the new inferences</p>" -}, -{ "info": "", -"question": "<p>The reasoner can now infer that the victim was shot. How can he infer which weapon is the murder weapon?</p>" -}, -{ "info": "", -"question": "<p>It can be seen that, while we can now infer who is the murderer and who is the victim, we can't say who is innocent. Suggest a solution.</p>" -}, - -{ - "partie":"Puzzle solution", - "info":"<p>And that's it, now the reasoner can conclude on the status of all the protagonists of our enigma. It should be noted, however, that the methods used to reach this conclusion are limited in their application. At the scale of the Web, an ontology can be reused in multiple knowledge graphs. By axiomatically restricting the instances belonging to a class, we prevent the reusability of our ontology in multiple knowledge graphs. Conclusion: the open-world assumption avoids inferring erroneous facts due to lack of knowledge, but restricts the automatic reasoning enabled by OWL.</p", - "question":"" -} - - - - - - - - - - ] \ No newline at end of file diff --git a/cluedo4KG-sources/cluedo4kg-App/Owluedo/questionsOWL-FR.json b/cluedo4KG-sources/cluedo4kg-App/Owluedo/questionsOWL-FR.json deleted file mode 100644 index afa155f88fad4e3bf03dc2a6bcdc83994fc15906..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Owluedo/questionsOWL-FR.json +++ /dev/null @@ -1,294 +0,0 @@ -[{ - "partie":"Construisons une ontologie pour résoudre un meurtre !", - "info":"", - "question":"<p> Commencez par télécharger le logiciel Protégé <a href=\"http://protege.stanford.edu/\">Protégé</a>, et <a href=\"materiels/OWLuedo.zip\">les ressources du TP</a>.</p>" -}, { - "partie":"Ebauche de l'ontologie légère : créer des classes", - "info":"<p>L'ontologie utilisée dans le TP précédent (SPARQLuedo) est extrêmement légère, que ce soit dans sa taxonomie ou les propriétés de raisonnement décrites. Il s'agira donc d'étendre cette ontologie en modifiant Owluedo.owl. Ouvrez ce fichier dans Protégé.</p>", - "question":"<p></p>" -}, -{ "info": "<p>Vous devez exprimer les connaissances suivantes sous forme de hiérarchie de classes.</p>", - "question": "<p>Un objet peut-être mobile ou immobile</p>", - "image": "protege_subClass.jpg" -},{ "info": "<p>Vous devez exprimer les connaissances suivantes sous forme de hiérarchie de classes.</p>", -"question": "<p>Il existe cinq grand types d'objets mobiles : contondant, tranchant, mou et armes à feu et produit.</p>" -}, { "info": "<p>Vous devez exprimer les connaissances suivantes sous forme de hiérarchie de classes.</p>", -"question": "<p>Les objets tranchants, contondants et armes et feux sont des armes, elles mêmes considérées comme des objets mobiles</p>", -"image": "protege_dragClass.jpg" -}, { "info": "<p>Vous devez exprimer les connaissances suivantes sous forme de hiérarchie de classes.</p>", -"question": "<p>Les personnes peuvent être victime, meurtrier ou innocent</p>" -}, { "info": "<p>Vous devez exprimer les connaissances suivantes sous forme de hiérarchie de classes.</p>", -"question": "<p>Une maison et une pièce sont des sortes de lieux</p>", -"image" : "protege_baseClass.png" -}, { "info": "<p>Vous devez exprimer les connaissances suivantes sous forme de hiérarchie de classes.</p>", -"question": "<p> Etage est un troisième genre de lieu</p>" -}, { "info": "<p>Vous devez exprimer les connaissances suivantes sous forme de hiérarchie de classes.</p>", -"question": "<p> Un produit est soit liquide, soit en poudre</p>" - - -}, { "info": "<p>Vous devez exprimer les connaissances suivantes sous forme de hiérarchie de classes.</p>", -"question": "<p> Il existe plusieurs causes de la mort, qu'on divisera entre blessures, noyade et empoisonnement.</p>" - -}, { "info": "<p>Vous devez exprimer les connaissances suivantes sous forme de hiérarchie de classes.</p>", -"question": "<p> Une blessure peut être causée par une balle, un objet tranchant ou un objet contondant, définissant autant de sous-classes de blessure.</p>" -} - -, { "info": "<p>Vous devez exprimer les connaissances suivantes sous forme de description de classe.</p>", -"question": "<p> Un meurtier peut être qualifié alternativement de \"tueur\" ou d'\"assassin\"</p>", -"image" : "protege_label.png" -}, -{ "info": "<p>Vous devez exprimer les connaissances suivantes sous forme de description de classe.</p>", -"question": "<p> En anglais, meurtrier se dit \"Murderer\"</p>", -"image" : "protege_language.png" -} - -, { "info": "<p>Vous devez exprimer les connaissances suivantes sous forme de hiérarchie de classes.</p>", -"question": "<p> Une pièce peut contenir des zones, qui sont des lieux.</p>" -}, -{ - "partie":"Ebauche de l'ontologie légère : créer des propriétés", - "info":"<p>Ajoutez les propriétés (et éventuellement les concepts supplémentaires) permettant d'exprimer les relations suivantes. Certaines propriétés seront des owl:ObjectProperty, d'autres des owl:DatatypeProperty, selon si la propriété permet de relier deux ressources (instances de classes) ou une ressource à une valeur littérale (ex : un entier).</p>", - "question":"" -}, { "info": "<p>Vous devez définir les propriétés pour décrire les connaissances suivantes. N'oubliez pas de définir le domain et range.</p>", -"question": "<p> Un lieu peut être situé dans un autre lieu.</p>", -"image" : "protege_subProperties.jpg" -}, { "info": "<p>Vous devez définir les propriétés pour décrire les connaissances suivantes. N'oubliez pas de définir le domain et range.</p>", -"question": "<p> La propriété pieceDansMaison est un cas particulier de lieu se situant dans un autre lieu</p>" -}, { "info": "<p>Vous devez définir les propriétés pour décrire les connaissances suivantes. N'oubliez pas de définir le domain et range.</p>", -"question": "<p> En particulier, une pièce peut se situer à un étage, et un étage se situe dans une maison</p>" -} - -, { "info": "<p>Vous devez définir les propriétés pour décrire les connaissances suivantes. N'oubliez pas de définir le domain et range.</p>", -"question": "<p> Une zone est organisée autour d'un objet immobile</p>" -} - -, { "info": "<p>Vous devez définir les propriétés pour décrire les connaissances suivantes. N'oubliez pas de définir le domain et range.</p>", -"question": "<p> Une victime a une cause de décès.</p>" -} - -, { "info": "<p>Vous devez définir les propriétés pour décrire les connaissances suivantes. N'oubliez pas de définir le domain et range.</p>", -"question": "<p> Une cause de la mort est imputable à un objet mobile</p>" -} - -, { "info": "<p>Vous devez définir les propriétés pour décrire les connaissances suivantes. N'oubliez pas de définir le domain et range.</p>", -"question": "<p> Un objet peut être ou avoir été en possession de quelqu'un.</p>" -} -, { "info": "<p>Vous devez définir les propriétés pour décrire les connaissances suivantes. N'oubliez pas de définir le domain et range.</p>", -"question": "<p> En particulier, il peut toujours être en sa possession</p>" -} -, { "info": "<p>Vous devez définir les propriétés pour décrire les connaissances suivantes. N'oubliez pas de définir le domain et range.</p>", -"question": "<p>Une victime a été tuée par un meurtrier</p>" -}, - - -{ "info": "<p>Vous devez définir les propriétés pour décrire les connaissances suivantes. N'oubliez pas de définir le domain et range.</p>", -"question": "<p>Une personne peut se trouver ou s'être trouvé dans une pièce (en particulier elle peut s'y trouver actuellement)</p>" -}, - -{ "info": "<p>Vous devez définir les propriétés pour décrire les connaissances suivantes. N'oubliez pas de définir le domain et range.</p>", -"question": "<p>Un produit a une densité</p>" -}, - { "info": "<p>Vous devez définir les propriétés pour décrire les connaissances suivantes. N'oubliez pas de définir le domain et range.</p>", -"question": "<p>Une personne est morte depuis un certain temps (en minutes) au moment de sa découverte</p>" -}, -{ - "partie":"Créer et décrire des instances", - "info":"<p>Vous allez décrire des faits à partir de l'ébauche d'ontologie que vous venez de construire. Après avoir représenté chacun des faits suivants, lancez le raisonneur Hermit, analysez les déductions faites. Apportez les modifications à l'ontologie si nécessaire.</p>", - "question":"" -}, { "info": "", -"question": "<p>Le scalpel est dans le Serre.</p>", -"image" : "protege_individuals.jpg" -}, { "info": "", -"question": "<p>Le bistouri et le scalpel sont une seule est même entité.</p>" -}, { "info": "", -"question": "<p>Ana Conda est dans la Bibliothèque.</p>" -}, { "info": "", -"question": "<p>La Bibliothèque se trouve au premier étage.</p>" -}, { "info": "", -"question": "<p>Omar Tyr n'est plus en vie.</p>" -}, { "info": "", -"question": "<p>Omar Tyr a été découvert 3 minutes après sa mort.</p>" -}, -{ - "partie":"Construction et peuplement guidés de l'ontologie lourde", - "info":"<p>En l'état actuel, l'ontologie ne permet qu'un nombre limité d'inférences. Il s'agit dans un deuxième temps d'ajouter des axiomes supplémentaires relatifs à nos classes et propriétés afin de permettre un raisonnement permettant l'identification du tueur.</p>", - "question":"" -},{ "info": "<p>En utilisant les propriétés de classe, exprimez les connaissances suivantes.</p>", -"question": "<p> Tout produit est soit liquide, soit en poudre.</p>", -"image" : "union_classProperties.png" -},{ "info": "<p>En utilisant les propriétés de classe, exprimez les connaissances suivantes.</p>", -"question": "<p> Une maison ne peut pas être un étage</p>", -"image" : "disjoint_classProperties.png" -},{ "info": "<p>En utilisant les propriétés de classe, exprimez les connaissances suivantes.</p>", -"question": "<p> Un étage ne peut pas être une pièce</p>" -},{ "info": "<p>En utilisant les propriétés de classe, exprimez les connaissances suivantes.</p>", -"question": "<p> Les personnes peuvent être alternativement victime, meurtrier ou innocent</p>" -},{ "info": "<p>A l'aide des caractéristiques des relations, exprimez les connaissances suivantes.</p>", -"question": "<p> Un produit ne peut avoir qu'une densité</p>", -"image" : "objecPropProperties.png" -},{ "info": "<p>A l'aide des caractéristiques des relations, exprimez les connaissances suivantes.</p>", -"question": "<p> Si un lieu A est situé dans un lieu B et que ce lieu B est situé dans un lieu C, alors le lieu A est situé dans le lieu C</p>" -},{ "info": "<p>A l'aide des caractéristiques des relations, exprimez les connaissances suivantes.</p>", -"question": "<p>Une pièce ne peut pas être sa propre voisine</p>" -},{ "info": "<p>A l'aide des caractéristiques des relations, exprimez les connaissances suivantes.</p>", -"question": "<p> Si une pièce A est voisine de B, alors B est voisine de A</p>" -}, - -{ "info": "<p>En décrivant des équivalences de classe à l'aide de la <a href=\"http://www.w3.org/TR/owl2-manchester-syntax/\">syntaxe de Manchester</a>, exprimez les connaissances suivantes (NB : il est possible qu'il soit nécessaire d'ajouter des classes intermédiaires)</p>", -"question": "<p> Une victime n'est plus en vie.</p>", -"image" : "manchesterValue.png" -}, - -{ "info": "<p>En décrivant des équivalences de classe à l'aide de la <a href=\"http://www.w3.org/TR/owl2-manchester-syntax/\">syntaxe de Manchester</a>, exprimez les connaissances suivantes (NB : il est possible qu'il soit nécessaire d'ajouter des classes intermédiaires)</p>", -"question": "<p> Un meurtrier est quelqu'un qui a tué au moins une personne</p>", -"image" : "manchesterSome.png" -}, - -{ "info": "<p>En décrivant des équivalences de classe à l'aide de la <a href=\"http://www.w3.org/TR/owl2-manchester-syntax/\">syntaxe de Manchester</a>, exprimez les connaissances suivantes (NB : il est possible qu'il soit nécessaire d'ajouter des classes intermédiaires)</p>", -"question": "<p> Une victime a une et une unique cause de la mort.</p>", -"image" : "manchesterExactly.png" -}, - -{ "info": "<p>En décrivant des équivalences de classe à l'aide de la <a href=\"http://www.w3.org/TR/owl2-manchester-syntax/\">syntaxe de Manchester</a>, exprimez les connaissances suivantes (NB : il est possible qu'il soit nécessaire d'ajouter des classes intermédiaires)</p>", -"question": "<p>Une cause de mort par balle est due à une arme à feu</p>" -}, - -{ "info": "<p>En décrivant des équivalences de classe à l'aide de la <a href=\"http://www.w3.org/TR/owl2-manchester-syntax/\">syntaxe de Manchester</a>, exprimez les connaissances suivantes (NB : il est possible qu'il soit nécessaire d'ajouter des classes intermédiaires)</p>", -"question": "<p> Un lieu du crime est une pièce dans laquelle on trouve une victime</p>" -}, - -{ "info": "<p>En décrivant des équivalences de classe à l'aide de la <a href=\"http://www.w3.org/TR/owl2-manchester-syntax/\">syntaxe de Manchester</a>, exprimez les connaissances suivantes (NB : il est possible qu'il soit nécessaire d'ajouter des classes intermédiaires)</p>", -"question": "<p>Un meurtrier est une personne qui a eu en sa possesion l'objet responsable du meurtre, et s'être trouvé dans la pièce où a eu lieu le crime</p>" -}, - -{ "info": "<p>En décrivant des équivalences de classe à l'aide de la <a href=\"http://www.w3.org/TR/owl2-manchester-syntax/\">syntaxe de Manchester</a>, exprimez les connaissances suivantes (NB : il est possible qu'il soit nécessaire d'ajouter des classes intermédiaires)</p>", -"question": "<p>Un produit en poudre a une densité supérieure à 2.5 (ua)</p>", -"image" : "manchesterDatatype.png" -}, - -{ "info": "<p>En décrivant des équivalences de classe à l'aide de la <a href=\"http://www.w3.org/TR/owl2-manchester-syntax/\">syntaxe de Manchester</a>, exprimez les connaissances suivantes (NB : il est possible qu'il soit nécessaire d'ajouter des classes intermédiaires)</p>", -"question": "<p>Un produit liquide a une densité inférieure à 2.5.</p>" -}, - -{ "info": "<p>En décrivant des équivalences de classe à l'aide de la <a href=\"http://www.w3.org/TR/owl2-manchester-syntax/\">syntaxe de Manchester</a>, exprimez les connaissances suivantes (NB : il est possible qu'il soit nécessaire d'ajouter des classes intermédiaires)</p>", -"question": "<p>Une personne tuée par balle est découverte en moins de cinq minutes</p>" -}, - -{ "info": "<p>En décrivant des équivalences de classe à l'aide de la <a href=\"http://www.w3.org/TR/owl2-manchester-syntax/\">syntaxe de Manchester</a>, exprimez les connaissances suivantes (NB : il est possible qu'il soit nécessaire d'ajouter des classes intermédiaires)</p>", -"question": "<p>Une personne tuée autrement est découverte en plus de cinq minutes.</p>" -} -, - -{ "info": "<p>A l'aide des chaînes de propriétés, renseignez les axiomes correspondant aux assertions suivantes.</p>", -"question": "<p>Si une personne est ou a été dans un lieu, elle a été dans tout lieu contenant.</p>", -"image" : "composition.png" -}, - -{ "info": "<p>A l'aide des chaînes de propriétés, renseignez les axiomes correspondant aux assertions suivantes.</p>", -"question": "<p>Si une pièce contient une zone organisée autour d'un objet, alors elle contient ledit objet</p>" -}, - - -{ "info": "<p>A l'aide des chaînes de propriétés, renseignez les axiomes correspondant aux assertions suivantes.</p>", -"question": "<p>A l'inverse, si un objet se trouve dans une pièce, alors la zone dont il est le centre s'y trouve aussi.</p>" -}, -{ "info": "<p>A l'aide des chaînes de propriétés, renseignez les axiomes correspondant aux assertions suivantes.</p>", -"question": "<p>Si une personne possède un objet situé dans une pièce, cette personne se trouve également dans cette pièce.</p>" -}, -{ "info": "<p>Avant de tenter de résoudre l'énigme, ajoutons les faits d'instances suivants</p>", -"question": "<p>La Serre est un étage</p>" -}, - -{ "info": "<p>Avant de tenter de résoudre l'énigme, ajoutons les faits d'instances suivants</p>", -"question": "<p>La Serre contient la pièce Serre</p>" -}, -{ - "partie":"Lançons le raisonneur !", - "info":"<p>Selon votre représentation, il est possible que vous obteniez alors une erreur au lancement du raisonneur. Quelle est la source de cette erreur ? Proposez une solution.</p>", - "question":"" -}, -{ - "partie":"Peuplement de l'ontologie via RML", - "info":"<p>Nous allons à présent ajouter un grand nombre d'individus à notre ontologie afin de tester la résolution d'une énigme complexe à l'aide du raisonneur. Vous disposez des trois fichiers .csv, contenant respectivement les informations relatives auw personnes, aux objets et aux pièces. Afin de créer des données rdf adpatées, nous allons utiliser un mapping. Afin de créer ledit mapping, nous utiliserons l'interface graphique <a href=\"https://app.rml.io/rmleditor/\">RMLEditor</a></p>", - "question":"" -}, - -{ "info": "<p> Afin de réaliser le mapping, procédez comme suit :</p>", -"question": "<p>Acceptez d'ajouter un URI de base. Ajoutez un nouveau namespace, correspondant à l'espace de nom de votre ontologie (accessible depuis Protégé).</p>", -"image" : "RML1.png" -}, - -{ "info": "<p> Afin de réaliser le mapping, procédez comme suit :</p>", -"question": "<p>Import the .csv files</p>", -"image" : "RML2.png" -} -, - -{ "info": "<p> Afin de réaliser le mapping, procédez comme suit :</p>", -"question": "<p>Pour chacun des fichiers, faites glisser les entêtes des différents concepts. Pensez à bien distinguer entre les entités (cibles des ObjectProperty) et les valeurs littérale (cible des DatatypeProperty)</p>", -"image" : "RML3.png" -}, - -{ "info": "<p> Afin de réaliser le mapping, procédez comme suit :</p>", -"question": "<p>Au besoin, passez par l'usage de fonctions sur les valeurs contenues dans les colonnes pour obtenir les URI souhaitées. En particulier, prenez garde à ce que les URI produites pour les individus déjà définis lors de l'étape précédente correspondent. De même, pour les objets, la colonne type correspond au sous-type d'objet auquel appartient l'objet en question. Il faut donc s'assurer que les URI correspondent également.</p>", -"image" : "RML4.png" -}, - -{ "info": "<p> Afin de réaliser le mapping, procédez comme suit :</p>", -"question": "<p>Utilisez l'interface pour spécifier le type de chacune des entités/valeurs. Pour les entités, vous ne pouvez pas utiliser la fonction de recherche car votre ontologie n'est pas disponible en ligne. Il s'agira simplement de copier les URI des classes au sein de votre ontologie, puis de les coller dans l'interface.</p>", -"image" : "RML5.png" -}, - -{ "info": "<p> Afin de réaliser le mapping, procédez comme suit :</p>", -"question": "<p>Ceci étant fait, ajoutez les relations entre les différentes composantes d'un même fichier. Spécifiez pour chacune d'entre elles le nom de la relation correspondant dans votre ontologie. Pour le typage des objets, utilisez rdf:type.</p>", -"image" : "RML6.png" -}, - -{ "info": "<p> Afin de réaliser le mapping, procédez comme suit :</p>", -"question": "<p>Une fois le mapping terminé, lancez la génération des résultats à l'aide du bouton Play button situé à droite de l'interface. Visualisez les résultats pour vérifier leur cohérence.</p>", -"image" : "RML7.png" -}, - -{ "info": "<p> Afin de réaliser le mapping, procédez comme suit :</p>", -"question": "<p> Lorsque le résultat est convaincant, exportez le résultat sous forme de fichier Turtle.</p>", -"image" : "RML8.png" -}, - -{ "info": "<p> Ouvrez le fichier Turtle produit. En vous basant sur ce que vous observez, ajoutez les triplets représentant les connaissances suivantes</p>", -"question": "<p>Le manoir Tamanoir est une maison, et elle contient quatre étages (Rez-de-chaussée, 1er étage, 2ème étage et l'étage Serre).</p>" -}, - -{ "info": "<p> Ouvrez le fichier Turtle produit. En vous basant sur ce que vous observez, ajoutez les triplets représentant les connaissances suivantes. Having done this, copy the contents of the Turtle file, and add it manually to your ontology file. Once this has been done, open the file in Protégé.</p>", -"question": "<p>L'échafaud pour Peinture s'organise autour de la peinture murale.</p>" -}, - -{ - "partie":"Résolution de l'énigme", - "info":"<p>Lancez le raisonneur, et observez les inférences. Malgré tout ce qu'on a représenté, on ne parvient pas en l'état à inférer qui est le meurtrier. Ceci est du à l'hypothèse du monde ouvert qui est sous-jacente au raisonnement avec OWL. Celle-ci stipule qu'on ne peut pas conclure sur la véracité d'un fait qui n'est pas exprimé dans notre base de connaissances. En particulier, rien ne dit que les entités décrites sont les seules à considérer. Il pourrait par exemple exister d'autres armes à feux dans la maison que l'on a pas encore découvertes. Afin de permettre au raisonneur de conclure à la culpabilité d'un individu, il va donc falloir ajouter des axiomes permettant de nous restreindre à notre cas d'étude.</p", - "question":"" -}, -{ "info": "", -"question": "<p>Déclarez qu'il n'existe qu'une unique instance de cause de la mort, qu'on créera comme une nouvelle entité. Synchronisez le raisonneur, et observez les nouvelles inférences.</p>" -}, -{ "info": "", -"question": "<p>Le raisonneur peut désormais inférer que la victime est morte par balle. Que faire pour qu'il puisse inférer quelle arme est l'arme du crime ?</p>" -}, -{ "info": "", -"question": "<p>On constate que, si on peut désormais inférer qui est le meurtrier et qui est la victime, on ne peut pour autant pas dire qui est innocent. Proposez une solution.</p>" -}, - -{ - "partie":"R ́esolution de l’ ́enigme", - "info":"<p>Et voilà, à présent le raisonneur peut conclure sur le statut de tous les protagonistes de notre énigme. On notera toutefois que les méthodes mises en place pour conduire à la conclusion sont limitées dans leur application. En effet, à l'échelle du Web, un ontologie peut être réutilisée dans de multiples graphes de connaissances. En restreignant de manière axiomatique les instances appartenant à une classe, on empêche la réutilisabilité de notre ontologie dans plusieurs graphes de connaissances. Conclusion : l'hypothèse du monde ouvert évite d'inférer des faits erronés par manque de connaissances, mais restreint les raisonnements automatiques permis par OWL.</p", - "question":"" -} - - - - - - - - - - ] \ No newline at end of file diff --git a/cluedo4KG-sources/cluedo4kg-App/README.md b/cluedo4KG-sources/cluedo4kg-App/README.md deleted file mode 100644 index b2c69efa0cea825999e4e6f762e55be61b589f37..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# cluedo4KG-app -The code developed uses HTML, CCS and javascript. - -The only library used in codemirror https://codemirror.net/ for displaying sparql queries and turtle ontology abstracts. - -The code is configurated to used our SPARQL endpoint. -When used on a other SPARQL server, the new endpoint must be indicated in the index.html file and the files provided in cluedo4KG-SPARQLuedo-resources folder must be loaded on the SPARQL server. \ No newline at end of file diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/.DS_Store b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/.DS_Store deleted file mode 100644 index 455a421fcc8ab320135086b517b489dfe247511f..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/.DS_Store and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/catalog-v001.xml b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/catalog-v001.xml deleted file mode 100644 index 072870f5920477837c98b8be20feed26fd755cfb..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/catalog-v001.xml +++ /dev/null @@ -1,5 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<catalog prefer="public" xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"> - <uri id="User Entered Import Resolution" name="https://w3id.org/cluedo4KG/onto" uri="cluedo4KG-onto.owl"/> - <group id="Folder Repository, directory=, recursive=true, Auto-Update=true, version=2" prefer="public" xml:base=""/> -</catalog> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/cluedo4KG-KG-pasSat.owl b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/cluedo4KG-KG-pasSat.owl deleted file mode 100644 index 346d12ab51a6f7c44ed1f177ab45cada9c24ed4a..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/cluedo4KG-KG-pasSat.owl +++ /dev/null @@ -1,288 +0,0 @@ -@prefix : <https://w3id.org/cluedo4KG/KG#> . -@prefix owl: <http://www.w3.org/2002/07/owl#> . -@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . -@prefix xml: <http://www.w3.org/XML/1998/namespace> . -@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . -@prefix onto: <https://w3id.org/cluedo4KG/onto#> . -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . -@base <https://w3id.org/cluedo4KG/KG> . - -<https://w3id.org/cluedo4KG/KG> a owl:Ontology ; - owl:imports <https://w3id.org/cluedo4KG/onto> . -# -# -# ################################################################# -# # -# # Individuals -# # -# ################################################################# -# -# -# https://w3id.org/cluedo4KG/KG#AldoBermann - -:AldoBermann a owl:NamedIndividual , onto:Personne ; - onto:personneDansPiece :PieceTele ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Aldo Bermann" . -# -# https://w3id.org/cluedo4KG/KG#DustinTime - -:DustinTime a owl:NamedIndividual , onto:Personne ; - onto:personneDansPiece :Salon ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Dustin Time" . -# -# https://w3id.org/cluedo4KG/KG#PaigeTurner - -:PaigeTurner a owl:NamedIndividual , onto:Personne ; - onto:personneDansPiece :Bureau ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Paige Turner" . -# -# https://w3id.org/cluedo4KG/KG#Bureau - -:Bureau a owl:NamedIndividual , onto:Piece ; - onto:aPourPieceVoisine :Chambre , :Couloir , :Salon ; - onto:pieceDansMaison :LaMaisonDuMeurtre ; - rdfs:label "bureau"@fr, "office"@en . -# -# https://w3id.org/cluedo4KG/KG#Chambre - -:Chambre a owl:NamedIndividual , onto:Piece ; - onto:aPourPieceVoisine :Couloir , :SalleDeBain , :Toilette ; - onto:pieceDansMaison :LaMaisonDuMeurtre ; - rdfs:label "chambre"@fr, "bedroom"@en . -# -# https://w3id.org/cluedo4KG/KG#ChambreDEnfant - -:ChambreDEnfant a owl:NamedIndividual , onto:Piece ; - onto:pieceDansMaison :LaFakeMaison ; - rdfs:label "chambre"@fr, "bedroom"@en. -# -# https://w3id.org/cluedo4KG/KG#Chandelier - -:Chandelier a owl:NamedIndividual , onto:Objet ; - onto:objetDansPiece :Salon ; - rdfs:label "chandelier"@fr, "chandelier"@en . -# -# https://w3id.org/cluedo4KG/KG#Couloir - -:Couloir a owl:NamedIndividual , onto:Piece ; - onto:aPourPieceVoisine :Cuisine , :Salon , :Toilette ; - onto:pieceDansMaison :LaMaisonDuMeurtre ; - rdfs:label "couloir"@fr, "corridor"@en . -# -# https://w3id.org/cluedo4KG/KG#Couteau - -:Couteau a owl:NamedIndividual , onto:Objet ; - rdfs:label "couteau"@fr, "knife"@en . -# -# https://w3id.org/cluedo4KG/KG#Cuisine - -:Cuisine a owl:NamedIndividual , onto:Piece ; - onto:aPourPieceVoisine :SalleAManger , :SalleDeBain , :Salon ; - onto:pieceDansMaison :LaMaisonDuMeurtre ; - rdfs:label "cuisine"@fr, "kitchen"@en . -# -# https://w3id.org/cluedo4KG/KG#EauDeJavel - -:EauDeJavel a owl:NamedIndividual , onto:Objet ; - onto:objetDansPiece :Toilette ; - rdfs:label "eau de javel"@fr, "bleach"@en . -# -# https://w3id.org/cluedo4KG/KG#WillBury - -:WillBury a owl:NamedIndividual , onto:Personne ; - onto:personneDansPiece :Toilette ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Will Bury" . -# -# https://w3id.org/cluedo4KG/KG#ClaireVoyan - -:ClaireVoyan a owl:NamedIndividual , onto:Personne ; - onto:personneDansPiece :SalleDeBain ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Claire Voyan" . -# -# https://w3id.org/cluedo4KG/KG#AlBeback - -:AlBeback a owl:NamedIndividual , onto:Personne ; - onto:personneDansPiece :SalleDeJeu ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Al Beback" . -# -# https://w3id.org/cluedo4KG/KG#RickOShea - -:RickOShea a owl:NamedIndividual , onto:Personne ; - onto:personneDansPiece :SalleAManger ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Rick O'Shea" . -# -# https://w3id.org/cluedo4KG/KG#Hall - -:Hall a owl:NamedIndividual , onto:Piece ; - onto:aPourPieceVoisine :SalleAManger , :Salon ; - onto:pieceDansMaison :LaMaisonDuMeurtre ; - rdfs:label "hall"@fr, "entrance hall"@en . -# -# https://w3id.org/cluedo4KG/KG#JackPot - -:JackPot a owl:NamedIndividual , onto:Personne ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Jack Pot" . -# -# https://w3id.org/cluedo4KG/KG#LaFakeMaison - -:LaFakeMaison a owl:NamedIndividual , onto:Maison . -# -# https://w3id.org/cluedo4KG/KG#LaMaisonDuMeurtre - -:LaMaisonDuMeurtre a owl:NamedIndividual , onto:Maison ; - rdfs:label "la maison du meutre"@fr, "the murder house"@en . -# -# https://w3id.org/cluedo4KG/KG#Lacet - -:Lacet a owl:NamedIndividual , onto:Objet ; - onto:objetDansPiece :Toilette ; - rdfs:label "lacet"@fr, "shoelace"@en . -# -# https://w3id.org/cluedo4KG/KG#Livre - -:Livre a owl:NamedIndividual , onto:Objet ; - onto:objetDansPiece :Bureau ; - rdfs:label "livre"@fr, "book"@en . -# -# https://w3id.org/cluedo4KG/KG#AnitaBath - -:AnitaBath a owl:NamedIndividual , onto:Personne ; - onto:personneDansPiece :Salon ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Anita Bath" . -# -# https://w3id.org/cluedo4KG/KG#Marteau - -:Marteau a owl:NamedIndividual , onto:Objet ; - onto:objetDansPiece :Salon ; - rdfs:label "marteau"@fr, "hammer"@en . -# -# https://w3id.org/cluedo4KG/KG#MikeSir - -:MikeSir a owl:NamedIndividual , onto:Personne ; - onto:personneDansPiece :Toilette ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Mike Sir". - -# -# https://w3id.org/cluedo4KG/KG#MikeGod - -:MikeGod a owl:NamedIndividual , onto:Personne ; - onto:personneDansPiece :Toilette ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Mike God". - -# -# https://w3id.org/cluedo4KG/KG#Nokia3310 - -:Nokia3310 a owl:NamedIndividual , onto:Objet ; - onto:objetDansPiece :SalleAManger ; - rdfs:label "Nokia 3310"@fr, "Nokia 3310"@en . -# -# https://w3id.org/cluedo4KG/KG#Oreiller - -:Oreiller a owl:NamedIndividual , onto:Objet ; - onto:objetDansPiece :Chambre ; - rdfs:label "oreiller"@fr, "pillow"@en . -# -# https://w3id.org/cluedo4KG/KG#SueYu - -:SueYu a owl:NamedIndividual , onto:Personne ; - onto:personneDansPiece :SalleAManger ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Sue Yu" . -# -# https://w3id.org/cluedo4KG/KG#PicAGlace - -:PicAGlace a owl:NamedIndividual , onto:Objet ; - onto:objetDansPiece :Cuisine ; - rdfs:label "pic à glace"@fr, "ice pick"@en . -# -# https://w3id.org/cluedo4KG/KG#PieceTele - -:PieceTele a owl:NamedIndividual , onto:Piece ; - onto:pieceDansMaison :LaFakeMaison ; - rdfs:label "pièce télé"@fr, "TV room"@en . -# -# https://w3id.org/cluedo4KG/KG#Poignard - -:Poignard a owl:NamedIndividual , onto:Objet ; - onto:objetDansPiece :Chambre ; - rdfs:label "poignard"@fr, "dagger"@en . -# -# https://w3id.org/cluedo4KG/KG#Revolver - -:Revolver a owl:NamedIndividual , onto:Objet ; - onto:objetDansPiece :Bureau ; - rdfs:label "revolver"@fr,"revolver"@en . -# -# https://w3id.org/cluedo4KG/KG#WarrenPeace - -:WarrenPeace a owl:NamedIndividual , onto:Personne ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Warren Peace". -# -# https://w3id.org/cluedo4KG/KG#SalleAManger - -:SalleAManger a owl:NamedIndividual , onto:Piece ; - onto:aPourPieceVoisine :Cuisine , :Hall , :Salon ; - onto:pieceDansMaison :LaMaisonDuMeurtre ; - rdfs:label "salle à manger"@fr,"dining room"@en . -# -# https://w3id.org/cluedo4KG/KG#SalleDeBain - -:SalleDeBain a owl:NamedIndividual , onto:Piece ; - onto:aPourPieceVoisine :Chambre , :Couloir , :Cuisine , :Toilette ; - onto:pieceDansMaison :LaMaisonDuMeurtre ; - rdfs:label "salle de bain"@fr,"bathroom"@en . -# -# https://w3id.org/cluedo4KG/KG#SalleDeJeu - -:SalleDeJeu a owl:NamedIndividual , onto:Piece ; - onto:pieceDansMaison :LaFakeMaison ; - rdfs:label "salle de jeu"@fr,"games room"@en . -# -# https://w3id.org/cluedo4KG/KG#Salon - -:Salon a owl:NamedIndividual , onto:Piece ; - onto:aPourPieceVoisine :Couloir , :Cuisine , :Hall , :SalleAManger ; - onto:pieceDansMaison :LaMaisonDuMeurtre ; - rdfs:label "salon"@fr, "living room"@en . -# -# https://w3id.org/cluedo4KG/KG#BenDover - -:BenDover a owl:NamedIndividual , onto:Personne ; - onto:personneDansPiece :Hall ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Ben Dover" . -# -# https://w3id.org/cluedo4KG/KG#Toilette - -:Toilette a owl:NamedIndividual , onto:Piece ; - onto:aPourPieceVoisine :Couloir , :SalleDeBain ; - onto:pieceDansMaison :LaMaisonDuMeurtre ; - rdfs:label "toilette"@fr,"toilet"@en . -# -# https://w3id.org/cluedo4KG/KG#SueFlay - -:SueFlay a owl:NamedIndividual , onto:Personne ; - onto:personneDansPiece :Bureau ; - onto:estVivant "true"^^xsd:boolean ; - rdfs:label "Sue Flay" . -# -# https://w3id.org/cluedo4KG/KG#0c7gdr7 - -:0c7gdr7 a owl:NamedIndividual , onto:Personne ; - onto:personneDansPiece :Chambre ; - onto:estVivant "false"^^xsd:boolean ; - rdfs:label "Bud Luck". -# -# Generated by the OWL API (version 4.2.5.20160517-0735) https://github.com/owlcs/owlapi diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/index-fr.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/index-fr.html deleted file mode 100644 index 6ce5263cf99533a3e9072116dc360d295285e478..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/index-fr.html +++ /dev/null @@ -1,104 +0,0 @@ - <!DOCTYPE html> - <html lang="fr"> - <head> - <meta http-equiv="content-type" content="text/html; charset=utf-8" /> - <title>SPARQLUEDO</title> - <link rel="icon" href="media/ron_blood_038.png" /> - - <link rel="stylesheet" href="media/codemirror/lib/codemirror.css"> - <script src="media/codemirror/lib/codemirror.js"></script> - <script src="media/codemirror/mode/turtle/turtle.js"></script> - <script src="media/codemirror/mode/sparql/sparql.js"></script> - <script src="media/codemirror/mode/xml/xml.js"></script> - - <link rel="stylesheet" type="text/css" href="media/base.css" /> - <link rel="stylesheet" type="text/css" href="media/style.css" /> - - <script type="text/javascript" src="media/script.js" defer></script> - - </head> - - <body> - <p> <b id="lang">FR</b> | <a href="index.html">EN</a> </p> - <div id="consignes"> - <h1>SPARQLUEDO</h1> - <p>Dans ce tutoriel vous devrez résoudre une enquête au moyen de requêtes SPARQL.</p> - <p>Vos requêtes seront basées sur une ontologie à laquelle <a href="https://w3id.org/cluedo4KG/onto">vous avez accès</a>. Par contre, vous ignorez les données contenues dans le graphes de connaissances et décrivant la scène du crime à partir de cette ontologie. Vous ne pourrez les découvrir qu'au travers du endpoint SPARQL !</p> - <p>Dans la première partie du tutoriel, pour chaque requête que vous devrez formuler, vous trouverez un extrait de l'ontologie contenant les informations utiles à la rédaction de la requête. Vous pouvez également explorer l'ontologie avec Protege.</p> - <p>Lorsqu'une requête doit retourner une ou plusieurs ressources, pensez également à retourner un label (lorsque celui-ci existe) pour chaque ressource.</p> - <p>Ce tutoriel se déroule entièrement au sein d'une interface Web dans laquelle vous pourrez rédiger et exécuter vos requêtes SPARQL. Notez cependant que vos requêtes ne sont pas enregistrées au fur et à mesure que vous les rédigez ; c'est à vous de noter car elles peuvent être utiles pour les questions suivantes.</p> - <form> - <label for="binome1">Binôme 1 :</label> - <input type="text" id="binome1" placeholder="nom du binôme 1" size="30"> - <br> - <label for="binome2">Binôme 2 :</label> - <input type="text" id="binome2" placeholder="nom du binôme 2" size="30"> - <br> - </form> - <button id="commencer">Commencer</button> - </div> - - <div id="enquete"> - - <h1>SPARQLUEDO</h1> - - <div id="intro"> - <p>Par une sombre nuit d'hiver, <span id="hero1">Pli</span> et <span id="hero2">Plo</span> affrontent le froid et le brouillard pour se rendre à la demeure du <b>Professeur Peace</b>. Ils ont été appelés d'urgence car un horrible drame est survenu. Tout ce qu'ils ont compris lors de la communication téléphonique avec le professeur affolé, c'est qu'un meurtre a été commis, et que l'assassin se trouve encore dans la maison.</p> - <p>Ils arrivent maintenant sur place pour élucider cette nouvelle affaire...</p> - </div> - - - <div id="questions"> - <div id="nav"> - <span id="questpred"><</span> <span id="questsuiv">></span> - <p>Question <span id="numquestion"></span> :</p> - </div> - <div id="infoquestion"> - <div id="partie"></div> - <div id="info"></div> - <div id="question"></div> - </div> - </div> - - <div id="ontology"> - Extrait de l'ontologie - <form><textarea id="codeturtle"></textarea></form> - </div> - - - <div id="sparqlquery"> - Votre requête SPARQL - <form> - <textarea id="codesparql" name="codesparql">PREFIX : <https://w3id.org/cluedo4KG/onto#> -PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> -PREFIX xml: <http://www.w3.org/XML/1998/namespace> -PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> -PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> -PREFIX owl: <http://www.w3.org/2002/07/owl#> - -SELECT * WHERE -{ - ?a ?b ?c. -} -LIMIT 10</textarea> - SPARQL endpoint : - <input type="text" id="sparqlendpoint" value="https://cluedo4kg.irit.fr/repositories/sparqluedo" size="70"> - <br> - </form> - </div> - <input type="button" id="executeSparqlButton" src="media/loupe.png" value="Lancer la requête"> - <div id="response"> - Réponse à la requête - <form><textarea id="codexml" name="codexml"></textarea></form> - </div> - - </div> - - <section id="qui"> - - <p xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/"><a href="https://w3id.org/cluedo4KG/"><span property="dct:title">Cluedo4KG</span></a> by <span property="cc:attributionName">Camille Pradel, William Charles, <a href="https://www.irit.fr/~Nathalie.Hernandez">Nathalie Hernandez</a></span> is licensed under <a href="https://creativecommons.org/licenses/by-nc/4.0/?ref=chooser-v1" target="_blank" rel="license noopener noreferrer" style="display:inline-block;">CC BY-NC 4.0<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1" alt=""><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1" alt=""><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/nc.svg?ref=chooser-v1" alt=""></a></p> - <p>Don't hesitate to get in touch!</p> - </section> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/index.html deleted file mode 100644 index 4ee24cdadf268e19bf22e6861245169b0a3b26f3..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/index.html +++ /dev/null @@ -1,104 +0,0 @@ - <!DOCTYPE html> - <html lang="fr"> - <head> - <meta http-equiv="content-type" content="text/html; charset=utf-8" /> - <title>SPARQLUEDO</title> - <link rel="icon" href="media/ron_blood_038.png" /> - - <link rel="stylesheet" href="media/codemirror/lib/codemirror.css"> - <script src="media/codemirror/lib/codemirror.js"></script> - <script src="media/codemirror/mode/turtle/turtle.js"></script> - <script src="media/codemirror/mode/sparql/sparql.js"></script> - <script src="media/codemirror/mode/xml/xml.js"></script> - - <link rel="stylesheet" type="text/css" href="media/base.css" /> - <link rel="stylesheet" type="text/css" href="media/style.css" /> - - <script type="text/javascript" src="media/script.js" defer></script> - - </head> - - <body> - <p> <a href="index-fr.html">FR</a> | <b id="lang">EN</b> </p> - <div id="consignes"> - <h1>SPARQLUEDO</h1> - <p>In this tutorial you will be asked to solve a crime using SPARQL queries.</p> - <p>Your queries will be based on an ontology to which you have <a href="https://w3id.org/cluedo4KG/onto">acces</a>. However, you will ignore the data contained in the knowledge graph describing the crime scene whith this ontology. You will only be able to discover it through the SPARQL endpoint!</p> - <p>In the first part of the tutorial, for each query you have to formulate, you will find an extract from the ontology that you can use to write the expected query. You can also explore the ontology with <a href="https://protege.stanford.edu/">Protege</a>. In the second part, you will be guided to integrated information presented in other public knowledge graphs.</p> - <p>When a query returns one or more resources, remember to return a label (where one exists) for each resource.</p> - <p>This tutorial takes place within the Web interface in which you will write and execute your SPARQL queries. Note, however, that your queries are not saved as you write them; it's up to you to make a note of them, as they may be useful for subsequent questions.</p> - <p>This tutorial can be done by 2 people.</p> - <form> - <label for="binome1">Name 1 :</label> - <input type="text" id="binome1" placeholder="enter name 1" size="30"> - <br> - <label for="binome2">Name 2 :</label> - <input type="text" id="binome2" placeholder="enter name 2" size="30"> - <br> - </form> - <button id="commencer">let's get started</button> - </div> - - <div id="enquete"> - - <h1>SPARQLUEDO</h1> - - <div id="intro"> - <p>On a dark winter's night, <span id="hero1">Pli</span> and <span id="hero2">Plo</span> brave the cold and fog to get to <b>Professor Peace 's</b> house. They were called urgently because a horrible tragedy had occurred. All they understood from the telephone call to the distraught professor was that a murder had been committed, and that the killer was still in the house.</p> - <p>They are now arriving on the scene to solve this new case...</p> - </div> - - - <div id="questions"> - <div id="nav"> - <span id="questpred"><</span> <span id="questsuiv">></span> - <p>Question <span id="numquestion"></span> :</p> - </div> - <div id="infoquestion"> - <div id="partie"></div> - <div id="info"></div> - <div id="question"></div> - </div> - </div> - - <div id="ontology"> - Extract of the ontolgy - <form><textarea id="codeturtle"></textarea></form> - </div> - - - <div id="sparqlquery"> - Your SPARQL query - <form> - <textarea id="codesparql" name="codesparql">PREFIX : <https://w3id.org/cluedo4KG/onto#> -PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> -PREFIX xml: <http://www.w3.org/XML/1998/namespace> -PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> -PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> -PREFIX owl: <http://www.w3.org/2002/07/owl#> - -SELECT * WHERE -{ - ?a ?b ?c. -} -LIMIT 10</textarea> - SPARQL endpoint : - <input type="text" id="sparqlendpoint" value="https://cluedo4kg.irit.fr/repositories/sparqluedo" size="70"> - <br> - </form> - </div> - <input type="button" id="executeSparqlButton" src="media/loupe.png" value="Run the query"> - <div id="response"> - Response to the query - <form><textarea id="codexml" name="codexml"></textarea></form> - </div> - - </div> - - <section id="qui"> - <p xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/"><a href="https://w3id.org/cluedo4KG/"><span property="dct:title">Cluedo4KG</span></a> by <span property="cc:attributionName">Camille Pradel, William Charles, <a href="https://www.irit.fr/~Nathalie.Hernandez">Nathalie Hernandez</a></span> is licensed under <a href="https://creativecommons.org/licenses/by-nc/4.0/?ref=chooser-v1" target="_blank" rel="license noopener noreferrer" style="display:inline-block;">CC BY-NC 4.0<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1" alt=""><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1" alt=""><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/nc.svg?ref=chooser-v1" alt=""></a></p> - <p>Don't hesitate to get in touch!</p> - </section> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/.DS_Store b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/.DS_Store deleted file mode 100644 index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/.DS_Store and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/base.css b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/base.css deleted file mode 100644 index 29958c755474f51b2014f17ed7a1433039223614..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/base.css +++ /dev/null @@ -1,93 +0,0 @@ -/* --- STYLES DE BASE --- */ -/* inspiré de http://www.alsacreations.com/astuce/lire/654-feuille-de-styles-de-base.html */ - -/* Page */ -html { - font-size: 100%; /* Évite un bug d'IE 6-7. (1) */ -} -body { - margin: 0; - padding: 1em; /* Remettre à zéro si nécessaire. */ - /* Pensez à utiliser une collection de polices (2), par ex:*/ - font-family: Arial, Helvetica, sans-serif; - font-size: 1em; /* À adapter pour la police choisie. (3) */ - line-height: 1.4; /* À adapter au design. (4) */ - color: white; - /*background: url('ron_blood_032.png') repeat scroll 0 0 black;*/ - background: black; -} - -/* Titres */ -h1, h2, h3, h4, h5, h6 { - margin: 1em 0 .5em 0; /* Rapproche le titre du texte. (5) */ - line-height: 1.2; - font-weight: normal; /* Valeur par défaut. (6) */ - font-style: normal; - - font:30px/30px Georgia, "Times New Roman", Times, serif; - color:#777; -} -h1 { - font-size: 2.5em; -} -h2 { - font-size: 1.5em; -} -h3 { - font-size: 1.25em; -} -h4 { - font-size: 1em; -} - -/* Listes */ -ul, ol { - margin: .75em 0 .75em 32px; - padding: 0; -} - -/* Paragraphes */ -p { - margin: .75em 0; /* Marges plus faibles que par défaut. (7) */ -} -address { - margin: .75em 0; - font-style: normal; -} - -/* Liens */ -a { - text-decoration: underline; -} -a:link { - color: rgb(164, 164, 245); -} -a:visited { - color: rgb(167, 167, 218); -} -a:hover, a:focus, a:active { - color: rgb(176, 125, 228); -} - -/* Pas de bordure autour des images dans les liens */ -a img { - border: none; -} - -/* Divers éléments de type en-ligne (8) */ -em { - font-style: italic; -} -strong { - font-weight: bold; -} - -/* Formulaires */ -form, fieldset { - margin: 0; - padding: 0; - border: none; -} -input, button, select { - vertical-align: middle; /* Solution pb. d'alignement. (9) */ -} \ No newline at end of file diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/.gitattributes b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/.gitattributes deleted file mode 100644 index f8bdd60f493658c685ae9aa58bc63f4c4ce44789..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/.gitattributes +++ /dev/null @@ -1,8 +0,0 @@ -*.txt text -*.js text -*.html text -*.md text -*.json text -*.yml text -*.css text -*.svg text diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/.gitignore b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/.gitignore deleted file mode 100644 index ea08f9d7858fa67debfb0e1c94f12105b5d9ca7f..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/node_modules -/npm-debug.log -test.html diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/.travis.yml b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/.travis.yml deleted file mode 100644 index baa0031d5003b75b611433c7a8d83cc0e63fc050..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.8 diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/CONTRIBUTING.md b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/CONTRIBUTING.md deleted file mode 100644 index afc18373ccfd61934d1b95764bb40f8351564a7f..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/CONTRIBUTING.md +++ /dev/null @@ -1,70 +0,0 @@ -# How to contribute - -- [Getting help](#getting-help-) -- [Submitting bug reports](#submitting-bug-reports-) -- [Contributing code](#contributing-code-) - -## Getting help [^](#how-to-contribute) - -Community discussion, questions, and informal bug reporting is done on the -[CodeMirror Google group](http://groups.google.com/group/codemirror). - -## Submitting bug reports [^](#how-to-contribute) - -The preferred way to report bugs is to use the -[GitHub issue tracker](http://github.com/marijnh/CodeMirror/issues). Before -reporting a bug, read these pointers. - -**Note:** The issue tracker is for *bugs*, not requests for help. Questions -should be asked on the -[CodeMirror Google group](http://groups.google.com/group/codemirror) instead. - -### Reporting bugs effectively - -- CodeMirror is maintained by volunteers. They don't owe you anything, so be - polite. Reports with an indignant or belligerent tone tend to be moved to the - bottom of the pile. - -- Include information about **the browser in which the problem occurred**. Even - if you tested several browsers, and the problem occurred in all of them, - mention this fact in the bug report. Also include browser version numbers and - the operating system that you're on. - -- Mention which release of CodeMirror you're using. Preferably, try also with - the current development snapshot, to ensure the problem has not already been - fixed. - -- Mention very precisely what went wrong. "X is broken" is not a good bug - report. What did you expect to happen? What happened instead? Describe the - exact steps a maintainer has to take to make the problem occur. We can not - fix something that we can not observe. - -- If the problem can not be reproduced in any of the demos included in the - CodeMirror distribution, please provide an HTML document that demonstrates - the problem. The best way to do this is to go to - [jsbin.com](http://jsbin.com/ihunin/edit), enter it there, press save, and - include the resulting link in your bug report. - -## Contributing code [^](#how-to-contribute) - -- Make sure you have a [GitHub Account](https://github.com/signup/free) -- Fork [CodeMirror](https://github.com/marijnh/CodeMirror/) - ([how to fork a repo](https://help.github.com/articles/fork-a-repo)) -- Make your changes -- If your changes are easy to test or likely to regress, add tests. - Tests for the core go into `test/test.js`, some modes have their own - test suite under `mode/XXX/test.js`. Feel free to add new test - suites to modes that don't have one yet (be sure to link the new - tests into `test/index.html`). -- Make sure all tests pass. Visit `test/index.html` in your browser to - run them. -- Submit a pull request -([how to create a pull request](https://help.github.com/articles/fork-a-repo)) - -### Coding standards - -- 2 spaces per indentation level, no tabs. -- Include semicolons after statements. -- Note that the linter (`test/lint/lint.js`) which is run after each - commit complains about unused variables and functions. Prefix their - names with an underscore to muffle it. diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/LICENSE b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/LICENSE deleted file mode 100644 index 3916e96b2dd2b96c863f9cd8e9709109f67512ed..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (C) 2012 by Marijn Haverbeke <marijnh@gmail.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -Please note that some subdirectories of the CodeMirror distribution -include their own LICENSE files, and are released under different -licences. diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/README.md b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/README.md deleted file mode 100644 index 3e87272fd8bd238a78553355313abe145e23b893..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# CodeMirror [](http://travis-ci.org/marijnh/CodeMirror) - -CodeMirror is a JavaScript component that provides a code editor in -the browser. When a mode is available for the language you are coding -in, it will color your code, and optionally help with indentation. - -The project page is http://codemirror.net -The manual is at http://codemirror.net/doc/manual.html -The contributing guidelines are in the CONTRIBUTING.md file diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/bin/compress b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/bin/compress deleted file mode 100644 index de86ca1f693396a3e259c4c386d83b40e3156ce0..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/bin/compress +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/env node - -// Compression helper for CodeMirror -// -// Example: -// -// bin/compress codemirror runmode javascript xml -// -// Will take lib/codemirror.js, lib/util/runmode.js, -// mode/javascript/javascript.js, and mode/xml/xml.js, run them though -// the online minifier at http://marijnhaverbeke.nl/uglifyjs, and spit -// out the result. -// -// bin/compress codemirror --local /path/to/bin/UglifyJS -// -// Will use a local minifier instead of the online default one. -// -// Script files are specified without .js ending. Prefixing them with -// their full (local) path is optional. So you may say lib/codemirror -// or mode/xml/xml to be more precise. In fact, even the .js suffix -// may be speficied, if wanted. - -"use strict"; - -var fs = require("fs"); - -function help(ok) { - console.log("usage: " + process.argv[1] + " [--local /path/to/uglifyjs] files..."); - process.exit(ok ? 0 : 1); -} - -var local = null, args = null, files = [], blob = ""; - -for (var i = 2; i < process.argv.length; ++i) { - var arg = process.argv[i]; - if (arg == "--local" && i + 1 < process.argv.length) { - var parts = process.argv[++i].split(/\s+/); - local = parts[0]; - args = parts.slice(1); - } else if (arg == "--help") { - help(true); - } else if (arg[0] != "-") { - files.push({name: arg, re: new RegExp("(?:\\/|^)" + arg + (/\.js$/.test(arg) ? "$" : "\\.js$"))}); - } else help(false); -} - -function walk(dir) { - fs.readdirSync(dir).forEach(function(fname) { - if (/^[_\.]/.test(fname)) return; - var file = dir + fname; - if (fs.statSync(file).isDirectory()) return walk(file + "/"); - if (files.some(function(spec, i) { - var match = spec.re.test(file); - if (match) files.splice(i, 1); - return match; - })) { - if (local) args.push(file); - else blob += fs.readFileSync(file, "utf8"); - } - }); -} - -walk("lib/"); -walk("mode/"); - -if (!blob) help(false); - -if (files.length) { - console.log("Some speficied files were not found: " + - files.map(function(a){return a.name;}).join(", ")); - process.exit(1); -} - -if (local) { - require("child_process").spawn(local, args, {stdio: ["ignore", process.stdout, process.stderr]}); -} else { - var data = new Buffer("js_code=" + require("querystring").escape(blob), "utf8"); - var req = require("http").request({ - host: "marijnhaverbeke.nl", - port: 80, - method: "POST", - path: "/uglifyjs", - headers: {"content-type": "application/x-www-form-urlencoded", - "content-length": data.length} - }); - req.on("response", function(resp) { - resp.on("data", function (chunk) { process.stdout.write(chunk); }); - }); - req.end(data); -} diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/activeline.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/activeline.html deleted file mode 100644 index 457d69cad842731dcd9d4d311243cc7a4855ec60..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/activeline.html +++ /dev/null @@ -1,76 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Active Line Demo</title> - <link rel="stylesheet" href="../lib/codemirror.css"> - <script src="../lib/codemirror.js"></script> - <script src="../mode/xml/xml.js"></script> - <link rel="stylesheet" href="../doc/docs.css"> - - <style type="text/css"> - .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;} - .activeline {background: #e8f2ff !important;} - </style> - </head> - <body> - <h1>CodeMirror: Active Line Demo</h1> - - <form><textarea id="code" name="code"> -<?xml version="1.0" encoding="UTF-8"?> -<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" - xmlns:georss="http://www.georss.org/georss" - xmlns:twitter="http://api.twitter.com"> - <channel> - <title>Twitter / codemirror</title> - <link>http://twitter.com/codemirror</link> - <atom:link type="application/rss+xml" - href="http://twitter.com/statuses/user_timeline/242283288.rss" rel="self"/> - <description>Twitter updates from CodeMirror / codemirror.</description> - <language>en-us</language> - <ttl>40</ttl> - <item> - <title>codemirror: http://cloud-ide.com — they're springing up like mushrooms. This one - uses CodeMirror as its editor.</title> - <description>codemirror: http://cloud-ide.com — they're springing up like mushrooms. This - one uses CodeMirror as its editor.</description> - <pubDate>Thu, 17 Mar 2011 23:34:47 +0000</pubDate> - <guid>http://twitter.com/codemirror/statuses/48527733722058752</guid> - <link>http://twitter.com/codemirror/statuses/48527733722058752</link> - <twitter:source>web</twitter:source> - <twitter:place/> - </item> - <item> - <title>codemirror: Posted a description of the CodeMirror 2 internals at - http://codemirror.net/2/internals.html</title> - <description>codemirror: Posted a description of the CodeMirror 2 internals at - http://codemirror.net/2/internals.html</description> - <pubDate>Wed, 02 Mar 2011 12:15:09 +0000</pubDate> - <guid>http://twitter.com/codemirror/statuses/42920879788789760</guid> - <link>http://twitter.com/codemirror/statuses/42920879788789760</link> - <twitter:source>web</twitter:source> - <twitter:place/> - </item> - </channel> -</rss></textarea></form> - - <script> -var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - mode: "application/xml", - lineNumbers: true, - lineWrapping: true -}); -var hlLine = editor.addLineClass(0, "background", "activeline"); -editor.on("cursorActivity", function() { - var cur = editor.getLineHandle(editor.getCursor().line); - if (cur != hlLine) { - editor.removeLineClass(hlLine, "background", "activeline"); - hlLine = editor.addLineClass(cur, "background", "activeline"); - } -}); -</script> - - <p>Styling the current cursor line.</p> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/btree.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/btree.html deleted file mode 100644 index c23a7de52ee3215be73221be0c8e911127d6359b..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/btree.html +++ /dev/null @@ -1,87 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: B-Tree visualization</title> - <link rel="stylesheet" href="../lib/codemirror.css"> - <script src="../lib/codemirror.js"></script> - <link rel="stylesheet" href="../doc/docs.css"> - - <style type="text/css"> - .lineblock { display: inline-block; margin: 1px; height: 5px; } - .CodeMirror {border: 1px solid #aaa; height: 400px} - </style> - </head> - <body> - <h1>CodeMirror: B-Tree visualization</h1> - - <p>Shows a visual representation of the b-tree that CodeMirror - uses to store its document. See - the <a href="http://marijnhaverbeke.nl/blog/codemirror-line-tree.html">corresponding - blog post</a> for a description of this format. The gray blocks - under each leaf show the lines it holds (with their width - representing the line height). Add and remove content to see how - the nodes are split and merged to keep the tree balanced.</p> - - <div style="position: relative"> - <div style="width: 60%; display: inline-block; vertical-align: top"> - <form><textarea id="code" name="code">type here, see a summary of the document b-tree to the right</textarea></form> - </div> - <div style="display: inline-block; height: 402px; overflow-y: auto" id="output"></div> - </div> - - <script id="me"> -var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - lineWrapping: true -}); -var updateTimeout; -editor.on("change", function(cm) { - clearTimeout(updateTimeout); - updateTimeout = setTimeout(updateVisual, 200); -}); -updateVisual(); - -function updateVisual() { - var out = document.getElementById("output"); - out.innerHTML = ""; - - function drawTree(out, node) { - if (node.lines) { - out.appendChild(document.createElement("div")).innerHTML = - "<b>leaf</b>: " + node.lines.length + " lines, " + Math.round(node.height) + " px"; - var lines = out.appendChild(document.createElement("div")); - lines.style.lineHeight = "6px"; lines.style.marginLeft = "10px"; - for (var i = 0; i < node.lines.length; ++i) { - var line = node.lines[i], lineElt = lines.appendChild(document.createElement("div")); - lineElt.className = "lineblock"; - var gray = Math.min(line.text.length * 3, 230), col = gray.toString(16); - if (col.length == 1) col = "0" + col; - lineElt.style.background = "#" + col + col + col; - console.log(line.height, line); - lineElt.style.width = Math.max(Math.round(line.height / 3), 1) + "px"; - } - } else { - out.appendChild(document.createElement("div")).innerHTML = - "<b>node</b>: " + node.size + " lines, " + Math.round(node.height) + " px"; - var sub = out.appendChild(document.createElement("div")); - sub.style.paddingLeft = "20px"; - for (var i = 0; i < node.children.length; ++i) - drawTree(sub, node.children[i]); - } - } - drawTree(out, editor.view.doc); -} - -function fillEditor() { - var sc = document.getElementById("me"); - var doc = (sc.textContent || sc.innerText || sc.innerHTML).replace(/^\s*/, "") + "\n"; - doc += doc; doc += doc; doc += doc; doc += doc; doc += doc; doc += doc; - editor.setValue(doc); -} - </script> - -<p><button onclick="fillEditor()">Add a lot of content</button></p> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/changemode.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/changemode.html deleted file mode 100644 index 364c5cdb07b945f9abcbd382e2a80ef1b729bbb0..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/changemode.html +++ /dev/null @@ -1,50 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Mode-Changing Demo</title> - <link rel="stylesheet" href="../lib/codemirror.css"> - <script src="../lib/codemirror.js"></script> - <script src="../mode/javascript/javascript.js"></script> - <script src="../mode/scheme/scheme.js"></script> - <link rel="stylesheet" href="../doc/docs.css"> - - <style type="text/css"> - .CodeMirror {border: 1px solid black;} - </style> - </head> - <body> - <h1>CodeMirror: Mode-Changing demo</h1> - - <form><textarea id="code" name="code"> -;; If there is Scheme code in here, the editor will be in Scheme mode. -;; If you put in JS instead, it'll switch to JS mode. - -(define (double x) - (* x x)) -</textarea></form> - -<p>On changes to the content of the above editor, a (crude) script -tries to auto-detect the language used, and switches the editor to -either JavaScript or Scheme mode based on that.</p> - -<script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - mode: "scheme", - lineNumbers: true, - tabMode: "indent" - }); - editor.on("change", function() { - clearTimeout(pending); - setTimeout(update, 400); - }); - var pending; - function looksLikeScheme(code) { - return !/^\s*\(\s*function\b/.test(code) && /^\s*[;\(]/.test(code); - } - function update() { - editor.setOption("mode", looksLikeScheme(editor.getValue()) ? "scheme" : "javascript"); - } -</script> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/closetag.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/closetag.html deleted file mode 100644 index c33d10875f753ebb2caf960de8f7ad553ae6075a..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/closetag.html +++ /dev/null @@ -1,37 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Close-Tag Demo</title> - <link rel="stylesheet" href="../lib/codemirror.css"> - <script src="../lib/codemirror.js"></script> - <script src="../lib/util/closetag.js"></script> - <script src="../mode/xml/xml.js"></script> - <script src="../mode/javascript/javascript.js"></script> - <script src="../mode/css/css.js"></script> - <script src="../mode/htmlmixed/htmlmixed.js"></script> - <link rel="stylesheet" href="../doc/docs.css"> - <style type="text/css"> - .CodeMirror {border-top: 1px solid #888; border-bottom: 1px solid #888;} - </style> - </head> - <body> - - <h1>Close-Tag Demo</h1> - <ul> - <li>Type an html tag. When you type '>' or '/', the tag will auto-close/complete. Block-level tags will indent.</li> - <li>There are options for disabling tag closing or customizing the list of tags to indent.</li> - <li>Works with "text/html" (based on htmlmixed.js or xml.js) mode.</li> - <li>View source for key binding details.</li> - </ul> - - <form><textarea id="code" name="code"><html</textarea></form> - - <script type="text/javascript"> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - mode: 'text/html', - autoCloseTags: true - }); - </script> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/complete.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/complete.html deleted file mode 100644 index 13569edf929a4f8b6f617cf0de02304c76a85a1a..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/complete.html +++ /dev/null @@ -1,70 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Autocomplete Demo</title> - <link rel="stylesheet" href="../lib/codemirror.css"> - <script src="../lib/codemirror.js"></script> - <script src="../lib/util/simple-hint.js"></script> - <link rel="stylesheet" href="../lib/util/simple-hint.css"> - <script src="../lib/util/javascript-hint.js"></script> - <script src="../mode/javascript/javascript.js"></script> - <link rel="stylesheet" href="../doc/docs.css"> - </head> - <body> - <h1>CodeMirror: Autocomplete demo</h1> - - <form><textarea id="code" name="code"> -function getCompletions(token, context) { - var found = [], start = token.string; - function maybeAdd(str) { - if (str.indexOf(start) == 0) found.push(str); - } - function gatherCompletions(obj) { - if (typeof obj == "string") forEach(stringProps, maybeAdd); - else if (obj instanceof Array) forEach(arrayProps, maybeAdd); - else if (obj instanceof Function) forEach(funcProps, maybeAdd); - for (var name in obj) maybeAdd(name); - } - - if (context) { - // If this is a property, see if it belongs to some object we can - // find in the current environment. - var obj = context.pop(), base; - if (obj.className == "js-variable") - base = window[obj.string]; - else if (obj.className == "js-string") - base = ""; - else if (obj.className == "js-atom") - base = 1; - while (base != null && context.length) - base = base[context.pop().string]; - if (base != null) gatherCompletions(base); - } - else { - // If not, just look in the window object and any local scope - // (reading into JS mode internals to get at the local variables) - for (var v = token.state.localVars; v; v = v.next) maybeAdd(v.name); - gatherCompletions(window); - forEach(keywords, maybeAdd); - } - return found; -} -</textarea></form> - -<p>Press <strong>ctrl-space</strong> to activate autocompletion. See -the code (<a href="../lib/util/simple-hint.js">here</a> -and <a href="../lib/util/javascript-hint.js">here</a>) to figure out -how it works.</p> - - <script> - CodeMirror.commands.autocomplete = function(cm) { - CodeMirror.simpleHint(cm, CodeMirror.javascriptHint); - } - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - extraKeys: {"Ctrl-Space": "autocomplete"} - }); - </script> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/emacs.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/emacs.html deleted file mode 100644 index b37a46b0487b48216ee23cfe052417fde03294cc..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/emacs.html +++ /dev/null @@ -1,60 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Emacs bindings demo</title> - <link rel="stylesheet" href="../lib/codemirror.css"> - <script src="../lib/codemirror.js"></script> - <script src="../mode/clike/clike.js"></script> - <script src="../keymap/emacs.js"></script> - <link rel="stylesheet" href="../doc/docs.css"> - - <style type="text/css"> - .CodeMirror {border-top: 1px solid #eee; border-bottom: 1px solid #eee;} - </style> - </head> - <body> - <h1>CodeMirror: Emacs bindings demo</h1> - - <form><textarea id="code" name="code"> -#include "syscalls.h" -/* getchar: simple buffered version */ -int getchar(void) -{ - static char buf[BUFSIZ]; - static char *bufp = buf; - static int n = 0; - if (n == 0) { /* buffer is empty */ - n = read(0, buf, sizeof buf); - bufp = buf; - } - return (--n >= 0) ? (unsigned char) *bufp++ : EOF; -} -</textarea></form> - -<p>The emacs keybindings are enabled by -including <a href="../keymap/emacs.js">keymap/emacs.js</a> and setting -the <code>keyMap</code> option to <code>"emacs"</code>. Because -CodeMirror's internal API is quite different from Emacs, they are only -a loose approximation of actual emacs bindings, though.</p> - -<p>Also note that a lot of browsers disallow certain keys from being -captured. For example, Chrome blocks both Ctrl-W and Ctrl-N, with the -result that idiomatic use of Emacs keys will constantly close your tab -or open a new window.</p> - - <script> - CodeMirror.commands.save = function() { - var elt = editor.getWrapperElement(); - elt.style.background = "#def"; - setTimeout(function() { elt.style.background = ""; }, 300); - }; - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - mode: "text/x-csrc", - keyMap: "emacs" - }); - </script> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/folding.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/folding.html deleted file mode 100644 index 89120cb63f1105ecc352f4f9bee534943471a1b3..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/folding.html +++ /dev/null @@ -1,67 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Code Folding Demo</title> - <link rel="stylesheet" href="../lib/codemirror.css"> - <script src="../lib/codemirror.js"></script> - <script src="../lib/util/foldcode.js"></script> - <script src="../mode/javascript/javascript.js"></script> - <script src="../mode/xml/xml.js"></script> - <link rel="stylesheet" href="../doc/docs.css"> - - <style type="text/css"> - .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;} - .CodeMirror-foldmarker { - color: blue; - text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px; - font-family: arial; - line-height: .3; - cursor: pointer; - } - </style> - </head> - <body> - <h1>CodeMirror: Code Folding Demo</h1> - - <p>Demonstration of code folding using the code - in <a href="../lib/util/foldcode.js"><code>foldcode.js</code></a>. - Press ctrl-q or click on the gutter to fold a block, again - to unfold.</p> - <form> - <div style="max-width: 50em; margin-bottom: 1em">JavaScript:<br><textarea id="code" name="code"></textarea></div> - <div style="max-width: 50em">HTML:<br><textarea id="code-html" name="code-html"></textarea></div> - </form> - <script id="script"> -window.onload = function() { - var te = document.getElementById("code"); - var sc = document.getElementById("script"); - te.value = (sc.textContent || sc.innerText || sc.innerHTML).replace(/^\s*/, ""); - sc.innerHTML = ""; - var te_html = document.getElementById("code-html"); - te_html.value = "<html>\n " + document.documentElement.innerHTML + "\n</html>"; - - var foldFunc = CodeMirror.newFoldFunction(CodeMirror.braceRangeFinder); - window.editor = CodeMirror.fromTextArea(te, { - mode: "javascript", - lineNumbers: true, - lineWrapping: true, - extraKeys: {"Ctrl-Q": function(cm){foldFunc(cm, cm.getCursor().line);}} - }); - editor.on("gutterClick", foldFunc); - foldFunc(editor, 9); - - var foldFunc_html = CodeMirror.newFoldFunction(CodeMirror.tagRangeFinder); - window.editor_html = CodeMirror.fromTextArea(te_html, { - mode: "text/html", - lineNumbers: true, - lineWrapping: true, - extraKeys: {"Ctrl-Q": function(cm){foldFunc_html(cm, cm.getCursor().line);}} - }); - editor_html.on("gutterClick", foldFunc_html); - foldFunc_html(editor_html, 11); - foldFunc_html(editor_html, 1); -}; -</script> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/formatting.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/formatting.html deleted file mode 100644 index b9e800d9cf0348cd1c9312c65c7b9e35b6b83c55..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/formatting.html +++ /dev/null @@ -1,81 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Formatting Demo</title> - <link rel="stylesheet" href="../lib/codemirror.css"> - <script src="../lib/codemirror.js"></script> - <script src="../lib/util/formatting.js"></script> - <script src="../mode/css/css.js"></script> - <script src="../mode/xml/xml.js"></script> - <script src="../mode/javascript/javascript.js"></script> - <script src="../mode/htmlmixed/htmlmixed.js"></script> - <link rel="stylesheet" href="../doc/docs.css"> - - <style type="text/css"> - .CodeMirror { - border: 1px solid #eee; - } - td { - padding-right: 20px; - } - </style> - </head> - <body> - <h1>CodeMirror: Formatting demo</h1> - - <form><textarea id="code" name="code"><script> function (s,e){ for(var i=0; i < 1; i++) test("test();a=1");} </script> -<script> -function test(c){ for (var i = 0; i < 10; i++){ process("a.b();c = null;", 300);} -} -</script> -<table><tr><td>test 1</td></tr><tr><td>test 2</td></tr></table> -<script> function test() { return 1;} </script> -<style> .test { font-size: medium; font-family: monospace; } -</style></textarea></form> - -<p>Select a piece of code and click one of the links below to apply automatic formatting to the selected text or comment/uncomment the selected text. Note that the formatting behavior depends on the current block's mode. - <table> - <tr> - <td> - <a href="javascript:autoFormatSelection()"> - Autoformat Selected - </a> - </td> - <td> - <a href="javascript:commentSelection(true)"> - Comment Selected - </a> - </td> - <td> - <a href="javascript:commentSelection(false)"> - Uncomment Selected - </a> - </td> - </tr> - </table> -</p> - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - mode: "htmlmixed" - }); - CodeMirror.commands["selectAll"](editor); - - function getSelectedRange() { - return { from: editor.getCursor(true), to: editor.getCursor(false) }; - } - - function autoFormatSelection() { - var range = getSelectedRange(); - editor.autoFormatRange(range.from, range.to); - } - - function commentSelection(isComment) { - var range = getSelectedRange(); - editor.commentRange(isComment, range.from, range.to); - } - </script> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/fullscreen.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/fullscreen.html deleted file mode 100644 index 2709ebb4b5d22fc11a07db9d86777759f3e458c0..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/fullscreen.html +++ /dev/null @@ -1,147 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Full Screen Editing</title> - <link rel="stylesheet" href="../lib/codemirror.css"> - <script src="../lib/codemirror.js"></script> - <link rel="stylesheet" href="../theme/night.css"> - <script src="../mode/xml/xml.js"></script> - <link rel="stylesheet" href="../doc/docs.css"> - - <style type="text/css"> - .CodeMirror-fullscreen { - display: block; - position: absolute; - top: 0; left: 0; - width: 100%; - z-index: 9999; - } - </style> - </head> - <body> - <h1>CodeMirror: Full Screen Editing</h1> - - <form><textarea id="code" name="code" rows="5"> - <dt id="option_indentWithTabs"><code>indentWithTabs (boolean)</code></dt> - <dd>Whether, when indenting, the first N*8 spaces should be - replaced by N tabs. Default is false.</dd> - - <dt id="option_tabMode"><code>tabMode (string)</code></dt> - <dd>Determines what happens when the user presses the tab key. - Must be one of the following: - <dl> - <dt><code>"classic" (the default)</code></dt> - <dd>When nothing is selected, insert a tab. Otherwise, - behave like the <code>"shift"</code> mode. (When shift is - held, this behaves like the <code>"indent"</code> mode.)</dd> - <dt><code>"shift"</code></dt> - <dd>Indent all selected lines by - one <a href="#option_indentUnit"><code>indentUnit</code></a>. - If shift was held while pressing tab, un-indent all selected - lines one unit.</dd> - <dt><code>"indent"</code></dt> - <dd>Indent the line the 'correctly', based on its syntactic - context. Only works if the - mode <a href="#indent">supports</a> it.</dd> - <dt><code>"default"</code></dt> - <dd>Do not capture tab presses, let the browser apply its - default behaviour (which usually means it skips to the next - control).</dd> - </dl></dd> - - <dt id="option_enterMode"><code>enterMode (string)</code></dt> - <dd>Determines whether and how new lines are indented when the - enter key is pressed. The following modes are supported: - <dl> - <dt><code>"indent" (the default)</code></dt> - <dd>Use the mode's indentation rules to give the new line - the correct indentation.</dd> - <dt><code>"keep"</code></dt> - <dd>Indent the line the same as the previous line.</dd> - <dt><code>"flat"</code></dt> - <dd>Do not indent the new line.</dd> - </dl></dd> - - <dt id="option_enterMode"><code>enterMode (string)</code></dt> - <dd>Determines whether and how new lines are indented when the - enter key is pressed. The following modes are supported: - <dl> - <dt><code>"indent" (the default)</code></dt> - <dd>Use the mode's indentation rules to give the new line - the correct indentation.</dd> - <dt><code>"keep"</code></dt> - <dd>Indent the line the same as the previous line.</dd> - <dt><code>"flat"</code></dt> - <dd>Do not indent the new line.</dd> - </dl></dd> - - <dt id="option_enterMode"><code>enterMode (string)</code></dt> - <dd>Determines whether and how new lines are indented when the - enter key is pressed. The following modes are supported: - <dl> - <dt><code>"indent" (the default)</code></dt> - <dd>Use the mode's indentation rules to give the new line - the correct indentation.</dd> - <dt><code>"keep"</code></dt> - <dd>Indent the line the same as the previous line.</dd> - <dt><code>"flat"</code></dt> - <dd>Do not indent the new line.</dd> - </dl></dd> - - <dt id="option_enterMode"><code>enterMode (string)</code></dt> - <dd>Determines whether and how new lines are indented when the - enter key is pressed. The following modes are supported: - <dl> - <dt><code>"indent" (the default)</code></dt> - <dd>Use the mode's indentation rules to give the new line - the correct indentation.</dd> - <dt><code>"keep"</code></dt> - <dd>Indent the line the same as the previous line.</dd> - <dt><code>"flat"</code></dt> - <dd>Do not indent the new line.</dd> - </dl></dd> - -</textarea></form> - <script> - function isFullScreen(cm) { - return /\bCodeMirror-fullscreen\b/.test(cm.getWrapperElement().className); - } - function winHeight() { - return window.innerHeight || (document.documentElement || document.body).clientHeight; - } - function setFullScreen(cm, full) { - var wrap = cm.getWrapperElement(); - if (full) { - wrap.className += " CodeMirror-fullscreen"; - wrap.style.height = winHeight() + "px"; - document.documentElement.style.overflow = "hidden"; - } else { - wrap.className = wrap.className.replace(" CodeMirror-fullscreen", ""); - wrap.style.height = ""; - document.documentElement.style.overflow = ""; - } - cm.refresh(); - } - CodeMirror.on(window, "resize", function() { - var showing = document.body.getElementsByClassName("CodeMirror-fullscreen")[0]; - if (!showing) return; - showing.CodeMirror.getWrapperElement().style.height = winHeight() + "px"; - }); - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - theme: "night", - extraKeys: { - "F11": function(cm) { - setFullScreen(cm, !isFullScreen(cm)); - }, - "Esc": function(cm) { - if (isFullScreen(cm)) setFullScreen(cm, false); - } - } - }); - </script> - - <p>Press <strong>F11</strong> when cursor is in the editor to toggle full screen editing. <strong>Esc</strong> can also be used to <i>exit</i> full screen editing.</p> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/loadmode.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/loadmode.html deleted file mode 100644 index ffe97e30b60a010cf4573b86a413e9af1e160185..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/loadmode.html +++ /dev/null @@ -1,40 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Lazy Mode Loading Demo</title> - <link rel="stylesheet" href="../lib/codemirror.css"> - <script src="../lib/codemirror.js"></script> - <script src="../lib/util/loadmode.js"></script> - <link rel="stylesheet" href="../doc/docs.css"> - - <style type="text/css"> - .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;} - </style> - </head> - <body> - <h1>CodeMirror: Lazy Mode Loading</h1> - - <form><textarea id="code" name="code">This is the editor. -// It starts out in plain text mode, -# use the control below to load and apply a mode - "you'll see the highlighting of" this text /*change*/. -</textarea></form> -<p><input type=text value=javascript id=mode> <button type=button onclick="change()">change mode</button></p> - - <script> -CodeMirror.modeURL = "../mode/%N/%N.js"; -var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true -}); -var modeInput = document.getElementById("mode"); -CodeMirror.on(modeInput, "keypress", function(e) { - if (e.keyCode == 13) change(); -}); -function change() { - editor.setOption("mode", modeInput.value); - CodeMirror.autoLoadMode(editor, modeInput.value); -} -</script> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/marker.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/marker.html deleted file mode 100644 index f0981e4d5f110892859f28475da295b846686936..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/marker.html +++ /dev/null @@ -1,59 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Breakpoint Demo</title> - <link rel="stylesheet" href="../lib/codemirror.css"> - <script src="../lib/codemirror.js"></script> - <script src="../mode/javascript/javascript.js"></script> - <link rel="stylesheet" href="../doc/docs.css"> - - <style type="text/css"> - .breakpoints {width: .8em;} - .breakpoint { color: #822; } - .CodeMirror {border: 1px solid #aaa;} - </style> - </head> - <body> - <h1>CodeMirror: Breakpoint demo</h1> - - <form><textarea id="code" name="code"> -var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - gutters: ["CodeMirror-linenumbers", "breakpoints"] -}); -editor.on("gutterClick", function(cm, n) { - var info = cm.lineInfo(n); - cm.setGutterMarker(n, "breakpoints", info.markers ? null : makeMarker()); -}); - -function makeMarker() { - var marker = document.createElement("div"); - marker.innerHTML = "●"; - marker.className = "breakpoint"; - return marker; -} -</textarea></form> - -<p>Click the line-number gutter to add or remove 'breakpoints'.</p> - - <script> -var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - gutters: ["CodeMirror-linenumbers", "breakpoints"] -}); -editor.on("gutterClick", function(cm, n) { - var info = cm.lineInfo(n); - cm.setGutterMarker(n, "breakpoints", info.gutterMarkers ? null : makeMarker()); -}); - -function makeMarker() { - var marker = document.createElement("div"); - marker.style.color = "#822"; - marker.innerHTML = "●"; - return marker; -} - </script> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/matchhighlighter.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/matchhighlighter.html deleted file mode 100644 index c8a4bdf986e55f01a0902e5d40306a242bbfd80a..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/matchhighlighter.html +++ /dev/null @@ -1,36 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Match Highlighter Demo</title> - <link rel="stylesheet" href="../lib/codemirror.css"> - <script src="../lib/codemirror.js"></script> - <script src="../lib/util/searchcursor.js"></script> - <script src="../lib/util/match-highlighter.js"></script> - <link rel="stylesheet" href="../doc/docs.css"> - - <style type="text/css"> - .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;} - - span.CodeMirror-matchhighlight { background: #e9e9e9 } - .CodeMirror-focused span.CodeMirror-matchhighlight { background: #e7e4ff; !important } - </style> - </head> - <body> - <h1>CodeMirror: Match Highlighter Demo</h1> - - <form><textarea id="code" name="code">Select this text: hardToSpotVar - And everywhere else in your code where hardToSpotVar appears will automatically illuminate. -Give it a try! No more hardToSpotVars.</textarea></form> - - <script> -var editor = CodeMirror.fromTextArea(document.getElementById("code"), {lineNumbers : true}); -editor.on("cursorActivity", function() { - editor.matchHighlight("CodeMirror-matchhighlight"); -}); -</script> - - <p>Highlight matches of selected text on select</p> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/multiplex.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/multiplex.html deleted file mode 100644 index 25fffd32942128be719e24569570fc5883ffdb3b..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/multiplex.html +++ /dev/null @@ -1,60 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Multiplexing Parser Demo</title> - <link rel="stylesheet" href="../lib/codemirror.css"> - <script src="../lib/codemirror.js"></script> - <script src="../lib/util/multiplex.js"></script> - <script src="../mode/xml/xml.js"></script> - <link rel="stylesheet" href="../doc/docs.css"> - - <style type="text/css"> - .CodeMirror {border: 1px solid black;} - .cm-delimit {color: #fa4;} - </style> - </head> - <body> - <h1>CodeMirror: Multiplexing Parser Demo</h1> - - <form><textarea id="code" name="code"> -<html> - <body style="<<magic>>"> - <h1><< this is not <html >></h1> - << - multiline - not html - at all : &amp; <link/> - >> - <p>this is html again</p> - </body> -</html> -</textarea></form> - - <script> -CodeMirror.defineMode("demo", function(config) { - return CodeMirror.multiplexingMode( - CodeMirror.getMode(config, "text/html"), - {open: "<<", close: ">>", - mode: CodeMirror.getMode(config, "text/plain"), - delimStyle: "delimit"} - // .. more multiplexed styles can follow here - ); -}); -var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - mode: "demo", - lineNumbers: true, - lineWrapping: true -}); -</script> - - <p>Demonstration of a multiplexing mode, which, at certain - boundary strings, switches to one or more inner modes. The out - (HTML) mode does not get fed the content of the <code><< - >></code> blocks. See - the <a href="../doc/manual.html#util_multiplex">manual</a> and - the <a href="../lib/util/multiplex.js">source</a> for more - information.</p> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/mustache.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/mustache.html deleted file mode 100644 index c2ce331077f18af1b5c122d2ace2b6c6ebf7f5e4..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/mustache.html +++ /dev/null @@ -1,59 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Overlay Parser Demo</title> - <link rel="stylesheet" href="../lib/codemirror.css"> - <script src="../lib/codemirror.js"></script> - <script src="../lib/util/overlay.js"></script> - <script src="../mode/xml/xml.js"></script> - <link rel="stylesheet" href="../doc/docs.css"> - - <style type="text/css"> - .CodeMirror {border: 1px solid black;} - .cm-mustache {color: #0ca;} - </style> - </head> - <body> - <h1>CodeMirror: Overlay Parser Demo</h1> - - <form><textarea id="code" name="code"> -<html> - <body> - <h1>{{title}}</h1> - <p>These are links to {{things}}:</p> - <ul>{{#links}} - <li><a href="{{url}}">{{text}}</a></li> - {{/links}}</ul> - </body> -</html> -</textarea></form> - - <script> -CodeMirror.defineMode("mustache", function(config, parserConfig) { - var mustacheOverlay = { - token: function(stream, state) { - var ch; - if (stream.match("{{")) { - while ((ch = stream.next()) != null) - if (ch == "}" && stream.next() == "}") break; - stream.eat("}"); - return "mustache"; - } - while (stream.next() != null && !stream.match("{{", false)) {} - return null; - } - }; - return CodeMirror.overlayMode(CodeMirror.getMode(config, parserConfig.backdrop || "text/html"), mustacheOverlay); -}); -var editor = CodeMirror.fromTextArea(document.getElementById("code"), {mode: "mustache"}); -</script> - - <p>Demonstration of a mode that parses HTML, highlighting - the <a href="http://mustache.github.com/">Mustache</a> templating - directives inside of it by using the code - in <a href="../lib/util/overlay.js"><code>overlay.js</code></a>. View - source to see the 15 lines of code needed to accomplish this.</p> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/preview.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/preview.html deleted file mode 100644 index f70cdb009a309283b007fa00f94001dea1fed262..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/preview.html +++ /dev/null @@ -1,76 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: HTML5 preview</title> - <script src=../lib/codemirror.js></script> - <script src=../mode/xml/xml.js></script> - <script src=../mode/javascript/javascript.js></script> - <script src=../mode/css/css.js></script> - <script src=../mode/htmlmixed/htmlmixed.js></script> - <link rel=stylesheet href=../lib/codemirror.css> - <link rel=stylesheet href=../doc/docs.css> - <style type=text/css> - .CodeMirror { - float: left; - width: 50%; - border: 1px solid black; - } - iframe { - width: 49%; - float: left; - height: 300px; - border: 1px solid black; - border-left: 0px; - } - </style> - </head> - <body> - <h1>CodeMirror: HTML5 preview</h1> - <textarea id=code name=code> -<!doctype html> -<html> - <head> - <meta charset=utf-8> - <title>HTML5 canvas demo</title> - <style>p {font-family: monospace;}</style> - </head> - <body> - <p>Canvas pane goes here:</p> - <canvas id=pane width=300 height=200></canvas> - <script> - var canvas = document.getElementById('pane'); - var context = canvas.getContext('2d'); - - context.fillStyle = 'rgb(250,0,0)'; - context.fillRect(10, 10, 55, 50); - - context.fillStyle = 'rgba(0, 0, 250, 0.5)'; - context.fillRect(30, 30, 55, 50); - </script> - </body> -</html></textarea> - <iframe id=preview></iframe> - <script> - var delay; - // Initialize CodeMirror editor with a nice html5 canvas demo. - var editor = CodeMirror.fromTextArea(document.getElementById('code'), { - mode: 'text/html', - tabMode: 'indent' - }); - editor.on("change", function() { - clearTimeout(delay); - delay = setTimeout(updatePreview, 300); - }); - - function updatePreview() { - var previewFrame = document.getElementById('preview'); - var preview = previewFrame.contentDocument || previewFrame.contentWindow.document; - preview.open(); - preview.write(editor.getValue()); - preview.close(); - } - setTimeout(updatePreview, 300); - </script> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/resize.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/resize.html deleted file mode 100644 index ddd4e5669547beebe55112ae3f75102412b84472..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/resize.html +++ /dev/null @@ -1,46 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Autoresize Demo</title> - <link rel="stylesheet" href="../lib/codemirror.css"> - <script src="../lib/codemirror.js"></script> - <script src="../mode/css/css.js"></script> - <link rel="stylesheet" href="../doc/docs.css"> - - <style type="text/css"> - .CodeMirror { - border: 1px solid #eee; - height: auto; - } - .CodeMirror-scroll { - overflow-y: hidden; - overflow-x: auto; - } - </style> - </head> - <body> - <h1>CodeMirror: Autoresize demo</h1> - - <form><textarea id="code" name="code"> -.CodeMirror { - border: 1px solid #eee; - height: auto; -} -.CodeMirror-scroll { - overflow-y: hidden; - overflow-x: auto; -} -</textarea></form> - -<p>By setting a few CSS properties, CodeMirror can be made to -automatically resize to fit its content.</p> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true - }); - </script> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/runmode.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/runmode.html deleted file mode 100644 index 53ac04f9177f5fc61fbd7ffc88bc4f8b2904f206..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/runmode.html +++ /dev/null @@ -1,50 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Mode Runner Demo</title> - <link rel="stylesheet" href="../lib/codemirror.css"> - <script src="../lib/codemirror.js"></script> - <script src="../lib/util/runmode.js"></script> - <script src="../mode/xml/xml.js"></script> - <link rel="stylesheet" href="../doc/docs.css"> - </head> - <body> - <h1>CodeMirror: Mode Runner Demo</h1> - - <textarea id="code" style="width: 90%; height: 7em; border: 1px solid black; padding: .2em .4em;"> -<foobar> - <blah>Enter your xml here and press the button below to display - it as highlighted by the CodeMirror XML mode</blah> - <tag2 foo="2" bar="&quot;bar&quot;"/> -</foobar></textarea><br> - <button onclick="doHighlight();">Highlight!</button> - <pre id="output" class="cm-s-default"></pre> - - <script> -function doHighlight() { - CodeMirror.runMode(document.getElementById("code").value, "application/xml", - document.getElementById("output")); -} -</script> - - <p>Running a CodeMirror mode outside of the editor. - The <code>CodeMirror.runMode</code> function, defined - in <code><a href="../lib/util/runmode.js">lib/runmode.js</a></code> takes the following arguments:</p> - - <dl> - <dt><code>text (string)</code></dt> - <dd>The document to run through the highlighter.</dd> - <dt><code>mode (<a href="../doc/manual.html#option_mode">mode spec</a>)</code></dt> - <dd>The mode to use (must be loaded as normal).</dd> - <dt><code>output (function or DOM node)</code></dt> - <dd>If this is a function, it will be called for each token with - two arguments, the token's text and the token's style class (may - be <code>null</code> for unstyled tokens). If it is a DOM node, - the tokens will be converted to <code>span</code> elements as in - an editor, and inserted into the node - (through <code>innerHTML</code>).</dd> - </dl> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/search.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/search.html deleted file mode 100644 index 219c80572e7ada364b4204a76e00cbcb49c7b2a3..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/search.html +++ /dev/null @@ -1,85 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Search/Replace Demo</title> - <link rel="stylesheet" href="../lib/codemirror.css"> - <script src="../lib/codemirror.js"></script> - <script src="../mode/xml/xml.js"></script> - <script src="../lib/util/dialog.js"></script> - <link rel="stylesheet" href="../lib/util/dialog.css"> - <script src="../lib/util/searchcursor.js"></script> - <script src="../lib/util/search.js"></script> - <link rel="stylesheet" href="../doc/docs.css"> - - <style type="text/css"> - .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;} - dt {font-family: monospace; color: #666;} - </style> - </head> - <body> - <h1>CodeMirror: Search/Replace Demo</h1> - - <form><textarea id="code" name="code"> - <dt id="option_indentWithTabs"><code>indentWithTabs (boolean)</code></dt> - <dd>Whether, when indenting, the first N*8 spaces should be - replaced by N tabs. Default is false.</dd> - - <dt id="option_tabMode"><code>tabMode (string)</code></dt> - <dd>Determines what happens when the user presses the tab key. - Must be one of the following: - <dl> - <dt><code>"classic" (the default)</code></dt> - <dd>When nothing is selected, insert a tab. Otherwise, - behave like the <code>"shift"</code> mode. (When shift is - held, this behaves like the <code>"indent"</code> mode.)</dd> - <dt><code>"shift"</code></dt> - <dd>Indent all selected lines by - one <a href="#option_indentUnit"><code>indentUnit</code></a>. - If shift was held while pressing tab, un-indent all selected - lines one unit.</dd> - <dt><code>"indent"</code></dt> - <dd>Indent the line the 'correctly', based on its syntactic - context. Only works if the - mode <a href="#indent">supports</a> it.</dd> - <dt><code>"default"</code></dt> - <dd>Do not capture tab presses, let the browser apply its - default behaviour (which usually means it skips to the next - control).</dd> - </dl></dd> - - <dt id="option_enterMode"><code>enterMode (string)</code></dt> - <dd>Determines whether and how new lines are indented when the - enter key is pressed. The following modes are supported: - <dl> - <dt><code>"indent" (the default)</code></dt> - <dd>Use the mode's indentation rules to give the new line - the correct indentation.</dd> - <dt><code>"keep"</code></dt> - <dd>Indent the line the same as the previous line.</dd> - <dt><code>"flat"</code></dt> - <dd>Do not indent the new line.</dd> - </dl></dd> -</textarea></form> - - <script> -var editor = CodeMirror.fromTextArea(document.getElementById("code"), {mode: "text/html", lineNumbers: true}); -</script> - - <p>Demonstration of primitive search/replace functionality. The - keybindings (which can be overridden by custom keymaps) are:</p> - <dl> - <dt>Ctrl-F / Cmd-F</dt><dd>Start searching</dd> - <dt>Ctrl-G / Cmd-G</dt><dd>Find next</dd> - <dt>Shift-Ctrl-G / Shift-Cmd-G</dt><dd>Find previous</dd> - <dt>Shift-Ctrl-F / Cmd-Option-F</dt><dd>Replace</dd> - <dt>Shift-Ctrl-R / Shift-Cmd-Option-F</dt><dd>Replace all</dd> - </dl> - <p>Searching is enabled by - including <a href="../lib/util/search.js">lib/util/search.js</a> - and <a href="../lib/util/searchcursor.js">lib/util/searchcursor.js</a>. - For good-looking input dialogs, you also want to include - <a href="../lib/util/dialog.js">lib/util/dialog.js</a> - and <a href="../lib/util/dialog.css">lib/util/dialog.css</a>.</p> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/theme.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/theme.html deleted file mode 100644 index 42a1b0cde7554f9ee77628f8678fc8850f710329..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/theme.html +++ /dev/null @@ -1,85 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Theme Demo</title> - <link rel="stylesheet" href="../lib/codemirror.css"> - <script src="../lib/codemirror.js"></script> - <link rel="stylesheet" href="../theme/neat.css"> - <link rel="stylesheet" href="../theme/elegant.css"> - <link rel="stylesheet" href="../theme/erlang-dark.css"> - <link rel="stylesheet" href="../theme/night.css"> - <link rel="stylesheet" href="../theme/monokai.css"> - <link rel="stylesheet" href="../theme/cobalt.css"> - <link rel="stylesheet" href="../theme/eclipse.css"> - <link rel="stylesheet" href="../theme/rubyblue.css"> - <link rel="stylesheet" href="../theme/lesser-dark.css"> - <link rel="stylesheet" href="../theme/xq-dark.css"> - <link rel="stylesheet" href="../theme/ambiance.css"> - <link rel="stylesheet" href="../theme/blackboard.css"> - <link rel="stylesheet" href="../theme/vibrant-ink.css"> - <link rel="stylesheet" href="../theme/solarized.css"> - <link rel="stylesheet" href="../theme/twilight.css"> - <script src="../mode/javascript/javascript.js"></script> - <link rel="stylesheet" href="../doc/docs.css"> - - <style type="text/css"> - .CodeMirror {border: 1px solid black; font-size:13px} - </style> - </head> - <body> - <h1>CodeMirror: Theme demo</h1> - - <form><textarea id="code" name="code"> -function findSequence(goal) { - function find(start, history) { - if (start == goal) - return history; - else if (start > goal) - return null; - else - return find(start + 5, "(" + history + " + 5)") || - find(start * 3, "(" + history + " * 3)"); - } - return find(1, "1"); -}</textarea></form> - -<p>Select a theme: <select onchange="selectTheme()" id=select> - <option selected>default</option> - <option>ambiance</option> - <option>blackboard</option> - <option>cobalt</option> - <option>eclipse</option> - <option>elegant</option> - <option>erlang-dark</option> - <option>lesser-dark</option> - <option>monokai</option> - <option>neat</option> - <option>night</option> - <option>rubyblue</option> - <option>solarized dark</option> - <option>solarized light</option> - <option>twilight</option> - <option>vibrant-ink</option> - <option>xq-dark</option> -</select> -</p> - -<script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true - }); - var input = document.getElementById("select"); - function selectTheme() { - var theme = input.options[input.selectedIndex].innerHTML; - editor.setOption("theme", theme); - } - var choice = document.location.search && - decodeURIComponent(document.location.search.slice(1)); - if (choice) { - input.value = choice; - editor.setOption("theme", choice); - } -</script> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/variableheight.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/variableheight.html deleted file mode 100644 index 85230273688cb326e86505c28372e2cb335cce4b..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/variableheight.html +++ /dev/null @@ -1,52 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Variable Height Demo</title> - <link rel="stylesheet" href="../lib/codemirror.css"> - <script src="../lib/codemirror.js"></script> - <script src="../mode/markdown/markdown.js"></script> - <script src="../mode/xml/xml.js"></script> - <link rel="stylesheet" href="../doc/docs.css"> - - <style type="text/css"> - .CodeMirror {border: 1px solid silver; border-width: 1px 2px; } - .cm-header { font-size: 150%; font-family: arial; } - .cm-strong { font-size: 140%; } - </style> - </head> - <body> - <h1>CodeMirror: Variable Height Demo</h1> - - <form><textarea id="code" name="code">### A First Level Header - -**Bold** text in a normal-size paragraph. - -And a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long, wrapped line with a piece of **big** text inside of it. - -## A Second Level Header - -Now is the time for all good men to come to -the aid of their country. This is just a -regular paragraph. - -The quick brown fox jumped over the lazy -dog's back. - -### Header 3 - -> This is a blockquote. -> -> This is the second paragraph in the blockquote. -> -> ## This is an H2 in a blockquote -</textarea></form> - <script id="script"> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - lineWrapping: true, - mode: "markdown" - }); - </script> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/vim.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/vim.html deleted file mode 100644 index d2a143acf10bad09bf0440c2fe6c7a700ea85801..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/vim.html +++ /dev/null @@ -1,65 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Vim bindings demo</title> - <link rel="stylesheet" href="../lib/codemirror.css"> - <script src="../lib/codemirror.js"></script> - <script src="../lib/util/dialog.js"></script> - <script src="../lib/util/searchcursor.js"></script> - <script src="../mode/clike/clike.js"></script> - <script src="../keymap/vim.js"></script> - <link rel="stylesheet" href="../doc/docs.css"> - <link rel="stylesheet" href="../lib/util/dialog.css"> - - <style type="text/css"> - .CodeMirror {border-top: 1px solid #eee; border-bottom: 1px solid #eee;} - </style> - </head> - <body> - <h1>CodeMirror: Vim bindings demo</h1> - - <form><textarea id="code" name="code"> -#include "syscalls.h" -/* getchar: simple buffered version */ -int getchar(void) -{ - static char buf[BUFSIZ]; - static char *bufp = buf; - static int n = 0; - if (n == 0) { /* buffer is empty */ - n = read(0, buf, sizeof buf); - bufp = buf; - } - return (--n >= 0) ? (unsigned char) *bufp++ : EOF; -} -</textarea></form> - - <form><textarea id="code2" name="code2"> - I am another file! You can yank from my neighbor and paste here. -</textarea></form> - -<p>The vim keybindings are enabled by -including <a href="../keymap/vim.js">keymap/vim.js</a> and setting -the <code>keyMap</code> option to <code>"vim"</code>. Because -CodeMirror's internal API is quite different from Vim, they are only -a loose approximation of actual vim bindings, though.</p> - - <script> - CodeMirror.commands.save = function(){ alert("Saving"); }; - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - mode: "text/x-csrc", - keyMap: "vim", - showCursorWhenSelecting: true - }); - var editor2 = CodeMirror.fromTextArea(document.getElementById("code2"), { - lineNumbers: true, - mode: "text/x-csrc", - keyMap: "vim", - showCursorWhenSelecting: true - }); - </script> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/visibletabs.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/visibletabs.html deleted file mode 100644 index ddc12fb46aa824701fd1c834f33060f5e0057c9d..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/visibletabs.html +++ /dev/null @@ -1,53 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Visible tabs demo</title> - <link rel="stylesheet" href="../lib/codemirror.css"> - <script src="../lib/codemirror.js"></script> - <script src="../mode/clike/clike.js"></script> - <link rel="stylesheet" href="../doc/docs.css"> - - <style type="text/css"> - .CodeMirror {border-top: 1px solid #eee; border-bottom: 1px solid #eee;} - .cm-tab { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAMCAYAAAAkuj5RAAAAAXNSR0IArs4c6QAAAGFJREFUSMft1LsRQFAQheHPowAKoACx3IgEKtaEHujDjORSgWTH/ZOdnZOcM/sgk/kFFWY0qV8foQwS4MKBCS3qR6ixBJvElOobYAtivseIE120FaowJPN75GMu8j/LfMwNjh4HUpwg4LUAAAAASUVORK5CYII=); - background-position: right; - background-repeat: no-repeat; - } - </style> - </head> - <body> - <h1>CodeMirror: Visible tabs demo</h1> - - <form><textarea id="code" name="code"> -#include "syscalls.h" -/* getchar: simple buffered version */ -int getchar(void) -{ - static char buf[BUFSIZ]; - static char *bufp = buf; - static int n = 0; - if (n == 0) { /* buffer is empty */ - n = read(0, buf, sizeof buf); - bufp = buf; - } - return (--n >= 0) ? (unsigned char) *bufp++ : EOF; -} -</textarea></form> - -<p>Tabs inside the editor are spans with the -class <code>cm-tab</code>, and can be styled. - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - tabSize: 4, - indentUnit: 4, - indentWithTabs: true, - mode: "text/x-csrc" - }); - </script> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/widget.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/widget.html deleted file mode 100644 index a3b27a9e4774f5182bd47607fe1f4e589171f7f6..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/widget.html +++ /dev/null @@ -1,74 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Inline Widget Demo</title> - <link rel="stylesheet" href="../lib/codemirror.css"> - <script src="../lib/codemirror.js"></script> - <script src="../mode/javascript/javascript.js"></script> - <script src="http://ajax.aspnetcdn.com/ajax/jshint/r07/jshint.js"></script> - <link rel="stylesheet" href="../doc/docs.css"> - - <style type="text/css"> - .CodeMirror {border: 1px solid black;} - .lint-error {font-family: arial; font-size: 70%; background: #ffa; color: #a00; padding: 2px 5px 3px; } - .lint-error-icon {color: white; background-color: red; font-weight: bold; border-radius: 50%; padding: 0 3px; margin-right: 7px;} - </style> - </head> - <body> - <h1>CodeMirror: Inline Widget Demo</h1> - - <div id=code></div> - <script id="script">var widgets = [] -function updateHints() { - editor.operation(function(){ - for (var i = 0; i < widgets.length; ++i) - editor.removeLineWidget(widgets[i]); - widgets.length = 0; - - JSHINT(editor.getValue()); - for (var i = 0; i < JSHINT.errors.length; ++i) { - var err = JSHINT.errors[i]; - if (!err) continue; - var msg = document.createElement("div"); - var icon = msg.appendChild(document.createElement("span")); - icon.innerHTML = "!!"; - icon.className = "lint-error-icon"; - msg.appendChild(document.createTextNode(err.reason)); - msg.className = "lint-error"; - widgets.push(editor.addLineWidget(err.line - 1, msg, {coverGutter: false, noHScroll: true})); - } - }); - var info = editor.getScrollInfo(); - var after = editor.charCoords({line: editor.getCursor().line + 1, ch: 0}, "local").top; - if (info.top + info.clientHeight < after) - editor.scrollTo(null, after - info.clientHeight + 3); -} - -window.onload = function() { - var sc = document.getElementById("script"); - var content = sc.textContent || sc.innerText || sc.innerHTML; - - window.editor = CodeMirror(document.getElementById("code"), { - lineNumbers: true, - mode: "javascript", - value: content - }); - - var waiting; - editor.on("change", function() { - clearTimeout(waiting); - waiting = setTimeout(updateHints, 500); - }); - - setTimeout(updateHints, 100); -}; - -"long line to create a horizontal scrollbar, in order to test whether the (non-inline) widgets stay in place when scrolling to the right"; -</script> -<p>This demo runs <a href="http://jshint.com">JSHint</a> over the code -in the editor (which is the script used on this page), and -inserts <a href="../doc/manual.html#addLineWidget">line widgets</a> to -display the warnings that JSHint comes up with.</p> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/xmlcomplete.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/xmlcomplete.html deleted file mode 100644 index f7cca8a352306bf67ed937735f550d778b646cf7..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/demo/xmlcomplete.html +++ /dev/null @@ -1,74 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: XML Autocomplete Demo</title> - <link rel="stylesheet" href="../lib/codemirror.css"> - <script src="../lib/codemirror.js"></script> - <script src="../lib/util/simple-hint.js"></script> - <link rel="stylesheet" href="../lib/util/simple-hint.css"> - <script src="../lib/util/closetag.js"></script> - <script src="../lib/util/xml-hint.js"></script> - <script src="../mode/xml/xml.js"></script> - <link rel="stylesheet" href="../doc/docs.css"> - <style type="text/css"> - .CodeMirror { border: 1px solid #eee; height: auto; } - .CodeMirror-scroll { overflow-y: hidden; overflow-x: auto; } - </style> - </head> - <body> - <h1>CodeMirror: XML Autocomplete demo</h1> - - <form><textarea id="code" name="code"></textarea></form> - - <p>Type '<' or space inside tag or - press <strong>ctrl-space</strong> to activate autocompletion. See - the code (<a href="../lib/util/simple-hint.js">here</a> - and <a href="../lib/util/xml-hint.js">here</a>) to figure out how - it works.</p> - - <script> - CodeMirror.xmlHints['<'] = [ - 'levelTop', - 'levelRoot', - 'mainLevel' - ]; - - CodeMirror.xmlHints['<levelTop '] = - CodeMirror.xmlHints['<levelRoot '] = - CodeMirror.xmlHints['<mainLevel '] = [ - 'property1111', - 'property2222' - ]; - - CodeMirror.xmlHints['<levelTop><'] = - CodeMirror.xmlHints['<levelRoot><'] = - CodeMirror.xmlHints['<mainLevel><'] = [ - 'second', - 'two' - ]; - - CodeMirror.xmlHints['<levelTop><second '] = [ - 'secondProperty' - ]; - - CodeMirror.xmlHints['<levelTop><second><'] = [ - 'three', - 'x-three' - ]; - - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - value: '', - mode: 'text/html', - lineNumbers: true, - extraKeys: { - "'>'": function(cm) { cm.closeTag(cm, '>'); }, - "'/'": function(cm) { cm.closeTag(cm, '/'); }, - "' '": function(cm) { CodeMirror.xmlHint(cm, ' '); }, - "'<'": function(cm) { CodeMirror.xmlHint(cm, '<'); }, - "Ctrl-Space": function(cm) { CodeMirror.xmlHint(cm, ''); } - } - }); - </script> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/baboon.png b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/baboon.png deleted file mode 100644 index 55d97f70b817ff2b78ebb409bf34a5147fe40d07..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/baboon.png and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/baboon_vector.svg b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/baboon_vector.svg deleted file mode 100644 index dc1667af91371787b979f9155061ff5d954f3ece..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/baboon_vector.svg +++ /dev/null @@ -1,153 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - id="svg3181" - version="1.1" - inkscape:version="0.48.0 r9654" - width="1750" - height="960" - xml:space="preserve" - sodipodi:docname="baboon_vector.svg"><metadata - id="metadata3187"><rdf:RDF><cc:Work - rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs - id="defs3185"><clipPath - clipPathUnits="userSpaceOnUse" - id="clipPath3195"><path - d="M 0,768 1400,768 1400,0 0,0 0,768 z" - id="path3197" /></clipPath><clipPath - clipPathUnits="userSpaceOnUse" - id="clipPath3215"><path - d="M 0,768 1400,768 1400,0 0,0 0,768 z" - id="path3217" /></clipPath></defs><sodipodi:namedview - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1" - objecttolerance="10" - gridtolerance="10" - guidetolerance="10" - inkscape:pageopacity="0" - inkscape:pageshadow="2" - inkscape:window-width="1440" - inkscape:window-height="851" - id="namedview3183" - showgrid="false" - inkscape:zoom="0.20550291" - inkscape:cx="1534.1667" - inkscape:cy="795.78156" - inkscape:window-x="0" - inkscape:window-y="0" - inkscape:window-maximized="1" - inkscape:current-layer="g3189" /><g - id="g3189" - inkscape:groupmode="layer" - inkscape:label="baboon_vector" - transform="matrix(1.25,0,0,-1.25,0,960)"><g - id="g3191"><g - id="g3193" - clip-path="url(#clipPath3195)"><g - id="g3199" - transform="translate(458.9561,569.9678)"><path - d="m 0,0 59.835,69.355 87.034,26.518 133.949,-7.479 c 0,0 74.116,-32.639 74.795,-34.678 0.68,-2.04 84.314,-59.155 84.314,-59.155 l 12.238,-74.795 5.439,-97.912 -13.598,-25.159 -4.76,-40.797 -18.358,-23.118 24.39,-5.561 0.501,-5.192 -14.012,-60.641 16.477,-93.368 7.223,-49.972 -208.295,-51.754 -18.552,4.005 -37.468,8.325 -10.036,4.036 -66.885,10.101 c 0,0 -14.959,74.793 -16.999,73.433 -2.039,-1.359 -42.836,56.437 -42.836,56.437 l -19.719,65.274 12.48,74.571 -7.961,9.643 -26.479,16.187 -12.716,38.309 4.08,48.277 8.769,38.985 L 6.608,-74.308 0,0 z" - style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path3201" /></g><g - id="g3203" - transform="translate(78.8657,682.1582)"><path - d="M 0,0 142.789,40.797 259.74,52.355 313.457,-232.543 204.665,-291.698 78.194,-293.738 0,0 z" - style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path3205" /></g><g - id="g3207" - transform="translate(269.5122,345.2344)"><path - d="M 0,0 18.801,-74.425 40.728,-85.408 59.539,-59.541 40.259,13.503 36.821,15.669 0,0 z" - style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path3209" /></g></g></g><g - id="g3223" - transform="translate(741.918,109.0332)"><path - d="m 0,0 -17.236,-9.401 -16.452,-22.721 -0.783,12.537 6.268,17.234 13.317,6.268 L 0,7.833 14.884,3.917 0,0 z m 172.622,-21.824 c -0.031,0.271 -0.081,0.535 -0.117,0.804 -20.85,7.653 -49.59,7.327 -66.874,10.927 -13.849,2.886 -23.047,9.119 -27.032,12.298 -9.863,-8.494 -12.025,-14.377 -12.025,-14.377 0,0 -9.816,15.309 -30.17,25.76 -7.05,3.621 -17.767,5.691 -29.341,5.691 -24.297,0 -52.384,-9.155 -58.339,-32.223 -10.458,-40.511 9.697,-76.594 49.814,-77.623 1.325,-0.034 2.623,-0.12 3.894,-0.12 36.131,0 48.855,8.572 58.323,15.478 0.027,0.021 0.104,0 0.104,0 0,0 25.126,-11.506 53.529,-11.506 4.419,0 9.156,0.415 14.249,1.063 31.641,4.018 47.989,28.124 43.985,63.828" - style="fill:#df0019;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path3225" - inkscape:connector-curvature="0" /></g><g - id="g3227" - transform="translate(300.8481,270.0254)"><path - d="m 0,0 c -3.063,-0.691 -12.535,0.784 -12.535,0.784 l 6.267,-25.853 43.481,13.319 -9.01,27.418 C 28.203,15.668 7.867,1.777 0,0" - style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path3229" - inkscape:connector-curvature="0" /></g><g - id="g3231" - transform="translate(211.66052,615.85984)"><path - d="m 0,0 -16.243,-2.871 -15.462,-9.4 4.323,-10.938 14.568,9.89 L 2.75,-8.771 0,0 z" - style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path3233" - inkscape:connector-curvature="0" /></g><g - id="g3235" - transform="translate(274.15732,626.4084)"><path - d="m 0,0 -15.64,0.407 -14.279,-3.608 2.008,-9.747 14.756,4.208 L 1.111,-8.215 0,0 z" - style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path3237" - inkscape:connector-curvature="0" /></g><path - style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" - d="M 436.65625 22.28125 C 436.65625 22.28125 338.18375 25.385 251 42.8125 C 163.24875 60.35375 70.40625 99.65625 70.40625 99.65625 L 175.1875 495.28125 L 327.96875 492.34375 L 337.75 527.59375 C 337.75 527.59375 365.095 523.25875 373 518.78125 C 376.31375 516.90375 383.78125 508 383.78125 508 L 377.75 484.65625 L 504.21875 407.15625 L 436.65625 22.28125 z M 410.53125 55.1875 L 465.6875 393.3125 L 346.59375 456.625 L 202.75 466.46875 L 112 114.40625 L 263 79.1875 L 410.53125 55.1875 z " - transform="matrix(0.8,0,0,-0.8,0,768)" - id="path3253" /><g - id="g3247" - transform="matrix(1.199238,-0.02879331,0.02673084,1.0520756,172.41935,498.37339)"><path - d="m 0,0 c 0,0 -1.861,1.481 -9.143,-1.457 9.712,18.867 9.439,39.989 9.439,39.989 0,0 -3.106,-2.465 -11.311,-8.47 9.241,23.044 5.338,72.525 5.338,72.525 0,0 -17.493,40.746 -13.657,45.799 8.841,11.65 23.834,23.968 44.295,25.594 17.935,1.424 44.606,-4.953 55.865,-15.284 4.536,-4.161 23.367,-47.493 23.367,-47.493 0,0 6.104,-35.271 11.619,-54.108 5.513,-18.839 11.054,-26.674 21.284,-34.825 17.831,-14.207 27.076,-29.938 27.076,-29.938 L 143.399,3.945 c 3.655,-17.356 14.875,-34.28 27.39,-47.672 -12.863,1.507 -19.61,8.783 -19.61,8.783 0,0 2.151,-12.664 9.109,-26.554 l 28.712,15.264 -1.762,10.805 c -5.128,9.304 -9.336,15.534 -9.336,15.534 0,0 2.089,0.956 7.385,-3.572 l -2.005,12.296 c -4.814,9.391 -11.773,16.752 -25.115,31.113 5.944,-6.087 15.438,-5.379 20.751,-4.356 l -0.572,3.512 c -2.231,1.278 -5.494,3.171 -10.241,5.957 -12.43,7.299 -22.326,21.049 -22.326,21.049 0,0 12.85,1.815 20.513,11.022 -7.316,-2.641 -18.585,0.799 -18.585,0.799 -17.086,6.772 -15.022,30.217 -17.687,50.587 -2.667,20.37 -9.299,34.125 -9.299,34.125 0,0 -0.243,2.149 11.91,-5.906 -7.744,33.215 -35.545,44.94 -35.545,44.94 0,0 2.223,2.79 22.843,0.044 -16.469,15.817 -32.303,16.896 -32.303,16.896 0,0 10.077,2.25 23.611,0.24 0,0 -3.327,3.508 -7.549,6.453 L 35.985,194.291 -77.543,167.815 -8.211,-101.17 17.481,-99.413 C 8.602,-85.114 -0.371,-63.837 -2.15,-40.857 -4.911,-5.208 0,0 0,0" - style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path3249" - inkscape:connector-curvature="0" /></g><g - id="g3255" - transform="translate(204.22134,580.88353)"><path - d="m 0,0 c 0,-1.418 0.43,-2.736 1.168,-3.83 1.523,0.677 3.551,1.094 5.786,1.094 2.164,0 4.133,-0.39 5.639,-1.029 0.711,1.081 1.129,2.374 1.129,3.765 0,3.79 -3.072,6.861 -6.861,6.861 C 3.071,6.861 0,3.79 0,0" - style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path3257" - inkscape:connector-curvature="0" /></g><g - id="g3259" - transform="translate(256.3311,595.31646)"><path - d="m 0,0 c 0,-1.418 0.43,-2.736 1.168,-3.83 1.524,0.677 3.552,1.094 5.787,1.094 2.163,0 4.132,-0.39 5.638,-1.029 0.712,1.081 1.129,2.373 1.129,3.765 0,3.79 -3.072,6.861 -6.861,6.861 C 3.071,6.861 0,3.79 0,0" - style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path3261" - inkscape:connector-curvature="0" /></g><g - id="g4174" - transform="matrix(0.99694509,0.07810563,-0.07810563,0.99694509,47.348748,-15.348299)"><g - transform="translate(222.5098,610.1558)" - id="g3219"><path - inkscape:connector-curvature="0" - id="path3221" - style="fill:#df0019;fill-opacity:1;fill-rule:nonzero;stroke:none" - d="m 0,0 4.45,2.752 5.34,3.785 7.05,-8.226 7.093,-33.359 17.801,-51.259 13.86,-30.215 26.261,-1.55 -6.685,-35.653 c 0,0 -49.98,-21.871 -49.545,-21.911 -42.657,4.001 -12.553,43.066 -8.631,47.301 L 3.666,-47.869 0,0 z" /></g><g - transform="translate(247.626,467.3545)" - id="g3239"><path - inkscape:connector-curvature="0" - id="path3241" - style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" - d="M 0,0 C -3.044,-0.345 -5.232,-3.092 -4.888,-6.136 -4.543,-9.18 1.576,-2.254 13.308,-4.961 13.971,-1.97 3.044,0.344 0,0" /></g><g - transform="translate(279.4419,476.5762)" - id="g3243"><path - inkscape:connector-curvature="0" - id="path3245" - style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" - d="M 0,0 C 3.271,1.08 6.798,-0.697 7.88,-3.969 8.96,-7.24 -0.55,-3.044 -11.258,-11.329 -13.345,-8.586 -3.272,-1.081 0,0" /></g><g - transform="translate(284.1929,525.9082)" - id="g3263"><path - inkscape:connector-curvature="0" - id="path3265" - style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" - d="M 0,0 C 0,0 -6.972,28.671 -6.972,29.355 L 1.585,2.864 9.999,-10.564 13.634,-32.697 7.922,-11.098 0,0 z M -0.633,-15.036 -9.19,-4.86 -16.478,25.776 c -0.202,0.684 9.106,-28.811 9.106,-28.811 l 8.64,-11.642 2.469,-17.336 -4.37,16.977 z m -6.339,-6.085 -10.457,16.826 -5.444,28.646 6.614,-27.842 11.311,-18.026 1.413,-9.583 -3.437,9.979 z m -53.462,-13.246 -1.437,24.944 -2.682,28.754 5.106,-29.895 1.212,-21.677 4.139,-18.236 -6.338,16.11 z m -4.265,-19.55 -6.665,15.516 0.404,29.205 -0.882,28.169 3.104,-28.396 0.808,-26.697 4.242,-15.972 2.423,-6.617 -3.434,4.792 z m -9.695,-2.967 -7.117,16.885 1.318,32.01 0,25.223 2.115,-25.061 -0.581,-31.259 5.869,-16.429 5.056,-8.671 -6.66,7.302 z m 103.144,-7.97 -6.676,20.38 2.141,11.54 L 16.499,-9.376 4.557,13.104 -5.879,53.97 c 0,0 -8.325,-7.41 -16.781,-8.08 -8.455,-0.671 -15.09,4.018 -15.09,4.018 0,0 3.592,-17.761 8.659,-37.597 5.069,-19.836 17.528,-44.866 17.528,-44.866 0,0 21.578,-8.197 24.302,-16.587 2.724,-8.391 -3.508,-22.911 -14.102,-26.551 -10.593,-3.64 -32.284,-8.262 -32.284,-8.262 0,0 -19,1.512 -20.438,14.26 0,0 4.131,16.406 10.418,19.225 6.285,2.819 21.362,11.174 21.362,11.174 l -8.254,1.332 -7.664,-1.332 c 0,0 -4.784,11.295 -10.973,35.086 -6.19,23.79 -8.967,42.485 -8.967,42.485 0,0 -3.912,-4.391 -14.199,-4.885 -10.286,-0.494 -16.031,7.988 -16.031,7.988 l 1.027,-30.185 -1.049,-25.83 -0.15,-29.22 5.102,-15.99 19.818,-30.448 c 0,0 14.102,-9.293 31.728,-9.293 16.453,1.328 51.131,18.047 51.131,18.047 l 9.536,16.687 z" /></g></g><g - id="g3267" - transform="translate(847.2637,321.5059)"><path - d="m 0,0 c 2.252,3.516 6.693,15.3 6.693,15.3 0,0 3.778,-13.306 1.912,-17.213 -3.056,-6.404 -23.905,-15.3 -23.905,-15.3 0,0 12.196,12.364 15.3,17.213 m -33.514,23.16 -0.757,56.352 c 0,0 11.136,-14.028 11.843,-19.739 1.176,-9.491 -11.086,-36.613 -11.086,-36.613 m -17.575,236.921 c 0,0 12.453,-15.338 14.854,-21.39 1.424,-3.591 2.286,-15.287 2.286,-15.287 l -17.14,36.677 z M -98.574,-86.136 c -9.757,-0.906 -29.836,1.016 -38.912,4.708 -7.499,3.05 -25.734,19.656 -25.734,19.656 l 24.187,-10.86 -4.701,17.627 15.272,-22.009 41.813,-5.356 c 0,0 -8.812,-3.477 -11.925,-3.766 m -74.428,157.941 c -4.518,10.057 -1.763,44.065 -1.763,44.065 0,0 7.544,-31.093 12.338,-40.541 6.978,-13.754 37.015,-49.352 37.015,-49.352 0,0 -40.824,30.759 -47.59,45.828 m -17.833,-149.47 -40.407,24.724 1.636,-17.575 0.026,-0.035 -5.178,-29.811 -2.056,-10.701 0.383,-33.34 -4.982,36.406 6.41,41.45 -11.063,8.338 -17.532,43.159 23.502,-38.779 2.351,14.101 40.634,-25.695 11.924,-5.651 13.809,-28.871 -19.457,22.28 z m -85.522,138.863 17.212,-34.424 c 0,0 -12.972,11.185 -15.299,16.257 -1.905,4.152 -1.913,18.167 -1.913,18.167 m -2.367,66.042 c 0,0 -6.206,15.581 -6.323,21.082 -0.168,7.817 4.568,23.148 7.695,30.315 0.755,1.73 4.103,6.341 4.103,6.341 0,0 -4.654,-24.542 -5.347,-32.829 -0.518,-6.205 -0.128,-24.909 -0.128,-24.909 m -7.195,-114.809 c -0.334,3.363 1.912,13.387 1.912,13.387 l 3.825,-29.643 c 0,0 -5.313,11.967 -5.737,16.256 m -20.082,53.549 c -1.394,3.571 -0.956,15.301 -0.956,15.301 l 13.388,-30.6 c 0,0 -10.639,10.71 -12.432,15.299 m -6.03,106.795 c 0,0 -0.315,35.831 4.637,46.379 4.531,9.647 29.936,30.356 29.936,30.356 0,0 -17.824,-22.47 -21.503,-31.2 -5.089,-12.077 -10.119,-51.437 -10.119,-51.437 l -2.951,5.902 z M 50.121,205.01 c 3.335,-9.155 1.168,-38.956 1.168,-38.956 0,0 -5.451,29.987 -9.221,39.366 -4.214,10.487 -23.014,38.907 -23.014,38.907 0,0 26.78,-27.546 31.067,-39.317 M 54.506,95.624 c 0,0 6.884,-18.586 5.738,-24.861 -0.773,-4.241 -9.562,-14.345 -9.562,-14.345 0,0 2.414,12.874 2.868,17.212 0.573,5.474 0.956,21.994 0.956,21.994 M 19.125,-13.389 c 0,0 9.656,22.183 11.062,30.068 1.235,6.941 0,28.203 0,28.203 0,0 8.477,-22.819 7.106,-30.538 C 35.845,6.183 19.125,-13.389 19.125,-13.389 m 441.487,-40.965 c -3.249,8.935 -6.587,17.23 -10.01,24.928 l -1.862,28.873 -8.857,-4.876 -25.862,49.457 -4.828,-10.34 c -32.69,31.48 -70.457,34.284 -111.982,31.646 -65.568,-4.163 -91.587,-41.63 -79.098,-57.241 12.49,-15.613 18.733,-5.205 40.589,5.203 21.858,10.407 74.937,26.017 110.323,-2.082 35.386,-28.1 86.383,-109.281 50.997,-169.646 -35.386,-60.365 -105.626,-105.385 -182.135,-88.465 -86.422,19.112 -126.078,60.082 -177.675,74.811 -8.311,1.334 -18.347,2.789 -24.791,3.191 -12.671,0.792 -21.6,14.727 -21.6,14.727 l 17.181,-9.327 25.763,-2.36 c 2.331,14 9.395,49.054 9.395,49.054 l -8.688,87.29 -18.668,-27.06 -7.246,10.184 -21.349,-22.915 -15.473,-1.959 14.67,6.596 21.38,29.409 6.7,-13.754 19.485,24.691 0.004,-0.011 16.47,9.525 -3.123,68.69 10.407,-10.407 -4.163,40.59 22.173,71.502 -34.662,91.899 16.652,-4.162 -19.773,35.386 -40.591,38.509 9.368,17.693 -93.671,9.368 -20.229,-7.165 -18.437,38.292 13.22,8.813 -69.039,14.69 2.938,19.095 -80.791,-23.303 -26.147,-19.191 -116.339,0 8.814,-10.188 -42.501,-40.641 -8.911,-78.491 7.344,-1.494 8.814,-45.548 23.502,-24.978 19.096,45.533 -14.689,-4.409 41.13,48.474 30.848,26.44 -14.69,-1.469 19.096,16.158 105.763,2.938 72.917,15.799 -41.623,-14.742 -30.181,-7.285 -104.079,-1.043 1.04,-11.449 -64.526,-61.403 14.571,2.081 -27.844,-63.28 c -15.017,-13.719 -28.06,-55.016 -36.687,-75.145 -9.367,-21.856 -20.816,-39.55 -20.816,-39.55 0,0 -30.182,-6.244 -61.405,-18.734 -31.224,-12.489 -43.713,4.163 -43.713,4.163 l -3.122,-8.326 c 0,0 -18.28,-9.057 -39.303,-11.825 -16.43,-2.162 -9.967,-20.946 -9.613,-26.684 0.405,-6.57 4.294,-19.774 8.325,-24.978 3.227,-4.165 12.525,-10.425 17.694,-11.448 12.039,-2.385 28.101,5.204 45.794,17.693 74.936,-6.245 103.241,-10.321 126.974,8.326 14.572,11.448 29.142,22.897 41.631,40.59 l -15.611,42.671 -8.327,-14.569 -5.807,44.931 1.841,17.863 5.547,-51.234 7.789,9.257 35.387,-70.772 11.448,4.164 c 0,0 13.515,-18.583 23.057,-32.881 l -26.02,25.006 -10.224,-5.964 -11.076,22.152 c 0,0 -13.383,-2.353 -24.727,-18.027 -15.862,-21.915 -23.503,-24.678 -17.627,-78.735 5.876,-54.055 16.452,-54.055 64.632,-121.039 11.752,-16.452 14.601,-18.465 14.601,-18.465 l -51.03,-27.365 -22.327,-5.876 -21.384,-11.28 c 0,0 4.744,-8.174 7.495,-9.369 4.739,-2.062 20.613,1.56 20.613,1.56 0,0 15.603,-6.763 36.756,-6.763 21.152,0 32.903,8.225 47.005,8.225 14.101,0 38.78,-8.225 57.582,-5.876 18.802,2.351 22.328,12.927 22.328,12.927 l -51.706,54.057 -4.675,47.096 -56.605,75.769 -3.038,9.437 65.791,-82.24 5.107,-46.75 55.161,-61.405 37.468,-8.325 c 0,0 -0.257,1.226 -0.625,3.114 -6.146,15.664 -6.986,34.894 -1.999,54.214 6.975,27.012 38.85,36.596 64.029,36.596 12.506,0 24.179,-2.312 32.025,-6.341 12.912,-6.63 21.851,-15.076 27.029,-20.917 3.673,4.516 7.133,7.194 11.833,11.11 0,0 12.143,-11.751 45.047,-14.101 27.14,-1.939 45.048,-8.226 70.901,-19.585 53.676,-23.584 102.5,-61.785 207.618,-45.132 105.119,16.651 206.073,113.444 164.442,227.929" - style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path3269" - inkscape:connector-curvature="0" /></g><path - inkscape:connector-curvature="0" - style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none" - d="m 329.26398,723.3082 -118.025,-19.2 -120.800003,-28.175 72.600003,-281.65 115.075,7.875 95.275,50.65 -44.125,270.5 z m -6.55,-10.575 40.675,-252.4 -87.85,-47.275 -106.125,-7.325 -66.95,262.8 111.4,26.275 108.85,17.925 z" - id="path3253-3" /></g></svg> \ No newline at end of file diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/compress.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/compress.html deleted file mode 100644 index d830bde4322921a0bbfccff99a35abdbd089c4b2..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/compress.html +++ /dev/null @@ -1,172 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"/> - <title>CodeMirror: Compression Helper</title> - <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"/> - <link rel="stylesheet" type="text/css" href="docs.css"/> - </head> - <body> - -<h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1> - -<div class="grey"> -<img src="baboon.png" class="logo" alt="logo"/> -<pre> -/* Script compression - helper */ -</pre> -</div> - - <p>To optimize loading CodeMirror, especially when including a - bunch of different modes, it is recommended that you combine and - minify (and preferably also gzip) the scripts. This page makes - those first two steps very easy. Simply select the version and - scripts you need in the form below, and - click <strong>Compress</strong> to download the minified script - file.</p> - - <form id="form" action="http://marijnhaverbeke.nl/uglifyjs" method="post"> - <input type="hidden" id="download" name="download" value="codemirror-compressed.js"/> - <p>Version: <select id="version" onchange="setVersion(this);" style="padding: 1px"> - <option value="http://codemirror.net/">HEAD</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v3.0;f=">3.0</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v3.0rc2;f=">3.0rc2</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v3.0rc1;f=">3.0rc1</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v3.0beta2;f=">3.0beta2</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v3.0beta1;f=">3.0beta1</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.36;f=">2.36</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.35;f=">2.35</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.34;f=">2.34</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.33;f=">2.33</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.32;f=">2.32</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.31;f=">2.31</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.3;f=">2.3</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.25;f=">2.25</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.24;f=">2.24</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.23;f=">2.23</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.22;f=">2.22</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.21;f=">2.21</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.2;f=">2.2</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.18;f=">2.18</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.16;f=">2.16</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.15;f=">2.15</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.13;f=">2.13</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.12;f=">2.12</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.11;f=">2.11</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.1;f=">2.1</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.02;f=">2.02</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.01;f=">2.01</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.0;f=">2.0</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=beta2;f=">beta2</option> - <option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=beta1;f=">beta1</option> - </select></p> - - <select multiple="multiple" size="20" name="code_url" style="width: 40em;" class="field" id="files"> - <optgroup label="CodeMirror Library"> - <option value="http://codemirror.net/lib/codemirror.js" selected>codemirror.js</option> - </optgroup> - <optgroup label="Modes"> - <option value="http://codemirror.net/mode/clike/clike.js">clike.js</option> - <option value="http://codemirror.net/mode/clojure/clojure.js">clojure.js</option> - <option value="http://codemirror.net/mode/coffeescript/coffeescript.js">coffeescript.js</option> - <option value="http://codemirror.net/mode/commonlisp/commonlisp.js">commonlisp.js</option> - <option value="http://codemirror.net/mode/css/css.js">css.js</option> - <option value="http://codemirror.net/mode/diff/diff.js">diff.js</option> - <option value="http://codemirror.net/mode/ecl/ecl.js">ecl.js</option> - <option value="http://codemirror.net/mode/erlang/erlang.js">erlang.js</option> - <option value="http://codemirror.net/mode/gfm/gfm.js">gfm.js</option> - <option value="http://codemirror.net/mode/go/go.js">go.js</option> - <option value="http://codemirror.net/mode/groovy/groovy.js">groovy.js</option> - <option value="http://codemirror.net/mode/haskell/haskell.js">haskell.js</option> - <option value="http://codemirror.net/mode/haxe/haxe.js">haxe.js</option> - <option value="http://codemirror.net/mode/htmlembedded/htmlembedded.js">htmlembedded.js</option> - <option value="http://codemirror.net/mode/htmlmixed/htmlmixed.js">htmlmixed.js</option> - <option value="http://codemirror.net/mode/http/http.js">http.js</option> - <option value="http://codemirror.net/mode/javascript/javascript.js">javascript.js</option> - <option value="http://codemirror.net/mode/jinja2/jinja2.js">jinja2.js</option> - <option value="http://codemirror.net/mode/less/less.js">less.js</option> - <option value="http://codemirror.net/mode/lua/lua.js">lua.js</option> - <option value="http://codemirror.net/mode/markdown/markdown.js">markdown.js</option> - <option value="http://codemirror.net/mode/mysql/mysql.js">mysql.js</option> - <option value="http://codemirror.net/mode/ntriples/ntriples.js">ntriples.js</option> - <option value="http://codemirror.net/mode/ocaml/ocaml.js">ocaml.js</option> - <option value="http://codemirror.net/mode/pascal/pascal.js">pascal.js</option> - <option value="http://codemirror.net/mode/perl/perl.js">perl.js</option> - <option value="http://codemirror.net/mode/php/php.js">php.js</option> - <option value="http://codemirror.net/mode/pig/pig.js">pig.js</option> - <option value="http://codemirror.net/mode/plsql/plsql.js">plsql.js</option> - <option value="http://codemirror.net/mode/properties/properties.js">properties.js</option> - <option value="http://codemirror.net/mode/python/python.js">python.js</option> - <option value="http://codemirror.net/mode/r/r.js">r.js</option> - <option value="http://codemirror.net/mode/rpm/changes/changes.js">rpm/changes.js</option> - <option value="http://codemirror.net/mode/rpm/spec/spec.js">rpm/spec.js</option> - <option value="http://codemirror.net/mode/rst/rst.js">rst.js</option> - <option value="http://codemirror.net/mode/ruby/ruby.js">ruby.js</option> - <option value="http://codemirror.net/mode/rust/rust.js">rust.js</option> - <option value="http://codemirror.net/mode/scheme/scheme.js">scheme.js</option> - <option value="http://codemirror.net/mode/shell/shell.js">shell.js</option> - <option value="http://codemirror.net/mode/sieve/sieve.js">sieve.js</option> - <option value="http://codemirror.net/mode/smalltalk/smalltalk.js">smalltalk.js</option> - <option value="http://codemirror.net/mode/smarty/smarty.js">smarty.js</option> - <option value="http://codemirror.net/mode/sparql/sparql.js">sparql.js</option> - <option value="http://codemirror.net/mode/stex/stex.js">stex.js</option> - <option value="http://codemirror.net/mode/tiddlywiki/tiddlywiki.js">tiddlywiki.js</option> - <option value="http://codemirror.net/mode/tiki/tiki.js">tiki.js</option> - <option value="http://codemirror.net/mode/vb/vb.js">vb.js</option> - <option value="http://codemirror.net/mode/vbscript/vbscript.js">vbscript.js</option> - <option value="http://codemirror.net/mode/velocity/velocity.js">velocity.js</option> - <option value="http://codemirror.net/mode/verilog/verilog.js">verilog.js</option> - <option value="http://codemirror.net/mode/xml/xml.js">xml.js</option> - <option value="http://codemirror.net/mode/xquery/xquery.js">xquery.js</option> - <option value="http://codemirror.net/mode/yaml/yaml.js">yaml.js</option> - <option value="http://codemirror.net/mode/z80/z80.js">z80.js</option> - </optgroup> - <optgroup label="Utilities and add-ons"> - <option value="http://codemirror.net/lib/util/overlay.js">overlay.js</option> - <option value="http://codemirror.net/lib/util/multiplex.js">multiplex.js</option> - <option value="http://codemirror.net/lib/util/runmode.js">runmode.js</option> - <option value="http://codemirror.net/lib/util/simple-hint.js">simple-hint.js</option> - <option value="http://codemirror.net/lib/util/javascript-hint.js">javascript-hint.js</option> - <option value="http://codemirror.net/lib/util/xml-hint.js">xml-hint.js</option> - <option value="http://codemirror.net/lib/util/foldcode.js">foldcode.js</option> - <option value="http://codemirror.net/lib/util/dialog.js">dialog.js</option> - <option value="http://codemirror.net/lib/util/search.js">search.js</option> - <option value="http://codemirror.net/lib/util/searchcursor.js">searchcursor.js</option> - <option value="http://codemirror.net/lib/util/matchbrackets.js">matchbrackets.js</option> - <option value="http://codemirror.net/lib/util/formatting.js">formatting.js</option> - <option value="http://codemirror.net/lib/util/match-highlighter.js">match-highlighter.js</option> - <option value="http://codemirror.net/lib/util/closetag.js">closetag.js</option> - <option value="http://codemirror.net/lib/util/loadmode.js">loadmode.js</option> - </optgroup> - <optgroup label="Keymaps"> - <option value="http://codemirror.net/keymap/emacs.js">emacs.js</option> - <option value="http://codemirror.net/keymap/vim.js">vim.js</option> - </optgroup> - </select></p> - - <p> - <button type="submit">Compress</button> with <a href="http://github.com/mishoo/UglifyJS/">UglifyJS</a> - </p> - - <p>Custom code to add to the compressed file:<textarea name="js_code" style="width: 100%; height: 15em;" class="field"></textarea></p> - </form> - - <script type="text/javascript"> - function setVersion(ver) { - var urlprefix = ver.options[ver.selectedIndex].value; - var select = document.getElementById("files"), m; - for (var optgr = select.firstChild; optgr; optgr = optgr.nextSibling) - for (var opt = optgr.firstChild; opt; opt = opt.nextSibling) { - if (opt.nodeName != "OPTION") - continue; - else if (m = opt.value.match(/^http:\/\/codemirror.net\/(.*)$/)) - opt.value = urlprefix + m[1]; - else if (m = opt.value.match(/http:\/\/marijnhaverbeke.nl\/git\/codemirror\?a=blob_plain;hb=[^;]+;f=(.*)$/)) - opt.value = urlprefix + m[1]; - } - } - </script> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/docs.css b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/docs.css deleted file mode 100644 index 547b6175a9def974a95c2010223514142ad21720..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/docs.css +++ /dev/null @@ -1,167 +0,0 @@ -body { - font-family: Droid Sans, Arial, sans-serif; - line-height: 1.5; - max-width: 64.3em; - margin: 3em auto; - padding: 0 1em; -} - -h1 { - letter-spacing: -3px; - font-size: 3.23em; - font-weight: bold; - margin: 0; -} - -h2 { - font-size: 1.23em; - font-weight: bold; - margin: .5em 0; - letter-spacing: -1px; -} - -h3 { - font-size: 1em; - font-weight: bold; - margin: .4em 0; -} - -pre { - background-color: #eee; - -moz-border-radius: 6px; - -webkit-border-radius: 6px; - border-radius: 6px; - padding: 1em; -} - -pre.code { - margin: 0 1em; -} - -.grey { - background-color: #eee; - border-radius: 6px; - margin-bottom: 1.65em; - margin-top: 0.825em; - padding: 0.825em 1.65em; - position: relative; -} - -img.logo { - position: absolute; - right: -1em; - bottom: 4px; - max-width: 23.6875em; /* Scale image down with text to prevent clipping */ -} - -.grey > pre { - background:none; - border-radius:0; - padding:0; - margin:0; - font-size:2.2em; - line-height:1.2em; -} - -a:link, a:visited, .quasilink { - color: #df0019; - cursor: pointer; - text-decoration: none; -} - -a:hover, .quasilink:hover { - color: #800004; -} - -h1 a:link, h1 a:visited, h1 a:hover { - color: black; -} - -ul { - margin: 0; - padding-left: 1.2em; -} - -a.download { - color: white; - background-color: #df0019; - width: 100%; - display: block; - text-align: center; - font-size: 1.23em; - font-weight: bold; - text-decoration: none; - -moz-border-radius: 6px; - -webkit-border-radius: 6px; - border-radius: 6px; - padding: .5em 0; - margin-bottom: 1em; -} - -a.download:hover { - background-color: #bb0010; -} - -.rel { - margin-bottom: 0; -} - -.rel-note { - color: #777; - font-size: .9em; - margin-top: .1em; -} - -.logo-braces { - color: #df0019; - position: relative; - top: -4px; -} - -.blk { - float: left; -} - -.left { - margin-right: 20.68em; - max-width: 37em; - padding-right: 6.53em; - padding-bottom: 1em; -} - -.left1 { - width: 15.24em; - padding-right: 6.45em; -} - -.left2 { - max-width: 15.24em; -} - -.right { - width: 20.68em; - margin-left: -20.68em; -} - -.leftbig { - width: 42.44em; - padding-right: 6.53em; -} - -.rightsmall { - width: 15.24em; -} - -.clear:after { - visibility: hidden; - display: block; - font-size: 0; - content: " "; - clear: both; - height: 0; -} -.clear { display: inline-block; } -/* start commented backslash hack \*/ -* html .clear { height: 1%; } -.clear { display: block; } -/* close commented backslash hack */ diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/internals.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/internals.html deleted file mode 100644 index 9139528f3de75ca48a8f5b04a71511894ff42d9b..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/internals.html +++ /dev/null @@ -1,505 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"/> - <title>CodeMirror: Internals</title> - <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"/> - <link rel="stylesheet" type="text/css" href="docs.css"/> - <style>dl dl {margin: 0;} .update {color: #d40 !important}</style> - </head> - <body> - -<h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1> - -<div class="grey"> -<img src="baboon.png" class="logo" alt="logo"/> -<pre> -/* (Re-) Implementing A Syntax- - Highlighting Editor in JavaScript */ -</pre> -</div> - -<div class="clear"><div class="leftbig blk"> - -<p style="font-size: 85%" id="intro"> - <strong>Topic:</strong> JavaScript, code editor implementation<br> - <strong>Author:</strong> Marijn Haverbeke<br> - <strong>Date:</strong> March 2nd 2011 (updated November 13th 2011) -</p> - -<p style="padding: 0 3em 0 2em"><strong>Caution</strong>: this text was written briefly after -version 2 was initially written. It no longer (even including the -update at the bottom) fully represents the current implementation. I'm -leaving it here as a historic document. For more up-to-date -information, look at the entries -tagged <a href="http://marijnhaverbeke.nl/blog/#cm-internals">cm-internals</a> -on my blog.</p> - -<p>This is a followup to -my <a href="http://codemirror.net/story.html">Brutal Odyssey to the -Dark Side of the DOM Tree</a> story. That one describes the -mind-bending process of implementing (what would become) CodeMirror 1. -This one describes the internals of CodeMirror 2, a complete rewrite -and rethink of the old code base. I wanted to give this piece another -Hunter Thompson copycat subtitle, but somehow that would be out of -place—the process this time around was one of straightforward -engineering, requiring no serious mind-bending whatsoever.</p> - -<p>So, what is wrong with CodeMirror 1? I'd estimate, by mailing list -activity and general search-engine presence, that it has been -integrated into about a thousand systems by now. The most prominent -one, since a few weeks, -being <a href="http://googlecode.blogspot.com/2011/01/make-quick-fixes-quicker-on-google.html">Google -code's project hosting</a>. It works, and it's being used widely.</a> - -<p>Still, I did not start replacing it because I was bored. CodeMirror -1 was heavily reliant on <code>designMode</code> -or <code>contentEditable</code> (depending on the browser). Neither of -these are well specified (HTML5 tries -to <a href="http://www.w3.org/TR/html5/editing.html#contenteditable">specify</a> -their basics), and, more importantly, they tend to be one of the more -obscure and buggy areas of browser functionality—CodeMirror, by using -this functionality in a non-typical way, was constantly running up -against browser bugs. WebKit wouldn't show an empty line at the end of -the document, and in some releases would suddenly get unbearably slow. -Firefox would show the cursor in the wrong place. Internet Explorer -would insist on linkifying everything that looked like a URL or email -address, a behaviour that can't be turned off. Some bugs I managed to -work around (which was often a frustrating, painful process), others, -such as the Firefox cursor placement, I gave up on, and had to tell -user after user that they were known problems, but not something I -could help.</p> - -<p>Also, there is the fact that <code>designMode</code> (which seemed -to be less buggy than <code>contentEditable</code> in Webkit and -Firefox, and was thus used by CodeMirror 1 in those browsers) requires -a frame. Frames are another tricky area. It takes some effort to -prevent getting tripped up by domain restrictions, they don't -initialize synchronously, behave strangely in response to the back -button, and, on several browsers, can't be moved around the DOM -without having them re-initialize. They did provide a very nice way to -namespace the library, though—CodeMirror 1 could freely pollute the -namespace inside the frame.</p> - -<p>Finally, working with an editable document means working with -selection in arbitrary DOM structures. Internet Explorer (8 and -before) has an utterly different (and awkward) selection API than all -of the other browsers, and even among the different implementations of -<code>document.selection</code>, details about how exactly a selection -is represented vary quite a bit. Add to that the fact that Opera's -selection support tended to be very buggy until recently, and you can -imagine why CodeMirror 1 contains 700 lines of selection-handling -code.</p> - -<p>And that brings us to the main issue with the CodeMirror 1 -code base: The proportion of browser-bug-workarounds to real -application code was getting dangerously high. By building on top of a -few dodgy features, I put the system in a vulnerable position—any -incompatibility and bugginess in these features, I had to paper over -with my own code. Not only did I have to do some serious stunt-work to -get it to work on older browsers (as detailed in the -previous <a href="http://codemirror.net/story.html">story</a>), things -also kept breaking in newly released versions, requiring me to come up -with <em>new</em> scary hacks in order to keep up. This was starting -to lose its appeal.</p> - -<h2 id="approach">General Approach</h2> - -<p>What CodeMirror 2 does is try to sidestep most of the hairy hacks -that came up in version 1. I owe a lot to the -<a href="http://ace.ajax.org">ACE</a> editor for inspiration on how to -approach this.</p> - -<p>I absolutely did not want to be completely reliant on key events to -generate my input. Every JavaScript programmer knows that key event -information is horrible and incomplete. Some people (most awesomely -Mihai Bazon with <a href="http://ymacs.org">Ymacs</a>) have been able -to build more or less functioning editors by directly reading key -events, but it takes a lot of work (the kind of never-ending, fragile -work I described earlier), and will never be able to properly support -things like multi-keystoke international character -input. <a href="#keymap" class="update">[see below for caveat]</a></p> - -<p>So what I do is focus a hidden textarea, and let the browser -believe that the user is typing into that. What we show to the user is -a DOM structure we built to represent his document. If this is updated -quickly enough, and shows some kind of believable cursor, it feels -like a real text-input control.</p> - -<p>Another big win is that this DOM representation does not have to -span the whole document. Some CodeMirror 1 users insisted that they -needed to put a 30 thousand line XML document into CodeMirror. Putting -all that into the DOM takes a while, especially since, for some -reason, an editable DOM tree is slower than a normal one on most -browsers. If we have full control over what we show, we must only -ensure that the visible part of the document has been added, and can -do the rest only when needed. (Fortunately, the <code>onscroll</code> -event works almost the same on all browsers, and lends itself well to -displaying things only as they are scrolled into view.)</p> - -<h2 id="input">Input</h2> - -<p>ACE uses its hidden textarea only as a text input shim, and does -all cursor movement and things like text deletion itself by directly -handling key events. CodeMirror's way is to let the browser do its -thing as much as possible, and not, for example, define its own set of -key bindings. One way to do this would have been to have the whole -document inside the hidden textarea, and after each key event update -the display DOM to reflect what's in that textarea.</p> - -<p>That'd be simple, but it is not realistic. For even medium-sized -document the editor would be constantly munging huge strings, and get -terribly slow. What CodeMirror 2 does is put the current selection, -along with an extra line on the top and on the bottom, into the -textarea.</p> - -<p>This means that the arrow keys (and their ctrl-variations), home, -end, etcetera, do not have to be handled specially. We just read the -cursor position in the textarea, and update our cursor to match it. -Also, copy and paste work pretty much for free, and people get their -native key bindings, without any special work on my part. For example, -I have emacs key bindings configured for Chrome and Firefox. There is -no way for a script to detect this. <a class="update" -href="#keymap">[no longer the case]</a></p> - -<p>Of course, since only a small part of the document sits in the -textarea, keys like page up and ctrl-end won't do the right thing. -CodeMirror is catching those events and handling them itself.</p> - -<h2 id="selection">Selection</h2> - -<p>Getting and setting the selection range of a textarea in modern -browsers is trivial—you just use the <code>selectionStart</code> -and <code>selectionEnd</code> properties. On IE you have to do some -insane stuff with temporary ranges and compensating for the fact that -moving the selection by a 'character' will treat \r\n as a single -character, but even there it is possible to build functions that -reliably set and get the selection range.</p> - -<p>But consider this typical case: When I'm somewhere in my document, -press shift, and press the up arrow, something gets selected. Then, if -I, still holding shift, press the up arrow again, the top of my -selection is adjusted. The selection remembers where its <em>head</em> -and its <em>anchor</em> are, and moves the head when we shift-move. -This is a generally accepted property of selections, and done right by -every editing component built in the past twenty years.</p> - -<p>But not something that the browser selection APIs expose.</p> - -<p>Great. So when someone creates an 'upside-down' selection, the next -time CodeMirror has to update the textarea, it'll re-create the -selection as an 'upside-up' selection, with the anchor at the top, and -the next cursor motion will behave in an unexpected way—our second -up-arrow press in the example above will not do anything, since it is -interpreted in exactly the same way as the first.</p> - -<p>No problem. We'll just, ehm, detect that the selection is -upside-down (you can tell by the way it was created), and then, when -an upside-down selection is present, and a cursor-moving key is -pressed in combination with shift, we quickly collapse the selection -in the textarea to its start, allow the key to take effect, and then -combine its new head with its old anchor to get the <em>real</em> -selection.</p> - -<p>In short, scary hacks could not be avoided entirely in CodeMirror -2.</p> - -<p>And, the observant reader might ask, how do you even know that a -key combo is a cursor-moving combo, if you claim you support any -native key bindings? Well, we don't, but we can learn. The editor -keeps a set known cursor-movement combos (initialized to the -predictable defaults), and updates this set when it observes that -pressing a certain key had (only) the effect of moving the cursor. -This, of course, doesn't work if the first time the key is used was -for extending an inverted selection, but it works most of the -time.</p> - -<h2 id="update">Intelligent Updating</h2> - -<p>One thing that always comes up when you have a complicated internal -state that's reflected in some user-visible external representation -(in this case, the displayed code and the textarea's content) is -keeping the two in sync. The naive way is to just update the display -every time you change your state, but this is not only error prone -(you'll forget), it also easily leads to duplicate work on big, -composite operations. Then you start passing around flags indicating -whether the display should be updated in an attempt to be efficient -again and, well, at that point you might as well give up completely.</p> - -<p>I did go down that road, but then switched to a much simpler model: -simply keep track of all the things that have been changed during an -action, and then, only at the end, use this information to update the -user-visible display.</p> - -<p>CodeMirror uses a concept of <em>operations</em>, which start by -calling a specific set-up function that clears the state and end by -calling another function that reads this state and does the required -updating. Most event handlers, and all the user-visible methods that -change state are wrapped like this. There's a method -called <code>operation</code> that accepts a function, and returns -another function that wraps the given function as an operation.</p> - -<p>It's trivial to extend this (as CodeMirror does) to detect nesting, -and, when an operation is started inside an operation, simply -increment the nesting count, and only do the updating when this count -reaches zero again.</p> - -<p>If we have a set of changed ranges and know the currently shown -range, we can (with some awkward code to deal with the fact that -changes can add and remove lines, so we're dealing with a changing -coordinate system) construct a map of the ranges that were left -intact. We can then compare this map with the part of the document -that's currently visible (based on scroll offset and editor height) to -determine whether something needs to be updated.</p> - -<p>CodeMirror uses two update algorithms—a full refresh, where it just -discards the whole part of the DOM that contains the edited text and -rebuilds it, and a patch algorithm, where it uses the information -about changed and intact ranges to update only the out-of-date parts -of the DOM. When more than 30 percent (which is the current heuristic, -might change) of the lines need to be updated, the full refresh is -chosen (since it's faster to do than painstakingly finding and -updating all the changed lines), in the other case it does the -patching (so that, if you scroll a line or select another character, -the whole screen doesn't have to be -re-rendered). <span class="update">[the full-refresh -algorithm was dropped, it wasn't really faster than the patching -one]</span></p> - -<p>All updating uses <code>innerHTML</code> rather than direct DOM -manipulation, since that still seems to be by far the fastest way to -build documents. There's a per-line function that combines the -highlighting, <a href="manual.html#markText">marking</a>, and -selection info for that line into a snippet of HTML. The patch updater -uses this to reset individual lines, the refresh updater builds an -HTML chunk for the whole visible document at once, and then uses a -single <code>innerHTML</code> update to do the refresh.</p> - -<h2 id="parse">Parsers can be Simple</h2> - -<p>When I wrote CodeMirror 1, I -thought <a href="http://codemirror.net/story.html#parser">interruptable -parsers</a> were a hugely scary and complicated thing, and I used a -bunch of heavyweight abstractions to keep this supposed complexity -under control: parsers -were <a href="http://bob.pythonmac.org/archives/2005/07/06/iteration-in-javascript/">iterators</a> -that consumed input from another iterator, and used funny -closure-resetting tricks to copy and resume themselves.</p> - -<p>This made for a rather nice system, in that parsers formed strictly -separate modules, and could be composed in predictable ways. -Unfortunately, it was quite slow (stacking three or four iterators on -top of each other), and extremely intimidating to people not used to a -functional programming style.</p> - -<p>With a few small changes, however, we can keep all those -advantages, but simplify the API and make the whole thing less -indirect and inefficient. CodeMirror -2's <a href="manual.html#modeapi">mode API</a> uses explicit state -objects, and makes the parser/tokenizer a function that simply takes a -state and a character stream abstraction, advances the stream one -token, and returns the way the token should be styled. This state may -be copied, optionally in a mode-defined way, in order to be able to -continue a parse at a given point. Even someone who's never touched a -lambda in his life can understand this approach. Additionally, far -fewer objects are allocated in the course of parsing now.</p> - -<p>The biggest speedup comes from the fact that the parsing no longer -has to touch the DOM though. In CodeMirror 1, on an older browser, you -could <em>see</em> the parser work its way through the document, -managing some twenty lines in each 50-millisecond time slice it got. It -was reading its input from the DOM, and updating the DOM as it went -along, which any experienced JavaScript programmer will immediately -spot as a recipe for slowness. In CodeMirror 2, the parser usually -finishes the whole document in a single 100-millisecond time slice—it -manages some 1500 lines during that time on Chrome. All it has to do -is munge strings, so there is no real reason for it to be slow -anymore.</p> - -<h2 id="summary">What Gives?</h2> - -<p>Given all this, what can you expect from CodeMirror 2?</p> - -<ul> - -<li><strong>Small.</strong> the base library is -some <span class="update">45k</span> when minified -now, <span class="update">17k</span> when gzipped. It's smaller than -its own logo.</li> - -<li><strong>Lightweight.</strong> CodeMirror 2 initializes very -quickly, and does almost no work when it is not focused. This means -you can treat it almost like a textarea, have multiple instances on a -page without trouble.</li> - -<li><strong>Huge document support.</strong> Since highlighting is -really fast, and no DOM structure is being built for non-visible -content, you don't have to worry about locking up your browser when a -user enters a megabyte-sized document.</li> - -<li><strong>Extended API.</strong> Some things kept coming up in the -mailing list, such as marking pieces of text or lines, which were -extremely hard to do with CodeMirror 1. The new version has proper -support for these built in.</li> - -<li><strong>Tab support.</strong> Tabs inside editable documents were, -for some reason, a no-go. At least six different people announced they -were going to add tab support to CodeMirror 1, none survived (I mean, -none delivered a working version). CodeMirror 2 no longer removes tabs -from your document.</li> - -<li><strong>Sane styling.</strong> <code>iframe</code> nodes aren't -really known for respecting document flow. Now that an editor instance -is a plain <code>div</code> element, it is much easier to size it to -fit the surrounding elements. You don't even have to make it scroll if -you do not <a href="../demo/resize.html">want to</a>.</li> - -</ul> - -<p>On the downside, a CodeMirror 2 instance is <em>not</em> a native -editable component. Though it does its best to emulate such a -component as much as possible, there is functionality that browsers -just do not allow us to hook into. Doing select-all from the context -menu, for example, is not currently detected by CodeMirror.</p> - -<p id="changes" style="margin-top: 2em;"><span style="font-weight: -bold">[Updates from November 13th 2011]</span> Recently, I've made -some changes to the codebase that cause some of the text above to no -longer be current. I've left the text intact, but added markers at the -passages that are now inaccurate. The new situation is described -below.</p> - -<h2 id="btree">Content Representation</h2> - -<p>The original implementation of CodeMirror 2 represented the -document as a flat array of line objects. This worked well—splicing -arrays will require the part of the array after the splice to be -moved, but this is basically just a simple <code>memmove</code> of a -bunch of pointers, so it is cheap even for huge documents.</p> - -<p>However, I recently added line wrapping and code folding (line -collapsing, basically). Once lines start taking up a non-constant -amount of vertical space, looking up a line by vertical position -(which is needed when someone clicks the document, and to determine -the visible part of the document during scrolling) can only be done -with a linear scan through the whole array, summing up line heights as -you go. Seeing how I've been going out of my way to make big documents -fast, this is not acceptable.</p> - -<p>The new representation is based on a B-tree. The leaves of the tree -contain arrays of line objects, with a fixed minimum and maximum size, -and the non-leaf nodes simply hold arrays of child nodes. Each node -stores both the amount of lines that live below them and the vertical -space taken up by these lines. This allows the tree to be indexed both -by line number and by vertical position, and all access has -logarithmic complexity in relation to the document size.</p> - -<p>I gave line objects and tree nodes parent pointers, to the node -above them. When a line has to update its height, it can simply walk -these pointers to the top of the tree, adding or subtracting the -difference in height from each node it encounters. The parent pointers -also make it cheaper (in complexity terms, the difference is probably -tiny in normal-sized documents) to find the current line number when -given a line object. In the old approach, the whole document array had -to be searched. Now, we can just walk up the tree and count the sizes -of the nodes coming before us at each level.</p> - -<p>I chose B-trees, not regular binary trees, mostly because they -allow for very fast bulk insertions and deletions. When there is a big -change to a document, it typically involves adding, deleting, or -replacing a chunk of subsequent lines. In a regular balanced tree, all -these inserts or deletes would have to be done separately, which could -be really expensive. In a B-tree, to insert a chunk, you just walk -down the tree once to find where it should go, insert them all in one -shot, and then break up the node if needed. This breaking up might -involve breaking up nodes further up, but only requires a single pass -back up the tree. For deletion, I'm somewhat lax in keeping things -balanced—I just collapse nodes into a leaf when their child count goes -below a given number. This means that there are some weird editing -patterns that may result in a seriously unbalanced tree, but even such -an unbalanced tree will perform well, unless you spend a day making -strangely repeating edits to a really big document.</p> - -<h2 id="keymap">Keymaps</h2> - -<p><a href="#approach">Above</a>, I claimed that directly catching key -events for things like cursor movement is impractical because it -requires some browser-specific kludges. I then proceeded to explain -some awful <a href="#selection">hacks</a> that were needed to make it -possible for the selection changes to be detected through the -textarea. In fact, the second hack is about as bad as the first.</p> - -<p>On top of that, in the presence of user-configurable tab sizes and -collapsed and wrapped lines, lining up cursor movement in the textarea -with what's visible on the screen becomes a nightmare. Thus, I've -decided to move to a model where the textarea's selection is no longer -depended on.</p> - -<p>So I moved to a model where all cursor movement is handled by my -own code. This adds support for a goal column, proper interaction of -cursor movement with collapsed lines, and makes it possible for -vertical movement to move through wrapped lines properly, instead of -just treating them like non-wrapped lines.</p> - -<p>The key event handlers now translate the key event into a string, -something like <code>Ctrl-Home</code> or <code>Shift-Cmd-R</code>, and -use that string to look up an action to perform. To make keybinding -customizable, this lookup goes through -a <a href="manual.html#option_keyMap">table</a>, using a scheme that -allows such tables to be chained together (for example, the default -Mac bindings fall through to a table named 'emacsy', which defines -basic Emacs-style bindings like <code>Ctrl-F</code>, and which is also -used by the custom Emacs bindings).</p> - -<p>A new -option <a href="manual.html#option_extraKeys"><code>extraKeys</code></a> -allows ad-hoc keybindings to be defined in a much nicer way than what -was possible with the -old <a href="manual.html#option_onKeyEvent"><code>onKeyEvent</code></a> -callback. You simply provide an object mapping key identifiers to -functions, instead of painstakingly looking at raw key events.</p> - -<p>Built-in commands map to strings, rather than functions, for -example <code>"goLineUp"</code> is the default action bound to the up -arrow key. This allows new keymaps to refer to them without -duplicating any code. New commands can be defined by assigning to -the <code>CodeMirror.commands</code> object, which maps such commands -to functions.</p> - -<p>The hidden textarea now only holds the current selection, with no -extra characters around it. This has a nice advantage: polling for -input becomes much, much faster. If there's a big selection, this text -does not have to be read from the textarea every time—when we poll, -just noticing that something is still selected is enough to tell us -that no new text was typed.</p> - -<p>The reason that cheap polling is important is that many browsers do -not fire useful events on IME (input method engine) input, which is -the thing where people inputting a language like Japanese or Chinese -use multiple keystrokes to create a character or sequence of -characters. Most modern browsers fire <code>input</code> when the -composing is finished, but many don't fire anything when the character -is updated <em>during</em> composition. So we poll, whenever the -editor is focused, to provide immediate updates of the display.</p> - -</div><div class="rightsmall blk"> - - <h2>Contents</h2> - - <ul> - <li><a href="#intro">Introduction</a></li> - <li><a href="#approach">General Approach</a></li> - <li><a href="#input">Input</a></li> - <li><a href="#selection">Selection</a></li> - <li><a href="#update">Intelligent Updating</a></li> - <li><a href="#parse">Parsing</a></li> - <li><a href="#summary">What Gives?</a></li> - <li><a href="#btree">Content Representation</a></li> - <li><a href="#keymap">Key Maps</a></li> - </ul> - -</div></div> - -<div style="height: 2em"> </div> - -</body></html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/manual.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/manual.html deleted file mode 100644 index 811acaee45c356e65f6ac8544e10c76f156d621a..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/manual.html +++ /dev/null @@ -1,1463 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"/> - <title>CodeMirror: User Manual</title> - <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"/> - <link rel="stylesheet" type="text/css" href="docs.css"/> - <style>dl dl {margin: 0;}</style> - <script src="../lib/codemirror.js"></script> - <link rel="stylesheet" href="../lib/codemirror.css"> - <script src="../lib/util/runmode.js"></script> - <script src="../lib/util/colorize.js"></script> - <script src="../mode/javascript/javascript.js"></script> - <script src="../mode/xml/xml.js"></script> - <script src="../mode/css/css.js"></script> - <script src="../mode/htmlmixed/htmlmixed.js"></script> - </head> - <body> - -<h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1> - -<div class="grey"> -<img src="baboon.png" class="logo" alt="logo"/> -<pre> -/* User manual and - reference guide */ -</pre> -</div> - -<div class="clear"><div class="leftbig blk"> - - <h2 id="overview">Overview</h2> - - <p>CodeMirror is a code-editor component that can be embedded in - Web pages. The core library provides <em>only</em> the editor - component, no accompanying buttons, auto-completion, or other IDE - functionality. It does provide a rich API on top of which such - functionality can be straightforwardly implemented. See - the <a href="#addons">add-ons</a> included in the distribution, - and - the <a href="https://github.com/jagthedrummer/codemirror-ui">CodeMirror - UI</a> project, for reusable implementations of extra features.</p> - - <p>CodeMirror works with language-specific modes. Modes are - JavaScript programs that help color (and optionally indent) text - written in a given language. The distribution comes with a number - of modes (see the <a href="../mode/"><code>mode/</code></a> - directory), and it isn't hard to <a href="#modeapi">write new - ones</a> for other languages.</p> - - <h2 id="usage">Basic Usage</h2> - - <p>The easiest way to use CodeMirror is to simply load the script - and style sheet found under <code>lib/</code> in the distribution, - plus a mode script from one of the <code>mode/</code> directories. - (See <a href="compress.html">the compression helper</a> for an - easy way to combine scripts.) For example:</p> - - <pre data-lang="text/html"><script src="lib/codemirror.js"></script> -<link rel="stylesheet" href="../lib/codemirror.css"> -<script src="mode/javascript/javascript.js"></script></pre> - - <p>Having done this, an editor instance can be created like - this:</p> - - <pre data-lang="javascript">var myCodeMirror = CodeMirror(document.body);</pre> - - <p>The editor will be appended to the document body, will start - empty, and will use the mode that we loaded. To have more control - over the new editor, a configuration object can be passed - to <code>CodeMirror</code> as a second argument:</p> - - <pre data-lang="javascript">var myCodeMirror = CodeMirror(document.body, { - value: "function myScript(){return 100;}\n", - mode: "javascript" -});</pre> - - <p>This will initialize the editor with a piece of code already in - it, and explicitly tell it to use the JavaScript mode (which is - useful when multiple modes are loaded). - See <a href="#config">below</a> for a full discussion of the - configuration options that CodeMirror accepts.</p> - - <p>In cases where you don't want to append the editor to an - element, and need more control over the way it is inserted, the - first argument to the <code>CodeMirror</code> function can also - be a function that, when given a DOM element, inserts it into the - document somewhere. This could be used to, for example, replace a - textarea with a real editor:</p> - - <pre data-lang="javascript">var myCodeMirror = CodeMirror(function(elt) { - myTextArea.parentNode.replaceChild(elt, myTextArea); -}, {value: myTextArea.value});</pre> - - <p>However, for this use case, which is a common way to use - CodeMirror, the library provides a much more powerful - shortcut:</p> - - <pre data-lang="javascript">var myCodeMirror = CodeMirror.fromTextArea(myTextArea);</pre> - - <p>This will, among other things, ensure that the textarea's value - is updated with the editor's contents when the form (if it is part - of a form) is submitted. See the <a href="#fromTextArea">API - reference</a> for a full description of this method.</p> - - <h2 id="config">Configuration</h2> - - <p>Both the <code>CodeMirror</code> function and - its <code>fromTextArea</code> method take as second (optional) - argument an object containing configuration options. Any option - not supplied like this will be taken - from <code>CodeMirror.defaults</code>, an object containing the - default options. You can update this object to change the defaults - on your page.</p> - - <p>Options are not checked in any way, so setting bogus option - values is bound to lead to odd errors.</p> - - <p>These are the supported options:</p> - - <dl> - <dt id="option_value"><code>value (string)</code></dt> - <dd>The starting value of the editor.</dd> - - <dt id="option_mode"><code>mode (string or object)</code></dt> - <dd>The mode to use. When not given, this will default to the - first mode that was loaded. It may be a string, which either - simply names the mode or is - a <a href="http://en.wikipedia.org/wiki/MIME">MIME</a> type - associated with the mode. Alternatively, it may be an object - containing configuration options for the mode, with - a <code>name</code> property that names the mode (for - example <code>{name: "javascript", json: true}</code>). The demo - pages for each mode contain information about what configuration - parameters the mode supports. You can ask CodeMirror which modes - and MIME types have been defined by inspecting - the <code>CodeMirror.modes</code> - and <code>CodeMirror.mimeModes</code> objects. The first maps - mode names to their constructors, and the second maps MIME types - to mode specs.</dd> - - <dt id="option_theme"><code>theme (string)</code></dt> - <dd>The theme to style the editor with. You must make sure the - CSS file defining the corresponding <code>.cm-s-[name]</code> - styles is loaded (see - the <a href="../theme/"><code>theme</code></a> directory in the - distribution). The default is <code>"default"</code>, for which - colors are included in <code>codemirror.css</code>. It is - possible to use multiple theming classes at once—for - example <code>"foo bar"</code> will assign both - the <code>cm-s-foo</code> and the <code>cm-s-bar</code> classes - to the editor.</dd> - - <dt id="option_indentUnit"><code>indentUnit (integer)</code></dt> - <dd>How many spaces a block (whatever that means in the edited - language) should be indented. The default is 2.</dd> - - <dt id="option_smartIndent"><code>smartIndent (boolean)</code></dt> - <dd>Whether to use the context-sensitive indentation that the - mode provides (or just indent the same as the line before). - Defaults to true.</dd> - - <dt id="option_tabSize"><code>tabSize (integer)</code></dt> - <dd>The width of a tab character. Defaults to 4.</dd> - - <dt id="option_indentWithTabs"><code>indentWithTabs (boolean)</code></dt> - <dd>Whether, when indenting, the first N*<code>tabSize</code> - spaces should be replaced by N tabs. Default is false.</dd> - - <dt id="option_electricChars"><code>electricChars (boolean)</code></dt> - <dd>Configures whether the editor should re-indent the current - line when a character is typed that might change its proper - indentation (only works if the mode supports indentation). - Default is true.</dd> - - <dt id="option_keyMap"><code>keyMap (string)</code></dt> - <dd>Configures the keymap to use. The default - is <code>"default"</code>, which is the only keymap defined - in <code>codemirror.js</code> itself. Extra keymaps are found in - the <a href="../keymap/"><code>keymap</code></a> directory. See - the <a href="#keymaps">section on keymaps</a> for more - information.</dd> - - <dt id="option_extraKeys"><code>extraKeys (object)</code></dt> - <dd>Can be used to specify extra keybindings for the editor, - alongside the ones defined - by <a href="#option_keyMap"><code>keyMap</code></a>. Should be - either null, or a valid <a href="#keymaps">keymap</a> value.</dd> - - <dt id="option_lineWrapping"><code>lineWrapping (boolean)</code></dt> - <dd>Whether CodeMirror should scroll or wrap for long lines. - Defaults to <code>false</code> (scroll).</dd> - - <dt id="option_lineNumbers"><code>lineNumbers (boolean)</code></dt> - <dd>Whether to show line numbers to the left of the editor.</dd> - - <dt id="option_firstLineNumber"><code>firstLineNumber (integer)</code></dt> - <dd>At which number to start counting lines. Default is 1.</dd> - - <dt id="option_lineNumberFormatter"><code>lineNumberFormatter (function)</code></dt> - <dd>A function used to format line numbers. The function is - passed the line number, and should return a string that will be - shown in the gutter.</dd> - - <dt id="option_gutters"><code>gutters (array)</code></dt> - <dd>Can be used to add extra gutters (beyond or instead of the - line number gutter). Should be an array of CSS class names, each - of which defines a <code>width</code> (and optionally a - background), and which will be used to draw the background of - the gutters. <em>May</em> include - the <code>CodeMirror-linenumbers</code> class, in order to - explicitly set the position of the line number gutter (it will - default to be to the right of all other gutters). These class - names are the keys passed - to <a href="#setGutterMarker"><code>setGutterMarker</code></a>.</dd> - - <dt id="option_readOnly"><code>readOnly (boolean)</code></dt> - <dd>This disables editing of the editor content by the user. If - the special value <code>"nocursor"</code> is given (instead of - simply <code>true</code>), focusing of the editor is also - disallowed.</dd> - - <dt id="option_showCursorWhenSelecting"><code>showCursorWhenSelecting (boolean)</code></dt> - <dd>Whether the cursor should be drawn when a selection is - active. Defaults to false.</dd> - - <dt id="option_undoDepth"><code>undoDepth (integer)</code></dt> - <dd>The maximum number of undo levels that the editor stores. - Defaults to 40.</dd> - - <dt id="option_tabindex"><code>tabindex (integer)</code></dt> - <dd>The <a href="http://www.w3.org/TR/html401/interact/forms.html#adef-tabindex">tab - index</a> to assign to the editor. If not given, no tab index - will be assigned.</dd> - - <dt id="option_autofocus"><code>autofocus (boolean)</code></dt> - <dd>Can be used to make CodeMirror focus itself on - initialization. Defaults to off. - When <a href="#fromTextArea"><code>fromTextArea</code></a> is - used, and no explicit value is given for this option, it will be - set to true when either the source textarea is focused, or it - has an <code>autofocus</code> attribute and no other element is - focused.</dd> - </dl> - - <p>Below this a few more specialized, low-level options are - listed. These are only useful in very specific situations, you - might want to skip them the first time you read this manual.</p> - - <dl> - <dt id="option_dragDrop"><code>dragDrop (boolean)</code></dt> - <dd>Controls whether drag-and-drop is enabled. On by default.</dd> - - <dt id="option_onDragEvent"><code>onDragEvent (function)</code></dt> - <dd>When given, this will be called when the editor is handling - a <code>dragenter</code>, <code>dragover</code>, - or <code>drop</code> event. It will be passed the editor instance - and the event object as arguments. The callback can choose to - handle the event itself, in which case it should - return <code>true</code> to indicate that CodeMirror should not - do anything further.</dd> - - <dt id="option_onKeyEvent"><code>onKeyEvent (function)</code></dt> - <dd>This provides a rather low-level hook into CodeMirror's key - handling. If provided, this function will be called on - every <code>keydown</code>, <code>keyup</code>, - and <code>keypress</code> event that CodeMirror captures. It - will be passed two arguments, the editor instance and the key - event. This key event is pretty much the raw key event, except - that a <code>stop()</code> method is always added to it. You - could feed it to, for example, <code>jQuery.Event</code> to - further normalize it.<br>This function can inspect the key - event, and handle it if it wants to. It may return true to tell - CodeMirror to ignore the event. Be wary that, on some browsers, - stopping a <code>keydown</code> does not stop - the <code>keypress</code> from firing, whereas on others it - does. If you respond to an event, you should probably inspect - its <code>type</code> property and only do something when it - is <code>keydown</code> (or <code>keypress</code> for actions - that need character data).</dd> - - <dt id="option_cursorBlinkRate"><code>cursorBlinkRate (number)</code></dt> - <dd>Half-period in milliseconds used for cursor blinking. The default blink - rate is 530ms.</dd> - - <dt id="option_cursorHeight"><code>cursorHeight (number)</code></dt> - <dd>Determines the height of the cursor. Default is 1, meaning - it spans the whole height of the line. For some fonts (and by - some tastes) a smaller height (for example <code>0.85</code>), - which causes the cursor to not reach all the way to the bottom - of the line, looks better</dd> - - <dt id="option_workTime"><code>workTime, workDelay (number)</code></dt> - <dd>Highlighting is done by a pseudo background-thread that will - work for <code>workTime</code> milliseconds, and then use - timeout to sleep for <code>workDelay</code> milliseconds. The - defaults are 200 and 300, you can change these options to make - the highlighting more or less aggressive.</dd> - - <dt id="option_pollInterval"><code>pollInterval (number)</code></dt> - <dd>Indicates how quickly CodeMirror should poll its input - textarea for changes (when focused). Most input is captured by - events, but some things, like IME input on some browsers, don't - generate events that allow CodeMirror to properly detect it. - Thus, it polls. Default is 100 milliseconds.</dd> - - <dt id="option_flattenSpans"><code>flattenSpans (boolean)</code></dt> - <dd>By default, CodeMirror will combine adjacent tokens into a - single span if they have the same class. This will result in a - simpler DOM tree, and thus perform better. With some kinds of - styling (such as rounded corners), this will change the way the - document looks. You can set this option to false to disable this - behavior.</dd> - - <dt id="option_viewportMargin"><code>viewportMargin (integer)</code></dt> - <dd>Specifies the amount of lines that are rendered above and - below the part of the document that's currently scrolled into - view. This affects the amount of updates needed when scrolling, - and the amount of work that such an update does. You should - usually leave it at its default, 100. Can be set - to <code>Infinity</code> to make sure the whole document is - always rendered, and thus the browser's text search works on it. - This <em>will</em> have bad effects on performance of big - documents.</dd> - </dl> - - <h2 id="events">Events</h2> - - <p>A CodeMirror instance emits a number of events, which allow - client code to react to various situations. These are registered - with the <a href="#on"><code>on</code></a> method (and - removed with the <a href="#off"><code>off</code></a> - method). These are the events that fire on the instance object. - The name of the event is followed by the arguments that will be - passed to the handler. The <code>instance</code> argument always - refers to the editor instance.</p> - - <dl> - <dt id="event_change"><code>"change" (instance, changeObj)</code></dt> - <dd>Fires every time the content of the editor is changed. - The <code>changeObj</code> is a <code>{from, to, text, - next}</code> object containing information about the changes - that occurred as second argument. <code>from</code> - and <code>to</code> are the positions (in the pre-change - coordinate system) where the change started and ended (for - example, it might be <code>{ch:0, line:18}</code> if the - position is at the beginning of line #19). <code>text</code> is - an array of strings representing the text that replaced the - changed range (split by line). If multiple changes happened - during a single operation, the object will have - a <code>next</code> property pointing to another change object - (which may point to another, etc).</dd> - - <dt id="event_cursorActivity"><code>"cursorActivity" (instance)</code></dt> - <dd>Will be fired when the cursor or selection moves, or any - change is made to the editor content.</dd> - - <dt id="event_viewportChange"><code>"viewportChange" (instance, from, to)</code></dt> - <dd>Fires whenever the <a href="#getViewport">view port</a> of - the editor changes (due to scrolling, editing, or any other - factor). The <code>from</code> and <code>to</code> arguments - give the new start and end of the viewport.</dd> - - <dt id="event_gutterClick"><code>"gutterClick" (instance, line, gutter, clickEvent)</code></dt> - <dd>Fires when the editor gutter (the line-number area) is - clicked. Will pass the editor instance as first argument, the - (zero-based) number of the line that was clicked as second - argument, the CSS class of the gutter that was clicked as third - argument, and the raw <code>mousedown</code> event object as - fourth argument.</dd> - - <dt id="event_focus"><code>"focus", "blur" (instance)</code></dt> - <dd>These fire whenever the editor is focused or unfocused.</dd> - - <dt id="event_scroll"><code>"scroll" (instance)</code></dt> - <dd>Fires when the editor is scrolled.</dd> - - <dt id="event_update"><code>"update" (instance)</code></dt> - <dd>Will be fired whenever CodeMirror updates its DOM display.</dd> - </dl> - - <p>It is also possible to <a href="#on">register</a> events - on other objects. Line handles (as returned by, for - example, <a href="#getLineHandle"><code>getLineHandle</code></a>) - can be listened on with <code>CodeMirror.on(handle, "delete", - myFunc)</code>. They support the following events:</p> - - <dl> - <dt id="event_delete"><code>"delete" ()</code></dt> - <dd>Will be fired when the line object is deleted. A line object - is associated with the <em>start</em> of the line. Mostly useful - when you need to find out when your <a href="#setGutterMarker">gutter - markers</a> on a given line are removed.</dd> - <dt id="event_line_change"><code>"change" ()</code></dt> - <dd>Fires when the line's text content is changed in any way - (but the line is not deleted outright).</dd> - </dl> - - <p>Marked range handles, as returned - by <a href="#markText"><code>markText</code></a>, emit the - following event:</p> - - <dl> - <dt id="event_clear"><code>"clear" ()</code></dt> - <dd>Fired when the range is cleared, either through cursor - movement in combination - with <a href="#mark_clearOnEnter"><code>clearOnEnter</code></a> - or through a call to its <code>clear()</code> method. Will only - be fired once per handle. Note that deleting the range through - text editing does not fire this event, because an undo - action might bring the range back into existence.</dd> - </dl> - - <h2 id="keymaps">Keymaps</h2> - - <p>Keymaps are ways to associate keys with functionality. A keymap - is an object mapping strings that identify the keys to functions - that implement their functionality.</p> - - <p>Keys are identified either by name or by character. - The <code>CodeMirror.keyNames</code> object defines names for - common keys and associates them with their key codes. Examples of - names defined here are <code>Enter</code>, <code>F5</code>, - and <code>Q</code>. These can be prefixed - with <code>Shift-</code>, <code>Cmd-</code>, <code>Ctrl-</code>, - and <code>Alt-</code> (in that order!) to specify a modifier. So - for example, <code>Shift-Ctrl-Space</code> would be a valid key - identifier.</p> - - <p>Alternatively, a character can be specified directly by - surrounding it in single quotes, for example <code>'$'</code> - or <code>'q'</code>. Due to limitations in the way browsers fire - key events, these may not be prefixed with modifiers.</p> - - <p>The <code>CodeMirror.keyMap</code> object associates keymaps - with names. User code and keymap definitions can assign extra - properties to this object. Anywhere where a keymap is expected, a - string can be given, which will be looked up in this object. It - also contains the <code>"default"</code> keymap holding the - default bindings.</p> - - <p id="commands">The values of properties in keymaps can be either functions of - a single argument (the CodeMirror instance), strings, or - <code>false</code>. Such strings refer to properties of the - <code>CodeMirror.commands</code> object, which defines a number of - common commands that are used by the default keybindings, and maps - them to functions. If the property is set to <code>false</code>, - CodeMirror leaves handling of the key up to the browser. A key - handler function may throw <code>CodeMirror.Pass</code> to indicate - that it has decided not to handle the key, and other handlers (or - the default behavior) should be given a turn.</p> - - <p>Keys mapped to command names that start with the - characters <code>"go"</code> (which should be used for - cursor-movement actions) will be fired even when an - extra <code>Shift</code> modifier is present (i.e. <code>"Up": - "goLineUp"</code> matches both up and shift-up). This is used to - easily implement shift-selection.</p> - - <p>Keymaps can defer to each other by defining - a <code>fallthrough</code> property. This indicates that when a - key is not found in the map itself, one or more other maps should - be searched. It can hold either a single keymap or an array of - keymaps.</p> - - <p>When a keymap contains a <code>nofallthrough</code> property - set to <code>true</code>, keys matched against that map will be - ignored if they don't match any of the bindings in the map (no - further child maps will be tried, and the default effect of - inserting a character will not occur).</p> - - <h2 id="styling">Customized Styling</h2> - - <p>Up to a certain extent, CodeMirror's look can be changed by - modifying style sheet files. The style sheets supplied by modes - simply provide the colors for that mode, and can be adapted in a - very straightforward way. To style the editor itself, it is - possible to alter or override the styles defined - in <a href="../lib/codemirror.css"><code>codemirror.css</code></a>.</p> - - <p>Some care must be taken there, since a lot of the rules in this - file are necessary to have CodeMirror function properly. Adjusting - colors should be safe, of course, and with some care a lot of - other things can be changed as well. The CSS classes defined in - this file serve the following roles:</p> - - <dl> - <dt id="class_CodeMirror"><code>CodeMirror</code></dt> - <dd>The outer element of the editor. This should be used for the - editor width, height, borders and positioning. Can also be used - to set styles that should hold for everything inside the editor - (such as font and font size), or to set a background.</dd> - - <dt id="class_CodeMirror_scroll"><code>CodeMirror-scroll</code></dt> - <dd>Whether the editor scrolls (<code>overflow: auto</code> + - fixed height). By default, it does. Setting - the <code>CodeMirror</code> class to have <code>height: - auto</code> and giving this class <code>overflow-x: auto; - overflow-y: hidden;</code> will cause the editor - to <a href="../demo/resize.html">resize to fit its - content</a>.</dd> - - <dt id="class_CodeMirror_focused"><code>CodeMirror-focused</code></dt> - <dd>Whenever the editor is focused, the top element gets this - class. This is used to hide the cursor and give the selection a - different color when the editor is not focused.</dd> - - <dt id="class_CodeMirror_gutters"><code>CodeMirror-gutters</code></dt> - <dd>This is the backdrop for all gutters. Use it to set the - default gutter background color, and optionally add a border on - the right of the gutters.</dd> - - <dt id="class_CodeMirror_linenumbers"><code>CodeMirror-linenumbers</code></dt> - <dd>Use this for giving a background or width to the line number - gutter.</dd> - - <dt id="class_CodeMirror_linenumber"><code>CodeMirror-linenumber</code></dt> - <dd>Used to style the actual individual line numbers. These - won't be children of the <code>CodeMirror-linenumbers</code> - (plural) element, but rather will be absolutely positioned to - overlay it. Use this to set alignment and text properties for - the line numbers.</dd> - - <dt id="class_CodeMirror_lines"><code>CodeMirror-lines</code></dt> - <dd>The visible lines. This is where you specify vertical - padding for the editor content.</dd> - - <dt id="class_CodeMirror_cursor"><code>CodeMirror-cursor</code></dt> - <dd>The cursor is a block element that is absolutely positioned. - You can make it look whichever way you want.</dd> - - <dt id="class_CodeMirror_selected"><code>CodeMirror-selected</code></dt> - <dd>The selection is represented by <code>span</code> elements - with this class.</dd> - - <dt id="class_CodeMirror_matchingbracket"><code>CodeMirror-matchingbracket</code>, - <code>CodeMirror-nonmatchingbracket</code></dt> - <dd>These are used to style matched (or unmatched) brackets.</dd> - </dl> - - <p>If your page's style sheets do funky things to - all <code>div</code> or <code>pre</code> elements (you probably - shouldn't do that), you'll have to define rules to cancel these - effects out again for elements under the <code>CodeMirror</code> - class.</p> - - <p>Themes are also simply CSS files, which define colors for - various syntactic elements. See the files in - the <a href="../theme/"><code>theme</code></a> directory.</p> - - <h2 id="api">Programming API</h2> - - <p>A lot of CodeMirror features are only available through its - API. Thus, you need to write code (or - use <a href="#addons">add-ons</a>) if you want to expose them to - your users.</p> - - <p>Whenever points in the document are represented, the API uses - objects with <code>line</code> and <code>ch</code> properties. - Both are zero-based. CodeMirror makes sure to 'clip' any positions - passed by client code so that they fit inside the document, so you - shouldn't worry too much about sanitizing your coordinates. If you - give <code>ch</code> a value of <code>null</code>, or don't - specify it, it will be replaced with the length of the specified - line.</p> - - <dl> - <dt id="getValue"><code>getValue() → string</code></dt> - <dd>Get the current editor content. You can pass it an optional - argument to specify the string to be used to separate lines - (defaults to <code>"\n"</code>).</dd> - <dt id="setValue"><code>setValue(string)</code></dt> - <dd>Set the editor content.</dd> - - <dt id="lineCount"><code>lineCount() → number</code></dt> - <dd>Get the number of lines in the editor.</dd> - - <dt id="getRange"><code>getRange(from, to) → string</code></td> - <dd>Get the text between the given points in the editor, which - should be <code>{line, ch}</code> objects. An optional third - argument can be given to indicate the line separator string to - use (defaults to <code>"\n"</code>).</dd> - <dt id="replaceRange"><code>replaceRange(string, from, to)</code></dt> - <dd>Replace the part of the document between <code>from</code> - and <code>to</code> with the given string. <code>from</code> - and <code>to</code> must be <code>{line, ch}</code> - objects. <code>to</code> can be left off to simply insert the - string at position <code>from</code>.</dd> - - <dt id="getSelection"><code>getSelection() → string</code></dt> - <dd>Get the currently selected code.</dd> - <dt id="replaceSelection"><code>replaceSelection(string)</code></dt> - <dd>Replace the selection with the given string.</dd> - - <dt id="getCursor"><code>getCursor(start) → object</code></dt> - <dd><code>start</code> is a boolean indicating whether the start - or the end of the selection must be retrieved. If it is not - given, the current cursor pos, i.e. the side of the selection - that would move if you pressed an arrow key, is chosen. - Alternatively, you can pass one of the - strings <code>"start"</code>, <code>"end"</code>, <code>"head"</code> - (same as not passing anything), or <code>"anchor"</code> (the - opposite). A <code>{line, ch}</code> object will be - returned.</dd> - <dt id="somethingSelected"><code>somethingSelected() → boolean</code></dt> - <dd>Return true if any text is selected.</dd> - <dt id="setCursor"><code>setCursor(pos)</code></dt> - <dd>Set the cursor position. You can either pass a - single <code>{line, ch}</code> object, or the line and the - character as two separate parameters.</dd> - <dt id="setSelection"><code>setSelection(anchor, head)</code></dt> - <dd>Set the selection range. <code>anchor</code> - and <code>head</code> should be <code>{line, ch}</code> - objects. <code>head</code> defaults to <code>anchor</code> when - not givne.</dd> - - <dt id="getLine"><code>getLine(n) → string</code></dt> - <dd>Get the content of line <code>n</code>.</dd> - <dt id="setLine"><code>setLine(n, text)</code></dt> - <dd>Set the content of line <code>n</code>.</dd> - <dt id="removeLine"><code>removeLine(n)</code></dt> - <dd>Remove the given line from the document.</dd> - - <dt id="setSize"><code>setSize(width, height)</code></dt> - <dd>Programatically set the size of the editor (overriding the - applicable <a href="#css-resize">CSS - rules</a>). <code>width</code> and <code>height</code> height - can be either numbers (interpreted as pixels) or CSS units - (<code>"100%"</code>, for example). You can - pass <code>null</code> for either of them to indicate that that - dimension should not be changed.</dd> - <dt id="focus"><code>focus()</code></dt> - <dd>Give the editor focus.</dd> - <dt id="scrollTo"><code>scrollTo(x, y)</code></dt> - <dd>Scroll the editor to a given (pixel) position. Both - arguments may be left as <code>null</code> - or <code>undefined</code> to have no effect.</dd> - <dt id="getScrollInfo"><code>getScrollInfo()</code></dt> - <dd>Get an <code>{left, top, width, height, clientWidth, - clientHeight}</code> object that represents the current scroll - position, the size of the scrollable area, and the size of the - visible area (minus scrollbars).</dd> - <dt id="scrollIntoView"><code>scrollIntoView(pos)</code></dt> - <dd>Scrolls the given <code>{line, ch}</code> position into - view. If no argument is given, this will scroll the cursor into - view.</dd> - - <dt id="setOption"><code>setOption(option, value)</code></dt> - <dd>Change the configuration of the editor. <code>option</code> - should the name of an <a href="#config">option</a>, - and <code>value</code> should be a valid value for that - option.</dd> - <dt id="getOption"><code>getOption(option) → value</code></dt> - <dd>Retrieves the current value of the given option for this - editor instance.</dd> - <dt id="getMode"><code>getMode() → object</code></dt> - <dd>Gets the mode object for the editor. Note that this is - distinct from <code>getOption("mode")</code>, which gives you - the mode specification, rather than the resolved, instantiated - <a href="#defineMode">mode object</a>.</dd> - - <dt id="addKeyMap"><code>addKeyMap(map)</code></dt> - <dd>Attach an additional <a href="#keymaps">keymap</a> to the editor. This is mostly - useful for add-ons that need to register some key handlers - without trampling on - the <a href="#option_extraKeys"><code>extraKeys</code></a> - option. Maps added in this way have a lower precedence - than <code>extraKeys</code>, a higher precedence than the - base <a href="#option_keyMap"><code>keyMap</code></a>, and - between them, the maps added earlier have a higher precedence - than those added later.</dd> - <dt id="removeKeyMap"><code>removeKeyMap(map)</code></dt> - <dd>Disable a keymap added - with <a href="#addKeyMap"><code>addKeyMap</code></a>. Either - pass in the keymap object itself, or a string, which will be - compared against the <code>name</code> property of the active - keymaps.</dd> - - <dt id="on"><code>on(type, func)</code></dt> - <dd>Register an event handler for the given event type (a - string) on the editor instance. There is also - a <code>CodeMirror.on(object, type, func)</code> version - that allows registering of events on any object.</dd> - <dt id="off"><code>off(type, func)</code></dt> - <dd>Remove an event handler on the editor instance. An - equivalent <code>CodeMirror.off(object, type, - func)</code> also exists.</dd> - - <dt id="cursorCoords"><code>cursorCoords(where, mode) → object</code></dt> - <dd>Returns an <code>{left, top, bottom}</code> object - containing the coordinates of the cursor position. - If <code>mode</code> is <code>"local"</code>, they will be - relative to the top-left corner of the editable document. If it - is <code>"page"</code> or not given, they are relative to the - top-left corner of the page. <code>where</code> can be a boolean - indicating whether you want the start (<code>true</code>) or the - end (<code>false</code>) of the selection, or, if a <code>{line, - ch}</code> object is given, it specifies the precise position at - which you want to measure.</dd> - <dt id="charCoords"><code>charCoords(pos, mode) → object</code></dt> - <dd>Returns the position and dimensions of an arbitrary - character. <code>pos</code> should be a <code>{line, ch}</code> - object. This differs from <code>cursorCoords</code> in that - it'll give the size of the whole character, rather than just the - position that the cursor would have when it would sit at that - position.</dd> - <dt id="coordsChar"><code>coordsChar(object) → pos</code></dt> - <dd>Given an <code>{left, top}</code> object (in page coordinates), - returns the <code>{line, ch}</code> position that corresponds to - it.</dd> - <dt id="defaultTextHeight"><code>defaultTextHeight() → number</code></dt> - <dd>Returns the line height of the default font for the editor.</dd> - - <dt id="markClean"><code>markClean()</code></dt> - <dd>Set the editor content as 'clean', a flag that it will - retain until it is edited, and which will be set again when such - an edit is undone again. Useful to track whether the content - needs to be saved.</dd> - <dt id="isClean"><code>isClean() → boolean</code></dt> - <dd>Returns whether the document is currently clean (not - modified since initialization or the last call - to <a href="#markClean"><code>markClean</code></a>).</dd> - - <dt id="undo"><code>undo()</code></dt> - <dd>Undo one edit (if any undo events are stored).</dd> - <dt id="redo"><code>redo()</code></dt> - <dd>Redo one undone edit.</dd> - <dt id="historySize"><code>historySize() → object</code></dt> - <dd>Returns an object with <code>{undo, redo}</code> properties, - both of which hold integers, indicating the amount of stored - undo and redo operations.</dd> - <dt id="clearHistory"><code>clearHistory()</code></dt> - <dd>Clears the editor's undo history.</dd> - <dt id="getHistory"><code>getHistory() → object</code></dt> - <dd>Get a (JSON-serializeable) representation of the undo history.</dd> - <dt id="setHistory"><code>setHistory(object)</code></dt> - <dd>Replace the editor's undo history with the one provided, - which must be a value as returned - by <a href="#getHistory"><code>getHistory</code></a>. Note that - this will have entirely undefined results if the editor content - isn't also the same as it was when <code>getHistory</code> was - called.</dd> - - <dt id="indentLine"><code>indentLine(line, dir)</code></dt> - <dd>Adjust the indentation of the given line. The second - argument (which defaults to <code>"smart"</code>) may be one of: - <dl> - <dt><code>"prev"</code></dt> - <dd>Base indentation on the indentation of the previous line.</dd> - <dt><code>"smart"</code></dt> - <dd>Use the mode's smart indentation if available, behave - like <code>"prev"</code> otherwise.</dd> - <dt><code>"add"</code></dt> - <dd>Increase the indentation of the line by - one <a href="#option_indentUnit">indent unit</a>.</dd> - <dt><code>"subtract"</code></dt> - <dd>Reduce the indentation of the line.</dd> - </dl></dd> - - <dt id="getTokenAt"><code>getTokenAt(pos) → object</code></dt> - <dd>Retrieves information about the token the current mode found - before the given position (a <code>{line, ch}</code> object). The - returned object has the following properties: - <dl> - <dt><code>start</code></dt><dd>The character (on the given line) at which the token starts.</dd> - <dt><code>end</code></dt><dd>The character at which the token ends.</dd> - <dt><code>string</code></dt><dd>The token's string.</dd> - <dt><code>type</code></dt><dd>The token type the mode assigned - to the token, such as <code>"keyword"</code> - or <code>"comment"</code> (may also be null).</dd> - <dt><code>state</code></dt><dd>The mode's state at the end of this token.</dd> - </dl></dd> - - <dt id="markText"><code>markText(from, to, options) → object</code></dt> - <dd>Can be used to mark a range of text with a specific CSS - class name. <code>from</code> and <code>to</code> should - be <code>{line, ch}</code> objects. The <code>options</code> - parameter is optional. When given, it should be an object that - may contain the following configuration options: - <dl> - <dt id="mark_className"><code>className (string)</code></dt> - <dd>Assigns a CSS class to the marked stretch of text.</dd> - <dt id="mark_inclusiveLeft"><code>inclusiveLeft (boolean)</code></dt><dd>Determines whether - text inserted on the left of the marker will end up inside - or outside of it.</dd> - <dt id="mark_inclusiveRight"><code>inclusiveRight</code> (boolean)</dt><dd>Like <code>inclusiveLeft</code>, - but for the right side.</dd> - <dt id="mark_atomic"><code>atomic (boolean)</code></dt> - <dd>Atomic ranges act as a single unit when cursor movement is - concerned—i.e. it is impossible to place the cursor inside of - them. In atomic ranges, <code>inclusiveLeft</code> - and <code>inclusiveRight</code> have a different meaning—they - will prevent the cursor from being placed respectively - directly before and directly after the range.</dd> - <dt id="mark_collapsed"><code>collapsed (boolean)</code></dt> - <dd>Collapsed ranges do not show up in the display. Setting a - range to be collapsed will automatically make it atomic.</dd> - <dt id="mark_clearOnEnter"><code>clearOnEnter (boolean)</code></dt> - <dd>When enabled, will cause the mark to clear itself whenever - the cursor enters its range. This is mostly useful for - text-replacement widgets that need to 'snap open' when the - user tries to edit them. A - the <a href="#event_clear"><code>"clear"</code></a> event - fired on the range handle can be used to be notified when this - happens.</dd> - <dt id="mark_replacedWith"><code>replacedWith (dom node)</code></dt> - <dd>Use a given node to display this range. Implies both - collapsed and atomic.</dd> - <dt id="mark_readOnly"><code>readOnly</code></td> - <dd>A read-only span can, as long as it is not cleared, not be - modified except by - calling <a href="#setValue"><code>setValue</code></a> to reset - the whole document. <em>Note:</em> adding a read-only span - currently clears the undo history of the editor, because - existing undo events being partially nullified by read-only - spans would corrupt the history (in the current - implementation).</dd> - <dt id="mark_startStyle"><code>startStyle</code></dt><dd>Can be used to specify - an extra CSS class to be applied to the leftmost span that - is part of the marker.</dd> - <dt id="mark_endStyle"><code>endStyle</code></dt><dd>Equivalent - to <code>startStyle</code>, but for the rightmost span.</dd> - </dl> - The method will return an object with two methods, - <code>clear()</code>, which removes the mark, - and <code>find()</code>, which returns a <code>{from, to}</code> - (both document positions), indicating the current position of - the marked range, or <code>undefined</code> if the marker is no - longer in the document.</dd> - - <dt id="setBookmark"><code>setBookmark(pos, widget) → object</code></dt> - <dd>Inserts a bookmark, a handle that follows the text around it - as it is being edited, at the given position. A bookmark has two - methods <code>find()</code> and <code>clear()</code>. The first - returns the current position of the bookmark, if it is still in - the document, and the second explicitly removes the bookmark. - The widget argument is optional, and can be used to display a - DOM node at the current location of the bookmark (analogous to - the <a href="#mark_replacedWith"><code>replacedWith</code></a> - option to <code>markText</code>).</dd> - - <dt id="findMarksAt"><code>findMarksAt(pos) → array</code></dt> - <dd>Returns an array of all the bookmarks and marked ranges - present at the given position.</dd> - - <dt id="setGutterMarker"><code>setGutterMarker(line, gutterID, value) → lineHandle</code></dt> - <dd>Sets the gutter marker for the given gutter (identified by - its CSS class, see - the <a href="#option_gutters"><code>gutters</code></a> option) - to the given value. Value can be either <code>null</code>, to - clear the marker, or a DOM element, to set it. The DOM element - will be shown in the specified gutter next to the specified - line.</dd> - - <dt id="clearGutter"><code>clearGutter(gutterID)</code></dt> - <dd>Remove all gutter markers in - the <a href="#option_gutters">gutter</a> with the given ID.</dd> - - <dt id="addLineClass"><code>addLineClass(line, where, class) → lineHandle</code></dt> - <dd>Set a CSS class name for the given line. <code>line</code> - can be a number or a line handle. <code>where</code> determines - to which element this class should be applied, can can be one - of <code>"text"</code> (the text element, which lies in front of - the selection), <code>"background"</code> (a background element - that will be behind the selection), or <code>"wrap"</code> (the - wrapper node that wraps all of the line's elements, including - gutter elements). <code>class</code> should be the name of the - class to apply.</dd> - - <dt id="removeLineClass"><code>removeLineClass(line, where, class) → lineHandle</code></dt> - <dd>Remove a CSS class from a line. <code>line</code> can be a - line handle or number. <code>where</code> should be one - of <code>"text"</code>, <code>"background"</code>, - or <code>"wrap"</code> - (see <a href="#addLineClass"><code>addLineClass</code></a>). <code>class</code> - can be left off to remove all classes for the specified node, or - be a string to remove only a specific class.</dd> - - <dt id="lineInfo"><code>lineInfo(line) → object</code></dt> - <dd>Returns the line number, text content, and marker status of - the given line, which can be either a number or a line handle. - The returned object has the structure <code>{line, handle, text, - gutterMarkers, textClass, bgClass, wrapClass, widgets}</code>, - where <code>gutterMarkers</code> is an object mapping gutter IDs - to marker elements, and <code>widgets</code> is an array - of <a href="#addLineWidget">line widgets</a> attached to this - line, and the various class properties refer to classes added - with <a href="#addLineClass"><code>addLineClass</code></a>.</dd> - - <dt id="getLineHandle"><code>getLineHandle(num) → lineHandle</code></dt> - <dd>Fetches the line handle for the given line number.</dd> - - <dt id="getLineNumber"><code>getLineNumber(handle) → integer</code></dt> - <dd>Given a line handle, returns the current position of that - line (or <code>null</code> when it is no longer in the - document).</dd> - - <dt id="getViewport"><code>getViewport() → object</code></dt> - <dd>Returns a <code>{from, to}</code> object indicating the - start (inclusive) and end (exclusive) of the currently displayed - part of the document. In big documents, when most content is - scrolled out of view, CodeMirror will only render the visible - part, and a margin around it. See also - the <a href="#event_viewportChange"><code>viewportChange</code></a> - event.</dd> - - <dt id="addWidget"><code>addWidget(pos, node, scrollIntoView)</code></dt> - <dd>Puts <code>node</code>, which should be an absolutely - positioned DOM node, into the editor, positioned right below the - given <code>{line, ch}</code> position. - When <code>scrollIntoView</code> is true, the editor will ensure - that the entire node is visible (if possible). To remove the - widget again, simply use DOM methods (move it somewhere else, or - call <code>removeChild</code> on its parent).</dd> - - <dt id="addLineWidget"><code>addLineWidget(line, node, options) → object</code></dt> - <dd>Adds a line widget, an element shown below a line, spanning - the whole of the editor's width, and moving the lines below it - downwards. <code>line</code> should be either an integer or a - line handle, and <code>node</code> should be a DOM node, which - will be displayed below the given line. <code>options</code>, - when given, should be an object that configures the behavior of - the widget. The following options are supported (all default to - false): - <dl> - <dt><code>coverGutter (boolean)</code></dt> - <dd>Whether the widget should cover the gutter.</dd> - <dt><code>noHScroll (boolean)</code></dt> - <dd>Whether the widget should stay fixed in the face of - horizontal scrolling.</dd> - <dt><code>above (boolean)</code></dt> - <dd>Causes the widget to be placed above instead of below - the text of the line.</dd> - </dl> - Note that the widget node will become a descendant of nodes with - CodeMirror-specific CSS classes, and those classes might in some - cases affect it. This method returns an object that represents - the widget placement. It'll have a <code>line</code> property - pointing at the line handle that it is associated with, and it - can be passed to <code>removeLineWidget</code> to remove the - widget.</dd> - - <dt id="removeLineWidget"><code>removeLineWidget(widget)</code></dt> - <dd>Removes the given line widget.</dd> - - <dt id="posFromIndex"><code>posFromIndex(index) → object</code></dt> - <dd>Calculates and returns a <code>{line, ch}</code> object for a - zero-based <code>index</code> who's value is relative to the start of the - editor's text. If the <code>index</code> is out of range of the text then - the returned object is clipped to start or end of the text - respectively.</dd> - <dt id="indexFromPos"><code>indexFromPos(object) → number</code></dt> - <dd>The reverse of <a href="#posFromIndex"><code>posFromIndex</code></a>.</dd> - </dl> - - <p>The following are more low-level methods:</p> - - <dl> - <dt id="operation"><code>operation(func) → result</code></dt> - <dd>CodeMirror internally buffers changes and only updates its - DOM structure after it has finished performing some operation. - If you need to perform a lot of operations on a CodeMirror - instance, you can call this method with a function argument. It - will call the function, buffering up all changes, and only doing - the expensive update after the function returns. This can be a - lot faster. The return value from this method will be the return - value of your function.</dd> - - <dt id="refresh"><code>refresh()</code></dt> - <dd>If your code does something to change the size of the editor - element (window resizes are already listened for), or unhides - it, you should probably follow up by calling this method to - ensure CodeMirror is still looking as intended.</dd> - - <dt id="extendSelection"><code>extendSelection(pos, pos2)</code></dt> - <dd>Similar - to <a href="#setSelection"><code>setSelection</code></a>, but - will, if shift is held or - the <a href="#setExtending">extending</a> flag is set, move the - head of the selection while leaving the anchor at its current - place. <code>pos2</code> is optional, and can be passed to - ensure a region (for example a word or paragraph) will end up - selected (in addition to whatever lies between that region and - the current anchor).</dd> - <dt id="setExtending"><code>setExtending(bool)</code></dt> - <dd>Sets or clears the 'extending' flag, which acts similar to - the shift key, in that it will cause cursor movement and calls - to <a href="#extendSelection"><code>extendSelection</code></a> - to leave the selection anchor in place.</dd> - - <dt id="getInputField"><code>getInputField() → textarea</code></dt> - <dd>Returns the hidden textarea used to read input.</dd> - <dt id="getWrapperElement"><code>getWrapperElement() → node</code></dt> - <dd>Returns the DOM node that represents the editor, and - controls its size. Remove this from your tree to delete an - editor instance.</dd> - <dt id="getScrollerElement"><code>getScrollerElement() → node</code></dt> - <dd>Returns the DOM node that is responsible for the scrolling - of the editor.</dd> - <dt id="getGutterElement"><code>getGutterElement() → node</code></dt> - <dd>Fetches the DOM node that contains the editor gutters.</dd> - - <dt id="getStateAfter"><code>getStateAfter(line) → state</code></dt> - <dd>Returns the mode's parser state, if any, at the end of the - given line number. If no line number is given, the state at the - end of the document is returned. This can be useful for storing - parsing errors in the state, or getting other kinds of - contextual information for a line.</dd> - </dl> - - <p id="version">The <code>CodeMirror</code> object itself provides - several useful properties. Firstly, its <code>version</code> - property contains a string that indicates the version of the - library. For releases, this simply - contains <code>"major.minor"</code> (for - example <code>"2.33"</code>. For beta versions, <code>" B"</code> - (space, capital B) is added at the end of the string, for - development snapshots, <code>" +"</code> (space, plus) is - added.</p> - - <p id="fromTextArea">The <code>CodeMirror.fromTextArea</code> - method provides another way to initialize an editor. It takes a - textarea DOM node as first argument and an optional configuration - object as second. It will replace the textarea with a CodeMirror - instance, and wire up the form of that textarea (if any) to make - sure the editor contents are put into the textarea when the form - is submitted. A CodeMirror instance created this way has three - additional methods:</p> - - <dl> - <dt id="save"><code>save()</code></dt> - <dd>Copy the content of the editor into the textarea.</dd> - - <dt id="toTextArea"><code>toTextArea()</code></dt> - <dd>Remove the editor, and restore the original textarea (with - the editor's current content).</dd> - - <dt id="getTextArea"><code>getTextArea() → textarea</code></dt> - <dd>Returns the textarea that the instance was based on.</dd> - </dl> - - <p id="defineExtension">If you want to define extra methods in terms - of the CodeMirror API, it is possible to - use <code>CodeMirror.defineExtension(name, value)</code>. This - will cause the given value (usually a method) to be added to all - CodeMirror instances created from then on.</p> - - <p id="defineOption">Similarly, <code>CodeMirror.defineOption(name, - default, updateFunc)</code> can be used to define new options for - CodeMirror. The <code>updateFunc</code> will be called with the - editor instance and the new value when an editor is initialized, - and whenever the option is modified - through <a href="#setOption"><code>setOption</code></a>.</p> - - <p id="defineInitHook">If your extention just needs to run some - code whenever a CodeMirror instance is initialized, - use <code>CodeMirror.defineInitHook</code>. Give it a function as - its only argument, and from then on, that function will be called - (with the instance as argument) whenever a new CodeMirror instance - is initialized.</p> - - <h2 id="addons">Add-ons</h2> - - <p>The <code>lib/util</code> directory in the distribution - contains a number of reusable components that implement extra - editor functionality. In brief, they are:</p> - - <dl> - <dt id="util_dialog"><a href="../lib/util/dialog.js"><code>dialog.js</code></a></dt> - <dd>Provides a very simple way to query users for text input. - Adds an <code>openDialog</code> method to CodeMirror instances, - which can be called with an HTML fragment that provides the - prompt (should include an <code>input</code> tag), and a - callback function that is called when text has been entered. - Depends on <code>lib/util/dialog.css</code>.</dd> - <dt id="util_searchcursor"><a href="../lib/util/searchcursor.js"><code>searchcursor.js</code></a></dt> - <dd>Adds the <code>getSearchCursor(query, start, caseFold) → - cursor</code> method to CodeMirror instances, which can be used - to implement search/replace functionality. <code>query</code> - can be a regular expression or a string (only strings will match - across lines—if they contain newlines). <code>start</code> - provides the starting position of the search. It can be - a <code>{line, ch}</code> object, or can be left off to default - to the start of the document. <code>caseFold</code> is only - relevant when matching a string. It will cause the search to be - case-insensitive. A search cursor has the following methods: - <dl> - <dt><code>findNext(), findPrevious() → boolean</code></dt> - <dd>Search forward or backward from the current position. - The return value indicates whether a match was found. If - matching a regular expression, the return value will be the - array returned by the <code>match</code> method, in case you - want to extract matched groups.</dd> - <dt><code>from(), to() → object</code></dt> - <dd>These are only valid when the last call - to <code>findNext</code> or <code>findPrevious</code> did - not return false. They will return <code>{line, ch}</code> - objects pointing at the start and end of the match.</dd> - <dt><code>replace(text)</code></dt> - <dd>Replaces the currently found match with the given text - and adjusts the cursor position to reflect the - replacement.</dd> - </dl></dd> - - <dt id="util_search"><a href="../lib/util/search.js"><code>search.js</code></a></dt> - <dd>Implements the search commands. CodeMirror has keys bound to - these by default, but will not do anything with them unless an - implementation is provided. Depends - on <code>searchcursor.js</code>, and will make use - of <a href="#util_dialog"><code>openDialog</code></a> when - available to make prompting for search queries less ugly.</dd> - <dt id="util_matchbrackets"><a href="../lib/util/matchbrackets.js"><code>matchbrackets.js</code></a></dt> - <dd>Defines an option <code>matchBrackets</code> which, when set - to true, causes matching brackets to be highlighted whenever the - cursor is next to them. It also adds a - method <code>matchBrackets</code> that forces this to happen - once, and a method <code>findMatchingBracket</code> that can be - used to run the bracket-finding algorithm that this uses - internally.</dd> - <dt id="util_foldcode"><a href="../lib/util/foldcode.js"><code>foldcode.js</code></a></dt> - <dd>Helps with code folding. - See <a href="../demo/folding.html">the demo</a> for an example. - Call <code>CodeMirror.newFoldFunction</code> with a range-finder - helper function to create a function that will, when applied to - a CodeMirror instance and a line number, attempt to fold or - unfold the block starting at the given line. A range-finder is a - language-specific function that also takes an instance and a - line number, and returns an range to be folded, or null if - no block is started on that line. This file - provides <code>CodeMirror.braceRangeFinder</code>, which finds - blocks in brace languages (JavaScript, C, Java, - etc), <code>CodeMirror.indentRangeFinder</code>, for languages - where indentation determines block structure (Python, Haskell), - and <code>CodeMirror.tagRangeFinder</code>, for XML-style - languages.</dd> - <dt id="util_runmode"><a href="../lib/util/runmode.js"><code>runmode.js</code></a></dt> - <dd>Can be used to run a CodeMirror mode over text without - actually opening an editor instance. - See <a href="../demo/runmode.html">the demo</a> for an - example.</dd> - <dt id="util_overlay"><a href="../lib/util/overlay.js"><code>overlay.js</code></a></dt> - <dd>Mode combinator that can be used to extend a mode with an - 'overlay' — a secondary mode is run over the stream, along with - the base mode, and can color specific pieces of text without - interfering with the base mode. - Defines <code>CodeMirror.overlayMode</code>, which is used to - create such a mode. See <a href="../demo/mustache.html">this - demo</a> for a detailed example.</dd> - <dt id="util_multiplex"><a href="../lib/util/multiplex.js"><code>multiplex.js</code></a></dt> - <dd>Mode combinator that can be used to easily 'multiplex' - between several modes. - Defines <code>CodeMirror.multiplexingMode</code> which, when - given as first argument a mode object, and as other arguments - any number of <code>{open, close, mode [, delimStyle]}</code> - objects, will return a mode object that starts parsing using the - mode passed as first argument, but will switch to another mode - as soon as it encounters a string that occurs in one of - the <code>open</code> fields of the passed objects. When in a - sub-mode, it will go back to the top mode again when - the <code>close</code> string is encountered. - Pass <code>"\n"</code> for <code>open</code> or <code>close</code> - if you want to switch on a blank line. - When <code>delimStyle</code> is specified, it will be the token - style returned for the delimiter tokens. The outer mode will not - see the content between the delimiters. - See <a href="../demo/multiplex.html">this demo</a> for an - example.</dd> - <dt id="util_simple-hint"><a href="../lib/util/simple-hint.js"><code>simple-hint.js</code></a></dt> - <dd>Provides a framework for showing autocompletion hints. - Defines <code>CodeMirror.simpleHint</code>, which takes a - CodeMirror instance and a hinting function, and pops up a widget - that allows the user to select a completion. Hinting functions - are function that take an editor instance, and return - a <code>{list, from, to}</code> object, where <code>list</code> - is an array of strings (the completions), and <code>from</code> - and <code>to</code> give the start and end of the token that is - being completed. Depends - on <code>lib/util/simple-hint.css</code>.</dd> - <dt id="util_javascript-hint"><a href="../lib/util/javascript-hint.js"><code>javascript-hint.js</code></a></dt> - <dd>Defines <code>CodeMirror.javascriptHint</code> - and <code>CodeMirror.coffeescriptHint</code>, which are simple - hinting functions for the JavaScript and CoffeeScript - modes.</dd> - <dt id="util_match-highlighter"><a href="../lib/util/match-highlighter.js"><code>match-highlighter.js</code></a></dt> - <dd>Adds a <code>matchHighlight</code> method to CodeMirror - instances that can be called (typically from - a <a href="#event_cursorActivity"><code>cursorActivity</code></a> - handler) to highlight all instances of a currently selected word - with the a classname given as a first argument to the method. - Depends on - the <a href="#util_searchcursor"><code>searchcursor</code></a> - add-on. Demo <a href="../demo/matchhighlighter.html">here</a>.</dd> - <dt id="util_formatting"><a href="../lib/util/formatting.js"><code>formatting.js</code></a></dt> - <dd>Adds <code>commentRange</code>, <code>autoIndentRange</code>, - and <code>autoFormatRange</code> methods that, respectively, - comment (or uncomment), indent, or format (add line breaks) a - range of code. <a href="../demo/formatting.html">Demo here.</a></dd> - <dt id="util_closetag"><a href="../lib/util/closetag.js"><code>closetag.js</code></a></dt> - <dd>Provides utility functions for adding automatic tag closing - to XML modes. See - the <a href="../demo/closetag.html">demo</a>.</dd> - <dt id="util_loadmode"><a href="../lib/util/loadmode.js"><code>loadmode.js</code></a></dt> - <dd>Defines a <code>CodeMirror.requireMode(modename, - callback)</code> function that will try to load a given mode and - call the callback when it succeeded. You'll have to - set <code>CodeMirror.modeURL</code> to a string that mode paths - can be constructed from, for - example <code>"mode/%N/%N.js"</code>—the <code>%N</code>'s will - be replaced with the mode name. Also - defines <code>CodeMirror.autoLoadMode(instance, mode)</code>, - which will ensure the given mode is loaded and cause the given - editor instance to refresh its mode when the loading - succeeded. See the <a href="../demo/loadmode.html">demo</a>.</dd> - <dt id="util_continuecomment"><a href="../lib/util/continuecomment.js"><code>continuecomment.js</code></a></dt> - <dd>Adds a <a href="#commands">command</a> - called <code>newlineAndIndentContinueComment</code> that you can - bind <code>Enter</code> to in order to have the editor prefix - new lines inside C-like block comments with an asterisk.</dd> - </dl> - - <h2 id="modeapi">Writing CodeMirror Modes</h2> - - <p>Modes typically consist of a single JavaScript file. This file - defines, in the simplest case, a lexer (tokenizer) for your - language—a function that takes a character stream as input, - advances it past a token, and returns a style for that token. More - advanced modes can also handle indentation for the language.</p> - - <p id="defineMode">The mode script should - call <code>CodeMirror.defineMode</code> to register itself with - CodeMirror. This function takes two arguments. The first should be - the name of the mode, for which you should use a lowercase string, - preferably one that is also the name of the files that define the - mode (i.e. <code>"xml"</code> is defined in <code>xml.js</code>). The - second argument should be a function that, given a CodeMirror - configuration object (the thing passed to - the <code>CodeMirror</code> function) and an optional mode - configuration object (as in - the <a href="#option_mode"><code>mode</code></a> option), returns - a mode object.</p> - - <p>Typically, you should use this second argument - to <code>defineMode</code> as your module scope function (modes - should not leak anything into the global scope!), i.e. write your - whole mode inside this function.</p> - - <p>The main responsibility of a mode script is <em>parsing</em> - the content of the editor. Depending on the language and the - amount of functionality desired, this can be done in really easy - or extremely complicated ways. Some parsers can be stateless, - meaning that they look at one element (<em>token</em>) of the code - at a time, with no memory of what came before. Most, however, will - need to remember something. This is done by using a <em>state - object</em>, which is an object that is always passed when - reading a token, and which can be mutated by the tokenizer.</p> - - <p id="startState">Modes that use a state must define - a <code>startState</code> method on their mode object. This is a - function of no arguments that produces a state object to be used - at the start of a document.</p> - - <p id="token">The most important part of a mode object is - its <code>token(stream, state)</code> method. All modes must - define this method. It should read one token from the stream it is - given as an argument, optionally update its state, and return a - style string, or <code>null</code> for tokens that do not have to - be styled. For your styles, you are encouraged to use the - 'standard' names defined in the themes (without - the <code>cm-</code> prefix). If that fails, it is also possible - to come up with your own and write your own CSS theme file.<p> - - <p id="StringStream">The stream object that's passed - to <code>token</code> encapsulates a line of code (tokens may - never span lines) and our current position in that line. It has - the following API:</p> - - <dl> - <dt><code>eol() → boolean</code></dt> - <dd>Returns true only if the stream is at the end of the - line.</dd> - <dt><code>sol() → boolean</code></dt> - <dd>Returns true only if the stream is at the start of the - line.</dd> - - <dt><code>peek() → character</code></dt> - <dd>Returns the next character in the stream without advancing - it. Will return an <code>null</code> at the end of the - line.</dd> - <dt><code>next() → character</code></dt> - <dd>Returns the next character in the stream and advances it. - Also returns <code>null</code> when no more characters are - available.</dd> - - <dt><code>eat(match) → character</code></dt> - <dd><code>match</code> can be a character, a regular expression, - or a function that takes a character and returns a boolean. If - the next character in the stream 'matches' the given argument, - it is consumed and returned. Otherwise, <code>undefined</code> - is returned.</dd> - <dt><code>eatWhile(match) → boolean</code></dt> - <dd>Repeatedly calls <code>eat</code> with the given argument, - until it fails. Returns true if any characters were eaten.</dd> - <dt><code>eatSpace() → boolean</code></dt> - <dd>Shortcut for <code>eatWhile</code> when matching - white-space.</dd> - <dt><code>skipToEnd()</code></dt> - <dd>Moves the position to the end of the line.</dd> - <dt><code>skipTo(ch) → boolean</code></dt> - <dd>Skips to the next occurrence of the given character, if - found on the current line (doesn't advance the stream if the - character does not occur on the line). Returns true if the - character was found.</dd> - <dt><code>match(pattern, consume, caseFold) → boolean</code></dt> - <dd>Act like a - multi-character <code>eat</code>—if <code>consume</code> is true - or not given—or a look-ahead that doesn't update the stream - position—if it is false. <code>pattern</code> can be either a - string or a regular expression starting with <code>^</code>. - When it is a string, <code>caseFold</code> can be set to true to - make the match case-insensitive. When successfully matching a - regular expression, the returned value will be the array - returned by <code>match</code>, in case you need to extract - matched groups.</dd> - - <dt><code>backUp(n)</code></dt> - <dd>Backs up the stream <code>n</code> characters. Backing it up - further than the start of the current token will cause things to - break, so be careful.</dd> - <dt><code>column() → integer</code></dt> - <dd>Returns the column (taking into account tabs) at which the - current token starts.</dd> - <dt><code>indentation() → integer</code></dt> - <dd>Tells you how far the current line has been indented, in - spaces. Corrects for tab characters.</dd> - - <dt><code>current() → string</code></dt> - <dd>Get the string between the start of the current token and - the current stream position.</dd> - </dl> - - <p id="blankLine">By default, blank lines are simply skipped when - tokenizing a document. For languages that have significant blank - lines, you can define a <code>blankLine(state)</code> method on - your mode that will get called whenever a blank line is passed - over, so that it can update the parser state.</p> - - <p id="copyState">Because state object are mutated, and CodeMirror - needs to keep valid versions of a state around so that it can - restart a parse at any line, copies must be made of state objects. - The default algorithm used is that a new state object is created, - which gets all the properties of the old object. Any properties - which hold arrays get a copy of these arrays (since arrays tend to - be used as mutable stacks). When this is not correct, for example - because a mode mutates non-array properties of its state object, a - mode object should define a <code>copyState</code> method, - which is given a state and should return a safe copy of that - state.</p> - - <p id="indent">If you want your mode to provide smart indentation - (through the <a href="#indentLine"><code>indentLine</code></a> - method and the <code>indentAuto</code> - and <code>newlineAndIndent</code> commands, which keys can be - <a href="#option_extraKeys">bound</a> to), you must define - an <code>indent(state, textAfter)</code> method on your mode - object.</p> - - <p>The indentation method should inspect the given state object, - and optionally the <code>textAfter</code> string, which contains - the text on the line that is being indented, and return an - integer, the amount of spaces to indent. It should usually take - the <a href="#option_indentUnit"><code>indentUnit</code></a> - option into account.</p> - - <p id="electricChars">Finally, a mode may define - an <code>electricChars</code> property, which should hold a string - containing all the characters that should trigger the behaviour - described for - the <a href="#option_electricChars"><code>electricChars</code></a> - option.</p> - - <p>So, to summarize, a mode <em>must</em> provide - a <code>token</code> method, and it <em>may</em> - provide <code>startState</code>, <code>copyState</code>, - and <code>indent</code> methods. For an example of a trivial mode, - see the <a href="../mode/diff/diff.js">diff mode</a>, for a more - involved example, see the <a href="../mode/clike/clike.js">C-like - mode</a>.</p> - - <p>Sometimes, it is useful for modes to <em>nest</em>—to have one - mode delegate work to another mode. An example of this kind of - mode is the <a href="../mode/htmlmixed/htmlmixed.js">mixed-mode HTML - mode</a>. To implement such nesting, it is usually necessary to - create mode objects and copy states yourself. To create a mode - object, there are <code>CodeMirror.getMode(options, - parserConfig)</code>, where the first argument is a configuration - object as passed to the mode constructor function, and the second - argument is a mode specification as in - the <a href="#option_mode"><code>mode</code></a> option. To copy a - state object, call <code>CodeMirror.copyState(mode, state)</code>, - where <code>mode</code> is the mode that created the given - state.</p> - - <p id="innerMode">In a nested mode, it is recommended to add an - extra methods, <code>innerMode</code> which, given a state object, - returns a <code>{state, mode}</code> object with the inner mode - and its state for the current position. These are used by utility - scripts such as the <a href="#util_formatting">autoformatter</a> - and the <a href="#util_closetag">tag closer</a> to get context - information. Use the <code>CodeMirror.innerMode</code> helper - function to, starting from a mode and a state, recursively walk - down to the innermost mode and state.</p> - - <p>To make indentation work properly in a nested parser, it is - advisable to give the <code>startState</code> method of modes that - are intended to be nested an optional argument that provides the - base indentation for the block of code. The JavaScript and CSS - parser do this, for example, to allow JavaScript and CSS code - inside the mixed-mode HTML mode to be properly indented.</p> - - <p>It is possible, and encouraged, to associate your mode, or a - certain configuration of your mode, with - a <a href="http://en.wikipedia.org/wiki/MIME">MIME</a> type. For - example, the JavaScript mode associates itself - with <code>text/javascript</code>, and its JSON variant - with <code>application/json</code>. To do this, - call <code>CodeMirror.defineMIME(mime, modeSpec)</code>, - where <code>modeSpec</code> can be a string or object specifying a - mode, as in the <a href="#option_mode"><code>mode</code></a> - option.</p> - - <p id="extendMode">Sometimes, it is useful to add or override mode - object properties from external code. - The <code>CodeMirror.extendMode</code> can be used to add - properties to mode objects produced for a specific mode. Its first - argument is the name of the mode, its second an object that - specifies the properties that should be added. This is mostly - useful to add utilities that can later be looked - up through <a href="#getMode"><code>getMode</code></a>.</p> - -</div><div class="rightsmall blk"> - - <h2>Contents</h2> - - <ul> - <li><a href="#overview">Overview</a></li> - <li><a href="#usage">Basic Usage</a></li> - <li><a href="#config">Configuration</a></li> - <li><a href="#events">Events</a></li> - <li><a href="#keymaps">Keymaps</a></li> - <li><a href="#styling">Customized Styling</a></li> - <li><a href="#api">Programming API</a></li> - <li><a href="#addons">Add-ons</a></li> - <li><a href="#modeapi">Writing CodeMirror Modes</a></li> - </ul> - -</div></div> - -<div style="height: 2em"> </div> - -<script>setTimeout(function(){CodeMirror.colorize();}, 20);</script> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/oldrelease.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/oldrelease.html deleted file mode 100644 index 702e75d2e76cc4e056f9c3a166703d991c33e568..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/oldrelease.html +++ /dev/null @@ -1,398 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"/> - <title>CodeMirror</title> - <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"/> - <link rel="stylesheet" type="text/css" href="docs.css"/> - <link rel="alternate" href="http://twitter.com/statuses/user_timeline/242283288.rss" type="application/rss+xml"/> - </head> - <body> - -<h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1> - -<div class="grey"> -<img src="baboon.png" class="logo" alt="logo"/> -<pre> -/* Old release - history */ -</pre> -</div> - - <p class="rel">23-04-2012: <a href="http://codemirror.net/codemirror-2.24.zip">Version 2.24</a>:</p> - - <ul class="rel-note"> - <li><strong>Drop support for Internet Explorer 6</strong>.</li> - <li>New - modes: <a href="../mode/shell/index.html">Shell</a>, <a href="../mode/tiki/index.html">Tiki - wiki</a>, <a href="../mode/pig/index.html">Pig Latin</a>.</li> - <li>New themes: <a href="../demo/theme.html?ambiance">Ambiance</a>, <a href="../demo/theme.html?blackboard">Blackboard</a>.</li> - <li>More control over drag/drop - with <a href="manual.html#option_dragDrop"><code>dragDrop</code></a> - and <a href="manual.html#option_onDragEvent"><code>onDragEvent</code></a> - options.</li> - <li>Make HTML mode a bit less pedantic.</li> - <li>Add <a href="manual.html#compoundChange"><code>compoundChange</code></a> API method.</li> - <li>Several fixes in undo history and line hiding.</li> - <li>Remove (broken) support for <code>catchall</code> in key maps, - add <code>nofallthrough</code> boolean field instead.</li> - </ul> - - <p class="rel">26-03-2012: <a href="http://codemirror.net/codemirror-2.23.zip">Version 2.23</a>:</p> - - <ul class="rel-note"> - <li>Change <strong>default binding for tab</strong> <a href="javascript:void(document.getElementById('tabbinding').style.display='')">[more]</a> - <div style="display: none" id=tabbinding> - Starting in 2.23, these bindings are default: - <ul><li>Tab: Insert tab character</li> - <li>Shift-tab: Reset line indentation to default</li> - <li>Ctrl/Cmd-[: Reduce line indentation (old tab behaviour)</li> - <li>Ctrl/Cmd-]: Increase line indentation (old shift-tab behaviour)</li> - </ul> - </div> - </li> - <li>New modes: <a href="../mode/xquery/index.html">XQuery</a> and <a href="../mode/vbscript/index.html">VBScript</a>.</li> - <li>Two new themes: <a href="../mode/less/index.html">lesser-dark</a> and <a href="../mode/xquery/index.html">xq-dark</a>.</li> - <li>Differentiate between background and text styles in <a href="manual.html#setLineClass"><code>setLineClass</code></a>.</li> - <li>Fix drag-and-drop in IE9+.</li> - <li>Extend <a href="manual.html#charCoords"><code>charCoords</code></a> - and <a href="manual.html#cursorCoords"><code>cursorCoords</code></a> with a <code>mode</code> argument.</li> - <li>Add <a href="manual.html#option_autofocus"><code>autofocus</code></a> option.</li> - <li>Add <a href="manual.html#findMarksAt"><code>findMarksAt</code></a> method.</li> - </ul> - - <p class="rel">27-02-2012: <a href="http://codemirror.net/codemirror-2.22.zip">Version 2.22</a>:</p> - - <ul class="rel-note"> - <li>Allow <a href="manual.html#keymaps">key handlers</a> to pass up events, allow binding characters.</li> - <li>Add <a href="manual.html#option_autoClearEmptyLines"><code>autoClearEmptyLines</code></a> option.</li> - <li>Properly use tab stops when rendering tabs.</li> - <li>Make PHP mode more robust.</li> - <li>Support indentation blocks in <a href="manual.html#util_foldcode">code folder</a>.</li> - <li>Add a script for <a href="manual.html#util_match-highlighter">highlighting instances of the selection</a>.</li> - <li>New <a href="../mode/properties/index.html">.properties</a> mode.</li> - <li>Fix many bugs.</li> - </ul> - - <p class="rel">27-01-2012: <a href="http://codemirror.net/codemirror-2.21.zip">Version 2.21</a>:</p> - - <ul class="rel-note"> - <li>Added <a href="../mode/less/index.html">LESS</a>, <a href="../mode/mysql/index.html">MySQL</a>, - <a href="../mode/go/index.html">Go</a>, and <a href="../mode/verilog/index.html">Verilog</a> modes.</li> - <li>Add <a href="manual.html#option_smartIndent"><code>smartIndent</code></a> - option.</li> - <li>Support a cursor in <a href="manual.html#option_readOnly"><code>readOnly</code></a>-mode.</li> - <li>Support assigning multiple styles to a token.</li> - <li>Use a new approach to drawing the selection.</li> - <li>Add <a href="manual.html#scrollTo"><code>scrollTo</code></a> method.</li> - <li>Allow undo/redo events to span non-adjacent lines.</li> - <li>Lots and lots of bugfixes.</li> - </ul> - - <p class="rel">20-12-2011: <a href="http://codemirror.net/codemirror-2.2.zip">Version 2.2</a>:</p> - - <ul class="rel-note"> - <li>Slightly incompatible API changes. Read <a href="upgrade_v2.2.html">this</a>.</li> - <li>New approach - to <a href="manual.html#option_extraKeys">binding</a> keys, - support for <a href="manual.html#option_keyMap">custom - bindings</a>.</li> - <li>Support for overwrite (insert).</li> - <li><a href="manual.html#option_tabSize">Custom-width</a> - and <a href="../demo/visibletabs.html">stylable</a> tabs.</li> - <li>Moved more code into <a href="manual.html#addons">add-on scripts</a>.</li> - <li>Support for sane vertical cursor movement in wrapped lines.</li> - <li>More reliable handling of - editing <a href="manual.html#markText">marked text</a>.</li> - <li>Add minimal <a href="../demo/emacs.html">emacs</a> - and <a href="../demo/vim.html">vim</a> bindings.</li> - <li>Rename <code>coordsFromIndex</code> - to <a href="manual.html#posFromIndex"><code>posFromIndex</code></a>, - add <a href="manual.html#indexFromPos"><code>indexFromPos</code></a> - method.</li> - </ul> - - <p class="rel">21-11-2011: <a href="http://codemirror.net/codemirror-2.18.zip">Version 2.18</a>:</p> - <p class="rel-note">Fixes <code>TextMarker.clear</code>, which is broken in 2.17.</p> - - <p class="rel">21-11-2011: <a href="http://codemirror.net/codemirror-2.17.zip">Version 2.17</a>:</p> - <ul class="rel-note"> - <li>Add support for <a href="manual.html#option_lineWrapping">line - wrapping</a> and <a href="manual.html#hideLine">code - folding</a>.</li> - <li>Add <a href="../mode/gfm/index.html">Github-style Markdown</a> mode.</li> - <li>Add <a href="../theme/monokai.css">Monokai</a> - and <a href="../theme/rubyblue.css">Rubyblue</a> themes.</li> - <li>Add <a href="manual.html#setBookmark"><code>setBookmark</code></a> method.</li> - <li>Move some of the demo code into reusable components - under <a href="../lib/util/"><code>lib/util</code></a>.</li> - <li>Make screen-coord-finding code faster and more reliable.</li> - <li>Fix drag-and-drop in Firefox.</li> - <li>Improve support for IME.</li> - <li>Speed up content rendering.</li> - <li>Fix browser's built-in search in Webkit.</li> - <li>Make double- and triple-click work in IE.</li> - <li>Various fixes to modes.</li> - </ul> - - <p class="rel">27-10-2011: <a href="http://codemirror.net/codemirror-2.16.zip">Version 2.16</a>:</p> - <ul class="rel-note"> - <li>Add <a href="../mode/perl/index.html">Perl</a>, <a href="../mode/rust/index.html">Rust</a>, <a href="../mode/tiddlywiki/index.html">TiddlyWiki</a>, and <a href="../mode/groovy/index.html">Groovy</a> modes.</li> - <li>Dragging text inside the editor now moves, rather than copies.</li> - <li>Add a <a href="manual.html#coordsFromIndex"><code>coordsFromIndex</code></a> method.</li> - <li><strong>API change</strong>: <code>setValue</code> now no longer clears history. Use <a href="manual.html#clearHistory"><code>clearHistory</code></a> for that.</li> - <li><strong>API change</strong>: <a href="manual.html#markText"><code>markText</code></a> now - returns an object with <code>clear</code> and <code>find</code> - methods. Marked text is now more robust when edited.</li> - <li>Fix editing code with tabs in Internet Explorer.</li> - </ul> - - <p class="rel">26-09-2011: <a href="http://codemirror.net/codemirror-2.15.zip">Version 2.15</a>:</p> - <p class="rel-note">Fix bug that snuck into 2.14: Clicking the - character that currently has the cursor didn't re-focus the - editor.</p> - - <p class="rel">26-09-2011: <a href="http://codemirror.net/codemirror-2.14.zip">Version 2.14</a>:</p> - <ul class="rel-note"> - <li>Add <a href="../mode/clojure/index.html">Clojure</a>, <a href="../mode/pascal/index.html">Pascal</a>, <a href="../mode/ntriples/index.html">NTriples</a>, <a href="../mode/jinja2/index.html">Jinja2</a>, and <a href="../mode/markdown/index.html">Markdown</a> modes.</li> - <li>Add <a href="../theme/cobalt.css">Cobalt</a> and <a href="../theme/eclipse.css">Eclipse</a> themes.</li> - <li>Add a <a href="manual.html#option_fixedGutter"><code>fixedGutter</code></a> option.</li> - <li>Fix bug with <code>setValue</code> breaking cursor movement.</li> - <li>Make gutter updates much more efficient.</li> - <li>Allow dragging of text out of the editor (on modern browsers).</li> - </ul> - - - <p class="rel">23-08-2011: <a href="http://codemirror.net/codemirror-2.13.zip">Version 2.13</a>:</p> - <ul class="rel-note"> - <li>Add <a href="../mode/ruby/index.html">Ruby</a>, <a href="../mode/r/index.html">R</a>, <a href="../mode/coffeescript/index.html">CoffeeScript</a>, and <a href="../mode/velocity/index.html">Velocity</a> modes.</li> - <li>Add <a href="manual.html#getGutterElement"><code>getGutterElement</code></a> to API.</li> - <li>Several fixes to scrolling and positioning.</li> - <li>Add <a href="manual.html#option_smartHome"><code>smartHome</code></a> option.</li> - <li>Add an experimental <a href="../mode/xmlpure/index.html">pure XML</a> mode.</li> - </ul> - - <p class="rel">25-07-2011: <a href="http://codemirror.net/codemirror-2.12.zip">Version 2.12</a>:</p> - <ul class="rel-note"> - <li>Add a <a href="../mode/sparql/index.html">SPARQL</a> mode.</li> - <li>Fix bug with cursor jumping around in an unfocused editor in IE.</li> - <li>Allow key and mouse events to bubble out of the editor. Ignore widget clicks.</li> - <li>Solve cursor flakiness after undo/redo.</li> - <li>Fix block-reindent ignoring the last few lines.</li> - <li>Fix parsing of multi-line attrs in XML mode.</li> - <li>Use <code>innerHTML</code> for HTML-escaping.</li> - <li>Some fixes to indentation in C-like mode.</li> - <li>Shrink horiz scrollbars when long lines removed.</li> - <li>Fix width feedback loop bug that caused the width of an inner DIV to shrink.</li> - </ul> - - <p class="rel">04-07-2011: <a href="http://codemirror.net/codemirror-2.11.zip">Version 2.11</a>:</p> - <ul class="rel-note"> - <li>Add a <a href="../mode/scheme/index.html">Scheme mode</a>.</li> - <li>Add a <code>replace</code> method to search cursors, for cursor-preserving replacements.</li> - <li>Make the <a href="../mode/clike/index.html">C-like mode</a> mode more customizable.</li> - <li>Update XML mode to spot mismatched tags.</li> - <li>Add <code>getStateAfter</code> API and <code>compareState</code> mode API methods for finer-grained mode magic.</li> - <li>Add a <code>getScrollerElement</code> API method to manipulate the scrolling DIV.</li> - <li>Fix drag-and-drop for Firefox.</li> - <li>Add a C# configuration for the <a href="../mode/clike/index.html">C-like mode</a>.</li> - <li>Add <a href="../demo/fullscreen.html">full-screen editing</a> and <a href="../demo/changemode.html">mode-changing</a> demos.</li> - </ul> - - <p class="rel">07-06-2011: <a href="http://codemirror.net/codemirror-2.1.zip">Version 2.1</a>:</p> - <p class="rel-note">Add - a <a href="manual.html#option_theme">theme</a> system - (<a href="../demo/theme.html">demo</a>). Note that this is not - backwards-compatible—you'll have to update your styles and - modes!</p> - - <p class="rel">07-06-2011: <a href="http://codemirror.net/codemirror-2.02.zip">Version 2.02</a>:</p> - <ul class="rel-note"> - <li>Add a <a href="../mode/lua/index.html">Lua mode</a>.</li> - <li>Fix reverse-searching for a regexp.</li> - <li>Empty lines can no longer break highlighting.</li> - <li>Rework scrolling model (the outer wrapper no longer does the scrolling).</li> - <li>Solve horizontal jittering on long lines.</li> - <li>Add <a href="../demo/runmode.html">runmode.js</a>.</li> - <li>Immediately re-highlight text when typing.</li> - <li>Fix problem with 'sticking' horizontal scrollbar.</li> - </ul> - - <p class="rel">26-05-2011: <a href="http://codemirror.net/codemirror-2.01.zip">Version 2.01</a>:</p> - <ul class="rel-note"> - <li>Add a <a href="../mode/smalltalk/index.html">Smalltalk mode</a>.</li> - <li>Add a <a href="../mode/rst/index.html">reStructuredText mode</a>.</li> - <li>Add a <a href="../mode/python/index.html">Python mode</a>.</li> - <li>Add a <a href="../mode/plsql/index.html">PL/SQL mode</a>.</li> - <li><code>coordsChar</code> now works</li> - <li>Fix a problem where <code>onCursorActivity</code> interfered with <code>onChange</code>.</li> - <li>Fix a number of scrolling and mouse-click-position glitches.</li> - <li>Pass information about the changed lines to <code>onChange</code>.</li> - <li>Support cmd-up/down on OS X.</li> - <li>Add triple-click line selection.</li> - <li>Don't handle shift when changing the selection through the API.</li> - <li>Support <code>"nocursor"</code> mode for <code>readOnly</code> option.</li> - <li>Add an <code>onHighlightComplete</code> option.</li> - <li>Fix the context menu for Firefox.</li> - </ul> - - <p class="rel">28-03-2011: <a href="http://codemirror.net/codemirror-2.0.zip">Version 2.0</a>:</p> - <p class="rel-note">CodeMirror 2 is a complete rewrite that's - faster, smaller, simpler to use, and less dependent on browser - quirks. See <a href="internals.html">this</a> - and <a href="http://groups.google.com/group/codemirror/browse_thread/thread/5a8e894024a9f580">this</a> - for more information.</a> - - <p class="rel">28-03-2011: <a href="http://codemirror.net/codemirror-1.0.zip">Version 1.0</a>:</p> - <ul class="rel-note"> - <li>Fix error when debug history overflows.</li> - <li>Refine handling of C# verbatim strings.</li> - <li>Fix some issues with JavaScript indentation.</li> - </ul> - - <p class="rel">22-02-2011: <a href="https://github.com/marijnh/codemirror/tree/beta2">Version 2.0 beta 2</a>:</p> - <p class="rel-note">Somewhat more mature API, lots of bugs shaken out.</a> - - <p class="rel">17-02-2011: <a href="http://codemirror.net/codemirror-0.94.zip">Version 0.94</a>:</p> - <ul class="rel-note"> - <li><code>tabMode: "spaces"</code> was modified slightly (now indents when something is selected).</li> - <li>Fixes a bug that would cause the selection code to break on some IE versions.</li> - <li>Disabling spell-check on WebKit browsers now works.</li> - </ul> - - <p class="rel">08-02-2011: <a href="http://codemirror.net/">Version 2.0 beta 1</a>:</p> - <p class="rel-note">CodeMirror 2 is a complete rewrite of - CodeMirror, no longer depending on an editable frame.</p> - - <p class="rel">19-01-2011: <a href="http://codemirror.net/codemirror-0.93.zip">Version 0.93</a>:</p> - <ul class="rel-note"> - <li>Added a <a href="contrib/regex/index.html">Regular Expression</a> parser.</li> - <li>Fixes to the PHP parser.</li> - <li>Support for regular expression in search/replace.</li> - <li>Add <code>save</code> method to instances created with <code>fromTextArea</code>.</li> - <li>Add support for MS T-SQL in the SQL parser.</li> - <li>Support use of CSS classes for highlighting brackets.</li> - <li>Fix yet another hang with line-numbering in hidden editors.</li> - </ul> - - <p class="rel">17-12-2010: <a href="http://codemirror.net/codemirror-0.92.zip">Version 0.92</a>:</p> - <ul class="rel-note"> - <li>Make CodeMirror work in XHTML documents.</li> - <li>Fix bug in handling of backslashes in Python strings.</li> - <li>The <code>styleNumbers</code> option is now officially - supported and documented.</li> - <li><code>onLineNumberClick</code> option added.</li> - <li>More consistent names <code>onLoad</code> and - <code>onCursorActivity</code> callbacks. Old names still work, but - are deprecated.</li> - <li>Add a <a href="contrib/freemarker/index.html">Freemarker</a> mode.</li> - </ul> - - <p class="rel">11-11-2010: <a - href="http://codemirror.net/codemirror-0.91.zip">Version 0.91</a>:</p> - <ul class="rel-note"> - <li>Adds support for <a href="contrib/java">Java</a>.</li> - <li>Small additions to the <a href="contrib/php">PHP</a> and <a href="contrib/sql">SQL</a> parsers.</li> - <li>Work around various <a href="https://bugs.webkit.org/show_bug.cgi?id=47806">Webkit</a> <a href="https://bugs.webkit.org/show_bug.cgi?id=23474">issues</a>.</li> - <li>Fix <code>toTextArea</code> to update the code in the textarea.</li> - <li>Add a <code>noScriptCaching</code> option (hack to ease development).</li> - <li>Make sub-modes of <a href="mixedtest.html">HTML mixed</a> mode configurable.</li> - </ul> - - <p class="rel">02-10-2010: <a - href="http://codemirror.net/codemirror-0.9.zip">Version 0.9</a>:</p> - <ul class="rel-note"> - <li>Add support for searching backwards.</li> - <li>There are now parsers for <a href="contrib/scheme/index.html">Scheme</a>, <a href="contrib/xquery/index.html">XQuery</a>, and <a href="contrib/ometa/index.html">OmetaJS</a>.</li> - <li>Makes <code>height: "dynamic"</code> more robust.</li> - <li>Fixes bug where paste did not work on OS X.</li> - <li>Add a <code>enterMode</code> and <code>electricChars</code> options to make indentation even more customizable.</li> - <li>Add <code>firstLineNumber</code> option.</li> - <li>Fix bad handling of <code>@media</code> rules by the CSS parser.</li> - <li>Take a new, more robust approach to working around the invisible-last-line bug in WebKit.</li> - </ul> - - <p class="rel">22-07-2010: <a - href="http://codemirror.net/codemirror-0.8.zip">Version 0.8</a>:</p> - <ul class="rel-note"> - <li>Add a <code>cursorCoords</code> method to find the screen - coordinates of the cursor.</li> - <li>A number of fixes and support for more syntax in the PHP parser.</li> - <li>Fix indentation problem with JSON-mode JS parser in Webkit.</li> - <li>Add a <a href="compress.html">minification</a> UI.</li> - <li>Support a <code>height: dynamic</code> mode, where the editor's - height will adjust to the size of its content.</li> - <li>Better support for IME input mode.</li> - <li>Fix JavaScript parser getting confused when seeing a no-argument - function call.</li> - <li>Have CSS parser see the difference between selectors and other - identifiers.</li> - <li>Fix scrolling bug when pasting in a horizontally-scrolled - editor.</li> - <li>Support <code>toTextArea</code> method in instances created with - <code>fromTextArea</code>.</li> - <li>Work around new Opera cursor bug that causes the cursor to jump - when pressing backspace at the end of a line.</li> - </ul> - - <p class="rel">27-04-2010: <a - href="http://codemirror.net/codemirror-0.67.zip">Version - 0.67</a>:</p> - <p class="rel-note">More consistent page-up/page-down behaviour - across browsers. Fix some issues with hidden editors looping forever - when line-numbers were enabled. Make PHP parser parse - <code>"\\"</code> correctly. Have <code>jumpToLine</code> work on - line handles, and add <code>cursorLine</code> function to fetch the - line handle where the cursor currently is. Add new - <code>setStylesheet</code> function to switch style-sheets in a - running editor.</p> - - <p class="rel">01-03-2010: <a - href="http://codemirror.net/codemirror-0.66.zip">Version - 0.66</a>:</p> - <p class="rel-note">Adds <code>removeLine</code> method to API. - Introduces the <a href="contrib/plsql/index.html">PLSQL parser</a>. - Marks XML errors by adding (rather than replacing) a CSS class, so - that they can be disabled by modifying their style. Fixes several - selection bugs, and a number of small glitches.</p> - - <p class="rel">12-11-2009: <a - href="http://codemirror.net/codemirror-0.65.zip">Version - 0.65</a>:</p> - <p class="rel-note">Add support for having both line-wrapping and - line-numbers turned on, make paren-highlighting style customisable - (<code>markParen</code> and <code>unmarkParen</code> config - options), work around a selection bug that Opera - <em>re</em>introduced in version 10.</p> - - <p class="rel">23-10-2009: <a - href="http://codemirror.net/codemirror-0.64.zip">Version - 0.64</a>:</p> - <p class="rel-note">Solves some issues introduced by the - paste-handling changes from the previous release. Adds - <code>setSpellcheck</code>, <code>setTextWrapping</code>, - <code>setIndentUnit</code>, <code>setUndoDepth</code>, - <code>setTabMode</code>, and <code>setLineNumbers</code> to - customise a running editor. Introduces an <a - href="contrib/sql/index.html">SQL</a> parser. Fixes a few small - problems in the <a href="contrib/python/index.html">Python</a> - parser. And, as usual, add workarounds for various newly discovered - browser incompatibilities.</p> - -<p class="rel"><em>31-08-2009</em>: <a -href="http://codemirror.net/codemirror-0.63.zip">Version -0.63</a>:</p> -<p class="rel-note"> Overhaul of paste-handling (less fragile), fixes for several -serious IE8 issues (cursor jumping, end-of-document bugs) and a number -of small problems.</p> - -<p class="rel"><em>30-05-2009</em>: <a -href="http://codemirror.net/codemirror-0.62.zip">Version -0.62</a>:</p> -<p class="rel-note">Introduces <a href="contrib/python/index.html">Python</a> -and <a href="contrib/lua/index.html">Lua</a> parsers. Add -<code>setParser</code> (on-the-fly mode changing) and -<code>clearHistory</code> methods. Make parsing passes time-based -instead of lines-based (see the <code>passTime</code> option).</p> - -</body></html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/realworld.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/realworld.html deleted file mode 100644 index 2f0ab9163461b139c781e21f310225fc0bd197ca..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/realworld.html +++ /dev/null @@ -1,81 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"/> - <title>CodeMirror: Real-world uses</title> - <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"/> - <link rel="stylesheet" type="text/css" href="docs.css"/> - </head> - <body> - -<h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1> - -<div class="grey"> -<img src="baboon.png" class="logo" alt="logo"/> -<pre> -/* Real world uses, - full list */ -</pre> -</div> - - <p><a href="mailto:marijnh@gmail.com">Contact me</a> if you'd like - your project to be added to this list.</p> - - <ul> - <li><a href="http://brackets.io">Adobe Brackets</a> (code editor)</li> - <li><a href="http://bluegriffon.org/">BlueGriffon</a> (HTML editor)</li> - <li><a href="http://cargocollective.com/">Cargo Collective</a> (creative publishing platform)</li> - <li><a href="http://www.codebugapp.com/">Codebug</a> (PHP Xdebug front-end)</li> - <li><a href="http://code.google.com/p/codemirror2-gwt/">CodeMirror2-GWT</a> (Google Web Toolkit wrapper)</li> - <li><a href="http://codepen.io">Codepen</a> (gallery of animations)</li> - <li><a href="http://codev.it/">Codev</a> (collaborative IDE)</li> - <li><a href="http://ot.substance.io/demo/">Collaborative CodeMirror demo</a> (CodeMirror + operational transforms)</li> - <li><a href="http://www.ckwnc.com/">CKWNC</a> (UML editor)</li> - <li><a href="http://cssdeck.com/">CSSDeck</a> (CSS showcase)</li> - <li><a href="http://ireneros.com/deck/deck.js-codemirror/introduction/#textarea-code">Deck.js integration</a> (slides with editors)</li> - <li><a href="http://www.dbninja.com">DbNinja</a> (MySQL access interface)</li> - <li><a href="http://elm-lang.org/Examples.elm">Elm language examples</a></li> - <li><a href="http://eloquentjavascript.net/chapter1.html">Eloquent JavaScript</a> (book)</li> - <li><a href="http://www.fastfig.com/">Fastfig</a> (online computation/math tool)</li> - <li><a href="https://metacpan.org/module/Farabi">Farabi</a> (Perl editor)</li> - <li><a href="http://blog.pamelafox.org/2012/02/interactive-html5-slides-with-fathomjs.html">FathomJS integration</a> (slides with editors, again)</li> - <li><a href="http://tour.golang.org">Go language tour</a></li> - <li><a href="https://github.com/github/android">GitHub's Android app</a></li> - <li><a href="https://script.google.com/">Google Apps Script</a></li> - <li><a href="http://web.uvic.ca/~siefkenj/graphit/graphit.html">Graphit</a> (function graphing)</li> - <li><a href="http://try.haxe.org">Haxe</a> (Haxe Playground) </li> - <li><a href="http://haxpad.com/">HaxPad</a> (editor for Win RT)</li> - <li><a href="http://megafonweblab.github.com/histone-javascript/">Histone template engine playground</a></li> - <li><a href="http://icecoder.net">ICEcoder</a> (web IDE)</li> - <li><a href="http://extensions.joomla.org/extensions/edition/editors/8723">Joomla plugin</a></li> - <li><a href="http://jqfundamentals.com/">jQuery fundamentals</a> (interactive tutorial)</li> - <li><a href="http://jsbin.com">jsbin.com</a> (JS playground)</li> - <li><a href="http://www.jshint.com/">JSHint</a> (JS linter)</li> - <li><a href="http://jumpseller.com/">Jumpseller</a> (online store builder)</li> - <li><a href="http://kl1p.com/cmtest/1">kl1p</a> (paste service)</li> - <li><a href="http://www.chris-granger.com/2012/04/12/light-table---a-new-ide-concept/">Light Table</a> (experimental IDE)</li> - <li><a href="http://www.mergely.com/">Mergely</a> (interactive diffing)</li> - <li><a href="https://notex.ch">NoTex</a> (rST authoring)</li> - <li><a href="http://clrhome.org/asm/">ORG</a> (z80 assembly IDE)</li> - <li><a href="https://github.com/mamacdon/orion-codemirror">Orion-CodeMirror integration</a> (running CodeMirror modes in Orion)</li> - <li><a href="http://paperjs.org/">Paper.js</a> (graphics scripting)</li> - <li><a href="http://prose.io/">Prose.io</a> (github content editor)</li> - <li><a href="http://ql.io/">ql.io</a> (http API query helper)</li> - <li><a href="http://qyapp.com">QiYun web app platform</a></li> - <li><a href="http://ariya.ofilabs.com/2011/09/hybrid-webnative-desktop-codemirror.html">Qt+Webkit integration</a> (building a desktop CodeMirror app)</li> - <li><a href="http://www.sketchpatch.net/labs/livecodelabIntro.html">sketchPatch Livecodelab</a></li> - <li><a href="http://www.skulpt.org/">Skulpt</a> (in-browser Python environment)</li> - <li><a href="http://www.solidshops.com/">SolidShops</a> (hosted e-commerce platform)</li> - <li><a href="http://sqlfiddle.com">SQLFiddle</a> (SQL playground)</li> - <li><a href="https://thefiletree.com">The File Tree</a> (collab editor)</li> - <li><a href="http://enjalot.com/tributary/2636296/sinwaves.js">Tributary</a> (augmented editing)</li> - <li><a href="http://turbopy.com/">TurboPY</a> (web publishing framework)</li> - <li><a href="http://webglplayground.net/">WebGL playground</a></li> - <li><a href="http://www.wescheme.org/">WeScheme</a> (learning tool)</li> - <li><a href="http://wordpress.org/extend/plugins/codemirror-for-codeeditor/">WordPress plugin</a></li> - <li><a href="http://www.xosystem.org/home/applications_websites/xosystem_website/xoside_EN.php">XOSide</a> (online editor)</li> - <li><a href="http://media.chikuyonok.ru/codemirror2/">Zen Coding</a> (fast XML editing)</li> - </ul> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/reporting.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/reporting.html deleted file mode 100644 index a616512530473e72c69ffdfd888c45b9d3cf3d6d..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/reporting.html +++ /dev/null @@ -1,60 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"/> - <title>CodeMirror: Reporting Bugs</title> - <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"/> - <link rel="stylesheet" type="text/css" href="docs.css"/> - <style>li { margin-top: 1em; }</style> - </head> - <body> - -<h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1> - -<div class="grey"> -<img src="baboon.png" class="logo" alt="logo"/> -<pre> -/* Reporting bugs - effectively */ -</pre> -</div> - -<div class="left"> - -<p>So you found a problem in CodeMirror. By all means, report it! Bug -reports from users are the main drive behind improvements to -CodeMirror. But first, please read over these points:</p> - -<ol> - <li>CodeMirror is maintained by volunteers. They don't owe you - anything, so be polite. Reports with an indignant or belligerent - tone tend to be moved to the bottom of the pile.</li> - - <li>Include information about <strong>the browser in which the - problem occurred</strong>. Even if you tested several browsers, and - the problem occurred in all of them, mention this fact in the bug - report. Also include browser version numbers and the operating - system that you're on.</li> - - <li>Mention which release of CodeMirror you're using. Preferably, - try also with the current development snapshot, to ensure the - problem has not already been fixed.</li> - - <li>Mention very precisely what went wrong. "X is broken" is not a - good bug report. What did you expect to happen? What happened - instead? Describe the exact steps a maintainer has to take to make - the problem occur. We can not fix something that we can not - observe.</li> - - <li>If the problem can not be reproduced in any of the demos - included in the CodeMirror distribution, please provide an HTML - document that demonstrates the problem. The best way to do this is - to go to <a href="http://jsbin.com/ihunin/edit">jsbin.com</a>, enter - it there, press save, and include the resulting link in your bug - report.</li> -</ol> - -</div> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/upgrade_v2.2.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/upgrade_v2.2.html deleted file mode 100644 index 7e4d840043077d575ce642ecff50d80348ee84bd..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/upgrade_v2.2.html +++ /dev/null @@ -1,98 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"/> - <title>CodeMirror: Upgrading to v2.2</title> - <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"/> - <link rel="stylesheet" type="text/css" href="docs.css"/> - </head> - <body> - -<h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1> - -<div class="grey"> -<img src="baboon.png" class="logo" alt="logo"/> -<pre> -/* Upgrading to - v2.2 */ -</pre> -</div> - -<div class="left"> - -<p>There are a few things in the 2.2 release that require some care -when upgrading.</p> - -<h2>No more default.css</h2> - -<p>The default theme is now included -in <a href="../lib/codemirror.css"><code>codemirror.css</code></a>, so -you do not have to included it separately anymore. (It was tiny, so -even if you're not using it, the extra data overhead is negligible.) - -<h2>Different key customization</h2> - -<p>CodeMirror has moved to a system -where <a href="manual.html#option_keyMap">keymaps</a> are used to -bind behavior to keys. This means <a href="../demo/emacs.html">custom -bindings</a> are now possible.</p> - -<p>Three options that influenced key -behavior, <code>tabMode</code>, <code>enterMode</code>, -and <code>smartHome</code>, are no longer supported. Instead, you can -provide custom bindings to influence the way these keys act. This is -done through the -new <a href="manual.html#option_extraKeys"><code>extraKeys</code></a> -option, which can hold an object mapping key names to functionality. A -simple example would be:</p> - -<pre> extraKeys: { - "Ctrl-S": function(instance) { saveText(instance.getValue()); }, - "Ctrl-/": "undo" - }</pre> - -<p>Keys can be mapped either to functions, which will be given the -editor instance as argument, or to strings, which are mapped through -functions through the <code>CodeMirror.commands</code> table, which -contains all the built-in editing commands, and can be inspected and -extended by external code.</p> - -<p>By default, the <code>Home</code> key is bound to -the <code>"goLineStartSmart"</code> command, which moves the cursor to -the first non-whitespace character on the line. You can set do this to -make it always go to the very start instead:</p> - -<pre> extraKeys: {"Home": "goLineStart"}</pre> - -<p>Similarly, <code>Enter</code> is bound -to <code>"newlineAndIndent"</code> by default. You can bind it to -something else to get different behavior. To disable special handling -completely and only get a newline character inserted, you can bind it -to <code>false</code>:</p> - -<pre> extraKeys: {"Enter": false}</pre> - -<p>The same works for <code>Tab</code>. If you don't want CodeMirror -to handle it, bind it to <code>false</code>. The default behaviour is -to indent the current line more (<code>"indentMore"</code> command), -and indent it less when shift is held (<code>"indentLess"</code>). -There are also <code>"indentAuto"</code> (smart indent) -and <code>"insertTab"</code> commands provided for alternate -behaviors. Or you can write your own handler function to do something -different altogether.</p> - -<h2>Tabs</h2> - -<p>Handling of tabs changed completely. The display width of tabs can -now be set with the <code>tabSize</code> option, and tabs can -be <a href="../demo/visibletabs.html">styled</a> by setting CSS rules -for the <code>cm-tab</code> class.</p> - -<p>The default width for tabs is now 4, as opposed to the 8 that is -hard-wired into browsers. If you are relying on 8-space tabs, make -sure you explicitly set <code>tabSize: 8</code> in your options.</p> - -</div> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/upgrade_v3.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/upgrade_v3.html deleted file mode 100644 index eaaffec17f7cabefd83432a289561a5ea4c5d224..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/doc/upgrade_v3.html +++ /dev/null @@ -1,227 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"/> - <title>CodeMirror: Upgrading to v3</title> - <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"/> - <link rel="stylesheet" type="text/css" href="docs.css"/> - <script src="../lib/codemirror.js"></script> - <link rel="stylesheet" href="../lib/codemirror.css"> - <script src="../lib/util/runmode.js"></script> - <script src="../lib/util/colorize.js"></script> - <script src="../mode/javascript/javascript.js"></script> - <script src="../mode/xml/xml.js"></script> - <script src="../mode/css/css.js"></script> - <script src="../mode/htmlmixed/htmlmixed.js"></script> - </head> - <body> - -<h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1> - -<div class="grey"> -<img src="baboon.png" class="logo" alt="logo"/> -<pre> -/* Upgrading to - version 3 */ -</pre> -</div> - -<div class="clear"><div class="leftbig blk"> - -<p>Version 3 does not depart too much from 2.x API, and sites that use -CodeMirror in a very simple way might be able to upgrade without -trouble. But it does introduce a number of incompatibilities. Please -at least skim this text before upgrading.</p> - -<p>Note that <strong>version 3 drops full support for Internet -Explorer 7</strong>. The editor will mostly work on that browser, but -it'll be significantly glitchy.</p> - -<h2 id=dom>DOM structure</h2> - -<p>This one is the most likely to cause problems. The internal -structure of the editor has changed quite a lot, mostly to implement a -new scrolling model.</p> - -<p>Editor height is now set on the outer wrapper element (CSS -class <code>CodeMirror</code>), not on the scroller element -(<code>CodeMirror-scroll</code>).</p> - -<p>Other nodes were moved, dropped, and added. If you have any code -that makes assumptions about the internal DOM structure of the editor, -you'll have to re-test it and probably update it to work with v3.</p> - -<p>See the <a href="manual.html#styling">styling section</a> of the -manual for more information.</p> - -<h2 id=gutters>Gutter model</h2> - -<p>In CodeMirror 2.x, there was a single gutter, and line markers -created with <code>setMarker</code> would have to somehow coexist with -the line numbers (if present). Version 3 allows you to specify an -array of gutters, <a href="manual.html#option_gutters">by class -name</a>, -use <a href="manual.html#setGutterMarker"><code>setGutterMarker</code></a> -to add or remove markers in individual gutters, and clear whole -gutters -with <a href="manual.html#clearGutter"><code>clearGutter</code></a>. -Gutter markers are now specified as DOM nodes, rather than HTML -snippets.</p> - -<p>The gutters no longer horizontally scrolls along with the content. -The <code>fixedGutter</code> option was removed (since it is now the -only behavior).</p> - -<pre data-lang="text/html"> -<style> - /* Define a gutter style */ - .note-gutter { width: 3em; background: cyan; } -</style> -<script> - // Create an instance with two gutters -- line numbers and notes - var cm = new CodeMirror(document.body, { - gutters: ["note-gutter", "CodeMirror-linenumbers"], - lineNumbers: true - }); - // Add a note to line 0 - cm.setGutterMarker(0, "note-gutter", document.createTextNode("hi")); -</script> -</pre> - -<h2 id=events>Event handling</h2> - -<p>Most of the <code>onXYZ</code> options have been removed. The same -effect is now obtained by calling -the <a href="manual.html#on"><code>on</code></a> method with a string -identifying the event type. Multiple handlers can now be registered -(and individually unregistered) for an event, and objects such as line -handlers now also expose events. See <a href="manual.html#events">the -full list here</a>.</p> - -<p>(The <code>onKeyEvent</code> and <code>onDragEvent</code> options, -which act more as hooks than as event handlers, are still there in -their old form.)</p> - -<pre data-lang="javascript"> -cm.on("change", function(cm, change) { - console.log("something changed! (" + change.origin + ")"); -}); -</pre> - -<h2 id=marktext>markText method arguments</h2> - -<p>The <a href="manual.html#markText"><code>markText</code></a> method -(which has gained some interesting new features, such as creating -atomic and read-only spans, or replacing spans with widgets) no longer -takes the CSS class name as a separate argument, but makes it an -optional field in the options object instead.</p> - -<pre data-lang="javascript"> -// Style first ten lines, and forbid the cursor from entering them -cm.markText({line: 0, ch: 0}, {line: 10, ch: 0}, { - className: "magic-text", - inclusiveLeft: true, - atomic: true -}); -</pre> - -<h2 id=folding>Line folding</h2> - -<p>The interface for hiding lines has been -removed. <a href="manual.html#markText"><code>markText</code></a> can -now be used to do the same in a more flexible and powerful way.</p> - -<p>The <a href="../demo/folding.html">folding script</a> has been -updated to use the new interface, and should now be more robust.</p> - -<pre data-lang="javascript"> -// Fold a range, replacing it with the text "??" -var range = cm.markText({line: 4, ch: 2}, {line: 8, ch: 1}, { - replacedWith: document.createTextNode("??"), - // Auto-unfold when cursor moves into the range - clearOnEnter: true -}); -// Get notified when auto-unfolding -CodeMirror.on(range, "clear", function() { - console.log("boom"); -}); -</pre> - -<h2 id=lineclass>Line CSS classes</h2> - -<p>The <code>setLineClass</code> method has been replaced -by <a href="manual.html#addLineClass"><code>addLineClass</code></a> -and <a href="manual.html#removeLineClass"><code>removeLineClass</code></a>, -which allow more modular control over the classes attached to a line.</p> - -<pre data-lang="javascript"> -var marked = cm.addLineClass(10, "background", "highlighted-line"); -setTimeout(function() { - cm.removeLineClass(marked, "background", "highlighted-line"); -}); -</pre> - -<h2 id=positions>Position properties</h2> - -<p>All methods that take or return objects that represent screen -positions now use <code>{left, top, bottom, right}</code> properties -(not always all of them) instead of the <code>{x, y, yBot}</code> used -by some methods in v2.x.</p> - -<p>Affected methods -are <a href="manual.html#cursorCoords"><code>cursorCoords</code></a>, <a href="manual.html#charCoords"><code>charCoords</code></a>, <a href="manual.html#coordsChar"><code>coordsChar</code></a>, -and <a href="manual.html#getScrollInfo"><code>getScrollInfo</code></a>.</p> - -<h2 id=matchbrackets>Bracket matching no longer in core</h2> - -<p>The <a href="manual.html#util_matchbrackets"><code>matchBrackets</code></a> -option is no longer defined in the core editor. -Load <code>lib/util/matchbrackets.js</code> to enable it.</p> - -<h2 id=modes>Mode management</h2> - -<p>The <code>CodeMirror.listModes</code> -and <code>CodeMirror.listMIMEs</code> functions, used for listing -defined modes, are gone. You are now encouraged to simply -inspect <code>CodeMirror.modes</code> (mapping mode names to mode -constructors) and <code>CodeMirror.mimeModes</code> (mapping MIME -strings to mode specs).</p> - -<h2 id=new>New features</h2> - -<p>Some more reasons to upgrade to version 3.</p> - -<ul> - <li>Bi-directional text support. CodeMirror will now mostly do the - right thing when editing Arabic or Hebrew text.</li> - <li>Arbitrary line heights. Using fonts with different heights - inside the editor (whether off by one pixel or fifty) is now - supported and handled gracefully.</li> - <li>In-line widgets. See <a href="../demo/widget.html">the demo</a> - and <a href="manual.html#addLineWidget">the docs</a>.</li> - <li>Defining custom options - with <a href="manual.html#defineOption"><code>CodeMirror.defineOption</code></a>.</li> -</ul> - -</div><div class="rightsmall blk"> - -<h2>Contents</h2> - -<ul> - <li><a href="#dom">DOM structure</a></li> - <li><a href="#gutters">Gutter model</a></li> - <li><a href="#events">Event handling</a></li> - <li><a href="#folding">Line folding</a></li> - <li><a href="#marktext">markText method arguments</a></li> - <li><a href="#lineclass">Line CSS classes</a></li> - <li><a href="#positions">Position properties</a></li> - <li><a href="#matchbrackets">Bracket matching</a></li> - <li><a href="#modes">Mode management</a></li> - <li><a href="#new">New features</a></li> -</ul> - -</div></div> - -<script>setTimeout(function(){CodeMirror.colorize();}, 20);</script> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/index.html deleted file mode 100644 index c3380a1273457d0e07b2caf555a392b932ec44a3..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/index.html +++ /dev/null @@ -1,470 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"/> - <title>CodeMirror</title> - <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"/> - <link rel="stylesheet" type="text/css" href="doc/docs.css"/> - <link rel="alternate" href="https://groups.google.com/group/codemirror-announce/feed/atom_v1_0_topics.xml" type="application/atom+xml"/> - </head> - <body> - -<h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1> - -<div class="grey"> -<img src="doc/baboon.png" class="logo" alt="logo"/> -<pre> -/* In-browser code editing - made bearable */ -</pre> -</div> - -<div class="clear"><div class="left blk"> - - <p style="margin-top: 0">CodeMirror is a JavaScript component that - provides a code editor in the browser. When a mode is available for - the language you are coding in, it will color your code, and - optionally help with indentation.</p> - - <p>A <a href="doc/manual.html">rich programming API</a> and a CSS - theming system are available for customizing CodeMirror to fit your - application, and extending it with new functionality.</p> - - <div class="clear"><div class="left1 blk"> - - <h2 style="margin-top: 0">Supported modes:</h2> - - <ul> - <li><a href="mode/clike/index.html">C, C++, C#</a></li> - <li><a href="mode/clojure/index.html">Clojure</a></li> - <li><a href="mode/coffeescript/index.html">CoffeeScript</a></li> - <li><a href="mode/commonlisp/index.html">Common Lisp</a></li> - <li><a href="mode/css/index.html">CSS</a></li> - <li><a href="mode/diff/index.html">diff</a></li> - <li><a href="mode/ecl/index.html">ECL</a></li> - <li><a href="mode/erlang/index.html">Erlang</a></li> - <li><a href="mode/go/index.html">Go</a></li> - <li><a href="mode/groovy/index.html">Groovy</a></li> - <li><a href="mode/haskell/index.html">Haskell</a></li> - <li><a href="mode/haxe/index.html">Haxe</a></li> - <li><a href="mode/htmlembedded/index.html">HTML embedded scripts</a></li> - <li><a href="mode/htmlmixed/index.html">HTML mixed-mode</a></li> - <li><a href="mode/http/index.html">HTTP</a></li> - <li><a href="mode/clike/index.html">Java</a></li> - <li><a href="mode/javascript/index.html">JavaScript</a></li> - <li><a href="mode/jinja2/index.html">Jinja2</a></li> - <li><a href="mode/less/index.html">LESS</a></li> - <li><a href="mode/lua/index.html">Lua</a></li> - <li><a href="mode/markdown/index.html">Markdown</a> (<a href="mode/gfm/index.html">GitHub-flavour</a>)</li> - <li><a href="mode/mysql/index.html">MySQL</a></li> - <li><a href="mode/ntriples/index.html">NTriples</a></li> - <li><a href="mode/ocaml/index.html">OCaml</a></li> - <li><a href="mode/pascal/index.html">Pascal</a></li> - <li><a href="mode/perl/index.html">Perl</a></li> - <li><a href="mode/php/index.html">PHP</a></li> - <li><a href="mode/pig/index.html">Pig Latin</a></li> - <li><a href="mode/plsql/index.html">PL/SQL</a></li> - <li><a href="mode/properties/index.html">Properties files</a></li> - <li><a href="mode/python/index.html">Python</a></li> - <li><a href="mode/r/index.html">R</a></li> - <li>RPM <a href="mode/rpm/spec/index.html">spec</a> and <a href="mode/rpm/changes/index.html">changelog</a></li> - <li><a href="mode/rst/index.html">reStructuredText</a></li> - <li><a href="mode/ruby/index.html">Ruby</a></li> - <li><a href="mode/rust/index.html">Rust</a></li> - <li><a href="mode/clike/scala.html">Scala</a></li> - <li><a href="mode/scheme/index.html">Scheme</a></li> - <li><a href="mode/shell/index.html">Shell</a></li> - <li><a href="mode/sieve/index.html">Sieve</a></li> - <li><a href="mode/smalltalk/index.html">Smalltalk</a></li> - <li><a href="mode/smarty/index.html">Smarty</a></li> - <li><a href="mode/sparql/index.html">SPARQL</a></li> - <li><a href="mode/stex/index.html">sTeX, LaTeX</a></li> - <li><a href="mode/tiddlywiki/index.html">Tiddlywiki</a></li> - <li><a href="mode/tiki/index.html">Tiki wiki</a></li> - <li><a href="mode/vb/index.html">VB.NET</a></li> - <li><a href="mode/vbscript/index.html">VBScript</a></li> - <li><a href="mode/velocity/index.html">Velocity</a></li> - <li><a href="mode/verilog/index.html">Verilog</a></li> - <li><a href="mode/xml/index.html">XML/HTML</a></li> - <li><a href="mode/xquery/index.html">XQuery</a></li> - <li><a href="mode/yaml/index.html">YAML</a></li> - <li><a href="mode/z80/index.html">Z80</a></li> - </ul> - - </div><div class="left2 blk"> - - <h2 style="margin-top: 0">Usage demos:</h2> - - <ul> - <li><a href="demo/complete.html">Autocompletion</a> (<a href="demo/xmlcomplete.html">XML</a>)</li> - <li><a href="demo/search.html">Search/replace</a></li> - <li><a href="demo/folding.html">Code folding</a></li> - <li><a href="demo/widget.html">Line widgets</a> (via JSHint)</li> - <li><a href="demo/mustache.html">Mode overlays</a></li> - <li><a href="demo/multiplex.html">Mode multiplexer</a></li> - <li><a href="demo/preview.html">HTML editor with preview</a></li> - <li><a href="demo/resize.html">Auto-resizing editor</a></li> - <li><a href="demo/marker.html">Setting breakpoints</a></li> - <li><a href="demo/activeline.html">Highlighting the current line</a></li> - <li><a href="demo/matchhighlighter.html">Highlighting selection matches</a></li> - <li><a href="demo/theme.html">Theming</a></li> - <li><a href="demo/variableheight.html">Mixed font sizes</a></li> - <li><a href="demo/runmode.html">Stand-alone highlighting</a></li> - <li><a href="demo/fullscreen.html">Full-screen editing</a></li> - <li><a href="demo/changemode.html">Mode auto-changing</a></li> - <li><a href="demo/visibletabs.html">Visible tabs</a></li> - <li><a href="demo/formatting.html">Autoformatting of code</a></li> - <li><a href="demo/emacs.html">Emacs keybindings</a></li> - <li><a href="demo/vim.html">Vim keybindings</a></li> - <li><a href="demo/closetag.html">Automatic xml tag closing</a></li> - <li><a href="demo/loadmode.html">Lazy mode loading</a></li> - <li><a href="demo/btree.html">Document tree visualization</a></li> - </ul> - - <h2>Real-world uses:</h2> - - <ul> - <li><a href="http://jsbin.com">jsbin.com</a> (JS playground)</li> - <li><a href="http://www.chris-granger.com/2012/04/12/light-table---a-new-ide-concept/">Light Table</a> (experimental IDE)</li> - <li><a href="http://brackets.io">Adobe Brackets</a> (code editor)</li> - <li><a href="http://www.mergely.com/">Mergely</a> (interactive diffing)</li> - <li><a href="https://script.google.com/">Google Apps Script</a></li> - <li><a href="https://github.com/github/android">GitHub's Android app</a></li> - <li><a href="http://eloquentjavascript.net/chapter1.html">Eloquent JavaScript</a> (book)</li> - <li><a href="http://media.chikuyonok.ru/codemirror2/">Zen Coding</a> (fast XML editing)</li> - <li><a href="http://paperjs.org/">Paper.js</a> (graphics scripting)</li> - <li><a href="http://tour.golang.org">Go language tour</a></li> - <li><a href="http://codev.it/">Codev</a> (collaborative IDE)</li> - <li><a href="http://enjalot.com/tributary/2636296/sinwaves.js">Tributary</a> (augmented editing)</li> - <li><a href="http://prose.io/">Prose.io</a> (github content editor)</li> - <li><a href="http://www.wescheme.org/">WeScheme</a> (learning tool)</li> - <li><a href="http://webglplayground.net/">WebGL playground</a></li> - <li><a href="http://ql.io/">ql.io</a> (http API query helper)</li> - <li><a href="http://elm-lang.org/Examples.elm">Elm language examples</a></li> - <li><a href="https://thefiletree.com">The File Tree</a> (collab editor)</li> - <li><a href="http://www.jshint.com/">JSHint</a> (JS linter)</li> - <li><a href="http://kl1p.com/cmtest/1">kl1p</a> (paste service)</li> - <li><a href="http://sqlfiddle.com">SQLFiddle</a> (SQL playground)</li> - <li><a href="http://try.haxe.org">Try Haxe</a> (Haxe Playground) </li> - <li><a href="http://cssdeck.com/">CSSDeck</a> (CSS showcase)</li> - <li><a href="http://www.sketchpatch.net/labs/livecodelabIntro.html">sketchPatch Livecodelab</a></li> - <li><a href="https://notex.ch">NoTex</a> (rST authoring)</li> - <li><a href="doc/realworld.html">More...</a></li> - </ul> - - </div></div> - - <h2 id="code">Getting the code</h2> - - <p>All of CodeMirror is released under a <a - href="LICENSE">MIT-style</a> license. To get it, you can download - the <a href="http://codemirror.net/codemirror.zip">latest - release</a> or the current <a - href="http://codemirror.net/codemirror-latest.zip">development - snapshot</a> as zip files. To create a custom minified script file, - you can use the <a href="doc/compress.html">compression API</a>.</p> - - <p>We use <a href="http://git-scm.com/">git</a> for version control. - The main repository can be fetched in this way:</p> - - <pre class="code">git clone http://marijnhaverbeke.nl/git/codemirror</pre> - - <p>CodeMirror can also be found on GitHub at <a - href="http://github.com/marijnh/CodeMirror">marijnh/CodeMirror</a>. - If you plan to hack on the code and contribute patches, the best way - to do it is to create a GitHub fork, and send pull requests.</p> - - <h2 id="documention">Documentation</h2> - - <p>The <a href="doc/manual.html">manual</a> is your first stop for - learning how to use this library. It starts with a quick explanation - of how to use the editor, and then describes the API in detail.</p> - - <p>For those who want to learn more about the code, there is - a <a href="http://marijnhaverbeke.nl/blog/#cm-internals">series of - posts</a> on CodeMirror on my blog, and the - old <a href="doc/internals.html">overview of the editor - internals</a>. - The <a href="http://github.com/marijnh/CodeMirror">source code</a> - itself is, for the most part, also very readable.</p> - - <h2 id="support">Support and bug reports</h2> - - <p>Community discussion, questions, and informal bug reporting is - done on - the <a href="http://groups.google.com/group/codemirror">CodeMirror - Google group</a>. There is a separate - group, <a href="http://groups.google.com/group/codemirror-announce">CodeMirror-announce</a>, - which is lower-volume, and is only used for major announcements—new - versions and such. These will be cross-posted to both groups, so you - don't need to subscribe to both.</p> - - <p>Though bug reports through e-mail are responded to, the preferred - way to report bugs is to use - the <a href="http://github.com/marijnh/CodeMirror/issues">GitHub - issue tracker</a>. Before reporting a - bug, <a href="doc/reporting.html">read these pointers</a>. Also, - the issue tracker is for <em>bugs</em>, not requests for help.</p> - - <p>When none of these seem fitting, you can - simply <a href="mailto:marijnh@gmail.com">e-mail the maintainer</a> - directly.</p> - - <h2 id="supported">Supported browsers</h2> - - <p>The following <em>desktop</em> browsers are able to run CodeMirror:</p> - - <ul> - <li>Firefox 3 or higher</li> - <li>Chrome, any version</li> - <li>Safari 5.2 or higher</li> - <li>Opera 9 or higher (with some key-handling problems on OS X)</li> - <li>Internet Explorer 8 or higher in standards mode<br> - <em>(<strong>Not</strong> quirks mode. But quasi-standards mode with a - transitional doctype is also flaky. <code><!doctype - html></code> is recommended.)</em></li> - <li>Internet Explorer 7 (standards mode) is usable, but buggy. It - has a <a href="http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html">z-index - bug</a> that prevents CodeMirror from working properly.</li> - </ul> - - <p>I am not actively testing against every new browser release, and - vendors have a habit of introducing bugs all the time, so I am - relying on the community to tell me when something breaks. - See <a href="#support">here</a> for information on how to contact - me.</p> - - <p>Mobile browsers mostly kind of work, but, because of limitations - and their fundamentally different UI assumptions, show a lot of - quirks that are hard to work around.</p> - - <h2 id="commercial">Commercial support</h2> - - <p>CodeMirror is developed and maintained by me, Marijn Haverbeke, - in my own time. If your company is getting value out of CodeMirror, - please consider purchasing a support contract.</p> - - <ul> - <li>You'll be funding further work on CodeMirror.</li> - <li>You ensure that you get a quick response when you have a - problem, even when I am otherwise busy.</li> - </ul> - - <p>CodeMirror support contracts exist in two - forms—<strong>basic</strong> at €100 per month, - and <strong>premium</strong> at €500 per - month. <a href="mailto:marijnh@gmail.com">Contact me</a> for further - information.</p> - -</div> - -<div class="right blk"> - - <a href="http://codemirror.net/codemirror.zip" class="download">Download the latest release</a> - - <h2>Support CodeMirror</h2> - - <ul> - <li>Donate - (<span onclick="document.getElementById('paypal').submit();" - class="quasilink">Paypal</span>, - <span onclick="document.getElementById('bankinfo').style.display = 'block';" - class="quasilink">bank</span>, or - <a href="https://www.gittip.com/marijnh">Gittip</a>)</li> - <li>Purchase <a href="#commercial">commercial support</a></li> - </ul> - - <p id="bankinfo" style="display: none;"> - Bank: <i>Rabobank</i><br/> - Country: <i>Netherlands</i><br/> - SWIFT: <i>RABONL2U</i><br/> - Account: <i>147850770</i><br/> - Name: <i>Marijn Haverbeke</i><br/> - IBAN: <i>NL26 RABO 0147 8507 70</i> - </p> - - <h2>Reading material</h2> - - <ul> - <li><a href="doc/manual.html">User manual</a></li> - <li><a href="http://github.com/marijnh/CodeMirror">Browse the code</a></li> - </ul> - - <h2 id=releases>Releases</h2> - - <p class="rel">20-11-2012: <a href="http://codemirror.net/codemirror-3.0.zip">Version 3.0</a>:</p> - - <p class="rel-note"><strong>New major version</strong>. Only - partially backwards-compatible. See - the <a href="doc/upgrade_v3.html">upgrading guide</a> for more - information. Changes since release candidate 2:</p> - - <ul class="rel-note"> - <li>Rewritten VIM mode.</li> - <li>Fix a few minor scrolling and sizing issues.</li> - <li>Work around Safari segfault when dragging.</li> - <li>Full <a href="https://github.com/marijnh/CodeMirror/compare/v3.0rc2...v3.0">list of patches</a>.</li> - </ul> - - - <p class="rel">20-11-2012: <a href="http://codemirror.net/codemirror-3.0rc2.zip">Version 3.0, release candidate 2</a>:</p> - - <ul class="rel-note"> - <li>New mode: <a href="mode/http/index.html">HTTP</a>.</li> - <li>Improved handling of selection anchor position.</li> - <li>Improve IE performance on longer lines.</li> - <li>Reduce gutter glitches during horiz. scrolling.</li> - <li>Add <a href="doc/manual.html#addKeyMap"><code>addKeyMap</code></a> and <a href="doc/manual.html#removeKeyMap"><code>removeKeyMap</code></a> methods.</li> - <li>Rewrite <code>formatting</code> and <code>closetag</code> add-ons.</li> - <li>Full <a href="https://github.com/marijnh/CodeMirror/compare/v3.0rc1...v3.0rc2">list of patches</a>.</li> - </ul> - - <p class="rel">20-11-2012: <a href="http://codemirror.net/codemirror-2.36.zip">Version 2.36</a>:</p> - - <ul class="rel-note"> - <li>New mode: <a href="mode/z80/index.html">Z80 assembly</a>.</li> - <li>New theme: <a href="demo/theme.html?twilight">Twilight</a>.</li> - <li>Add command-line compression helper.</li> - <li>Make <a href="doc/manual.html#scrollIntoView"><code>scrollIntoView</code></a> public.</li> - <li>Add <a href="doc/manual.html#defaultTextHeight"><code>defaultTextHeight</code></a> method.</li> - <li>Various extensions to the vim keymap.</li> - <li>Make <a href="mode/php/index.html">PHP mode</a> build on <a href="mode/htmlmixed/index.html">mixed HTML mode</a>.</li> - <li>Add <a href="doc/manual.html#util_continuecomment">comment-continuing</a> add-on.</li> - <li>Full <a href="https://github.com/marijnh/CodeMirror/compare/v2.35...v2.36">list of patches</a>.</li> - </ul> - - <p class="rel">20-11-2012: <a href="http://codemirror.net/codemirror-3.0rc1.zip">Version 3.0, release candidate 1</a>:</p> - - <ul class="rel-note"> - <li>New theme: <a href="demo/theme.html?solarized%20light">Solarized</a>.</li> - <li>Introduce <a href="doc/manual.html#addLineClass"><code>addLineClass</code></a> - and <a href="doc/manual.html#removeLineClass"><code>removeLineClass</code></a>, - drop <code>setLineClass</code>.</li> - <li>Add a <em>lot</em> of - new <a href="doc/manual.html#markText">options for marked text</a> - (read-only, atomic, collapsed, widget replacement).</li> - <li>Remove the old code folding interface in favour of these new ranges.</li> - <li>Add <a href="doc/manual.html#isClean"><code>isClean</code></a>/<a href="doc/manual.html#markClean"><code>markClean</code></a> methods.</li> - <li>Remove <code>compoundChange</code> method, use better undo-event-combining heuristic.</li> - <li>Improve scrolling performance smoothness.</li> - <li>Full <a href="https://github.com/marijnh/CodeMirror/compare/v3.0beta2...v3.0rc1">list of patches</a>.</li> - </ul> - - <p class="rel">22-10-2012: <a href="http://codemirror.net/codemirror-2.35.zip">Version 2.35</a>:</p> - - <ul class="rel-note"> - <li>New (sub) mode: <a href="mode/javascript/typescript.html">TypeScript</a>.</li> - <li>Don't overwrite (insert key) when pasting.</li> - <li>Fix several bugs in <a href="doc/manual.html#markText"><code>markText</code></a>/undo interaction.</li> - <li>Better indentation of JavaScript code without semicolons.</li> - <li>Add <a href="doc/manual.html#defineInitHook"><code>defineInitHook</code></a> function.</li> - <li>Full <a href="https://github.com/marijnh/CodeMirror/compare/v2.34...v2.35">list of patches</a>.</li> - </ul> - - <p class="rel">22-10-2012: <a href="http://codemirror.net/codemirror-3.0beta2.zip">Version 3.0, beta 2</a>:</p> - - <ul class="rel-note"> - <li>Fix page-based coordinate computation.</li> - <li>Fix firing of <a href="doc/manual.html#event_gutterClick"><code>gutterClick</code></a> event.</li> - <li>Add <a href="doc/manual.html#option_cursorHeight"><code>cursorHeight</code></a> option.</li> - <li>Fix bi-directional text regression.</li> - <li>Add <a href="doc/manual.html#option_viewportMargin"><code>viewportMargin</code></a> option.</li> - <li>Directly handle mousewheel events (again, hopefully better).</li> - <li>Make vertical cursor movement more robust (through widgets, big line gaps).</li> - <li>Add <a href="doc/manual.html#option_flattenSpans"><code>flattenSpans</code></a> option.</li> - <li>Many optimizations. Poor responsiveness should be fixed.</li> - <li>Initialization in hidden state works again.</li> - <li>Full <a href="https://github.com/marijnh/CodeMirror/compare/v3.0beta1...v3.0beta2">list of patches</a>.</li> - </ul> - - <p class="rel">19-09-2012: <a href="http://codemirror.net/codemirror-2.34.zip">Version 2.34</a>:</p> - - <ul class="rel-note"> - <li>New mode: <a href="mode/commonlisp/index.html">Common Lisp</a>.</li> - <li>Fix right-click select-all on most browsers.</li> - <li>Change the way highlighting happens:<br> Saves memory and CPU cycles.<br> <code>compareStates</code> is no longer needed.<br> <code>onHighlightComplete</code> no longer works.</li> - <li>Integrate mode (Markdown, XQuery, CSS, sTex) tests in central testsuite.</li> - <li>Add a <a href="doc/manual.html#version"><code>CodeMirror.version</code></a> property.</li> - <li>More robust handling of nested modes in <a href="demo/formatting.html">formatting</a> and <a href="demo/closetag.html">closetag</a> plug-ins.</li> - <li>Un/redo now preserves <a href="doc/manual.html#markText">marked text</a> and bookmarks.</li> - <li><a href="https://github.com/marijnh/CodeMirror/compare/v2.33...v2.34">Full list</a> of patches.</li> - </ul> - - <p class="rel">19-09-2012: <a href="http://codemirror.net/codemirror-3.0beta1.zip">Version 3.0, beta 1</a>:</p> - - <ul class="rel-note"> - <li>Bi-directional text support.</li> - <li>More powerful gutter model.</li> - <li>Support for arbitrary text/widget height.</li> - <li>In-line widgets.</li> - <li>Generalized event handling.</li> - </ul> - - <p class="rel">23-08-2012: <a href="http://codemirror.net/codemirror-2.33.zip">Version 2.33</a>:</p> - - <ul class="rel-note"> - <li>New mode: <a href="mode/sieve/index.html">Sieve</a>.</li> - <li>New <a href="doc/manual.html#getViewport"><code>getViewPort</code></a> and <a href="doc/manual.html#option_onViewportChange"><code>onViewportChange</code></a> API.</li> - <li><a href="doc/manual.html#option_cursorBlinkRate">Configurable</a> cursor blink rate.</li> - <li>Make binding a key to <code>false</code> disabling handling (again).</li> - <li>Show non-printing characters as red dots.</li> - <li>More tweaks to the scrolling model.</li> - <li>Expanded testsuite. Basic linter added.</li> - <li>Remove most uses of <code>innerHTML</code>. Remove <code>CodeMirror.htmlEscape</code>.</li> - <li><a href="https://github.com/marijnh/CodeMirror/compare/v2.32...v2.33">Full list</a> of patches.</li> - </ul> - - <p class="rel">23-07-2012: <a href="http://codemirror.net/codemirror-2.32.zip">Version 2.32</a>:</p> - - <p class="rel-note">Emergency fix for a bug where an editor with - line wrapping on IE will break when there is <em>no</em> - scrollbar.</p> - - <p class="rel">20-07-2012: <a href="http://codemirror.net/codemirror-2.31.zip">Version 2.31</a>:</p> - - <ul class="rel-note"> - <li>New modes: <a href="mode/ocaml/index.html">OCaml</a>, <a href="mode/haxe/index.html">Haxe</a>, and <a href="mode/vb/index.html">VB.NET</a>.</li> - <li>Several fixes to the new scrolling model.</li> - <li>Add a <a href="doc/manual.html#setSize"><code>setSize</code></a> method for programmatic resizing.</li> - <li>Add <a href="doc/manual.html#getHistory"><code>getHistory</code></a> and <a href="doc/manual.html#setHistory"><code>setHistory</code></a> methods.</li> - <li>Allow custom line separator string in <a href="doc/manual.html#getValue"><code>getValue</code></a> and <a href="doc/manual.html#getRange"><code>getRange</code></a>.</li> - <li>Support double- and triple-click drag, double-clicking whitespace.</li> - <li>And more... <a href="https://github.com/marijnh/CodeMirror/compare/v2.3...v2.31">(all patches)</a></li> - </ul> - - <p class="rel">22-06-2012: <a href="http://codemirror.net/codemirror-2.3.zip">Version 2.3</a>:</p> - - <ul class="rel-note"> - <li><strong>New scrollbar implementation</strong>. Should flicker less. Changes DOM structure of the editor.</li> - <li>New theme: <a href="demo/theme.html?vibrant-ink">vibrant-ink</a>.</li> - <li>Many extensions to the VIM keymap (including text objects).</li> - <li>Add <a href="demo/multiplex.html">mode-multiplexing</a> utility script.</li> - <li>Fix bug where right-click paste works in read-only mode.</li> - <li>Add a <a href="doc/manual.html#getScrollInfo"><code>getScrollInfo</code></a> method.</li> - <li>Lots of other <a href="https://github.com/marijnh/CodeMirror/compare/v2.25...v2.3">fixes</a>.</li> - </ul> - - <p class="rel">23-05-2012: <a href="http://codemirror.net/codemirror-2.25.zip">Version 2.25</a>:</p> - - <ul class="rel-note"> - <li>New mode: <a href="mode/erlang/index.html">Erlang</a>.</li> - <li><strong>Remove xmlpure mode</strong> (use <a href="mode/xml/index.html">xml.js</a>).</li> - <li>Fix line-wrapping in Opera.</li> - <li>Fix X Windows middle-click paste in Chrome.</li> - <li>Fix bug that broke pasting of huge documents.</li> - <li>Fix backspace and tab key repeat in Opera.</li> - </ul> - - <p><a href="doc/oldrelease.html">Older releases...</a></p> - -</div></div> - -<div style="height: 2em"> </div> - - <form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="paypal"> - <input type="hidden" name="cmd" value="_s-xclick"/> - <input type="hidden" name="hosted_button_id" value="3FVHS5FGUY7CC"/> - </form> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/keymap/emacs.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/keymap/emacs.js deleted file mode 100644 index fab3ab9fe6a53965035045ffc197fe6d677cc458..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/keymap/emacs.js +++ /dev/null @@ -1,30 +0,0 @@ -// TODO number prefixes -(function() { - // Really primitive kill-ring implementation. - var killRing = []; - function addToRing(str) { - killRing.push(str); - if (killRing.length > 50) killRing.shift(); - } - function getFromRing() { return killRing[killRing.length - 1] || ""; } - function popFromRing() { if (killRing.length > 1) killRing.pop(); return getFromRing(); } - - CodeMirror.keyMap.emacs = { - "Ctrl-X": function(cm) {cm.setOption("keyMap", "emacs-Ctrl-X");}, - "Ctrl-W": function(cm) {addToRing(cm.getSelection()); cm.replaceSelection("");}, - "Ctrl-Alt-W": function(cm) {addToRing(cm.getSelection()); cm.replaceSelection("");}, - "Alt-W": function(cm) {addToRing(cm.getSelection());}, - "Ctrl-Y": function(cm) {cm.replaceSelection(getFromRing());}, - "Alt-Y": function(cm) {cm.replaceSelection(popFromRing());}, - "Ctrl-/": "undo", "Shift-Ctrl--": "undo", "Shift-Alt-,": "goDocStart", "Shift-Alt-.": "goDocEnd", - "Ctrl-S": "findNext", "Ctrl-R": "findPrev", "Ctrl-G": "clearSearch", "Shift-Alt-5": "replace", - "Ctrl-Z": "undo", "Cmd-Z": "undo", "Alt-/": "autocomplete", "Alt-V": "goPageUp", - "Ctrl-J": "newlineAndIndent", "Enter": false, "Tab": "indentAuto", - fallthrough: ["basic", "emacsy"] - }; - - CodeMirror.keyMap["emacs-Ctrl-X"] = { - "Ctrl-S": "save", "Ctrl-W": "save", "S": "saveAll", "F": "open", "U": "undo", "K": "close", - auto: "emacs", nofallthrough: true - }; -})(); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/keymap/vim.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/keymap/vim.js deleted file mode 100644 index aa1856518b0876067689128787de58179e763a8a..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/keymap/vim.js +++ /dev/null @@ -1,2298 +0,0 @@ -/** - * Supported keybindings: - * - * Motion: - * h, j, k, l - * e, E, w, W, b, B, ge, gE - * f<character>, F<character>, t<character>, T<character> - * $, ^, 0 - * gg, G - * % - * '<character>, `<character> - * - * Operator: - * d, y, c - * dd, yy, cc - * g~, g~g~ - * >, <, >>, << - * - * Operator-Motion: - * x, X, D, Y, C, ~ - * - * Action: - * a, i, s, A, I, S, o, O - * J - * u, Ctrl-r - * m<character> - * r<character> - * - * Modes: - * ESC - leave insert mode, visual mode, and clear input state. - * Ctrl-[, Ctrl-c - same as ESC. - * - * Registers: unamed, -, a-z, A-Z, 0-9 - * (Does not respect the special case for number registers when delete - * operator is made with these commands: %, (, ), , /, ?, n, N, {, } ) - * TODO: Implement the remaining registers. - * Marks: a-z, A-Z, and 0-9 - * TODO: Implement the remaining special marks. They have more complex - * behavior. - * - * Code structure: - * 1. Default keymap - * 2. Variable declarations and short basic helpers - * 3. Instance (External API) implementation - * 4. Internal state tracking objects (input state, counter) implementation - * and instanstiation - * 5. Key handler (the main command dispatcher) implementation - * 6. Motion, operator, and action implementations - * 7. Helper functions for the key handler, motions, operators, and actions - * 8. Set up Vim to work as a keymap for CodeMirror. - */ - -(function() { - 'use strict'; - - var defaultKeymap = [ - // Key to key mapping. This goes first to make it possible to override - // existing mappings. - { keys: ['Left'], type: 'keyToKey', toKeys: ['h'] }, - { keys: ['Right'], type: 'keyToKey', toKeys: ['l'] }, - { keys: ['Up'], type: 'keyToKey', toKeys: ['k'] }, - { keys: ['Down'], type: 'keyToKey', toKeys: ['j'] }, - { keys: ['Space'], type: 'keyToKey', toKeys: ['l'] }, - { keys: ['Backspace'], type: 'keyToKey', toKeys: ['h'] }, - { keys: ['Ctrl-Space'], type: 'keyToKey', toKeys: ['W'] }, - { keys: ['Ctrl-Backspace'], type: 'keyToKey', toKeys: ['B'] }, - { keys: ['Shift-Space'], type: 'keyToKey', toKeys: ['w'] }, - { keys: ['Shift-Backspace'], type: 'keyToKey', toKeys: ['b'] }, - { keys: ['Ctrl-n'], type: 'keyToKey', toKeys: ['j'] }, - { keys: ['Ctrl-p'], type: 'keyToKey', toKeys: ['k'] }, - { keys: ['Ctrl-['], type: 'keyToKey', toKeys: ['Esc'] }, - { keys: ['Ctrl-c'], type: 'keyToKey', toKeys: ['Esc'] }, - { keys: ['s'], type: 'keyToKey', toKeys: ['c', 'l'] }, - { keys: ['S'], type: 'keyToKey', toKeys: ['c', 'c'] }, - { keys: ['Home'], type: 'keyToKey', toKeys: ['0'] }, - { keys: ['End'], type: 'keyToKey', toKeys: ['$'] }, - { keys: ['PageUp'], type: 'keyToKey', toKeys: ['Ctrl-b'] }, - { keys: ['PageDown'], type: 'keyToKey', toKeys: ['Ctrl-f'] }, - // Motions - { keys: ['h'], type: 'motion', - motion: 'moveByCharacters', - motionArgs: { forward: false }}, - { keys: ['l'], type: 'motion', - motion: 'moveByCharacters', - motionArgs: { forward: true }}, - { keys: ['j'], type: 'motion', - motion: 'moveByLines', - motionArgs: { forward: true, linewise: true }}, - { keys: ['k'], type: 'motion', - motion: 'moveByLines', - motionArgs: { forward: false, linewise: true }}, - { keys: ['w'], type: 'motion', - motion: 'moveByWords', - motionArgs: { forward: true, wordEnd: false }}, - { keys: ['W'], type: 'motion', - motion: 'moveByWords', - motionArgs: { forward: true, wordEnd: false, bigWord: true }}, - { keys: ['e'], type: 'motion', - motion: 'moveByWords', - motionArgs: { forward: true, wordEnd: true, inclusive: true }}, - { keys: ['E'], type: 'motion', - motion: 'moveByWords', - motionArgs: { forward: true, wordEnd: true, bigWord: true, - inclusive: true }}, - { keys: ['b'], type: 'motion', - motion: 'moveByWords', - motionArgs: { forward: false, wordEnd: false }}, - { keys: ['B'], type: 'motion', - motion: 'moveByWords', - motionArgs: { forward: false, wordEnd: false, bigWord: true }}, - { keys: ['g', 'e'], type: 'motion', - motion: 'moveByWords', - motionArgs: { forward: false, wordEnd: true, inclusive: true }}, - { keys: ['g', 'E'], type: 'motion', - motion: 'moveByWords', - motionArgs: { forward: false, wordEnd: true, bigWord: true, - inclusive: true }}, - { keys: ['Ctrl-f'], type: 'motion', - motion: 'moveByPage', motionArgs: { forward: true }}, - { keys: ['Ctrl-b'], type: 'motion', - motion: 'moveByPage', motionArgs: { forward: false }}, - { keys: ['g', 'g'], type: 'motion', - motion: 'moveToLineOrEdgeOfDocument', - motionArgs: { forward: false, explicitRepeat: true, linewise: true }}, - { keys: ['G'], type: 'motion', - motion: 'moveToLineOrEdgeOfDocument', - motionArgs: { forward: true, explicitRepeat: true, linewise: true }}, - { keys: ['0'], type: 'motion', motion: 'moveToStartOfLine' }, - { keys: ['^'], type: 'motion', - motion: 'moveToFirstNonWhiteSpaceCharacter' }, - { keys: ['$'], type: 'motion', - motion: 'moveToEol', - motionArgs: { inclusive: true }}, - { keys: ['%'], type: 'motion', - motion: 'moveToMatchedSymbol', - motionArgs: { inclusive: true }}, - { keys: ['f', 'character'], type: 'motion', - motion: 'moveToCharacter', - motionArgs: { forward: true , inclusive: true }}, - { keys: ['F', 'character'], type: 'motion', - motion: 'moveToCharacter', - motionArgs: { forward: false }}, - { keys: ['t', 'character'], type: 'motion', - motion: 'moveTillCharacter', - motionArgs: { forward: true, inclusive: true }}, - { keys: ['T', 'character'], type: 'motion', - motion: 'moveTillCharacter', - motionArgs: { forward: false }}, - { keys: ['\'', 'character'], type: 'motion', motion: 'goToMark' }, - { keys: ['`', 'character'], type: 'motion', motion: 'goToMark' }, - { keys: ['|'], type: 'motion', - motion: 'moveToColumn', - motionArgs: { }}, - // Operators - { keys: ['d'], type: 'operator', operator: 'delete' }, - { keys: ['y'], type: 'operator', operator: 'yank' }, - { keys: ['c'], type: 'operator', operator: 'change', - operatorArgs: { enterInsertMode: true } }, - { keys: ['>'], type: 'operator', operator: 'indent', - operatorArgs: { indentRight: true }}, - { keys: ['<'], type: 'operator', operator: 'indent', - operatorArgs: { indentRight: false }}, - { keys: ['g', '~'], type: 'operator', operator: 'swapcase' }, - { keys: ['n'], type: 'motion', motion: 'findNext' }, - { keys: ['N'], type: 'motion', motion: 'findPrev' }, - // Operator-Motion dual commands - { keys: ['x'], type: 'operatorMotion', operator: 'delete', - motion: 'moveByCharacters', motionArgs: { forward: true }, - operatorMotionArgs: { visualLine: false }}, - { keys: ['X'], type: 'operatorMotion', operator: 'delete', - motion: 'moveByCharacters', motionArgs: { forward: false }, - operatorMotionArgs: { visualLine: true }}, - { keys: ['D'], type: 'operatorMotion', operator: 'delete', - motion: 'moveToEol', motionArgs: { inclusive: true }, - operatorMotionArgs: { visualLine: true }}, - { keys: ['Y'], type: 'operatorMotion', operator: 'yank', - motion: 'moveToEol', motionArgs: { inclusive: true }, - operatorMotionArgs: { visualLine: true }}, - { keys: ['C'], type: 'operatorMotion', - operator: 'change', operatorArgs: { enterInsertMode: true }, - motion: 'moveToEol', motionArgs: { inclusive: true }, - operatorMotionArgs: { visualLine: true }}, - { keys: ['~'], type: 'operatorMotion', operator: 'swapcase', - motion: 'moveByCharacters', motionArgs: { forward: true }}, - // Actions - { keys: ['a'], type: 'action', action: 'enterInsertMode', - actionArgs: { insertAt: 'charAfter' }}, - { keys: ['A'], type: 'action', action: 'enterInsertMode', - actionArgs: { insertAt: 'eol' }}, - { keys: ['i'], type: 'action', action: 'enterInsertMode' }, - { keys: ['I'], type: 'action', action: 'enterInsertMode', - motion: 'moveToFirstNonWhiteSpaceCharacter' }, - { keys: ['o'], type: 'action', action: 'newLineAndEnterInsertMode', - actionArgs: { after: true }}, - { keys: ['O'], type: 'action', action: 'newLineAndEnterInsertMode', - actionArgs: { after: false }}, - { keys: ['v'], type: 'action', action: 'toggleVisualMode' }, - { keys: ['V'], type: 'action', action: 'toggleVisualMode', - actionArgs: { linewise: true }}, - { keys: ['J'], type: 'action', action: 'joinLines' }, - { keys: ['p'], type: 'action', action: 'paste', - actionArgs: { after: true }}, - { keys: ['P'], type: 'action', action: 'paste', - actionArgs: { after: false }}, - { keys: ['r', 'character'], type: 'action', action: 'replace' }, - { keys: ['u'], type: 'action', action: 'undo' }, - { keys: ['Ctrl-r'], type: 'action', action: 'redo' }, - { keys: ['m', 'character'], type: 'action', action: 'setMark' }, - { keys: ['\"', 'character'], type: 'action', action: 'setRegister' }, - { keys: [',', '/'], type: 'action', action: 'clearSearchHighlight' }, - // Text object motions - { keys: ['a', 'character'], type: 'motion', - motion: 'textObjectManipulation' }, - { keys: ['i', 'character'], type: 'motion', - motion: 'textObjectManipulation', - motionArgs: { textObjectInner: true }}, - // Search - { keys: ['/'], type: 'search', - searchArgs: { forward: true, querySrc: 'prompt' }}, - { keys: ['?'], type: 'search', - searchArgs: { forward: false, querySrc: 'prompt' }}, - { keys: ['*'], type: 'search', - searchArgs: { forward: true, querySrc: 'wordUnderCursor' }}, - { keys: ['#'], type: 'search', - searchArgs: { forward: false, querySrc: 'wordUnderCursor' }}, - // Ex command - { keys: [':'], type: 'ex' } - ]; - - var Vim = function() { - var alphabetRegex = /[A-Za-z]/; - var numberRegex = /[\d]/; - var whiteSpaceRegex = /\s/; - var wordRegexp = [(/\w/), (/[^\w\s]/)], bigWordRegexp = [(/\S/)]; - function makeKeyRange(start, size) { - var keys = []; - for (var i = start; i < start + size; i++) { - keys.push(String.fromCharCode(i)); - } - return keys; - } - var upperCaseAlphabet = makeKeyRange(65, 26); - var lowerCaseAlphabet = makeKeyRange(97, 26); - var numbers = makeKeyRange(48, 10); - var SPECIAL_SYMBOLS = '~`!@#$%^&*()_-+=[{}]\\|/?.,<>:;\"\''; - var specialSymbols = SPECIAL_SYMBOLS.split(''); - var specialKeys = ['Left', 'Right', 'Up', 'Down', 'Space', 'Backspace', - 'Esc', 'Home', 'End', 'PageUp', 'PageDown']; - var validMarks = upperCaseAlphabet.concat(lowerCaseAlphabet).concat( - numbers); - var validRegisters = upperCaseAlphabet.concat(lowerCaseAlphabet).concat( - numbers).concat('-\"'.split('')); - - function isAlphabet(k) { - return alphabetRegex.test(k); - } - function isLine(cm, line) { - return line >= 0 && line < cm.lineCount(); - } - function isLowerCase(k) { - return (/^[a-z]$/).test(k); - } - function isMatchableSymbol(k) { - return '()[]{}'.indexOf(k) != -1; - } - function isNumber(k) { - return numberRegex.test(k); - } - function isUpperCase(k) { - return (/^[A-Z]$/).test(k); - } - function isAlphanumeric(k) { - return (/^[\w]$/).test(k); - } - function isWhiteSpace(k) { - return whiteSpaceRegex.test(k); - } - function isWhiteSpaceString(k) { - return (/^\s*$/).test(k); - } - function inRangeInclusive(x, start, end) { - return x >= start && x <= end; - } - function inArray(val, arr) { - for (var i = 0; i < arr.length; i++) { - if (arr[i] == val) { - return true; - } - } - return false; - } - - // Global Vim state. Call getVimGlobalState to get and initialize. - var vimGlobalState; - function getVimGlobalState() { - if (!vimGlobalState) { - vimGlobalState = { - // The current search query. - searchQuery: null, - // Whether we are searching backwards. - searchIsReversed: false, - registerController: new RegisterController({}) - }; - } - return vimGlobalState; - } - function getVimState(cm) { - if (!cm.vimState) { - // Store instance state in the CodeMirror object. - cm.vimState = { - inputState: new InputState(), - // When using jk for navigation, if you move from a longer line to a - // shorter line, the cursor may clip to the end of the shorter line. - // If j is pressed again and cursor goes to the next line, the - // cursor should go back to its horizontal position on the longer - // line if it can. This is to keep track of the horizontal position. - lastHPos: -1, - // The last motion command run. Cleared if a non-motion command gets - // executed in between. - lastMotion: null, - marks: {}, - visualMode: false, - // If we are in visual line mode. No effect if visualMode is false. - visualLine: false - }; - } - return cm.vimState; - } - - var vimApi= { - buildKeyMap: function() { - // TODO: Convert keymap into dictionary format for fast lookup. - }, - // Testing hook, though it might be useful to expose the register - // controller anyways. - getRegisterController: function() { - return getVimGlobalState().registerController; - }, - // Testing hook. - clearVimGlobalState_: function() { - vimGlobalState = null; - }, - map: function(lhs, rhs) { - // Add user defined key bindings. - exCommandDispatcher.map(lhs, rhs); - }, - // Initializes vim state variable on the CodeMirror object. Should only be - // called lazily by handleKey or for testing. - maybeInitState: function(cm) { - getVimState(cm); - }, - // This is the outermost function called by CodeMirror, after keys have - // been mapped to their Vim equivalents. - handleKey: function(cm, key) { - var command; - var vim = getVimState(cm); - if (key == 'Esc') { - // Clear input state and get back to normal mode. - vim.inputState.reset(); - if (vim.visualMode) { - exitVisualMode(cm, vim); - } - return; - } - if (vim.visualMode && - cursorEqual(cm.getCursor('head'), cm.getCursor('anchor'))) { - // The selection was cleared. Exit visual mode. - exitVisualMode(cm, vim); - } - if (!vim.visualMode && - !cursorEqual(cm.getCursor('head'), cm.getCursor('anchor'))) { - vim.visualMode = true; - vim.visualLine = false; - } - if (key != '0' || (key == '0' && vim.inputState.getRepeat() === 0)) { - // Have to special case 0 since it's both a motion and a number. - command = commandDispatcher.matchCommand(key, defaultKeymap, vim); - } - if (!command) { - if (isNumber(key)) { - // Increment count unless count is 0 and key is 0. - vim.inputState.pushRepeatDigit(key); - } - return; - } - if (command.type == 'keyToKey') { - // TODO: prevent infinite recursion. - for (var i = 0; i < command.toKeys.length; i++) { - this.handleKey(cm, command.toKeys[i]); - } - } else { - commandDispatcher.processCommand(cm, vim, command); - } - } - }; - - // Represents the current input state. - function InputState() { - this.reset(); - } - InputState.prototype.reset = function() { - this.prefixRepeat = []; - this.motionRepeat = []; - - this.operator = null; - this.operatorArgs = null; - this.motion = null; - this.motionArgs = null; - this.keyBuffer = []; // For matching multi-key commands. - this.registerName = null; // Defaults to the unamed register. - }; - InputState.prototype.pushRepeatDigit = function(n) { - if (!this.operator) { - this.prefixRepeat = this.prefixRepeat.concat(n); - } else { - this.motionRepeat = this.motionRepeat.concat(n); - } - }; - InputState.prototype.getRepeat = function() { - var repeat = 0; - if (this.prefixRepeat.length > 0 || this.motionRepeat.length > 0) { - repeat = 1; - if (this.prefixRepeat.length > 0) { - repeat *= parseInt(this.prefixRepeat.join(''), 10); - } - if (this.motionRepeat.length > 0) { - repeat *= parseInt(this.motionRepeat.join(''), 10); - } - } - return repeat; - }; - - /* - * Register stores information about copy and paste registers. Besides - * text, a register must store whether it is linewise (i.e., when it is - * pasted, should it insert itself into a new line, or should the text be - * inserted at the cursor position.) - */ - function Register(text, linewise) { - this.clear(); - if (text) { - this.set(text, linewise); - } - } - Register.prototype = { - set: function(text, linewise) { - this.text = text; - this.linewise = !!linewise; - }, - append: function(text, linewise) { - // if this register has ever been set to linewise, use linewise. - if (linewise || this.linewise) { - this.text += '\n' + text; - this.linewise = true; - } else { - this.text += text; - } - }, - clear: function() { - this.text = ''; - this.linewise = false; - }, - toString: function() { return this.text; } - }; - - /* - * vim registers allow you to keep many independent copy and paste buffers. - * See http://usevim.com/2012/04/13/registers/ for an introduction. - * - * RegisterController keeps the state of all the registers. An initial - * state may be passed in. The unnamed register '"' will always be - * overridden. - */ - function RegisterController(registers) { - this.registers = registers; - this.unamedRegister = registers['\"'] = new Register(); - } - RegisterController.prototype = { - pushText: function(registerName, operator, text, linewise) { - // Lowercase and uppercase registers refer to the same register. - // Uppercase just means append. - var register = this.isValidRegister(registerName) ? - this.getRegister(registerName) : null; - // if no register/an invalid register was specified, things go to the - // default registers - if (!register) { - switch (operator) { - case 'yank': - // The 0 register contains the text from the most recent yank. - this.registers['0'] = new Register(text, linewise); - break; - case 'delete': - case 'change': - if (text.indexOf('\n') == -1) { - // Delete less than 1 line. Update the small delete register. - this.registers['-'] = new Register(text, linewise); - } else { - // Shift down the contents of the numbered registers and put the - // deleted text into register 1. - this.shiftNumericRegisters_(); - this.registers['1'] = new Register(text, linewise); - } - break; - } - // Make sure the unnamed register is set to what just happened - this.unamedRegister.set(text, linewise); - return; - } - - // If we've gotten to this point, we've actually specified a register - var append = isUpperCase(registerName); - if (append) { - register.append(text, linewise); - // The unamed register always has the same value as the last used - // register. - this.unamedRegister.append(text, linewise); - } else { - register.set(text, linewise); - this.unamedRegister.set(text, linewise); - } - }, - // Gets the register named @name. If one of @name doesn't already exist, - // create it. If @name is invalid, return the unamedRegister. - getRegister: function(name) { - if (!this.isValidRegister(name)) { - return this.unamedRegister; - } - name = name.toLowerCase(); - if (!this.registers[name]) { - this.registers[name] = new Register(); - } - return this.registers[name]; - }, - isValidRegister: function(name) { - return name && inArray(name, validRegisters); - }, - shiftNumericRegisters_: function() { - for (var i = 9; i >= 2; i--) { - this.registers[i] = this.getRegister('' + (i - 1)); - } - } - }; - - var commandDispatcher = { - matchCommand: function(key, keyMap, vim) { - var inputState = vim.inputState; - var keys = inputState.keyBuffer.concat(key); - for (var i = 0; i < keyMap.length; i++) { - var command = keyMap[i]; - if (matchKeysPartial(keys, command.keys)) { - if (keys.length < command.keys.length) { - // Matches part of a multi-key command. Buffer and wait for next - // stroke. - inputState.keyBuffer.push(key); - return null; - } else { - if (inputState.operator && command.type == 'action') { - // Ignore matched action commands after an operator. Operators - // only operate on motions. This check is really for text - // objects since aW, a[ etcs conflicts with a. - continue; - } - // Matches whole comand. Return the command. - if (command.keys[keys.length - 1] == 'character') { - inputState.selectedCharacter = keys[keys.length - 1]; - } - inputState.keyBuffer = []; - return command; - } - } - } - // Clear the buffer since there are no partial matches. - inputState.keyBuffer = []; - return null; - }, - processCommand: function(cm, vim, command) { - switch (command.type) { - case 'motion': - this.processMotion(cm, vim, command); - break; - case 'operator': - this.processOperator(cm, vim, command); - break; - case 'operatorMotion': - this.processOperatorMotion(cm, vim, command); - break; - case 'action': - this.processAction(cm, vim, command); - break; - case 'search': - this.processSearch(cm, vim, command); - break; - case 'ex': - case 'keyToEx': - this.processEx(cm, vim, command); - break; - default: - break; - } - }, - processMotion: function(cm, vim, command) { - vim.inputState.motion = command.motion; - vim.inputState.motionArgs = copyArgs(command.motionArgs); - this.evalInput(cm, vim); - }, - processOperator: function(cm, vim, command) { - var inputState = vim.inputState; - if (inputState.operator) { - if (inputState.operator == command.operator) { - // Typing an operator twice like 'dd' makes the operator operate - // linewise - inputState.motion = 'expandToLine'; - inputState.motionArgs = { linewise: true }; - this.evalInput(cm, vim); - return; - } else { - // 2 different operators in a row doesn't make sense. - inputState.reset(); - } - } - inputState.operator = command.operator; - inputState.operatorArgs = copyArgs(command.operatorArgs); - if (vim.visualMode) { - // Operating on a selection in visual mode. We don't need a motion. - this.evalInput(cm, vim); - } - }, - processOperatorMotion: function(cm, vim, command) { - var visualMode = vim.visualMode; - var operatorMotionArgs = copyArgs(command.operatorMotionArgs); - if (operatorMotionArgs) { - // Operator motions may have special behavior in visual mode. - if (visualMode && operatorMotionArgs.visualLine) { - vim.visualLine = true; - } - } - this.processOperator(cm, vim, command); - if (!visualMode) { - this.processMotion(cm, vim, command); - } - }, - processAction: function(cm, vim, command) { - var inputState = vim.inputState; - var repeat = inputState.getRepeat(); - var repeatIsExplicit = !!repeat; - var actionArgs = copyArgs(command.actionArgs) || {}; - if (inputState.selectedCharacter) { - actionArgs.selectedCharacter = inputState.selectedCharacter; - } - // Actions may or may not have motions and operators. Do these first. - if (command.operator) { - this.processOperator(cm, vim, command); - } - if (command.motion) { - this.processMotion(cm, vim, command); - } - if (command.motion || command.operator) { - this.evalInput(cm, vim); - } - actionArgs.repeat = repeat || 1; - actionArgs.repeatIsExplicit = repeatIsExplicit; - actionArgs.registerName = inputState.registerName; - inputState.reset(); - vim.lastMotion = null, - actions[command.action](cm, actionArgs, vim); - }, - processSearch: function(cm, vim, command) { - if (!cm.getSearchCursor) { - // Search depends on SearchCursor. - return; - } - var forward = command.searchArgs.forward; - getSearchState(cm).setReversed(!forward); - var promptPrefix = (forward) ? '/' : '?'; - function handleQuery(query, ignoreCase, smartCase) { - updateSearchQuery(cm, query, ignoreCase, smartCase); - commandDispatcher.processMotion(cm, vim, { - type: 'motion', - motion: 'findNext' - }); - } - function onPromptClose(query) { - handleQuery(query, true /** ignoreCase */, true /** smartCase */); - } - switch (command.searchArgs.querySrc) { - case 'prompt': - showPrompt(cm, onPromptClose, promptPrefix, searchPromptDesc); - break; - case 'wordUnderCursor': - var word = expandWordUnderCursor(cm, false /** inclusive */, - true /** forward */, false /** bigWord */, - true /** noSymbol */); - var isKeyword = true; - if (!word) { - word = expandWordUnderCursor(cm, false /** inclusive */, - true /** forward */, false /** bigWord */, - false /** noSymbol */); - isKeyword = false; - } - if (!word) { - return; - } - var query = cm.getLine(word.start.line).substring(word.start.ch, - word.end.ch + 1); - if (isKeyword) { - query = '\\b' + query + '\\b'; - } else { - query = escapeRegex(query); - } - cm.setCursor(word.start); - handleQuery(query, true /** ignoreCase */, false /** smartCase */); - break; - } - }, - processEx: function(cm, vim, command) { - function onPromptClose(input) { - exCommandDispatcher.processCommand(cm, input); - } - if (command.type == 'keyToEx') { - // Handle user defined Ex to Ex mappings - exCommandDispatcher.processCommand(cm, command.exArgs.input); - } else { - showPrompt(cm, onPromptClose, ':'); - } - }, - evalInput: function(cm, vim) { - // If the motion comand is set, execute both the operator and motion. - // Otherwise return. - var inputState = vim.inputState; - var motion = inputState.motion; - var motionArgs = inputState.motionArgs || {}; - var operator = inputState.operator; - var operatorArgs = inputState.operatorArgs || {}; - var registerName = inputState.registerName; - var selectionEnd = cm.getCursor('head'); - var selectionStart = cm.getCursor('anchor'); - // The difference between cur and selection cursors are that cur is - // being operated on and ignores that there is a selection. - var curStart = copyCursor(selectionEnd); - var curOriginal = copyCursor(curStart); - var curEnd; - var repeat; - if (motionArgs.repeat !== undefined) { - // If motionArgs specifies a repeat, that takes precedence over the - // input state's repeat. Used by Ex mode and can be user defined. - repeat = inputState.motionArgs.repeat; - } else { - repeat = inputState.getRepeat(); - } - if (repeat > 0 && motionArgs.explicitRepeat) { - motionArgs.repeatIsExplicit = true; - } else if (motionArgs.noRepeat || - (!motionArgs.explicitRepeat && repeat === 0)) { - repeat = 1; - motionArgs.repeatIsExplicit = false; - } - if (inputState.selectedCharacter) { - // If there is a character input, stick it in all of the arg arrays. - motionArgs.selectedCharacter = operatorArgs.selectedCharacter = - inputState.selectedCharacter; - } - motionArgs.repeat = repeat; - inputState.reset(); - if (motion) { - var motionResult = motions[motion](cm, motionArgs, vim); - vim.lastMotion = motions[motion]; - if (!motionResult) { - return; - } - if (motionResult instanceof Array) { - curStart = motionResult[0]; - curEnd = motionResult[1]; - } else { - curEnd = motionResult; - } - // TODO: Handle null returns from motion commands better. - if (!curEnd) { - curEnd = { ch: curStart.ch, line: curStart.line }; - } - if (vim.visualMode) { - // Check if the selection crossed over itself. Will need to shift - // the start point if that happened. - if (cursorIsBefore(selectionStart, selectionEnd) && - (cursorEqual(selectionStart, curEnd) || - cursorIsBefore(curEnd, selectionStart))) { - // The end of the selection has moved from after the start to - // before the start. We will shift the start right by 1. - selectionStart.ch += 1; - } else if (cursorIsBefore(selectionEnd, selectionStart) && - (cursorEqual(selectionStart, curEnd) || - cursorIsBefore(selectionStart, curEnd))) { - // The opposite happened. We will shift the start left by 1. - selectionStart.ch -= 1; - } - selectionEnd = curEnd; - if (vim.visualLine) { - if (cursorIsBefore(selectionStart, selectionEnd)) { - selectionStart.ch = 0; - selectionEnd.ch = lineLength(cm, selectionEnd.line); - } else { - selectionEnd.ch = 0; - selectionStart.ch = lineLength(cm, selectionStart.line); - } - } - // Need to set the cursor to clear the selection. Otherwise, - // CodeMirror can't figure out that we changed directions... - cm.setCursor(selectionStart); - cm.setSelection(selectionStart, selectionEnd); - } else if (!operator) { - curEnd = clipCursorToContent(cm, curEnd); - cm.setCursor(curEnd.line, curEnd.ch); - } - } - - if (operator) { - var inverted = false; - vim.lastMotion = null; - operatorArgs.repeat = repeat; // Indent in visual mode needs this. - if (vim.visualMode) { - curStart = selectionStart; - curEnd = selectionEnd; - motionArgs.inclusive = true; - } - // Swap start and end if motion was backward. - if (cursorIsBefore(curEnd, curStart)) { - var tmp = curStart; - curStart = curEnd; - curEnd = tmp; - inverted = true; - } - if (motionArgs.inclusive && !(vim.visualMode && inverted)) { - // Move the selection end one to the right to include the last - // character. - curEnd.ch++; - } - var linewise = motionArgs.linewise || - (vim.visualMode && vim.visualLine); - if (linewise) { - // Expand selection to entire line. - expandSelectionToLine(cm, curStart, curEnd); - } else if (motionArgs.forward) { - // Clip to trailing newlines only if we the motion goes forward. - clipToLine(cm, curStart, curEnd); - } - operatorArgs.registerName = registerName; - // Keep track of linewise as it affects how paste and change behave. - operatorArgs.linewise = linewise; - operators[operator](cm, operatorArgs, vim, curStart, - curEnd, curOriginal); - if (vim.visualMode) { - exitVisualMode(cm, vim); - } - if (operatorArgs.enterInsertMode) { - actions.enterInsertMode(cm); - } - } - } - }; - - /** - * typedef {Object{line:number,ch:number}} Cursor An object containing the - * position of the cursor. - */ - // All of the functions below return Cursor objects. - var motions = { - expandToLine: function(cm, motionArgs) { - // Expands forward to end of line, and then to next line if repeat is - // >1. Does not handle backward motion! - var cur = cm.getCursor(); - return { line: cur.line + motionArgs.repeat - 1, ch: Infinity }; - }, - findNext: function(cm, motionArgs, vim) { - return findNext(cm, false /** prev */, motionArgs.repeat); - }, - findPrev: function(cm, motionArgs, vim) { - return findNext(cm, true /** prev */, motionArgs.repeat); - }, - goToMark: function(cm, motionArgs, vim) { - var mark = vim.marks[motionArgs.selectedCharacter]; - if (mark) { - return mark.find(); - } - return null; - }, - moveByCharacters: function(cm, motionArgs) { - var cur = cm.getCursor(); - var repeat = motionArgs.repeat; - var ch = motionArgs.forward ? cur.ch + repeat : cur.ch - repeat; - return { line: cur.line, ch: ch }; - }, - moveByLines: function(cm, motionArgs, vim) { - var endCh = cm.getCursor().ch; - // Depending what our last motion was, we may want to do different - // things. If our last motion was moving vertically, we want to - // preserve the HPos from our last horizontal move. If our last motion - // was going to the end of a line, moving vertically we should go to - // the end of the line, etc. - switch (vim.lastMotion) { - case this.moveByLines: - case this.moveToColumn: - case this.moveToEol: - endCh = vim.lastHPos; - break; - default: - vim.lastHPos = endCh; - } - var cur = cm.getCursor(); - var repeat = motionArgs.repeat; - var line = motionArgs.forward ? cur.line + repeat : cur.line - repeat; - if (line < 0 || line > cm.lineCount() - 1) { - return null; - } - return { line: line, ch: endCh }; - }, - moveByPage: function(cm, motionArgs) { - // CodeMirror only exposes functions that move the cursor page down, so - // doing this bad hack to move the cursor and move it back. evalInput - // will move the cursor to where it should be in the end. - var curStart = cm.getCursor(); - var repeat = motionArgs.repeat; - cm.moveV((motionArgs.forward ? repeat : -repeat), 'page'); - var curEnd = cm.getCursor(); - cm.setCursor(curStart); - return curEnd; - }, - moveByWords: function(cm, motionArgs) { - return moveToWord(cm, motionArgs.repeat, !!motionArgs.forward, - !!motionArgs.wordEnd, !!motionArgs.bigWord); - }, - moveTillCharacter: function(cm, motionArgs) { - var repeat = motionArgs.repeat; - var curEnd = moveToCharacter(cm, repeat, motionArgs.forward, - motionArgs.selectedCharacter); - var increment = motionArgs.forward ? -1 : 1; - curEnd.ch += increment; - return curEnd; - }, - moveToCharacter: function(cm, motionArgs) { - var repeat = motionArgs.repeat; - return moveToCharacter(cm, repeat, motionArgs.forward, - motionArgs.selectedCharacter); - }, - moveToColumn: function(cm, motionArgs, vim) { - var repeat = motionArgs.repeat; - // repeat is equivalent to which column we want to move to! - vim.lastHPos = repeat - 1; - return moveToColumn(cm, repeat); - }, - moveToEol: function(cm, motionArgs, vim) { - var cur = cm.getCursor(); - vim.lastHPos = Infinity; - return { line: cur.line + motionArgs.repeat - 1, ch: Infinity }; - }, - moveToFirstNonWhiteSpaceCharacter: function(cm) { - // Go to the start of the line where the text begins, or the end for - // whitespace-only lines - var cursor = cm.getCursor(); - var line = cm.getLine(cursor.line); - return { line: cursor.line, - ch: findFirstNonWhiteSpaceCharacter(cm.getLine(cursor.line)) }; - }, - moveToMatchedSymbol: function(cm, motionArgs) { - var cursor = cm.getCursor(); - var symbol = cm.getLine(cursor.line).charAt(cursor.ch); - if (isMatchableSymbol(symbol)) { - return findMatchedSymbol(cm, cm.getCursor(), motionArgs.symbol); - } else { - return cursor; - } - }, - moveToStartOfLine: function(cm) { - var cursor = cm.getCursor(); - return { line: cursor.line, ch: 0 }; - }, - moveToLineOrEdgeOfDocument: function(cm, motionArgs) { - var lineNum = motionArgs.forward ? cm.lineCount() - 1 : 0; - if (motionArgs.repeatIsExplicit) { - lineNum = motionArgs.repeat - 1; - } - return { line: lineNum, - ch: findFirstNonWhiteSpaceCharacter(cm.getLine(lineNum)) }; - }, - textObjectManipulation: function(cm, motionArgs) { - var character = motionArgs.selectedCharacter; - // Inclusive is the difference between a and i - // TODO: Instead of using the additional text object map to perform text - // object operations, merge the map into the defaultKeyMap and use - // motionArgs to define behavior. Define separate entries for 'aw', - // 'iw', 'a[', 'i[', etc. - var inclusive = !motionArgs.textObjectInner; - if (!textObjects[character]) { - // No text object defined for this, don't move. - return null; - } - var tmp = textObjects[character](cm, inclusive); - var start = tmp.start; - var end = tmp.end; - return [start, end]; - } - }; - - var operators = { - change: function(cm, operatorArgs, vim, curStart, curEnd) { - getVimGlobalState().registerController.pushText( - operatorArgs.registerName, 'change', cm.getRange(curStart, curEnd), - operatorArgs.linewise); - if (operatorArgs.linewise) { - // Delete starting at the first nonwhitespace character of the first - // line, instead of from the start of the first line. This way we get - // an indent when we get into insert mode. This behavior isn't quite - // correct because we should treat this as a completely new line, and - // indent should be whatever codemirror thinks is the right indent. - // But cm.indentLine doesn't seem work on empty lines. - // TODO: Fix the above. - curStart.ch = - findFirstNonWhiteSpaceCharacter(cm.getLine(curStart.line)); - // Insert an additional newline so that insert mode can start there. - // curEnd should be on the first character of the new line. - cm.replaceRange('\n', curStart, curEnd); - } else { - cm.replaceRange('', curStart, curEnd); - } - cm.setCursor(curStart); - }, - // delete is a javascript keyword. - 'delete': function(cm, operatorArgs, vim, curStart, curEnd) { - getVimGlobalState().registerController.pushText( - operatorArgs.registerName, 'delete', cm.getRange(curStart, curEnd), - operatorArgs.linewise); - cm.replaceRange('', curStart, curEnd); - if (operatorArgs.linewise) { - cm.setCursor(motions.moveToFirstNonWhiteSpaceCharacter(cm)); - } else { - cm.setCursor(curStart); - } - }, - indent: function(cm, operatorArgs, vim, curStart, curEnd) { - var startLine = curStart.line; - var endLine = curEnd.line; - // In visual mode, n> shifts the selection right n times, instead of - // shifting n lines right once. - var repeat = (vim.visualMode) ? operatorArgs.repeat : 1; - if (operatorArgs.linewise) { - // The only way to delete a newline is to delete until the start of - // the next line, so in linewise mode evalInput will include the next - // line. We don't want this in indent, so we go back a line. - endLine--; - } - for (var i = startLine; i <= endLine; i++) { - for (var j = 0; j < repeat; j++) { - cm.indentLine(i, operatorArgs.indentRight); - } - } - cm.setCursor(curStart); - cm.setCursor(motions.moveToFirstNonWhiteSpaceCharacter(cm)); - }, - swapcase: function(cm, operatorArgs, vim, curStart, curEnd, curOriginal) { - var toSwap = cm.getRange(curStart, curEnd); - var swapped = ''; - for (var i = 0; i < toSwap.length; i++) { - var character = toSwap.charAt(i); - swapped += isUpperCase(character) ? character.toLowerCase() : - character.toUpperCase(); - } - cm.replaceRange(swapped, curStart, curEnd); - cm.setCursor(curOriginal); - }, - yank: function(cm, operatorArgs, vim, curStart, curEnd, curOriginal) { - getVimGlobalState().registerController.pushText( - operatorArgs.registerName, 'yank', - cm.getRange(curStart, curEnd), operatorArgs.linewise); - cm.setCursor(curOriginal); - } - }; - - var actions = { - clearSearchHighlight: clearSearchHighlight, - enterInsertMode: function(cm, actionArgs) { - var insertAt = (actionArgs) ? actionArgs.insertAt : null; - if (insertAt == 'eol') { - var cursor = cm.getCursor(); - cursor = { line: cursor.line, ch: lineLength(cm, cursor.line) }; - cm.setCursor(cursor); - } else if (insertAt == 'charAfter') { - cm.setCursor(offsetCursor(cm.getCursor(), 0, 1)); - } - cm.setOption('keyMap', 'vim-insert'); - }, - toggleVisualMode: function(cm, actionArgs, vim) { - var repeat = actionArgs.repeat; - var curStart = cm.getCursor(); - var curEnd; - // TODO: The repeat should actually select number of characters/lines - // equal to the repeat times the size of the previous visual - // operation. - if (!vim.visualMode) { - vim.visualMode = true; - vim.visualLine = !!actionArgs.linewise; - if (vim.visualLine) { - curStart.ch = 0; - curEnd = clipCursorToContent(cm, { - line: curStart.line + repeat - 1, - ch: lineLength(cm, curStart.line) - }, true /** includeLineBreak */); - } else { - curEnd = clipCursorToContent(cm, { - line: curStart.line, - ch: curStart.ch + repeat - }, true /** includeLineBreak */); - } - // Make the initial selection. - if (!actionArgs.repeatIsExplicit && !vim.visualLine) { - // This is a strange case. Here the implicit repeat is 1. The - // following commands lets the cursor hover over the 1 character - // selection. - cm.setCursor(curEnd); - cm.setSelection(curEnd, curStart); - } else { - cm.setSelection(curStart, curEnd); - } - } else { - if (!vim.visualLine && actionArgs.linewise) { - // Shift-V pressed in characterwise visual mode. Switch to linewise - // visual mode instead of exiting visual mode. - vim.visualLine = true; - curStart = cm.getCursor('anchor'); - curEnd = cm.getCursor('head'); - curStart.ch = cursorIsBefore(curStart, curEnd) ? 0 : - lineLength(cm, curStart.line); - curEnd.ch = cursorIsBefore(curStart, curEnd) ? - lineLength(cm, curEnd.line) : 0; - cm.setSelection(curStart, curEnd); - } else { - exitVisualMode(cm, vim); - } - } - }, - joinLines: function(cm, actionArgs, vim) { - var curStart, curEnd; - if (vim.visualMode) { - curStart = cm.getCursor('anchor'); - curEnd = cm.getCursor('head'); - curEnd.ch = lineLength(cm, curEnd.line) - 1; - } else { - // Repeat is the number of lines to join. Minimum 2 lines. - var repeat = Math.max(actionArgs.repeat, 2); - curStart = cm.getCursor(); - curEnd = clipCursorToContent(cm, { line: curStart.line + repeat - 1, - ch: Infinity }); - } - var finalCh = 0; - cm.operation(function() { - for (var i = curStart.line; i < curEnd.line; i++) { - finalCh = lineLength(cm, curStart.line); - var tmp = { line: curStart.line + 1, - ch: lineLength(cm, curStart.line + 1) }; - var text = cm.getRange(curStart, tmp); - text = text.replace(/\n\s*/g, ' '); - cm.replaceRange(text, curStart, tmp); - } - var curFinalPos = { line: curStart.line, ch: finalCh }; - cm.setCursor(curFinalPos); - }); - }, - newLineAndEnterInsertMode: function(cm, actionArgs) { - var insertAt = cm.getCursor(); - if (insertAt.line === 0 && !actionArgs.after) { - // Special case for inserting newline before start of document. - cm.replaceRange('\n', { line: 0, ch: 0 }); - cm.setCursor(0, 0); - } else { - insertAt.line = (actionArgs.after) ? insertAt.line : - insertAt.line - 1; - insertAt.ch = lineLength(cm, insertAt.line); - cm.setCursor(insertAt); - var newlineFn = CodeMirror.commands.newlineAndIndentContinueComment || - CodeMirror.commands.newlineAndIndent; - newlineFn(cm); - } - this.enterInsertMode(cm); - }, - paste: function(cm, actionArgs, vim) { - var cur = cm.getCursor(); - var register = getVimGlobalState().registerController.getRegister( - actionArgs.registerName); - if (!register.text) { - return; - } - for (var text = '', i = 0; i < actionArgs.repeat; i++) { - text += register.text; - } - var linewise = register.linewise; - if (linewise) { - if (actionArgs.after) { - // Move the newline at the end to the start instead, and paste just - // before the newline character of the line we are on right now. - text = '\n' + text.slice(0, text.length - 1); - cur.ch = lineLength(cm, cur.line); - } else { - cur.ch = 0; - } - } else { - cur.ch += actionArgs.after ? 1 : 0; - } - cm.replaceRange(text, cur); - // Now fine tune the cursor to where we want it. - var curPosFinal; - var idx; - if (linewise && actionArgs.after) { - curPosFinal = { line: cur.line + 1, - ch: findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line + 1)) }; - } else if (linewise && !actionArgs.after) { - curPosFinal = { line: cur.line, - ch: findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line)) }; - } else if (!linewise && actionArgs.after) { - idx = cm.indexFromPos(cur); - curPosFinal = cm.posFromIndex(idx + text.length - 1); - } else { - idx = cm.indexFromPos(cur); - curPosFinal = cm.posFromIndex(idx + text.length); - } - cm.setCursor(curPosFinal); - }, - undo: function(cm, actionArgs) { - repeatFn(cm, CodeMirror.commands.undo, actionArgs.repeat)(); - }, - redo: function(cm, actionArgs) { - repeatFn(cm, CodeMirror.commands.redo, actionArgs.repeat)(); - }, - setRegister: function(cm, actionArgs, vim) { - vim.inputState.registerName = actionArgs.selectedCharacter; - }, - setMark: function(cm, actionArgs, vim) { - var markName = actionArgs.selectedCharacter; - if (!inArray(markName, validMarks)) { - return; - } - if (vim.marks[markName]) { - vim.marks[markName].clear(); - } - vim.marks[markName] = cm.setBookmark(cm.getCursor()); - }, - replace: function(cm, actionArgs) { - var replaceWith = actionArgs.selectedCharacter; - var curStart = cm.getCursor(); - var line = cm.getLine(curStart.line); - var replaceTo = curStart.ch + actionArgs.repeat; - if (replaceTo > line.length) { - return; - } - var curEnd = { line: curStart.line, ch: replaceTo }; - var replaceWithStr = ''; - for (var i = 0; i < curEnd.ch - curStart.ch; i++) { - replaceWithStr += replaceWith; - } - cm.replaceRange(replaceWithStr, curStart, curEnd); - cm.setCursor(offsetCursor(curEnd, 0, -1)); - } - }; - - var textObjects = { - // TODO: lots of possible exceptions that can be thrown here. Try da( - // outside of a () block. - // TODO: implement text objects for the reverse like }. Should just be - // an additional mapping after moving to the defaultKeyMap. - 'w': function(cm, inclusive) { - return expandWordUnderCursor(cm, inclusive, true /** forward */, - false /** bigWord */); - }, - 'W': function(cm, inclusive) { - return expandWordUnderCursor(cm, inclusive, - true /** forward */, true /** bigWord */); - }, - '{': function(cm, inclusive) { - return selectCompanionObject(cm, '}', inclusive); - }, - '(': function(cm, inclusive) { - return selectCompanionObject(cm, ')', inclusive); - }, - '[': function(cm, inclusive) { - return selectCompanionObject(cm, ']', inclusive); - }, - '\'': function(cm, inclusive) { - return findBeginningAndEnd(cm, "'", inclusive); - }, - '\"': function(cm, inclusive) { - return findBeginningAndEnd(cm, '"', inclusive); - } - }; - - /* - * Below are miscellaneous utility functions used by vim.js - */ - - /** - * Clips cursor to ensure that: - * 0 <= cur.ch < lineLength - * AND - * 0 <= cur.line < lineCount - * If includeLineBreak is true, then allow cur.ch == lineLength. - */ - function clipCursorToContent(cm, cur, includeLineBreak) { - var line = Math.min(Math.max(0, cur.line), cm.lineCount() - 1); - var maxCh = lineLength(cm, line) - 1; - maxCh = (includeLineBreak) ? maxCh + 1 : maxCh; - var ch = Math.min(Math.max(0, cur.ch), maxCh); - return { line: line, ch: ch }; - } - // Merge arguments in place, for overriding arguments. - function mergeArgs(to, from) { - for (var prop in from) { - if (from.hasOwnProperty(prop)) { - to[prop] = from[prop]; - } - } - } - function copyArgs(args) { - var ret = {}; - for (var prop in args) { - if (args.hasOwnProperty(prop)) { - ret[prop] = args[prop]; - } - } - return ret; - } - function offsetCursor(cur, offsetLine, offsetCh) { - return { line: cur.line + offsetLine, ch: cur.ch + offsetCh }; - } - function arrayEq(a1, a2) { - if (a1.length != a2.length) { - return false; - } - for (var i = 0; i < a1.length; i++) { - if (a1[i] != a2[i]) { - return false; - } - } - return true; - } - function matchKeysPartial(pressed, mapped) { - for (var i = 0; i < pressed.length; i++) { - // 'character' means any character. For mark, register commads, etc. - if (pressed[i] != mapped[i] && mapped[i] != 'character') { - return false; - } - } - return true; - } - function arrayIsSubsetFromBeginning(small, big) { - for (var i = 0; i < small.length; i++) { - if (small[i] != big[i]) { - return false; - } - } - return true; - } - function repeatFn(cm, fn, repeat) { - return function() { - for (var i = 0; i < repeat; i++) { - fn(cm); - } - }; - } - function copyCursor(cur) { - return { line: cur.line, ch: cur.ch }; - } - function cursorEqual(cur1, cur2) { - return cur1.ch == cur2.ch && cur1.line == cur2.line; - } - function cursorIsBefore(cur1, cur2) { - if (cur1.line < cur2.line) { - return true; - } else if (cur1.line == cur2.line && cur1.ch < cur2.ch) { - return true; - } - return false; - } - function lineLength(cm, lineNum) { - return cm.getLine(lineNum).length; - } - function reverse(s){ - return s.split("").reverse().join(""); - } - function trim(s) { - if (s.trim) { - return s.trim(); - } else { - return s.replace(/^\s+|\s+$/g, ''); - } - } - function escapeRegex(s) { - return s.replace(/([.?*+$\[\]\/\\(){}|\-])/g, "\\$1"); - } - - function exitVisualMode(cm, vim) { - vim.visualMode = false; - vim.visualLine = false; - var selectionStart = cm.getCursor('anchor'); - var selectionEnd = cm.getCursor('head'); - if (!cursorEqual(selectionStart, selectionEnd)) { - // Clear the selection and set the cursor only if the selection has not - // already been cleared. Otherwise we risk moving the cursor somewhere - // it's not supposed to be. - cm.setCursor(clipCursorToContent(cm, selectionEnd)); - } - } - - // Remove any trailing newlines from the selection. For - // example, with the caret at the start of the last word on the line, - // 'dw' should word, but not the newline, while 'w' should advance the - // caret to the first character of the next line. - function clipToLine(cm, curStart, curEnd) { - var selection = cm.getRange(curStart, curEnd); - var lines = selection.split('\n'); - if (lines.length > 1 && isWhiteSpaceString(lines.pop())) { - curEnd.line--; - curEnd.ch = lineLength(cm, curEnd.line); - } - } - - // Expand the selection to line ends. - function expandSelectionToLine(cm, curStart, curEnd) { - curStart.ch = 0; - curEnd.ch = 0; - curEnd.line++; - } - - function findFirstNonWhiteSpaceCharacter(text) { - if (!text) { - return 0; - } - var firstNonWS = text.search(/\S/); - return firstNonWS == -1 ? text.length : firstNonWS; - } - - function expandWordUnderCursor(cm, inclusive, forward, bigWord, noSymbol) { - var cur = cm.getCursor(); - var line = cm.getLine(cur.line); - var idx = cur.ch; - - // Seek to first word or non-whitespace character, depending on if - // noSymbol is true. - var textAfterIdx = line.substring(idx); - var firstMatchedChar; - if (noSymbol) { - firstMatchedChar = textAfterIdx.search(/\w/); - } else { - firstMatchedChar = textAfterIdx.search(/\S/); - } - if (firstMatchedChar == -1) { - return null; - } - idx += firstMatchedChar; - textAfterIdx = line.substring(idx); - var textBeforeIdx = line.substring(0, idx); - - var matchRegex; - // Greedy matchers for the "word" we are trying to expand. - if (bigWord) { - matchRegex = /^\S+/; - } else { - if ((/\w/).test(line.charAt(idx))) { - matchRegex = /^\w+/; - } else { - matchRegex = /^[^\w\s]+/; - } - } - - var wordAfterRegex = matchRegex.exec(textAfterIdx); - var wordStart = idx; - var wordEnd = idx + wordAfterRegex[0].length - 1; - // TODO: Find a better way to do this. It will be slow on very long lines. - var wordBeforeRegex = matchRegex.exec(reverse(textBeforeIdx)); - if (wordBeforeRegex) { - wordStart -= wordBeforeRegex[0].length; - } - - if (inclusive) { - wordEnd++; - } - - return { start: { line: cur.line, ch: wordStart }, - end: { line: cur.line, ch: wordEnd }}; - } - - /* - * Returns the boundaries of the next word. If the cursor in the middle of - * the word, then returns the boundaries of the current word, starting at - * the cursor. If the cursor is at the start/end of a word, and we are going - * forward/backward, respectively, find the boundaries of the next word. - * - * @param {CodeMirror} cm CodeMirror object. - * @param {Cursor} cur The cursor position. - * @param {boolean} forward True to search forward. False to search - * backward. - * @param {boolean} bigWord True if punctuation count as part of the word. - * False if only [a-zA-Z0-9] characters count as part of the word. - * @return {Object{from:number, to:number, line: number}} The boundaries of - * the word, or null if there are no more words. - */ - // TODO: Treat empty lines (with no whitespace) as words. - function findWord(cm, cur, forward, bigWord) { - var lineNum = cur.line; - var pos = cur.ch; - var line = cm.getLine(lineNum); - var dir = forward ? 1 : -1; - var regexps = bigWord ? bigWordRegexp : wordRegexp; - - while (true) { - var stop = (dir > 0) ? line.length : -1; - var wordStart = stop, wordEnd = stop; - // Find bounds of next word. - while (pos != stop) { - var foundWord = false; - for (var i = 0; i < regexps.length && !foundWord; ++i) { - if (regexps[i].test(line.charAt(pos))) { - wordStart = pos; - // Advance to end of word. - while (pos != stop && regexps[i].test(line.charAt(pos))) { - pos += dir; - } - wordEnd = pos; - foundWord = wordStart != wordEnd; - if (wordStart == cur.ch && lineNum == cur.line && - wordEnd == wordStart + dir) { - // We started at the end of a word. Find the next one. - continue; - } else { - return { - from: Math.min(wordStart, wordEnd + 1), - to: Math.max(wordStart, wordEnd), - line: lineNum }; - } - } - } - if (!foundWord) { - pos += dir; - } - } - // Advance to next/prev line. - lineNum += dir; - if (!isLine(cm, lineNum)) { - return null; - } - line = cm.getLine(lineNum); - pos = (dir > 0) ? 0 : line.length; - } - // Should never get here. - throw 'The impossible happened.'; - } - - /** - * @param {CodeMirror} cm CodeMirror object. - * @param {int} repeat Number of words to move past. - * @param {boolean} forward True to search forward. False to search - * backward. - * @param {boolean} wordEnd True to move to end of word. False to move to - * beginning of word. - * @param {boolean} bigWord True if punctuation count as part of the word. - * False if only alphabet characters count as part of the word. - * @return {Cursor} The position the cursor should move to. - */ - function moveToWord(cm, repeat, forward, wordEnd, bigWord) { - var cur = cm.getCursor(); - for (var i = 0; i < repeat; i++) { - var startCh = cur.ch, startLine = cur.line, word; - var movedToNextWord = false; - while (!movedToNextWord) { - // Search and advance. - word = findWord(cm, cur, forward, bigWord); - movedToNextWord = true; - if (word) { - // Move to the word we just found. If by moving to the word we end - // up in the same spot, then move an extra character and search - // again. - cur.line = word.line; - if (forward && wordEnd) { - // 'e' - cur.ch = word.to - 1; - } else if (forward && !wordEnd) { - // 'w' - if (inRangeInclusive(cur.ch, word.from, word.to) && - word.line == startLine) { - // Still on the same word. Go to the next one. - movedToNextWord = false; - cur.ch = word.to - 1; - } else { - cur.ch = word.from; - } - } else if (!forward && wordEnd) { - // 'ge' - if (inRangeInclusive(cur.ch, word.from, word.to) && - word.line == startLine) { - // still on the same word. Go to the next one. - movedToNextWord = false; - cur.ch = word.from; - } else { - cur.ch = word.to; - } - } else if (!forward && !wordEnd) { - // 'b' - cur.ch = word.from; - } - } else { - // No more words to be found. Move to the end. - if (forward) { - return { line: cur.line, ch: lineLength(cm, cur.line) }; - } else { - return { line: cur.line, ch: 0 }; - } - } - } - } - return cur; - } - - function moveToCharacter(cm, repeat, forward, character) { - var cur = cm.getCursor(); - var start = cur.ch; - var idx; - for (var i = 0; i < repeat; i ++) { - var line = cm.getLine(cur.line); - idx = charIdxInLine(start, line, character, forward, true); - if (idx == -1) { - return cur; - } - start = idx; - } - return { line: cm.getCursor().line, ch: idx }; - } - - function moveToColumn(cm, repeat) { - // repeat is always >= 1, so repeat - 1 always corresponds - // to the column we want to go to. - var line = cm.getCursor().line; - return clipCursorToContent(cm, { line: line, ch: repeat - 1 }); - } - - function charIdxInLine(start, line, character, forward, includeChar) { - // Search for char in line. - // motion_options: {forward, includeChar} - // If includeChar = true, include it too. - // If forward = true, search forward, else search backwards. - // If char is not found on this line, do nothing - var idx; - if (forward) { - idx = line.indexOf(character, start + 1); - if (idx != -1 && !includeChar) { - idx -= 1; - } - } else { - idx = line.lastIndexOf(character, start - 1); - if (idx != -1 && !includeChar) { - idx += 1; - } - } - return idx; - } - - function findMatchedSymbol(cm, cur, symb) { - var line = cur.line; - symb = symb ? symb : cm.getLine(line).charAt(cur.ch); - - // Are we at the opening or closing char - var forwards = inArray(symb, ['(', '[', '{']); - - var reverseSymb = ({ - '(': ')', ')': '(', - '[': ']', ']': '[', - '{': '}', '}': '{'})[symb]; - - // Couldn't find a matching symbol, abort - if (!reverseSymb) { - return cur; - } - - // set our increment to move forward (+1) or backwards (-1) - // depending on which bracket we're matching - var increment = ({'(': 1, '{': 1, '[': 1})[symb] || -1; - var depth = 1, nextCh = symb, index = cur.ch, lineText = cm.getLine(line); - // Simple search for closing paren--just count openings and closings till - // we find our match - // TODO: use info from CodeMirror to ignore closing brackets in comments - // and quotes, etc. - while (nextCh && depth > 0) { - index += increment; - nextCh = lineText.charAt(index); - if (!nextCh) { - line += increment; - index = 0; - lineText = cm.getLine(line) || ''; - nextCh = lineText.charAt(index); - } - if (nextCh === symb) { - depth++; - } else if (nextCh === reverseSymb) { - depth--; - } - } - - if (nextCh) { - return { line: line, ch: index }; - } - return cur; - } - - function selectCompanionObject(cm, revSymb, inclusive) { - var cur = cm.getCursor(); - - var end = findMatchedSymbol(cm, cur, revSymb); - var start = findMatchedSymbol(cm, end); - start.ch += inclusive ? 1 : 0; - end.ch += inclusive ? 0 : 1; - - return { start: start, end: end }; - } - - function regexLastIndexOf(string, pattern, startIndex) { - for (var i = !startIndex ? string.length : startIndex; - i >= 0; --i) { - if (pattern.test(string.charAt(i))) { - return i; - } - } - return -1; - } - - // Takes in a symbol and a cursor and tries to simulate text objects that - // have identical opening and closing symbols - // TODO support across multiple lines - function findBeginningAndEnd(cm, symb, inclusive) { - var cur = cm.getCursor(); - var line = cm.getLine(cur.line); - var chars = line.split(''); - var start, end, i, len; - var firstIndex = chars.indexOf(symb); - - // the decision tree is to always look backwards for the beginning first, - // but if the cursor is in front of the first instance of the symb, - // then move the cursor forward - if (cur.ch < firstIndex) { - cur.ch = firstIndex; - // Why is this line even here??? - // cm.setCursor(cur.line, firstIndex+1); - } - // otherwise if the cursor is currently on the closing symbol - else if (firstIndex < cur.ch && chars[cur.ch] == symb) { - end = cur.ch; // assign end to the current cursor - --cur.ch; // make sure to look backwards - } - - // if we're currently on the symbol, we've got a start - if (chars[cur.ch] == symb && !end) { - start = cur.ch + 1; // assign start to ahead of the cursor - } else { - // go backwards to find the start - for (i = cur.ch; i > -1 && !start; i--) { - if (chars[i] == symb) { - start = i + 1; - } - } - } - - // look forwards for the end symbol - if (start && !end) { - for (i = start, len = chars.length; i < len && !end; i++) { - if (chars[i] == symb) { - end = i; - } - } - } - - // nothing found - if (!start || !end) { - return { start: cur, end: cur }; - } - - // include the symbols - if (inclusive) { - --start; ++end; - } - - return { - start: { line: cur.line, ch: start }, - end: { line: cur.line, ch: end } - }; - } - - // Search functions - function SearchState() { - // Highlighted text that match the query. - this.marked = null; - } - SearchState.prototype = { - getQuery: function() { - return getVimGlobalState().query; - }, - setQuery: function(query) { - getVimGlobalState().query = query; - }, - getMarked: function() { - return this.marked; - }, - setMarked: function(marked) { - this.marked = marked; - }, - isReversed: function() { - return getVimGlobalState().isReversed; - }, - setReversed: function(reversed) { - getVimGlobalState().isReversed = reversed; - } - }; - function getSearchState(cm) { - var vim = getVimState(cm); - return vim.searchState_ || (vim.searchState_ = new SearchState()); - } - function dialog(cm, text, shortText, callback) { - if (cm.openDialog) { - cm.openDialog(text, callback, {bottom: true}); - } - else { - callback(prompt(shortText, "")); - } - } - function findUnescapedSlashes(str) { - var escapeNextChar = false; - var slashes = []; - for (var i = 0; i < str.length; i++) { - var c = str.charAt(i); - if (!escapeNextChar && c == '/') { - slashes.push(i); - } - escapeNextChar = (c == '\\'); - } - return slashes; - } - /** - * Extract the regular expression from the query and return a Regexp object. - * Returns null if the query is blank. - * If ignoreCase is passed in, the Regexp object will have the 'i' flag set. - * If smartCase is passed in, and the query contains upper case letters, - * then ignoreCase is overridden, and the 'i' flag will not be set. - * If the query contains the /i in the flag part of the regular expression, - * then both ignoreCase and smartCase are ignored, and 'i' will be passed - * through to the Regex object. - */ - function parseQuery(cm, query, ignoreCase, smartCase) { - // First try to extract regex + flags from the input. If no flags found, - // extract just the regex. IE does not accept flags directly defined in - // the regex string in the form /regex/flags - var slashes = findUnescapedSlashes(query); - var regexPart; - var forceIgnoreCase; - if (!slashes.length) { - // Query looks like 'regexp' - regexPart = query; - } else { - // Query looks like 'regexp/...' - regexPart = query.substring(0, slashes[0]); - var flagsPart = query.substring(slashes[0]); - forceIgnoreCase = (flagsPart.indexOf('i') != -1); - } - if (!regexPart) { - return null; - } - if (smartCase) { - ignoreCase = (/^[^A-Z]*$/).test(regexPart); - } - try { - var regexp = new RegExp(regexPart, - (ignoreCase || forceIgnoreCase) ? 'i' : undefined); - return regexp; - } catch (e) { - showConfirm(cm, 'Invalid regex: ' + regexPart); - } - } - function showConfirm(cm, text) { - if (cm.openConfirm) { - cm.openConfirm('<span style="color: red">' + text + - '</span> <button type="button">OK</button>', function() {}, - {bottom: true}); - } else { - alert(text); - } - } - function makePrompt(prefix, desc) { - var raw = ''; - if (prefix) { - raw += '<span style="font-family: monospace">' + prefix + '</span>'; - } - raw += '<input type="text"/> ' + - '<span style="color: #888">'; - if (desc) { - raw += '<span style="color: #888">'; - raw += desc; - raw += '</span>'; - } - return raw; - } - var searchPromptDesc = '(Javascript regexp)'; - function showPrompt(cm, onPromptClose, prefix, desc) { - var shortText = (prefix || '') + ' ' + (desc || ''); - dialog(cm, makePrompt(prefix, desc), shortText, onPromptClose); - } - function regexEqual(r1, r2) { - if (r1 instanceof RegExp && r2 instanceof RegExp) { - var props = ["global", "multiline", "ignoreCase", "source"]; - for (var i = 0; i < props.length; i++) { - var prop = props[i]; - if (r1[prop] !== r2[prop]) { - return(false); - } - } - return(true); - } - return(false); - } - function updateSearchQuery(cm, rawQuery, ignoreCase, smartCase) { - cm.operation(function() { - var state = getSearchState(cm); - if (!rawQuery) { - return; - } - var query = parseQuery(cm, rawQuery, !!ignoreCase, !!smartCase); - if (!query) { - return; - } - if (regexEqual(query, state.getQuery())) { - return; - } - clearSearchHighlight(cm); - highlightSearchMatches(cm, query); - state.setQuery(query); - }); - } - function highlightSearchMatches(cm, query) { - // TODO: Highlight only text inside the viewport. Highlighting everything - // is inefficient and expensive. - if (cm.lineCount() < 2000) { // This is too expensive on big documents. - var marked = []; - for (var cursor = cm.getSearchCursor(query); - cursor.findNext();) { - marked.push(cm.markText(cursor.from(), cursor.to(), - { className: 'CodeMirror-searching' })); - } - getSearchState(cm).setMarked(marked); - } - } - function findNext(cm, prev, repeat) { - return cm.operation(function() { - var state = getSearchState(cm); - var query = state.getQuery(); - if (!query) { - return; - } - if (!state.getMarked()) { - highlightSearchMatches(cm, query); - } - var pos = cm.getCursor(); - // If search is initiated with ? instead of /, negate direction. - prev = (state.isReversed()) ? !prev : prev; - if (!prev) { - pos.ch += 1; - } - var cursor = cm.getSearchCursor(query, pos); - for (var i = 0; i < repeat; i++) { - if (!cursor.find(prev)) { - // SearchCursor may have returned null because it hit EOF, wrap - // around and try again. - cursor = cm.getSearchCursor(query, - (prev) ? { line: cm.lineCount() - 1} : {line: 0, ch: 0} ); - if (!cursor.find(prev)) { - return; - } - } - } - return cursor.from(); - });} - function clearSearchHighlight(cm) { - cm.operation(function() { - var state = getSearchState(cm); - if (!state.getQuery()) { - return; - } - var marked = state.getMarked(); - if (!marked) { - return; - } - for (var i = 0; i < marked.length; ++i) { - marked[i].clear(); - } - state.setMarked(null); - });} - - // Ex command handling - // Care must be taken when adding to the default Ex command map. For any - // pair of commands that have a shared prefix, at least one of their - // shortNames must not match the prefix of the other command. - var defaultExCommandMap = [ - { name: 'map', type: 'builtIn' }, - { name: 'write', shortName: 'w', type: 'builtIn' }, - { name: 'undo', shortName: 'u', type: 'builtIn' }, - { name: 'redo', shortName: 'red', type: 'builtIn' } - ]; - var ExCommandDispatcher = function() { - this.buildCommandMap_(); - }; - ExCommandDispatcher.prototype = { - processCommand: function(cm, input) { - var params = this.parseInput_(input); - var commandName; - if (!params.commandName) { - // If only a line range is defined, move to the line. - if (params.line !== undefined) { - commandName = 'move'; - } - } else { - var command = this.matchCommand_(params.commandName); - if (command) { - commandName = command.name; - if (command.type == 'exToKey') { - // Handle Ex to Key mapping. - for (var i = 0; i < command.toKeys.length; i++) { - vim.handleKey(cm, command.toKeys[i]); - } - return; - } else if (command.type == 'exToEx') { - // Handle Ex to Ex mapping. - this.processCommand(cm, command.toInput); - return; - } - } - } - if (!commandName) { - showConfirm(cm, 'Not an editor command ":' + input + '"'); - return; - } - exCommands[commandName](cm, params); - }, - parseInput_: function(input) { - var result = {}; - result.input = input; - var idx = 0; - // Trim preceding ':'. - var colons = (/^:+/).exec(input); - if (colons) { - idx += colons[0].length; - } - - // Parse range. - var numberMatch = (/^(\d+)/).exec(input.substring(idx)); - if (numberMatch) { - result.line = parseInt(numberMatch[1], 10); - idx += numberMatch[0].length; - } - - // Parse command name. - var commandMatch = (/^(\w+)/).exec(input.substring(idx)); - if (commandMatch) { - result.commandName = commandMatch[1]; - idx += commandMatch[1].length; - } - - // Parse command-line arguments - var args = trim(input.substring(idx)).split(/\s+/); - if (args.length && args[0]) { - result.commandArgs = args; - } - - return result; - }, - matchCommand_: function(commandName) { - // Return the command in the command map that matches the shortest - // prefix of the passed in command name. The match is guaranteed to be - // unambiguous if the defaultExCommandMap's shortNames are set up - // correctly. (see @code{defaultExCommandMap}). - for (var i = commandName.length; i > 0; i--) { - var prefix = commandName.substring(0, i); - if (this.commandMap_[prefix]) { - var command = this.commandMap_[prefix]; - if (command.name.indexOf(commandName) === 0) { - return command; - } - } - } - return null; - }, - buildCommandMap_: function() { - this.commandMap_ = {}; - for (var i = 0; i < defaultExCommandMap.length; i++) { - var command = defaultExCommandMap[i]; - var key = command.shortName || command.name; - this.commandMap_[key] = command; - } - }, - map: function(lhs, rhs) { - if (lhs.charAt(0) == ':') { - var commandName = lhs.substring(1); - if (rhs.charAt(0) == ':') { - // Ex to Ex mapping - this.commandMap_[commandName] = { - name: commandName, - type: 'exToEx', - toInput: rhs.substring(1) - }; - } else { - // Ex to key mapping - this.commandMap_[commandName] = { - name: commandName, - type: 'exToKey', - toKeys: parseKeyString(rhs) - }; - } - } else { - if (rhs.charAt(0) == ':') { - // Key to Ex mapping. - defaultKeymap.unshift({ - keys: parseKeyString(lhs), - type: 'keyToEx', - exArgs: { input: rhs.substring(1) }}); - } else { - // Key to key mapping - defaultKeymap.unshift({ - keys: parseKeyString(lhs), - type: 'keyToKey', - toKeys: parseKeyString(rhs) - }); - } - } - } - }; - - // Converts a key string sequence of the form a<C-w>bd<Left> into Vim's - // keymap representation. - function parseKeyString(str) { - var idx = 0; - var keys = []; - while (idx < str.length) { - if (str.charAt(idx) != '<') { - keys.push(str.charAt(idx)); - idx++; - continue; - } - // Vim key notation here means desktop Vim key-notation. - // See :help key-notation in desktop Vim. - var vimKeyNotationStart = ++idx; - while (str.charAt(idx++) != '>') {} - var vimKeyNotation = str.substring(vimKeyNotationStart, idx - 1); - var match = (/^C-(.+)$/).exec(vimKeyNotation); - if (match) { - var key; - switch (match[1]) { - case 'BS': - key = 'Backspace'; - break; - case 'CR': - key = 'Enter'; - break; - case 'Del': - key = 'Delete'; - break; - default: - key = match[1]; - break; - } - keys.push('Ctrl-' + key); - } - } - return keys; - } - - var exCommands = { - map: function(cm, params) { - var mapArgs = params.commandArgs; - if (!mapArgs || mapArgs.length < 2) { - if (cm) { - showConfirm(cm, 'Invalid mapping: ' + params.input); - } - return; - } - exCommandDispatcher.map(mapArgs[0], mapArgs[1], cm); - }, - move: function(cm, params) { - commandDispatcher.processMotion(cm, getVimState(cm), { - motion: 'moveToLineOrEdgeOfDocument', - motionArgs: { forward: false, explicitRepeat: true, - linewise: true, repeat: params.line }}); - }, - redo: CodeMirror.commands.redo, - undo: CodeMirror.commands.undo, - write: function(cm) { - if (CodeMirror.commands.save) { - // If a save command is defined, call it. - CodeMirror.commands.save(cm); - } else { - // Saves to text area if no save command is defined. - cm.save(); - } - } - }; - - var exCommandDispatcher = new ExCommandDispatcher(); - - // Register Vim with CodeMirror - function buildVimKeyMap() { - /** - * Handle the raw key event from CodeMirror. Translate the - * Shift + key modifier to the resulting letter, while preserving other - * modifers. - */ - // TODO: Figure out a way to catch capslock. - function handleKeyEvent_(cm, key, modifier) { - if (isUpperCase(key)) { - // Convert to lower case if shift is not the modifier since the key - // we get from CodeMirror is always upper case. - if (modifier == 'Shift') { - modifier = null; - } - else { - key = key.toLowerCase(); - } - } - if (modifier) { - // Vim will parse modifier+key combination as a single key. - key = modifier + '-' + key; - } - vim.handleKey(cm, key); - } - - // Closure to bind CodeMirror, key, modifier. - function keyMapper(key, modifier) { - return function(cm) { - handleKeyEvent_(cm, key, modifier); - }; - } - - var modifiers = ['Shift', 'Ctrl']; - var keyMap = { - 'nofallthrough': true, - 'style': 'fat-cursor' - }; - function bindKeys(keys, modifier) { - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (!modifier && inArray(key, specialSymbols)) { - // Wrap special symbols with '' because that's how CodeMirror binds - // them. - key = "'" + key + "'"; - } - if (modifier) { - keyMap[modifier + '-' + key] = keyMapper(keys[i], modifier); - } else { - keyMap[key] = keyMapper(keys[i]); - } - } - } - bindKeys(upperCaseAlphabet); - bindKeys(upperCaseAlphabet, 'Shift'); - bindKeys(upperCaseAlphabet, 'Ctrl'); - bindKeys(specialSymbols); - bindKeys(specialSymbols, 'Ctrl'); - bindKeys(numbers); - bindKeys(numbers, 'Ctrl'); - bindKeys(specialKeys); - bindKeys(specialKeys, 'Ctrl'); - return keyMap; - } - CodeMirror.keyMap.vim = buildVimKeyMap(); - - function exitInsertMode(cm) { - cm.setCursor(cm.getCursor().line, cm.getCursor().ch-1, true); - cm.setOption('keyMap', 'vim'); - } - - CodeMirror.keyMap['vim-insert'] = { - // TODO: override navigation keys so that Esc will cancel automatic - // indentation from o, O, i_<CR> - 'Esc': exitInsertMode, - 'Ctrl-[': exitInsertMode, - 'Ctrl-C': exitInsertMode, - 'Ctrl-N': 'autocomplete', - 'Ctrl-P': 'autocomplete', - 'Enter': function(cm) { - var fn = CodeMirror.commands.newlineAndIndentContinueComment || - CodeMirror.commands.newlineAndIndent; - fn(cm); - }, - fallthrough: ['default'] - }; - - return vimApi; - }; - // Initialize Vim and make it available as an API. - var vim = Vim(); - CodeMirror.Vim = vim; -} -)(); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/codemirror.css b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/codemirror.css deleted file mode 100644 index bf995f486696af279a1f1c5ea42d9256616677f2..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/codemirror.css +++ /dev/null @@ -1,239 +0,0 @@ -/* BASICS */ - -.CodeMirror { - /* Set height, width, borders, and global font properties here */ - font-family: monospace; - height: 300px; -} -.CodeMirror-scroll { - /* Set scrolling behaviour here */ - overflow: auto; -} - -/* PADDING */ - -.CodeMirror-lines { - padding: 4px 0; /* Vertical padding around content */ -} -.CodeMirror pre { - padding: 0 4px; /* Horizontal padding of content */ -} - -.CodeMirror-scrollbar-filler { - background-color: white; /* The little square between H and V scrollbars */ -} - -/* GUTTER */ - -.CodeMirror-gutters { - border-right: 1px solid #ddd; - background-color: #f7f7f7; -} -.CodeMirror-linenumbers {} -.CodeMirror-linenumber { - padding: 0 3px 0 5px; - min-width: 20px; - text-align: right; - color: #999; -} - -/* CURSOR */ - -.CodeMirror pre.CodeMirror-cursor { - border-left: 1px solid black; -} -/* Shown when moving in bi-directional text */ -.CodeMirror pre.CodeMirror-secondarycursor { - border-left: 1px solid silver; -} -.cm-keymap-fat-cursor pre.CodeMirror-cursor { - width: auto; - border: 0; - background: transparent; - background: rgba(0, 200, 0, .4); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800); -} -/* Kludge to turn off filter in ie9+, which also accepts rgba */ -.cm-keymap-fat-cursor pre.CodeMirror-cursor:not(#nonsense_id) { - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); -} -/* Can style cursor different in overwrite (non-insert) mode */ -.CodeMirror pre.CodeMirror-cursor.CodeMirror-overwrite {} - -/* DEFAULT THEME */ - -.cm-s-default .cm-keyword {color: #708;} -.cm-s-default .cm-atom {color: #219;} -.cm-s-default .cm-number {color: #164;} -.cm-s-default .cm-def {color: #00f;} -.cm-s-default .cm-variable {color: black;} -.cm-s-default .cm-variable-2 {color: #05a;} -.cm-s-default .cm-variable-3 {color: #085;} -.cm-s-default .cm-property {color: black;} -.cm-s-default .cm-operator {color: black;} -.cm-s-default .cm-comment {color: #a50;} -.cm-s-default .cm-string {color: #a11;} -.cm-s-default .cm-string-2 {color: #f50;} -.cm-s-default .cm-meta {color: #555;} -.cm-s-default .cm-error {color: #f00;} -.cm-s-default .cm-qualifier {color: #555;} -.cm-s-default .cm-builtin {color: #30a;} -.cm-s-default .cm-bracket {color: #997;} -.cm-s-default .cm-tag {color: #170;} -.cm-s-default .cm-attribute {color: #00c;} -.cm-s-default .cm-header {color: blue;} -.cm-s-default .cm-quote {color: #090;} -.cm-s-default .cm-hr {color: #999;} -.cm-s-default .cm-link {color: #00c;} - -.cm-negative {color: #d44;} -.cm-positive {color: #292;} -.cm-header, .cm-strong {font-weight: bold;} -.cm-em {font-style: italic;} -.cm-emstrong {font-style: italic; font-weight: bold;} -.cm-link {text-decoration: underline;} - -.cm-invalidchar {color: #f00;} - -div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} -div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} - -/* STOP */ - -/* The rest of this file contains styles related to the mechanics of - the editor. You probably shouldn't touch them. */ - -.CodeMirror { - line-height: 1; - position: relative; - overflow: hidden; -} - -.CodeMirror-scroll { - /* 30px is the magic margin used to hide the element's real scrollbars */ - /* See overflow: hidden in .CodeMirror, and the paddings in .CodeMirror-sizer */ - margin-bottom: -30px; margin-right: -30px; - padding-bottom: 30px; padding-right: 30px; - height: 100%; - outline: none; /* Prevent dragging from highlighting the element */ - position: relative; -} -.CodeMirror-sizer { - position: relative; -} - -/* The fake, visible scrollbars. Used to force redraw during scrolling - before actuall scrolling happens, thus preventing shaking and - flickering artifacts. */ -.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler { - position: absolute; - z-index: 6; - display: none; -} -.CodeMirror-vscrollbar { - right: 0; top: 0; - overflow-x: hidden; - overflow-y: scroll; -} -.CodeMirror-hscrollbar { - bottom: 0; left: 0; - overflow-y: hidden; - overflow-x: scroll; -} -.CodeMirror-scrollbar-filler { - right: 0; bottom: 0; - z-index: 6; -} - -.CodeMirror-gutters { - position: absolute; left: 0; top: 0; - height: 100%; - z-index: 3; -} -.CodeMirror-gutter { - height: 100%; - display: inline-block; - /* Hack to make IE7 behave */ - *zoom:1; - *display:inline; -} -.CodeMirror-gutter-elt { - position: absolute; - cursor: default; - z-index: 4; -} - -.CodeMirror-lines { - cursor: text; -} -.CodeMirror pre { - /* Reset some styles that the rest of the page might have set */ - -moz-border-radius: 0; -webkit-border-radius: 0; -o-border-radius: 0; border-radius: 0; - border-width: 0; - background: transparent; - font-family: inherit; - font-size: inherit; - margin: 0; - white-space: pre; - word-wrap: normal; - line-height: inherit; - color: inherit; - z-index: 2; - position: relative; - overflow: visible; -} -.CodeMirror-wrap pre { - word-wrap: break-word; - white-space: pre-wrap; - word-break: normal; -} -.CodeMirror-linebackground { - position: absolute; - left: 0; right: 0; top: 0; bottom: 0; - z-index: 0; -} - -.CodeMirror-linewidget { - position: relative; - z-index: 2; -} - -.CodeMirror-wrap .CodeMirror-scroll { - overflow-x: hidden; -} - -.CodeMirror-measure { - position: absolute; - width: 100%; height: 0px; - overflow: hidden; - visibility: hidden; -} -.CodeMirror-measure pre { position: static; } - -.CodeMirror pre.CodeMirror-cursor { - position: absolute; - visibility: hidden; - border-right: none; - width: 0; -} -.CodeMirror-focused pre.CodeMirror-cursor { - visibility: visible; -} - -.CodeMirror-selected { background: #d9d9d9; } -.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } - -.CodeMirror-searching { - background: #ffa; - background: rgba(255, 255, 0, .4); -} - -/* IE7 hack to prevent it from returning funny offsetTops on the spans */ -.CodeMirror span { *vertical-align: text-bottom; } - -@media print { - /* Hide the cursor when printing */ - .CodeMirror pre.CodeMirror-cursor { - visibility: hidden; - } -} diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/codemirror.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/codemirror.js deleted file mode 100644 index 2003aa74ba3aba26e5a49d2aa132805b329595ee..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/codemirror.js +++ /dev/null @@ -1,4553 +0,0 @@ -// CodeMirror version 3.0 -// -// CodeMirror is the only global var we claim -window.CodeMirror = (function() { - "use strict"; - - // BROWSER SNIFFING - - // Crude, but necessary to handle a number of hard-to-feature-detect - // bugs and behavior differences. - var gecko = /gecko\/\d/i.test(navigator.userAgent); - var ie = /MSIE \d/.test(navigator.userAgent); - var ie_lt8 = /MSIE [1-7]\b/.test(navigator.userAgent); - var ie_lt9 = /MSIE [1-8]\b/.test(navigator.userAgent); - var webkit = /WebKit\//.test(navigator.userAgent); - var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(navigator.userAgent); - var chrome = /Chrome\//.test(navigator.userAgent); - var opera = /Opera\//.test(navigator.userAgent); - var safari = /Apple Computer/.test(navigator.vendor); - var khtml = /KHTML\//.test(navigator.userAgent); - var mac_geLion = /Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent); - var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent); - var phantom = /PhantomJS/.test(navigator.userAgent); - - var ios = /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent); - // This is woefully incomplete. Suggestions for alternative methods welcome. - var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|IEMobile/i.test(navigator.userAgent); - var mac = ios || /Mac/.test(navigator.platform); - - // Optimize some code when these features are not used - var sawReadOnlySpans = false, sawCollapsedSpans = false; - - // CONSTRUCTOR - - function CodeMirror(place, options) { - if (!(this instanceof CodeMirror)) return new CodeMirror(place, options); - - this.options = options = options || {}; - // Determine effective options based on given values and defaults. - for (var opt in defaults) if (!options.hasOwnProperty(opt) && defaults.hasOwnProperty(opt)) - options[opt] = defaults[opt]; - setGuttersForLineNumbers(options); - - var display = this.display = makeDisplay(place); - display.wrapper.CodeMirror = this; - updateGutters(this); - if (options.autofocus && !mobile) focusInput(this); - - this.view = makeView(new BranchChunk([new LeafChunk([makeLine("", null, textHeight(display))])])); - this.nextOpId = 0; - loadMode(this); - themeChanged(this); - if (options.lineWrapping) - this.display.wrapper.className += " CodeMirror-wrap"; - - // Initialize the content. - this.setValue(options.value || ""); - // Override magic textarea content restore that IE sometimes does - // on our hidden textarea on reload - if (ie) setTimeout(bind(resetInput, this, true), 20); - this.view.history = makeHistory(); - - registerEventHandlers(this); - // IE throws unspecified error in certain cases, when - // trying to access activeElement before onload - var hasFocus; try { hasFocus = (document.activeElement == display.input); } catch(e) { } - if (hasFocus || (options.autofocus && !mobile)) setTimeout(bind(onFocus, this), 20); - else onBlur(this); - - operation(this, function() { - for (var opt in optionHandlers) - if (optionHandlers.propertyIsEnumerable(opt)) - optionHandlers[opt](this, options[opt], Init); - for (var i = 0; i < initHooks.length; ++i) initHooks[i](this); - })(); - } - - // DISPLAY CONSTRUCTOR - - function makeDisplay(place) { - var d = {}; - var input = d.input = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em; outline: none;"); - input.setAttribute("wrap", "off"); input.setAttribute("autocorrect", "off"); input.setAttribute("autocapitalize", "off"); - // Wraps and hides input textarea - d.inputDiv = elt("div", [input], null, "overflow: hidden; position: relative; width: 3px; height: 0px;"); - // The actual fake scrollbars. - d.scrollbarH = elt("div", [elt("div", null, null, "height: 1px")], "CodeMirror-hscrollbar"); - d.scrollbarV = elt("div", [elt("div", null, null, "width: 1px")], "CodeMirror-vscrollbar"); - d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler"); - // DIVs containing the selection and the actual code - d.lineDiv = elt("div"); - d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1"); - // Blinky cursor, and element used to ensure cursor fits at the end of a line - d.cursor = elt("pre", "\u00a0", "CodeMirror-cursor"); - // Secondary cursor, shown when on a 'jump' in bi-directional text - d.otherCursor = elt("pre", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor"); - // Used to measure text size - d.measure = elt("div", null, "CodeMirror-measure"); - // Wraps everything that needs to exist inside the vertically-padded coordinate system - d.lineSpace = elt("div", [d.measure, d.selectionDiv, d.lineDiv, d.cursor, d.otherCursor], - null, "position: relative; outline: none"); - // Moved around its parent to cover visible view - d.mover = elt("div", [elt("div", [d.lineSpace], "CodeMirror-lines")], null, "position: relative"); - // Set to the height of the text, causes scrolling - d.sizer = elt("div", [d.mover], "CodeMirror-sizer"); - // D is needed because behavior of elts with overflow: auto and padding is inconsistent across browsers - d.heightForcer = elt("div", "\u00a0", null, "position: absolute; height: " + scrollerCutOff + "px"); - // Will contain the gutters, if any - d.gutters = elt("div", null, "CodeMirror-gutters"); - d.lineGutter = null; - // Helper element to properly size the gutter backgrounds - var scrollerInner = elt("div", [d.sizer, d.heightForcer, d.gutters], null, "position: relative; min-height: 100%"); - // Provides scrolling - d.scroller = elt("div", [scrollerInner], "CodeMirror-scroll"); - d.scroller.setAttribute("tabIndex", "-1"); - // The element in which the editor lives. - d.wrapper = elt("div", [d.inputDiv, d.scrollbarH, d.scrollbarV, - d.scrollbarFiller, d.scroller], "CodeMirror"); - // Work around IE7 z-index bug - if (ie_lt8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; } - if (place.appendChild) place.appendChild(d.wrapper); else place(d.wrapper); - - // Needed to hide big blue blinking cursor on Mobile Safari - if (ios) input.style.width = "0px"; - if (!webkit) d.scroller.draggable = true; - // Needed to handle Tab key in KHTML - if (khtml) { d.inputDiv.style.height = "1px"; d.inputDiv.style.position = "absolute"; } - // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). - else if (ie_lt8) d.scrollbarH.style.minWidth = d.scrollbarV.style.minWidth = "18px"; - - // Current visible range (may be bigger than the view window). - d.viewOffset = d.showingFrom = d.showingTo = d.lastSizeC = 0; - - // Used to only resize the line number gutter when necessary (when - // the amount of lines crosses a boundary that makes its width change) - d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null; - // See readInput and resetInput - d.prevInput = ""; - // Set to true when a non-horizontal-scrolling widget is added. As - // an optimization, widget aligning is skipped when d is false. - d.alignWidgets = false; - // Flag that indicates whether we currently expect input to appear - // (after some event like 'keypress' or 'input') and are polling - // intensively. - d.pollingFast = false; - // Self-resetting timeout for the poller - d.poll = new Delayed(); - // True when a drag from the editor is active - d.draggingText = false; - - d.cachedCharWidth = d.cachedTextHeight = null; - d.measureLineCache = []; - d.measureLineCachePos = 0; - - // Tracks when resetInput has punted to just putting a short - // string instead of the (large) selection. - d.inaccurateSelection = false; - - // Used to adjust overwrite behaviour when a paste has been - // detected - d.pasteIncoming = false; - - return d; - } - - // VIEW CONSTRUCTOR - - function makeView(doc) { - var selPos = {line: 0, ch: 0}; - return { - doc: doc, - // frontier is the point up to which the content has been parsed, - frontier: 0, highlight: new Delayed(), - sel: {from: selPos, to: selPos, head: selPos, anchor: selPos, shift: false, extend: false}, - scrollTop: 0, scrollLeft: 0, - overwrite: false, focused: false, - // Tracks the maximum line length so that - // the horizontal scrollbar can be kept - // static when scrolling. - maxLine: getLine(doc, 0), - maxLineLength: 0, - maxLineChanged: false, - suppressEdits: false, - goalColumn: null, - cantEdit: false, - keyMaps: [] - }; - } - - // STATE UPDATES - - // Used to get the editor into a consistent state again when options change. - - function loadMode(cm) { - var doc = cm.view.doc; - cm.view.mode = CodeMirror.getMode(cm.options, cm.options.mode); - doc.iter(0, doc.size, function(line) { line.stateAfter = null; }); - cm.view.frontier = 0; - startWorker(cm, 100); - } - - function wrappingChanged(cm) { - var doc = cm.view.doc, th = textHeight(cm.display); - if (cm.options.lineWrapping) { - cm.display.wrapper.className += " CodeMirror-wrap"; - var perLine = cm.display.scroller.clientWidth / charWidth(cm.display) - 3; - doc.iter(0, doc.size, function(line) { - if (line.height == 0) return; - var guess = Math.ceil(line.text.length / perLine) || 1; - if (guess != 1) updateLineHeight(line, guess * th); - }); - cm.display.sizer.style.minWidth = ""; - } else { - cm.display.wrapper.className = cm.display.wrapper.className.replace(" CodeMirror-wrap", ""); - computeMaxLength(cm.view); - doc.iter(0, doc.size, function(line) { - if (line.height != 0) updateLineHeight(line, th); - }); - } - regChange(cm, 0, doc.size); - clearCaches(cm); - setTimeout(function(){updateScrollbars(cm.display, cm.view.doc.height);}, 100); - } - - function keyMapChanged(cm) { - var style = keyMap[cm.options.keyMap].style; - cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-keymap-\S+/g, "") + - (style ? " cm-keymap-" + style : ""); - } - - function themeChanged(cm) { - cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + - cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-"); - clearCaches(cm); - } - - function guttersChanged(cm) { - updateGutters(cm); - updateDisplay(cm, true); - } - - function updateGutters(cm) { - var gutters = cm.display.gutters, specs = cm.options.gutters; - removeChildren(gutters); - for (var i = 0; i < specs.length; ++i) { - var gutterClass = specs[i]; - var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass)); - if (gutterClass == "CodeMirror-linenumbers") { - cm.display.lineGutter = gElt; - gElt.style.width = (cm.display.lineNumWidth || 1) + "px"; - } - } - gutters.style.display = i ? "" : "none"; - } - - function lineLength(doc, line) { - if (line.height == 0) return 0; - var len = line.text.length, merged, cur = line; - while (merged = collapsedSpanAtStart(cur)) { - var found = merged.find(); - cur = getLine(doc, found.from.line); - len += found.from.ch - found.to.ch; - } - cur = line; - while (merged = collapsedSpanAtEnd(cur)) { - var found = merged.find(); - len -= cur.text.length - found.from.ch; - cur = getLine(doc, found.to.line); - len += cur.text.length - found.to.ch; - } - return len; - } - - function computeMaxLength(view) { - view.maxLine = getLine(view.doc, 0); - view.maxLineLength = lineLength(view.doc, view.maxLine); - view.maxLineChanged = true; - view.doc.iter(1, view.doc.size, function(line) { - var len = lineLength(view.doc, line); - if (len > view.maxLineLength) { - view.maxLineLength = len; - view.maxLine = line; - } - }); - } - - // Make sure the gutters options contains the element - // "CodeMirror-linenumbers" when the lineNumbers option is true. - function setGuttersForLineNumbers(options) { - var found = false; - for (var i = 0; i < options.gutters.length; ++i) { - if (options.gutters[i] == "CodeMirror-linenumbers") { - if (options.lineNumbers) found = true; - else options.gutters.splice(i--, 1); - } - } - if (!found && options.lineNumbers) - options.gutters.push("CodeMirror-linenumbers"); - } - - // SCROLLBARS - - // Re-synchronize the fake scrollbars with the actual size of the - // content. Optionally force a scrollTop. - function updateScrollbars(d /* display */, docHeight) { - var totalHeight = docHeight + 2 * paddingTop(d); - d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + "px"; - var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight); - var needsH = d.scroller.scrollWidth > d.scroller.clientWidth; - var needsV = scrollHeight > d.scroller.clientHeight; - if (needsV) { - d.scrollbarV.style.display = "block"; - d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + "px" : "0"; - d.scrollbarV.firstChild.style.height = - (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + "px"; - } else d.scrollbarV.style.display = ""; - if (needsH) { - d.scrollbarH.style.display = "block"; - d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + "px" : "0"; - d.scrollbarH.firstChild.style.width = - (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + "px"; - } else d.scrollbarH.style.display = ""; - if (needsH && needsV) { - d.scrollbarFiller.style.display = "block"; - d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + "px"; - } else d.scrollbarFiller.style.display = ""; - - if (mac_geLion && scrollbarWidth(d.measure) === 0) - d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? "18px" : "12px"; - } - - function visibleLines(display, doc, viewPort) { - var top = display.scroller.scrollTop, height = display.wrapper.clientHeight; - if (typeof viewPort == "number") top = viewPort; - else if (viewPort) {top = viewPort.top; height = viewPort.bottom - viewPort.top;} - top = Math.floor(top - paddingTop(display)); - var bottom = Math.ceil(top + height); - return {from: lineAtHeight(doc, top), to: lineAtHeight(doc, bottom)}; - } - - // LINE NUMBERS - - function alignHorizontally(cm) { - var display = cm.display; - if (!display.alignWidgets && !display.gutters.firstChild) return; - var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.view.scrollLeft; - var gutterW = display.gutters.offsetWidth, l = comp + "px"; - for (var n = display.lineDiv.firstChild; n; n = n.nextSibling) if (n.alignable) { - for (var i = 0, a = n.alignable; i < a.length; ++i) a[i].style.left = l; - } - display.gutters.style.left = (comp + gutterW) + "px"; - } - - function maybeUpdateLineNumberWidth(cm) { - if (!cm.options.lineNumbers) return false; - var doc = cm.view.doc, last = lineNumberFor(cm.options, doc.size - 1), display = cm.display; - if (last.length != display.lineNumChars) { - var test = display.measure.appendChild(elt("div", [elt("div", last)], - "CodeMirror-linenumber CodeMirror-gutter-elt")); - var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW; - display.lineGutter.style.width = ""; - display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding); - display.lineNumWidth = display.lineNumInnerWidth + padding; - display.lineNumChars = display.lineNumInnerWidth ? last.length : -1; - display.lineGutter.style.width = display.lineNumWidth + "px"; - return true; - } - return false; - } - - function lineNumberFor(options, i) { - return String(options.lineNumberFormatter(i + options.firstLineNumber)); - } - function compensateForHScroll(display) { - return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left; - } - - // DISPLAY DRAWING - - function updateDisplay(cm, changes, viewPort) { - var oldFrom = cm.display.showingFrom, oldTo = cm.display.showingTo; - var updated = updateDisplayInner(cm, changes, viewPort); - if (updated) { - signalLater(cm, cm, "update", cm); - if (cm.display.showingFrom != oldFrom || cm.display.showingTo != oldTo) - signalLater(cm, cm, "viewportChange", cm, cm.display.showingFrom, cm.display.showingTo); - } - updateSelection(cm); - updateScrollbars(cm.display, cm.view.doc.height); - - return updated; - } - - // Uses a set of changes plus the current scroll position to - // determine which DOM updates have to be made, and makes the - // updates. - function updateDisplayInner(cm, changes, viewPort) { - var display = cm.display, doc = cm.view.doc; - if (!display.wrapper.clientWidth) { - display.showingFrom = display.showingTo = display.viewOffset = 0; - return; - } - - // Compute the new visible window - // If scrollTop is specified, use that to determine which lines - // to render instead of the current scrollbar position. - var visible = visibleLines(display, doc, viewPort); - // Bail out if the visible area is already rendered and nothing changed. - if (changes !== true && changes.length == 0 && - visible.from > display.showingFrom && visible.to < display.showingTo) - return; - - if (changes && maybeUpdateLineNumberWidth(cm)) - changes = true; - display.sizer.style.marginLeft = display.scrollbarH.style.left = display.gutters.offsetWidth + "px"; - - // When merged lines are present, the line that needs to be - // redrawn might not be the one that was changed. - if (changes !== true && sawCollapsedSpans) - for (var i = 0; i < changes.length; ++i) { - var ch = changes[i], merged; - while (merged = collapsedSpanAtStart(getLine(doc, ch.from))) { - var from = merged.find().from.line; - if (ch.diff) ch.diff -= ch.from - from; - ch.from = from; - } - } - - // Used to determine which lines need their line numbers updated - var positionsChangedFrom = changes === true ? 0 : Infinity; - if (cm.options.lineNumbers && changes && changes !== true) - for (var i = 0; i < changes.length; ++i) - if (changes[i].diff) { positionsChangedFrom = changes[i].from; break; } - - var from = Math.max(visible.from - cm.options.viewportMargin, 0); - var to = Math.min(doc.size, visible.to + cm.options.viewportMargin); - if (display.showingFrom < from && from - display.showingFrom < 20) from = display.showingFrom; - if (display.showingTo > to && display.showingTo - to < 20) to = Math.min(doc.size, display.showingTo); - if (sawCollapsedSpans) { - from = lineNo(visualLine(doc, getLine(doc, from))); - while (to < doc.size && lineIsHidden(getLine(doc, to))) ++to; - } - - // Create a range of theoretically intact lines, and punch holes - // in that using the change info. - var intact = changes === true ? [] : - computeIntact([{from: display.showingFrom, to: display.showingTo}], changes); - // Clip off the parts that won't be visible - var intactLines = 0; - for (var i = 0; i < intact.length; ++i) { - var range = intact[i]; - if (range.from < from) range.from = from; - if (range.to > to) range.to = to; - if (range.from >= range.to) intact.splice(i--, 1); - else intactLines += range.to - range.from; - } - if (intactLines == to - from && from == display.showingFrom && to == display.showingTo) - return; - intact.sort(function(a, b) {return a.from - b.from;}); - - if (intactLines < (to - from) * .7) display.lineDiv.style.display = "none"; - patchDisplay(cm, from, to, intact, positionsChangedFrom); - display.lineDiv.style.display = ""; - - var different = from != display.showingFrom || to != display.showingTo || - display.lastSizeC != display.wrapper.clientHeight; - // This is just a bogus formula that detects when the editor is - // resized or the font size changes. - if (different) display.lastSizeC = display.wrapper.clientHeight; - display.showingFrom = from; display.showingTo = to; - startWorker(cm, 100); - - var prevBottom = display.lineDiv.offsetTop; - for (var node = display.lineDiv.firstChild, height; node; node = node.nextSibling) if (node.lineObj) { - if (ie_lt8) { - var bot = node.offsetTop + node.offsetHeight; - height = bot - prevBottom; - prevBottom = bot; - } else { - var box = node.getBoundingClientRect(); - height = box.bottom - box.top; - } - var diff = node.lineObj.height - height; - if (height < 2) height = textHeight(display); - if (diff > .001 || diff < -.001) - updateLineHeight(node.lineObj, height); - } - display.viewOffset = heightAtLine(cm, getLine(doc, from)); - // Position the mover div to align with the current virtual scroll position - display.mover.style.top = display.viewOffset + "px"; - return true; - } - - function computeIntact(intact, changes) { - for (var i = 0, l = changes.length || 0; i < l; ++i) { - var change = changes[i], intact2 = [], diff = change.diff || 0; - for (var j = 0, l2 = intact.length; j < l2; ++j) { - var range = intact[j]; - if (change.to <= range.from && change.diff) { - intact2.push({from: range.from + diff, to: range.to + diff}); - } else if (change.to <= range.from || change.from >= range.to) { - intact2.push(range); - } else { - if (change.from > range.from) - intact2.push({from: range.from, to: change.from}); - if (change.to < range.to) - intact2.push({from: change.to + diff, to: range.to + diff}); - } - } - intact = intact2; - } - return intact; - } - - function getDimensions(cm) { - var d = cm.display, left = {}, width = {}; - for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) { - left[cm.options.gutters[i]] = n.offsetLeft; - width[cm.options.gutters[i]] = n.offsetWidth; - } - return {fixedPos: compensateForHScroll(d), - gutterTotalWidth: d.gutters.offsetWidth, - gutterLeft: left, - gutterWidth: width, - wrapperWidth: d.wrapper.clientWidth}; - } - - function patchDisplay(cm, from, to, intact, updateNumbersFrom) { - var dims = getDimensions(cm); - var display = cm.display, lineNumbers = cm.options.lineNumbers; - // IE does bad things to nodes when .innerHTML = "" is used on a parent - // we still need widgets and markers intact to add back to the new content later - if (!intact.length && !ie && (!webkit || !cm.display.currentWheelTarget)) - removeChildren(display.lineDiv); - var container = display.lineDiv, cur = container.firstChild; - - function rm(node) { - var next = node.nextSibling; - if (webkit && mac && cm.display.currentWheelTarget == node) { - node.style.display = "none"; - node.lineObj = null; - } else { - container.removeChild(node); - } - return next; - } - - var nextIntact = intact.shift(), lineNo = from; - cm.view.doc.iter(from, to, function(line) { - if (nextIntact && nextIntact.to == lineNo) nextIntact = intact.shift(); - if (lineIsHidden(line)) { - if (line.height != 0) updateLineHeight(line, 0); - } else if (nextIntact && nextIntact.from <= lineNo && nextIntact.to > lineNo) { - // This line is intact. Skip to the actual node. Update its - // line number if needed. - while (cur.lineObj != line) cur = rm(cur); - if (lineNumbers && updateNumbersFrom <= lineNo && cur.lineNumber) - setTextContent(cur.lineNumber, lineNumberFor(cm.options, lineNo)); - cur = cur.nextSibling; - } else { - // This line needs to be generated. - var lineNode = buildLineElement(cm, line, lineNo, dims); - container.insertBefore(lineNode, cur); - lineNode.lineObj = line; - } - ++lineNo; - }); - while (cur) cur = rm(cur); - } - - function buildLineElement(cm, line, lineNo, dims) { - var lineElement = lineContent(cm, line); - var markers = line.gutterMarkers, display = cm.display; - - if (!cm.options.lineNumbers && !markers && !line.bgClass && !line.wrapClass && - (!line.widgets || !line.widgets.length)) return lineElement; - - // Lines with gutter elements or a background class need - // to be wrapped again, and have the extra elements added - // to the wrapper div - - var wrap = elt("div", null, line.wrapClass, "position: relative"); - if (cm.options.lineNumbers || markers) { - var gutterWrap = wrap.appendChild(elt("div", null, null, "position: absolute; left: " + - dims.fixedPos + "px")); - wrap.alignable = [gutterWrap]; - if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"])) - wrap.lineNumber = gutterWrap.appendChild( - elt("div", lineNumberFor(cm.options, lineNo), - "CodeMirror-linenumber CodeMirror-gutter-elt", - "left: " + dims.gutterLeft["CodeMirror-linenumbers"] + "px; width: " - + display.lineNumInnerWidth + "px")); - if (markers) - for (var k = 0; k < cm.options.gutters.length; ++k) { - var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id]; - if (found) - gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", "left: " + - dims.gutterLeft[id] + "px; width: " + dims.gutterWidth[id] + "px")); - } - } - // Kludge to make sure the styled element lies behind the selection (by z-index) - if (line.bgClass) - wrap.appendChild(elt("div", "\u00a0", line.bgClass + " CodeMirror-linebackground")); - wrap.appendChild(lineElement); - if (line.widgets) - for (var i = 0, ws = line.widgets; i < ws.length; ++i) { - var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget"); - node.widget = widget; - if (widget.noHScroll) { - (wrap.alignable || (wrap.alignable = [])).push(node); - var width = dims.wrapperWidth; - node.style.left = dims.fixedPos + "px"; - if (!widget.coverGutter) { - width -= dims.gutterTotalWidth; - node.style.paddingLeft = dims.gutterTotalWidth + "px"; - } - node.style.width = width + "px"; - } - if (widget.coverGutter) { - node.style.zIndex = 5; - node.style.position = "relative"; - if (!widget.noHScroll) node.style.marginLeft = -dims.gutterTotalWidth + "px"; - } - if (widget.above) - wrap.insertBefore(node, cm.options.lineNumbers && line.height != 0 ? gutterWrap : lineElement); - else - wrap.appendChild(node); - } - - if (ie_lt8) wrap.style.zIndex = 2; - return wrap; - } - - // SELECTION / CURSOR - - function updateSelection(cm) { - var display = cm.display; - var collapsed = posEq(cm.view.sel.from, cm.view.sel.to); - if (collapsed || cm.options.showCursorWhenSelecting) - updateSelectionCursor(cm); - else - display.cursor.style.display = display.otherCursor.style.display = "none"; - if (!collapsed) - updateSelectionRange(cm); - else - display.selectionDiv.style.display = "none"; - - // Move the hidden textarea near the cursor to prevent scrolling artifacts - var headPos = cursorCoords(cm, cm.view.sel.head, "div"); - var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect(); - display.inputDiv.style.top = Math.max(0, Math.min(display.wrapper.clientHeight - 10, - headPos.top + lineOff.top - wrapOff.top)) + "px"; - display.inputDiv.style.left = Math.max(0, Math.min(display.wrapper.clientWidth - 10, - headPos.left + lineOff.left - wrapOff.left)) + "px"; - } - - // No selection, plain cursor - function updateSelectionCursor(cm) { - var display = cm.display, pos = cursorCoords(cm, cm.view.sel.head, "div"); - display.cursor.style.left = pos.left + "px"; - display.cursor.style.top = pos.top + "px"; - display.cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"; - display.cursor.style.display = ""; - - if (pos.other) { - display.otherCursor.style.display = ""; - display.otherCursor.style.left = pos.other.left + "px"; - display.otherCursor.style.top = pos.other.top + "px"; - display.otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"; - } else { display.otherCursor.style.display = "none"; } - } - - // Highlight selection - function updateSelectionRange(cm) { - var display = cm.display, doc = cm.view.doc, sel = cm.view.sel; - var fragment = document.createDocumentFragment(); - var clientWidth = display.lineSpace.offsetWidth, pl = paddingLeft(cm.display); - - function add(left, top, width, bottom) { - if (top < 0) top = 0; - fragment.appendChild(elt("div", null, "CodeMirror-selected", "position: absolute; left: " + left + - "px; top: " + top + "px; width: " + (width == null ? clientWidth - left : width) + - "px; height: " + (bottom - top) + "px")); - } - - function drawForLine(line, fromArg, toArg, retTop) { - var lineObj = getLine(doc, line); - var lineLen = lineObj.text.length, rVal = retTop ? Infinity : -Infinity; - function coords(ch) { - return charCoords(cm, {line: line, ch: ch}, "div", lineObj); - } - - iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) { - var leftPos = coords(dir == "rtl" ? to - 1 : from); - var rightPos = coords(dir == "rtl" ? from : to - 1); - var left = leftPos.left, right = rightPos.right; - if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part - add(left, leftPos.top, null, leftPos.bottom); - left = pl; - if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top); - } - if (toArg == null && to == lineLen) right = clientWidth; - if (fromArg == null && from == 0) left = pl; - rVal = retTop ? Math.min(rightPos.top, rVal) : Math.max(rightPos.bottom, rVal); - if (left < pl + 1) left = pl; - add(left, rightPos.top, right - left, rightPos.bottom); - }); - return rVal; - } - - if (sel.from.line == sel.to.line) { - drawForLine(sel.from.line, sel.from.ch, sel.to.ch); - } else { - var fromObj = getLine(doc, sel.from.line); - var cur = fromObj, merged, path = [sel.from.line, sel.from.ch], singleLine; - while (merged = collapsedSpanAtEnd(cur)) { - var found = merged.find(); - path.push(found.from.ch, found.to.line, found.to.ch); - if (found.to.line == sel.to.line) { - path.push(sel.to.ch); - singleLine = true; - break; - } - cur = getLine(doc, found.to.line); - } - - // This is a single, merged line - if (singleLine) { - for (var i = 0; i < path.length; i += 3) - drawForLine(path[i], path[i+1], path[i+2]); - } else { - var middleTop, middleBot, toObj = getLine(doc, sel.to.line); - if (sel.from.ch) - // Draw the first line of selection. - middleTop = drawForLine(sel.from.line, sel.from.ch, null, false); - else - // Simply include it in the middle block. - middleTop = heightAtLine(cm, fromObj) - display.viewOffset; - - if (!sel.to.ch) - middleBot = heightAtLine(cm, toObj) - display.viewOffset; - else - middleBot = drawForLine(sel.to.line, collapsedSpanAtStart(toObj) ? null : 0, sel.to.ch, true); - - if (middleTop < middleBot) add(pl, middleTop, null, middleBot); - } - } - - removeChildrenAndAdd(display.selectionDiv, fragment); - display.selectionDiv.style.display = ""; - } - - // Cursor-blinking - function restartBlink(cm) { - var display = cm.display; - clearInterval(display.blinker); - var on = true; - display.cursor.style.visibility = display.otherCursor.style.visibility = ""; - display.blinker = setInterval(function() { - if (!display.cursor.offsetHeight) return; - display.cursor.style.visibility = display.otherCursor.style.visibility = (on = !on) ? "" : "hidden"; - }, cm.options.cursorBlinkRate); - } - - // HIGHLIGHT WORKER - - function startWorker(cm, time) { - if (cm.view.frontier < cm.display.showingTo) - cm.view.highlight.set(time, bind(highlightWorker, cm)); - } - - function highlightWorker(cm) { - var view = cm.view, doc = view.doc; - if (view.frontier >= cm.display.showingTo) return; - var end = +new Date + cm.options.workTime; - var state = copyState(view.mode, getStateBefore(cm, view.frontier)); - var changed = [], prevChange; - doc.iter(view.frontier, Math.min(doc.size, cm.display.showingTo + 500), function(line) { - if (view.frontier >= cm.display.showingFrom) { // Visible - if (highlightLine(cm, line, state) && view.frontier >= cm.display.showingFrom) { - if (prevChange && prevChange.end == view.frontier) prevChange.end++; - else changed.push(prevChange = {start: view.frontier, end: view.frontier + 1}); - } - line.stateAfter = copyState(view.mode, state); - } else { - processLine(cm, line, state); - line.stateAfter = view.frontier % 5 == 0 ? copyState(view.mode, state) : null; - } - ++view.frontier; - if (+new Date > end) { - startWorker(cm, cm.options.workDelay); - return true; - } - }); - if (changed.length) - operation(cm, function() { - for (var i = 0; i < changed.length; ++i) - regChange(this, changed[i].start, changed[i].end); - })(); - } - - // Finds the line to start with when starting a parse. Tries to - // find a line with a stateAfter, so that it can start with a - // valid state. If that fails, it returns the line with the - // smallest indentation, which tends to need the least context to - // parse correctly. - function findStartLine(cm, n) { - var minindent, minline, doc = cm.view.doc; - for (var search = n, lim = n - 100; search > lim; --search) { - if (search == 0) return 0; - var line = getLine(doc, search-1); - if (line.stateAfter) return search; - var indented = countColumn(line.text, null, cm.options.tabSize); - if (minline == null || minindent > indented) { - minline = search - 1; - minindent = indented; - } - } - return minline; - } - - function getStateBefore(cm, n) { - var view = cm.view; - var pos = findStartLine(cm, n), state = pos && getLine(view.doc, pos-1).stateAfter; - if (!state) state = startState(view.mode); - else state = copyState(view.mode, state); - view.doc.iter(pos, n, function(line) { - processLine(cm, line, state); - var save = pos == n - 1 || pos % 5 == 0 || pos >= view.showingFrom && pos < view.showingTo; - line.stateAfter = save ? copyState(view.mode, state) : null; - ++pos; - }); - return state; - } - - // POSITION MEASUREMENT - - function paddingTop(display) {return display.lineSpace.offsetTop;} - function paddingLeft(display) { - var e = removeChildrenAndAdd(display.measure, elt("pre")).appendChild(elt("span", "x")); - return e.offsetLeft; - } - - function measureChar(cm, line, ch, data) { - var data = data || measureLine(cm, line), dir = -1; - for (var pos = ch;; pos += dir) { - var r = data[pos]; - if (r) break; - if (dir < 0 && pos == 0) dir = 1; - } - return {left: pos < ch ? r.right : r.left, - right: pos > ch ? r.left : r.right, - top: r.top, bottom: r.bottom}; - } - - function measureLine(cm, line) { - // First look in the cache - var display = cm.display, cache = cm.display.measureLineCache; - for (var i = 0; i < cache.length; ++i) { - var memo = cache[i]; - if (memo.text == line.text && memo.markedSpans == line.markedSpans && - display.scroller.clientWidth == memo.width) - return memo.measure; - } - - var measure = measureLineInner(cm, line); - // Store result in the cache - var memo = {text: line.text, width: display.scroller.clientWidth, - markedSpans: line.markedSpans, measure: measure}; - if (cache.length == 16) cache[++display.measureLineCachePos % 16] = memo; - else cache.push(memo); - return measure; - } - - function measureLineInner(cm, line) { - var display = cm.display, measure = emptyArray(line.text.length); - var pre = lineContent(cm, line, measure); - - // IE does not cache element positions of inline elements between - // calls to getBoundingClientRect. This makes the loop below, - // which gathers the positions of all the characters on the line, - // do an amount of layout work quadratic to the number of - // characters. When line wrapping is off, we try to improve things - // by first subdividing the line into a bunch of inline blocks, so - // that IE can reuse most of the layout information from caches - // for those blocks. This does interfere with line wrapping, so it - // doesn't work when wrapping is on, but in that case the - // situation is slightly better, since IE does cache line-wrapping - // information and only recomputes per-line. - if (ie && !ie_lt8 && !cm.options.lineWrapping && pre.childNodes.length > 100) { - var fragment = document.createDocumentFragment(); - var chunk = 10, n = pre.childNodes.length; - for (var i = 0, chunks = Math.ceil(n / chunk); i < chunks; ++i) { - var wrap = elt("div", null, null, "display: inline-block"); - for (var j = 0; j < chunk && n; ++j) { - wrap.appendChild(pre.firstChild); - --n; - } - fragment.appendChild(wrap); - } - pre.appendChild(fragment); - } - - removeChildrenAndAdd(display.measure, pre); - - var outer = display.lineDiv.getBoundingClientRect(); - var vranges = [], data = emptyArray(line.text.length), maxBot = pre.offsetHeight; - for (var i = 0, cur; i < measure.length; ++i) if (cur = measure[i]) { - var size = cur.getBoundingClientRect(); - var top = Math.max(0, size.top - outer.top), bot = Math.min(size.bottom - outer.top, maxBot); - for (var j = 0; j < vranges.length; j += 2) { - var rtop = vranges[j], rbot = vranges[j+1]; - if (rtop > bot || rbot < top) continue; - if (rtop <= top && rbot >= bot || - top <= rtop && bot >= rbot || - Math.min(bot, rbot) - Math.max(top, rtop) >= (bot - top) >> 1) { - vranges[j] = Math.min(top, rtop); - vranges[j+1] = Math.max(bot, rbot); - break; - } - } - if (j == vranges.length) vranges.push(top, bot); - data[i] = {left: size.left - outer.left, right: size.right - outer.left, top: j}; - } - for (var i = 0, cur; i < data.length; ++i) if (cur = data[i]) { - var vr = cur.top; - cur.top = vranges[vr]; cur.bottom = vranges[vr+1]; - } - return data; - } - - function clearCaches(cm) { - cm.display.measureLineCache.length = cm.display.measureLineCachePos = 0; - cm.display.cachedCharWidth = cm.display.cachedTextHeight = null; - cm.view.maxLineChanged = true; - } - - // Context is one of "line", "div" (display.lineDiv), "local"/null (editor), or "page" - function intoCoordSystem(cm, lineObj, rect, context) { - if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) { - var size = lineObj.widgets[i].node.offsetHeight; - rect.top += size; rect.bottom += size; - } - if (context == "line") return rect; - if (!context) context = "local"; - var yOff = heightAtLine(cm, lineObj); - if (context != "local") yOff -= cm.display.viewOffset; - if (context == "page") { - var lOff = cm.display.lineSpace.getBoundingClientRect(); - yOff += lOff.top + (window.pageYOffset || (document.documentElement || document.body).scrollTop); - var xOff = lOff.left + (window.pageXOffset || (document.documentElement || document.body).scrollLeft); - rect.left += xOff; rect.right += xOff; - } - rect.top += yOff; rect.bottom += yOff; - return rect; - } - - function charCoords(cm, pos, context, lineObj) { - if (!lineObj) lineObj = getLine(cm.view.doc, pos.line); - return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch), context); - } - - function cursorCoords(cm, pos, context, lineObj, measurement) { - lineObj = lineObj || getLine(cm.view.doc, pos.line); - if (!measurement) measurement = measureLine(cm, lineObj); - function get(ch, right) { - var m = measureChar(cm, lineObj, ch, measurement); - if (right) m.left = m.right; else m.right = m.left; - return intoCoordSystem(cm, lineObj, m, context); - } - var order = getOrder(lineObj), ch = pos.ch; - if (!order) return get(ch); - var main, other, linedir = order[0].level; - for (var i = 0; i < order.length; ++i) { - var part = order[i], rtl = part.level % 2, nb, here; - if (part.from < ch && part.to > ch) return get(ch, rtl); - var left = rtl ? part.to : part.from, right = rtl ? part.from : part.to; - if (left == ch) { - // Opera and IE return bogus offsets and widths for edges - // where the direction flips, but only for the side with the - // lower level. So we try to use the side with the higher - // level. - if (i && part.level < (nb = order[i-1]).level) here = get(nb.level % 2 ? nb.from : nb.to - 1, true); - else here = get(rtl && part.from != part.to ? ch - 1 : ch); - if (rtl == linedir) main = here; else other = here; - } else if (right == ch) { - var nb = i < order.length - 1 && order[i+1]; - if (!rtl && nb && nb.from == nb.to) continue; - if (nb && part.level < nb.level) here = get(nb.level % 2 ? nb.to - 1 : nb.from); - else here = get(rtl ? ch : ch - 1, true); - if (rtl == linedir) main = here; else other = here; - } - } - if (linedir && !ch) other = get(order[0].to - 1); - if (!main) return other; - if (other) main.other = other; - return main; - } - - // Coords must be lineSpace-local - function coordsChar(cm, x, y) { - var doc = cm.view.doc; - y += cm.display.viewOffset; - if (y < 0) return {line: 0, ch: 0, outside: true}; - var lineNo = lineAtHeight(doc, y); - if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc, doc.size - 1).text.length}; - if (x < 0) x = 0; - - for (;;) { - var lineObj = getLine(doc, lineNo); - var found = coordsCharInner(cm, lineObj, lineNo, x, y); - var merged = collapsedSpanAtEnd(lineObj); - if (merged && found.ch == lineRight(lineObj)) - lineNo = merged.find().to.line; - else - return found; - } - } - - function coordsCharInner(cm, lineObj, lineNo, x, y) { - var innerOff = y - heightAtLine(cm, lineObj); - var wrongLine = false, cWidth = cm.display.wrapper.clientWidth; - var measurement = measureLine(cm, lineObj); - - function getX(ch) { - var sp = cursorCoords(cm, {line: lineNo, ch: ch}, "line", - lineObj, measurement); - wrongLine = true; - if (innerOff > sp.bottom) return Math.max(0, sp.left - cWidth); - else if (innerOff < sp.top) return sp.left + cWidth; - else wrongLine = false; - return sp.left; - } - - var bidi = getOrder(lineObj), dist = lineObj.text.length; - var from = lineLeft(lineObj), to = lineRight(lineObj); - var fromX = paddingLeft(cm.display), toX = getX(to); - - if (x > toX) return {line: lineNo, ch: to, outside: wrongLine}; - // Do a binary search between these bounds. - for (;;) { - if (bidi ? to == from || to == moveVisually(lineObj, from, 1) : to - from <= 1) { - var after = x - fromX < toX - x, ch = after ? from : to; - while (isExtendingChar.test(lineObj.text.charAt(ch))) ++ch; - return {line: lineNo, ch: ch, after: after, outside: wrongLine}; - } - var step = Math.ceil(dist / 2), middle = from + step; - if (bidi) { - middle = from; - for (var i = 0; i < step; ++i) middle = moveVisually(lineObj, middle, 1); - } - var middleX = getX(middle); - if (middleX > x) {to = middle; toX = middleX; if (wrongLine) toX += 1000; dist -= step;} - else {from = middle; fromX = middleX; dist = step;} - } - } - - var measureText; - function textHeight(display) { - if (display.cachedTextHeight != null) return display.cachedTextHeight; - if (measureText == null) { - measureText = elt("pre"); - // Measure a bunch of lines, for browsers that compute - // fractional heights. - for (var i = 0; i < 49; ++i) { - measureText.appendChild(document.createTextNode("x")); - measureText.appendChild(elt("br")); - } - measureText.appendChild(document.createTextNode("x")); - } - removeChildrenAndAdd(display.measure, measureText); - var height = measureText.offsetHeight / 50; - if (height > 3) display.cachedTextHeight = height; - removeChildren(display.measure); - return height || 1; - } - - function charWidth(display) { - if (display.cachedCharWidth != null) return display.cachedCharWidth; - var anchor = elt("span", "x"); - var pre = elt("pre", [anchor]); - removeChildrenAndAdd(display.measure, pre); - var width = anchor.offsetWidth; - if (width > 2) display.cachedCharWidth = width; - return width || 10; - } - - // OPERATIONS - - // Operations are used to wrap changes in such a way that each - // change won't have to update the cursor and display (which would - // be awkward, slow, and error-prone), but instead updates are - // batched and then all combined and executed at once. - - function startOperation(cm) { - if (cm.curOp) ++cm.curOp.depth; - else cm.curOp = { - // Nested operations delay update until the outermost one - // finishes. - depth: 1, - // An array of ranges of lines that have to be updated. See - // updateDisplay. - changes: [], - delayedCallbacks: [], - updateInput: null, - userSelChange: null, - textChanged: null, - selectionChanged: false, - updateMaxLine: false, - id: ++cm.nextOpId - }; - } - - function endOperation(cm) { - var op = cm.curOp; - if (--op.depth) return; - cm.curOp = null; - var view = cm.view, display = cm.display; - if (op.updateMaxLine) computeMaxLength(view); - if (view.maxLineChanged && !cm.options.lineWrapping) { - var width = measureChar(cm, view.maxLine, view.maxLine.text.length).right; - display.sizer.style.minWidth = (width + 3 + scrollerCutOff) + "px"; - view.maxLineChanged = false; - } - var newScrollPos, updated; - if (op.selectionChanged) { - var coords = cursorCoords(cm, view.sel.head); - newScrollPos = calculateScrollPos(cm, coords.left, coords.top, coords.left, coords.bottom); - } - if (op.changes.length || newScrollPos && newScrollPos.scrollTop != null) - updated = updateDisplay(cm, op.changes, newScrollPos && newScrollPos.scrollTop); - if (!updated && op.selectionChanged) updateSelection(cm); - if (newScrollPos) scrollCursorIntoView(cm); - if (op.selectionChanged) restartBlink(cm); - - if (view.focused && op.updateInput) - resetInput(cm, op.userSelChange); - - if (op.textChanged) - signal(cm, "change", cm, op.textChanged); - if (op.selectionChanged) signal(cm, "cursorActivity", cm); - for (var i = 0; i < op.delayedCallbacks.length; ++i) op.delayedCallbacks[i](cm); - } - - // Wraps a function in an operation. Returns the wrapped function. - function operation(cm1, f) { - return function() { - var cm = cm1 || this; - startOperation(cm); - try {var result = f.apply(cm, arguments);} - finally {endOperation(cm);} - return result; - }; - } - - function regChange(cm, from, to, lendiff) { - cm.curOp.changes.push({from: from, to: to, diff: lendiff}); - } - - // INPUT HANDLING - - function slowPoll(cm) { - if (cm.view.pollingFast) return; - cm.display.poll.set(cm.options.pollInterval, function() { - readInput(cm); - if (cm.view.focused) slowPoll(cm); - }); - } - - function fastPoll(cm) { - var missed = false; - cm.display.pollingFast = true; - function p() { - var changed = readInput(cm); - if (!changed && !missed) {missed = true; cm.display.poll.set(60, p);} - else {cm.display.pollingFast = false; slowPoll(cm);} - } - cm.display.poll.set(20, p); - } - - // prevInput is a hack to work with IME. If we reset the textarea - // on every change, that breaks IME. So we look for changes - // compared to the previous content instead. (Modern browsers have - // events that indicate IME taking place, but these are not widely - // supported or compatible enough yet to rely on.) - function readInput(cm) { - var input = cm.display.input, prevInput = cm.display.prevInput, view = cm.view, sel = view.sel; - if (!view.focused || hasSelection(input) || isReadOnly(cm)) return false; - var text = input.value; - if (text == prevInput && posEq(sel.from, sel.to)) return false; - startOperation(cm); - view.sel.shift = false; - var same = 0, l = Math.min(prevInput.length, text.length); - while (same < l && prevInput[same] == text[same]) ++same; - var from = sel.from, to = sel.to; - if (same < prevInput.length) - from = {line: from.line, ch: from.ch - (prevInput.length - same)}; - else if (view.overwrite && posEq(from, to) && !cm.display.pasteIncoming) - to = {line: to.line, ch: Math.min(getLine(cm.view.doc, to.line).text.length, to.ch + (text.length - same))}; - var updateInput = cm.curOp.updateInput; - updateDoc(cm, from, to, splitLines(text.slice(same)), "end", - cm.display.pasteIncoming ? "paste" : "input", {from: from, to: to}); - cm.curOp.updateInput = updateInput; - if (text.length > 1000) input.value = cm.display.prevInput = ""; - else cm.display.prevInput = text; - endOperation(cm); - cm.display.pasteIncoming = false; - return true; - } - - function resetInput(cm, user) { - var view = cm.view, minimal, selected; - if (!posEq(view.sel.from, view.sel.to)) { - cm.display.prevInput = ""; - minimal = hasCopyEvent && - (view.sel.to.line - view.sel.from.line > 100 || (selected = cm.getSelection()).length > 1000); - if (minimal) cm.display.input.value = "-"; - else cm.display.input.value = selected || cm.getSelection(); - if (view.focused) selectInput(cm.display.input); - } else if (user) cm.display.prevInput = cm.display.input.value = ""; - cm.display.inaccurateSelection = minimal; - } - - function focusInput(cm) { - if (cm.options.readOnly != "nocursor" && (ie || document.activeElement != cm.display.input)) - cm.display.input.focus(); - } - - function isReadOnly(cm) { - return cm.options.readOnly || cm.view.cantEdit; - } - - // EVENT HANDLERS - - function registerEventHandlers(cm) { - var d = cm.display; - on(d.scroller, "mousedown", operation(cm, onMouseDown)); - on(d.scroller, "dblclick", operation(cm, e_preventDefault)); - on(d.lineSpace, "selectstart", function(e) { - if (!mouseEventInWidget(d, e)) e_preventDefault(e); - }); - // Gecko browsers fire contextmenu *after* opening the menu, at - // which point we can't mess with it anymore. Context menu is - // handled in onMouseDown for Gecko. - if (!gecko) on(d.scroller, "contextmenu", function(e) {onContextMenu(cm, e);}); - - on(d.scroller, "scroll", function() { - setScrollTop(cm, d.scroller.scrollTop); - setScrollLeft(cm, d.scroller.scrollLeft, true); - signal(cm, "scroll", cm); - }); - on(d.scrollbarV, "scroll", function() { - setScrollTop(cm, d.scrollbarV.scrollTop); - }); - on(d.scrollbarH, "scroll", function() { - setScrollLeft(cm, d.scrollbarH.scrollLeft); - }); - - on(d.scroller, "mousewheel", function(e){onScrollWheel(cm, e);}); - on(d.scroller, "DOMMouseScroll", function(e){onScrollWheel(cm, e);}); - - function reFocus() { if (cm.view.focused) setTimeout(bind(focusInput, cm), 0); } - on(d.scrollbarH, "mousedown", reFocus); - on(d.scrollbarV, "mousedown", reFocus); - // Prevent wrapper from ever scrolling - on(d.wrapper, "scroll", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; }); - on(window, "resize", function resizeHandler() { - // Might be a text scaling operation, clear size caches. - d.cachedCharWidth = d.cachedTextHeight = null; - clearCaches(cm); - if (d.wrapper.parentNode) updateDisplay(cm, true); - else off(window, "resize", resizeHandler); - }); - - on(d.input, "keyup", operation(cm, function(e) { - if (cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return; - if (e_prop(e, "keyCode") == 16) cm.view.sel.shift = false; - })); - on(d.input, "input", bind(fastPoll, cm)); - on(d.input, "keydown", operation(cm, onKeyDown)); - on(d.input, "keypress", operation(cm, onKeyPress)); - on(d.input, "focus", bind(onFocus, cm)); - on(d.input, "blur", bind(onBlur, cm)); - - function drag_(e) { - if (cm.options.onDragEvent && cm.options.onDragEvent(cm, addStop(e))) return; - e_stop(e); - } - if (cm.options.dragDrop) { - on(d.scroller, "dragstart", function(e){onDragStart(cm, e);}); - on(d.scroller, "dragenter", drag_); - on(d.scroller, "dragover", drag_); - on(d.scroller, "drop", operation(cm, onDrop)); - } - on(d.scroller, "paste", function(){focusInput(cm); fastPoll(cm);}); - on(d.input, "paste", function() { - d.pasteIncoming = true; - fastPoll(cm); - }); - - function prepareCopy() { - if (d.inaccurateSelection) { - d.prevInput = ""; - d.inaccurateSelection = false; - d.input.value = cm.getSelection(); - selectInput(d.input); - } - } - on(d.input, "cut", prepareCopy); - on(d.input, "copy", prepareCopy); - - // Needed to handle Tab key in KHTML - if (khtml) on(d.sizer, "mouseup", function() { - if (document.activeElement == d.input) d.input.blur(); - focusInput(cm); - }); - } - - function mouseEventInWidget(display, e) { - for (var n = e_target(e); n != display.wrapper; n = n.parentNode) - if (/\bCodeMirror-(?:line)?widget\b/.test(n.className) || - n.parentNode == display.sizer && n != display.mover) return true; - } - - function posFromMouse(cm, e, liberal) { - var display = cm.display; - if (!liberal) { - var target = e_target(e); - if (target == display.scrollbarH || target == display.scrollbarH.firstChild || - target == display.scrollbarV || target == display.scrollbarV.firstChild || - target == display.scrollbarFiller) return null; - } - var x, y, space = display.lineSpace.getBoundingClientRect(); - // Fails unpredictably on IE[67] when mouse is dragged around quickly. - try { x = e.clientX; y = e.clientY; } catch (e) { return null; } - return coordsChar(cm, x - space.left, y - space.top); - } - - var lastClick, lastDoubleClick; - function onMouseDown(e) { - var cm = this, display = cm.display, view = cm.view, sel = view.sel, doc = view.doc; - sel.shift = e_prop(e, "shiftKey"); - - if (mouseEventInWidget(display, e)) { - if (!webkit) { - display.scroller.draggable = false; - setTimeout(function(){display.scroller.draggable = true;}, 100); - } - return; - } - if (clickInGutter(cm, e)) return; - var start = posFromMouse(cm, e); - - switch (e_button(e)) { - case 3: - if (gecko) onContextMenu.call(cm, cm, e); - return; - case 2: - if (start) extendSelection(cm, start); - setTimeout(bind(focusInput, cm), 20); - e_preventDefault(e); - return; - } - // For button 1, if it was clicked inside the editor - // (posFromMouse returning non-null), we have to adjust the - // selection. - if (!start) {if (e_target(e) == display.scroller) e_preventDefault(e); return;} - - if (!view.focused) onFocus(cm); - - var now = +new Date, type = "single"; - if (lastDoubleClick && lastDoubleClick.time > now - 400 && posEq(lastDoubleClick.pos, start)) { - type = "triple"; - e_preventDefault(e); - setTimeout(bind(focusInput, cm), 20); - selectLine(cm, start.line); - } else if (lastClick && lastClick.time > now - 400 && posEq(lastClick.pos, start)) { - type = "double"; - lastDoubleClick = {time: now, pos: start}; - e_preventDefault(e); - var word = findWordAt(getLine(doc, start.line).text, start); - extendSelection(cm, word.from, word.to); - } else { lastClick = {time: now, pos: start}; } - - var last = start; - if (cm.options.dragDrop && dragAndDrop && !isReadOnly(cm) && !posEq(sel.from, sel.to) && - !posLess(start, sel.from) && !posLess(sel.to, start) && type == "single") { - var dragEnd = operation(cm, function(e2) { - if (webkit) display.scroller.draggable = false; - view.draggingText = false; - off(document, "mouseup", dragEnd); - off(display.scroller, "drop", dragEnd); - if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) { - e_preventDefault(e2); - extendSelection(cm, start); - focusInput(cm); - } - }); - // Let the drag handler handle this. - if (webkit) display.scroller.draggable = true; - view.draggingText = dragEnd; - // IE's approach to draggable - if (display.scroller.dragDrop) display.scroller.dragDrop(); - on(document, "mouseup", dragEnd); - on(display.scroller, "drop", dragEnd); - return; - } - e_preventDefault(e); - if (type == "single") extendSelection(cm, clipPos(doc, start)); - - var startstart = sel.from, startend = sel.to; - - function doSelect(cur) { - if (type == "single") { - extendSelection(cm, clipPos(doc, start), cur); - return; - } - - startstart = clipPos(doc, startstart); - startend = clipPos(doc, startend); - if (type == "double") { - var word = findWordAt(getLine(doc, cur.line).text, cur); - if (posLess(cur, startstart)) extendSelection(cm, word.from, startend); - else extendSelection(cm, startstart, word.to); - } else if (type == "triple") { - if (posLess(cur, startstart)) extendSelection(cm, startend, clipPos(doc, {line: cur.line, ch: 0})); - else extendSelection(cm, startstart, clipPos(doc, {line: cur.line + 1, ch: 0})); - } - } - - var editorSize = display.wrapper.getBoundingClientRect(); - // Used to ensure timeout re-tries don't fire when another extend - // happened in the meantime (clearTimeout isn't reliable -- at - // least on Chrome, the timeouts still happen even when cleared, - // if the clear happens after their scheduled firing time). - var counter = 0; - - function extend(e) { - var curCount = ++counter; - var cur = posFromMouse(cm, e, true); - if (!cur) return; - if (!posEq(cur, last)) { - if (!view.focused) onFocus(cm); - last = cur; - doSelect(cur); - var visible = visibleLines(display, doc); - if (cur.line >= visible.to || cur.line < visible.from) - setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150); - } else { - var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0; - if (outside) setTimeout(operation(cm, function() { - if (counter != curCount) return; - display.scroller.scrollTop += outside; - extend(e); - }), 50); - } - } - - function done(e) { - counter = Infinity; - var cur = posFromMouse(cm, e); - if (cur) doSelect(cur); - e_preventDefault(e); - focusInput(cm); - off(document, "mousemove", move); - off(document, "mouseup", up); - } - - var move = operation(cm, function(e) { - if (!ie && !e_button(e)) done(e); - else extend(e); - }); - var up = operation(cm, done); - on(document, "mousemove", move); - on(document, "mouseup", up); - } - - function onDrop(e) { - var cm = this; - if (cm.options.onDragEvent && cm.options.onDragEvent(cm, addStop(e))) return; - e_preventDefault(e); - var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files; - if (!pos || isReadOnly(cm)) return; - if (files && files.length && window.FileReader && window.File) { - var n = files.length, text = Array(n), read = 0; - var loadFile = function(file, i) { - var reader = new FileReader; - reader.onload = function() { - text[i] = reader.result; - if (++read == n) { - pos = clipPos(cm.view.doc, pos); - operation(cm, function() { - var end = replaceRange(cm, text.join(""), pos, pos, "paste"); - setSelection(cm, pos, end); - })(); - } - }; - reader.readAsText(file); - }; - for (var i = 0; i < n; ++i) loadFile(files[i], i); - } else { - // Don't do a replace if the drop happened inside of the selected text. - if (cm.view.draggingText && !(posLess(pos, cm.view.sel.from) || posLess(cm.view.sel.to, pos))) { - cm.view.draggingText(e); - if (ie) setTimeout(bind(focusInput, cm), 50); - return; - } - try { - var text = e.dataTransfer.getData("Text"); - if (text) { - var curFrom = cm.view.sel.from, curTo = cm.view.sel.to; - setSelection(cm, pos, pos); - if (cm.view.draggingText) replaceRange(cm, "", curFrom, curTo, "paste"); - cm.replaceSelection(text, null, "paste"); - focusInput(cm); - onFocus(cm); - } - } - catch(e){} - } - } - - function clickInGutter(cm, e) { - var display = cm.display; - try { var mX = e.clientX, mY = e.clientY; } - catch(e) { return false; } - - if (mX >= Math.floor(display.gutters.getBoundingClientRect().right)) return false; - e_preventDefault(e); - if (!hasHandler(cm, "gutterClick")) return true; - - var lineBox = display.lineDiv.getBoundingClientRect(); - if (mY > lineBox.bottom) return true; - mY -= lineBox.top - display.viewOffset; - - for (var i = 0; i < cm.options.gutters.length; ++i) { - var g = display.gutters.childNodes[i]; - if (g && g.getBoundingClientRect().right >= mX) { - var line = lineAtHeight(cm.view.doc, mY); - var gutter = cm.options.gutters[i]; - signalLater(cm, cm, "gutterClick", cm, line, gutter, e); - break; - } - } - return true; - } - - function onDragStart(cm, e) { - var txt = cm.getSelection(); - e.dataTransfer.setData("Text", txt); - - // Use dummy image instead of default browsers image. - // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there. - if (e.dataTransfer.setDragImage && !safari) - e.dataTransfer.setDragImage(elt('img'), 0, 0); - } - - function setScrollTop(cm, val) { - if (Math.abs(cm.view.scrollTop - val) < 2) return; - cm.view.scrollTop = val; - if (!gecko) updateDisplay(cm, [], val); - if (cm.display.scroller.scrollTop != val) cm.display.scroller.scrollTop = val; - if (cm.display.scrollbarV.scrollTop != val) cm.display.scrollbarV.scrollTop = val; - if (gecko) updateDisplay(cm, []); - } - function setScrollLeft(cm, val, isScroller) { - if (isScroller ? val == cm.view.scrollLeft : Math.abs(cm.view.scrollLeft - val) < 2) return; - cm.view.scrollLeft = val; - alignHorizontally(cm); - if (cm.display.scroller.scrollLeft != val) cm.display.scroller.scrollLeft = val; - if (cm.display.scrollbarH.scrollLeft != val) cm.display.scrollbarH.scrollLeft = val; - } - - // Since the delta values reported on mouse wheel events are - // unstandardized between browsers and even browser versions, and - // generally horribly unpredictable, this code starts by measuring - // the scroll effect that the first few mouse wheel events have, - // and, from that, detects the way it can convert deltas to pixel - // offsets afterwards. - // - // The reason we want to know the amount a wheel event will scroll - // is that it gives us a chance to update the display before the - // actual scrolling happens, reducing flickering. - - var wheelSamples = 0, wheelDX, wheelDY, wheelStartX, wheelStartY, wheelPixelsPerUnit = null; - // Fill in a browser-detected starting value on browsers where we - // know one. These don't have to be accurate -- the result of them - // being wrong would just be a slight flicker on the first wheel - // scroll (if it is large enough). - if (ie) wheelPixelsPerUnit = -.53; - else if (gecko) wheelPixelsPerUnit = 15; - else if (chrome) wheelPixelsPerUnit = -.7; - else if (safari) wheelPixelsPerUnit = -1/3; - - function onScrollWheel(cm, e) { - var dx = e.wheelDeltaX, dy = e.wheelDeltaY; - if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) dx = e.detail; - if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) dy = e.detail; - else if (dy == null) dy = e.wheelDelta; - - // Webkit browsers on OS X abort momentum scrolls when the target - // of the scroll event is removed from the scrollable element. - // This hack (see related code in patchDisplay) makes sure the - // element is kept around. - if (dy && mac && webkit) { - for (var cur = e.target; cur != scroll; cur = cur.parentNode) { - if (cur.lineObj) { - cm.display.currentWheelTarget = cur; - break; - } - } - } - - var scroll = cm.display.scroller; - // On some browsers, horizontal scrolling will cause redraws to - // happen before the gutter has been realigned, causing it to - // wriggle around in a most unseemly way. When we have an - // estimated pixels/delta value, we just handle horizontal - // scrolling entirely here. It'll be slightly off from native, but - // better than glitching out. - if (dx && !gecko && !opera && wheelPixelsPerUnit != null) { - if (dy) - setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight))); - setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth))); - e_preventDefault(e); - wheelStartX = null; // Abort measurement, if in progress - return; - } - - if (dy && wheelPixelsPerUnit != null) { - var pixels = dy * wheelPixelsPerUnit; - var top = cm.view.scrollTop, bot = top + cm.display.wrapper.clientHeight; - if (pixels < 0) top = Math.max(0, top + pixels - 50); - else bot = Math.min(cm.view.doc.height, bot + pixels + 50); - updateDisplay(cm, [], {top: top, bottom: bot}); - } - - if (wheelSamples < 20) { - if (wheelStartX == null) { - wheelStartX = scroll.scrollLeft; wheelStartY = scroll.scrollTop; - wheelDX = dx; wheelDY = dy; - setTimeout(function() { - if (wheelStartX == null) return; - var movedX = scroll.scrollLeft - wheelStartX; - var movedY = scroll.scrollTop - wheelStartY; - var sample = (movedY && wheelDY && movedY / wheelDY) || - (movedX && wheelDX && movedX / wheelDX); - wheelStartX = wheelStartY = null; - if (!sample) return; - wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1); - ++wheelSamples; - }, 200); - } else { - wheelDX += dx; wheelDY += dy; - } - } - } - - function doHandleBinding(cm, bound, dropShift) { - if (typeof bound == "string") { - bound = commands[bound]; - if (!bound) return false; - } - // Ensure previous input has been read, so that the handler sees a - // consistent view of the document - if (cm.display.pollingFast && readInput(cm)) cm.display.pollingFast = false; - var view = cm.view, prevShift = view.sel.shift; - try { - if (isReadOnly(cm)) view.suppressEdits = true; - if (dropShift) view.sel.shift = false; - bound(cm); - } catch(e) { - if (e != Pass) throw e; - return false; - } finally { - view.sel.shift = prevShift; - view.suppressEdits = false; - } - return true; - } - - function allKeyMaps(cm) { - var maps = cm.view.keyMaps.slice(0); - maps.push(cm.options.keyMap); - if (cm.options.extraKeys) maps.unshift(cm.options.extraKeys); - return maps; - } - - var maybeTransition; - function handleKeyBinding(cm, e) { - // Handle auto keymap transitions - var startMap = getKeyMap(cm.options.keyMap), next = startMap.auto; - clearTimeout(maybeTransition); - if (next && !isModifierKey(e)) maybeTransition = setTimeout(function() { - if (getKeyMap(cm.options.keyMap) == startMap) - cm.options.keyMap = (next.call ? next.call(null, cm) : next); - }, 50); - - var name = keyNames[e_prop(e, "keyCode")], handled = false; - var flipCtrlCmd = mac && (opera || qtwebkit); - if (name == null || e.altGraphKey) return false; - if (e_prop(e, "altKey")) name = "Alt-" + name; - if (e_prop(e, flipCtrlCmd ? "metaKey" : "ctrlKey")) name = "Ctrl-" + name; - if (e_prop(e, flipCtrlCmd ? "ctrlKey" : "metaKey")) name = "Cmd-" + name; - - var stopped = false; - function stop() { stopped = true; } - var keymaps = allKeyMaps(cm); - - if (e_prop(e, "shiftKey")) { - handled = lookupKey("Shift-" + name, keymaps, - function(b) {return doHandleBinding(cm, b, true);}, stop) - || lookupKey(name, keymaps, function(b) { - if (typeof b == "string" && /^go[A-Z]/.test(b)) return doHandleBinding(cm, b); - }, stop); - } else { - handled = lookupKey(name, keymaps, - function(b) { return doHandleBinding(cm, b); }, stop); - } - if (stopped) handled = false; - if (handled) { - e_preventDefault(e); - restartBlink(cm); - if (ie_lt9) { e.oldKeyCode = e.keyCode; e.keyCode = 0; } - } - return handled; - } - - function handleCharBinding(cm, e, ch) { - var handled = lookupKey("'" + ch + "'", allKeyMaps(cm), - function(b) { return doHandleBinding(cm, b, true); }); - if (handled) { - e_preventDefault(e); - restartBlink(cm); - } - return handled; - } - - var lastStoppedKey = null; - function onKeyDown(e) { - var cm = this; - if (!cm.view.focused) onFocus(cm); - if (ie && e.keyCode == 27) { e.returnValue = false; } - if (cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return; - var code = e_prop(e, "keyCode"); - // IE does strange things with escape. - cm.view.sel.shift = code == 16 || e_prop(e, "shiftKey"); - // First give onKeyEvent option a chance to handle this. - var handled = handleKeyBinding(cm, e); - if (opera) { - lastStoppedKey = handled ? code : null; - // Opera has no cut event... we try to at least catch the key combo - if (!handled && code == 88 && !hasCopyEvent && e_prop(e, mac ? "metaKey" : "ctrlKey")) - cm.replaceSelection(""); - } - } - - function onKeyPress(e) { - var cm = this; - if (cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return; - var keyCode = e_prop(e, "keyCode"), charCode = e_prop(e, "charCode"); - if (opera && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return;} - if (((opera && (!e.which || e.which < 10)) || khtml) && handleKeyBinding(cm, e)) return; - var ch = String.fromCharCode(charCode == null ? keyCode : charCode); - if (this.options.electricChars && this.view.mode.electricChars && - this.options.smartIndent && !isReadOnly(this) && - this.view.mode.electricChars.indexOf(ch) > -1) - setTimeout(operation(cm, function() {indentLine(cm, cm.view.sel.to.line, "smart");}), 75); - if (handleCharBinding(cm, e, ch)) return; - fastPoll(cm); - } - - function onFocus(cm) { - if (cm.options.readOnly == "nocursor") return; - if (!cm.view.focused) { - signal(cm, "focus", cm); - cm.view.focused = true; - if (cm.display.scroller.className.search(/\bCodeMirror-focused\b/) == -1) - cm.display.scroller.className += " CodeMirror-focused"; - resetInput(cm, true); - } - slowPoll(cm); - restartBlink(cm); - } - function onBlur(cm) { - if (cm.view.focused) { - signal(cm, "blur", cm); - cm.view.focused = false; - cm.display.scroller.className = cm.display.scroller.className.replace(" CodeMirror-focused", ""); - } - clearInterval(cm.display.blinker); - setTimeout(function() {if (!cm.view.focused) cm.view.sel.shift = false;}, 150); - } - - var detectingSelectAll; - function onContextMenu(cm, e) { - var display = cm.display, sel = cm.view.sel; - var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop; - if (!pos || opera) return; // Opera is difficult. - if (posEq(sel.from, sel.to) || posLess(pos, sel.from) || !posLess(pos, sel.to)) - operation(cm, setSelection)(cm, pos, pos); - - var oldCSS = display.input.style.cssText; - display.inputDiv.style.position = "absolute"; - display.input.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (e.clientY - 5) + - "px; left: " + (e.clientX - 5) + "px; z-index: 1000; background: white; outline: none;" + - "border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"; - focusInput(cm); - resetInput(cm, true); - // Adds "Select all" to context menu in FF - if (posEq(sel.from, sel.to)) display.input.value = display.prevInput = " "; - - function rehide() { - display.inputDiv.style.position = "relative"; - display.input.style.cssText = oldCSS; - if (ie_lt9) display.scrollbarV.scrollTop = display.scroller.scrollTop = scrollPos; - slowPoll(cm); - - // Try to detect the user choosing select-all - if (display.input.selectionStart != null) { - clearTimeout(detectingSelectAll); - var extval = display.input.value = " " + (posEq(sel.from, sel.to) ? "" : display.input.value), i = 0; - display.prevInput = " "; - display.input.selectionStart = 1; display.input.selectionEnd = extval.length; - detectingSelectAll = setTimeout(function poll(){ - if (display.prevInput == " " && display.input.selectionStart == 0) - operation(cm, commands.selectAll)(cm); - else if (i++ < 10) detectingSelectAll = setTimeout(poll, 500); - else resetInput(cm); - }, 200); - } - } - - if (gecko) { - e_stop(e); - on(window, "mouseup", function mouseup() { - off(window, "mouseup", mouseup); - setTimeout(rehide, 20); - }); - } else { - setTimeout(rehide, 50); - } - } - - // UPDATING - - // Replace the range from from to to by the strings in newText. - // Afterwards, set the selection to selFrom, selTo. - function updateDoc(cm, from, to, newText, selUpdate, origin) { - // Possibly split or suppress the update based on the presence - // of read-only spans in its range. - var split = sawReadOnlySpans && - removeReadOnlyRanges(cm.view.doc, from, to); - if (split) { - for (var i = split.length - 1; i >= 1; --i) - updateDocInner(cm, split[i].from, split[i].to, [""], origin); - if (split.length) - return updateDocInner(cm, split[0].from, split[0].to, newText, selUpdate, origin); - } else { - return updateDocInner(cm, from, to, newText, selUpdate, origin); - } - } - - function updateDocInner(cm, from, to, newText, selUpdate, origin) { - if (cm.view.suppressEdits) return; - - var view = cm.view, doc = view.doc, old = []; - doc.iter(from.line, to.line + 1, function(line) { - old.push(newHL(line.text, line.markedSpans)); - }); - var startSelFrom = view.sel.from, startSelTo = view.sel.to; - var lines = updateMarkedSpans(hlSpans(old[0]), hlSpans(lst(old)), from.ch, to.ch, newText); - var retval = updateDocNoUndo(cm, from, to, lines, selUpdate, origin); - if (view.history) addChange(cm, from.line, newText.length, old, origin, - startSelFrom, startSelTo, view.sel.from, view.sel.to); - return retval; - } - - function unredoHelper(cm, type) { - var doc = cm.view.doc, hist = cm.view.history; - var set = (type == "undo" ? hist.done : hist.undone).pop(); - if (!set) return; - var anti = {events: [], fromBefore: set.fromAfter, toBefore: set.toAfter, - fromAfter: set.fromBefore, toAfter: set.toBefore}; - for (var i = set.events.length - 1; i >= 0; i -= 1) { - hist.dirtyCounter += type == "undo" ? -1 : 1; - var change = set.events[i]; - var replaced = [], end = change.start + change.added; - doc.iter(change.start, end, function(line) { replaced.push(newHL(line.text, line.markedSpans)); }); - anti.events.push({start: change.start, added: change.old.length, old: replaced}); - var selPos = i ? null : {from: set.fromBefore, to: set.toBefore}; - updateDocNoUndo(cm, {line: change.start, ch: 0}, {line: end - 1, ch: getLine(doc, end-1).text.length}, - change.old, selPos, type); - } - (type == "undo" ? hist.undone : hist.done).push(anti); - } - - function updateDocNoUndo(cm, from, to, lines, selUpdate, origin) { - var view = cm.view, doc = view.doc, display = cm.display; - if (view.suppressEdits) return; - - var nlines = to.line - from.line, firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line); - var recomputeMaxLength = false, checkWidthStart = from.line; - if (!cm.options.lineWrapping) { - checkWidthStart = lineNo(visualLine(doc, firstLine)); - doc.iter(checkWidthStart, to.line + 1, function(line) { - if (lineLength(doc, line) == view.maxLineLength) { - recomputeMaxLength = true; - return true; - } - }); - } - - var lastHL = lst(lines), th = textHeight(display); - - // First adjust the line structure - if (from.ch == 0 && to.ch == 0 && hlText(lastHL) == "") { - // This is a whole-line replace. Treated specially to make - // sure line objects move the way they are supposed to. - var added = []; - for (var i = 0, e = lines.length - 1; i < e; ++i) - added.push(makeLine(hlText(lines[i]), hlSpans(lines[i]), th)); - updateLine(cm, lastLine, lastLine.text, hlSpans(lastHL)); - if (nlines) doc.remove(from.line, nlines, cm); - if (added.length) doc.insert(from.line, added); - } else if (firstLine == lastLine) { - if (lines.length == 1) { - updateLine(cm, firstLine, firstLine.text.slice(0, from.ch) + hlText(lines[0]) + - firstLine.text.slice(to.ch), hlSpans(lines[0])); - } else { - for (var added = [], i = 1, e = lines.length - 1; i < e; ++i) - added.push(makeLine(hlText(lines[i]), hlSpans(lines[i]), th)); - added.push(makeLine(hlText(lastHL) + firstLine.text.slice(to.ch), hlSpans(lastHL), th)); - updateLine(cm, firstLine, firstLine.text.slice(0, from.ch) + hlText(lines[0]), hlSpans(lines[0])); - doc.insert(from.line + 1, added); - } - } else if (lines.length == 1) { - updateLine(cm, firstLine, firstLine.text.slice(0, from.ch) + hlText(lines[0]) + - lastLine.text.slice(to.ch), hlSpans(lines[0])); - doc.remove(from.line + 1, nlines, cm); - } else { - var added = []; - updateLine(cm, firstLine, firstLine.text.slice(0, from.ch) + hlText(lines[0]), hlSpans(lines[0])); - updateLine(cm, lastLine, hlText(lastHL) + lastLine.text.slice(to.ch), hlSpans(lastHL)); - for (var i = 1, e = lines.length - 1; i < e; ++i) - added.push(makeLine(hlText(lines[i]), hlSpans(lines[i]), th)); - if (nlines > 1) doc.remove(from.line + 1, nlines - 1, cm); - doc.insert(from.line + 1, added); - } - - if (cm.options.lineWrapping) { - var perLine = Math.max(5, display.scroller.clientWidth / charWidth(display) - 3); - doc.iter(from.line, from.line + lines.length, function(line) { - if (line.height == 0) return; - var guess = (Math.ceil(line.text.length / perLine) || 1) * th; - if (guess != line.height) updateLineHeight(line, guess); - }); - } else { - doc.iter(checkWidthStart, from.line + lines.length, function(line) { - var len = lineLength(doc, line); - if (len > view.maxLineLength) { - view.maxLine = line; - view.maxLineLength = len; - view.maxLineChanged = true; - recomputeMaxLength = false; - } - }); - if (recomputeMaxLength) cm.curOp.updateMaxLine = true; - } - - // Adjust frontier, schedule worker - view.frontier = Math.min(view.frontier, from.line); - startWorker(cm, 400); - - var lendiff = lines.length - nlines - 1; - // Remember that these lines changed, for updating the display - regChange(cm, from.line, to.line + 1, lendiff); - if (hasHandler(cm, "change")) { - // Normalize lines to contain only strings, since that's what - // the change event handler expects - for (var i = 0; i < lines.length; ++i) - if (typeof lines[i] != "string") lines[i] = lines[i].text; - var changeObj = {from: from, to: to, text: lines, origin: origin}; - if (cm.curOp.textChanged) { - for (var cur = cm.curOp.textChanged; cur.next; cur = cur.next) {} - cur.next = changeObj; - } else cm.curOp.textChanged = changeObj; - } - - // Update the selection - var newSelFrom, newSelTo, end = {line: from.line + lines.length - 1, - ch: hlText(lastHL).length + (lines.length == 1 ? from.ch : 0)}; - if (selUpdate && typeof selUpdate != "string") { - if (selUpdate.from) { newSelFrom = selUpdate.from; newSelTo = selUpdate.to; } - else newSelFrom = newSelTo = selUpdate; - } else if (selUpdate == "end") { - newSelFrom = newSelTo = end; - } else if (selUpdate == "start") { - newSelFrom = newSelTo = from; - } else if (selUpdate == "around") { - newSelFrom = from; newSelTo = end; - } else { - var adjustPos = function(pos) { - if (posLess(pos, from)) return pos; - if (!posLess(to, pos)) return end; - var line = pos.line + lendiff; - var ch = pos.ch; - if (pos.line == to.line) - ch += hlText(lastHL).length - (to.ch - (to.line == from.line ? from.ch : 0)); - return {line: line, ch: ch}; - }; - newSelFrom = adjustPos(view.sel.from); - newSelTo = adjustPos(view.sel.to); - } - setSelection(cm, newSelFrom, newSelTo, null, true); - return end; - } - - function replaceRange(cm, code, from, to, origin) { - if (!to) to = from; - if (posLess(to, from)) { var tmp = to; to = from; from = tmp; } - return updateDoc(cm, from, to, splitLines(code), null, origin); - } - - // SELECTION - - function posEq(a, b) {return a.line == b.line && a.ch == b.ch;} - function posLess(a, b) {return a.line < b.line || (a.line == b.line && a.ch < b.ch);} - function copyPos(x) {return {line: x.line, ch: x.ch};} - - function clipLine(doc, n) {return Math.max(0, Math.min(n, doc.size-1));} - function clipPos(doc, pos) { - if (pos.line < 0) return {line: 0, ch: 0}; - if (pos.line >= doc.size) return {line: doc.size-1, ch: getLine(doc, doc.size-1).text.length}; - var ch = pos.ch, linelen = getLine(doc, pos.line).text.length; - if (ch == null || ch > linelen) return {line: pos.line, ch: linelen}; - else if (ch < 0) return {line: pos.line, ch: 0}; - else return pos; - } - function isLine(doc, l) {return l >= 0 && l < doc.size;} - - // If shift is held, this will move the selection anchor. Otherwise, - // it'll set the whole selection. - function extendSelection(cm, pos, other, bias) { - var sel = cm.view.sel; - if (sel.shift || sel.extend) { - var anchor = sel.anchor; - if (other) { - var posBefore = posLess(pos, anchor); - if (posBefore != posLess(other, anchor)) { - anchor = pos; - pos = other; - } else if (posBefore != posLess(pos, other)) { - pos = other; - } - } - setSelection(cm, anchor, pos, bias); - } else { - setSelection(cm, pos, other || pos, bias); - } - cm.curOp.userSelChange = true; - } - - // Update the selection. Last two args are only used by - // updateDoc, since they have to be expressed in the line - // numbers before the update. - function setSelection(cm, anchor, head, bias, checkAtomic) { - cm.view.goalColumn = null; - var sel = cm.view.sel; - // Skip over atomic spans. - if (checkAtomic || !posEq(anchor, sel.anchor)) - anchor = skipAtomic(cm, anchor, bias, checkAtomic != "push"); - if (checkAtomic || !posEq(head, sel.head)) - head = skipAtomic(cm, head, bias, checkAtomic != "push"); - - if (posEq(sel.anchor, anchor) && posEq(sel.head, head)) return; - - sel.anchor = anchor; sel.head = head; - var inv = posLess(head, anchor); - sel.from = inv ? head : anchor; - sel.to = inv ? anchor : head; - - cm.curOp.updateInput = true; - cm.curOp.selectionChanged = true; - } - - function reCheckSelection(cm) { - setSelection(cm, cm.view.sel.from, cm.view.sel.to, null, "push"); - } - - function skipAtomic(cm, pos, bias, mayClear) { - var doc = cm.view.doc, flipped = false, curPos = pos; - var dir = bias || 1; - cm.view.cantEdit = false; - search: for (;;) { - var line = getLine(doc, curPos.line), toClear; - if (line.markedSpans) { - for (var i = 0; i < line.markedSpans.length; ++i) { - var sp = line.markedSpans[i], m = sp.marker; - if ((sp.from == null || (m.inclusiveLeft ? sp.from <= curPos.ch : sp.from < curPos.ch)) && - (sp.to == null || (m.inclusiveRight ? sp.to >= curPos.ch : sp.to > curPos.ch))) { - if (mayClear && m.clearOnEnter) { - (toClear || (toClear = [])).push(m); - continue; - } else if (!m.atomic) continue; - var newPos = m.find()[dir < 0 ? "from" : "to"]; - if (posEq(newPos, curPos)) { - newPos.ch += dir; - if (newPos.ch < 0) { - if (newPos.line) newPos = clipPos(doc, {line: newPos.line - 1}); - else newPos = null; - } else if (newPos.ch > line.text.length) { - if (newPos.line < doc.size - 1) newPos = {line: newPos.line + 1, ch: 0}; - else newPos = null; - } - if (!newPos) { - if (flipped) { - // Driven in a corner -- no valid cursor position found at all - // -- try again *with* clearing, if we didn't already - if (!mayClear) return skipAtomic(cm, pos, bias, true); - // Otherwise, turn off editing until further notice, and return the start of the doc - cm.view.cantEdit = true; - return {line: 0, ch: 0}; - } - flipped = true; newPos = pos; dir = -dir; - } - } - curPos = newPos; - continue search; - } - } - if (toClear) for (var i = 0; i < toClear.length; ++i) toClear[i].clear(); - } - return curPos; - } - } - - // SCROLLING - - function scrollCursorIntoView(cm) { - var view = cm.view; - var coords = scrollPosIntoView(cm, view.sel.head); - if (!view.focused) return; - var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null; - if (coords.top + box.top < 0) doScroll = true; - else if (coords.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) doScroll = false; - if (doScroll != null && !phantom) { - var hidden = display.cursor.style.display == "none"; - if (hidden) { - display.cursor.style.display = ""; - display.cursor.style.left = coords.left + "px"; - display.cursor.style.top = (coords.top - display.viewOffset) + "px"; - } - display.cursor.scrollIntoView(doScroll); - if (hidden) display.cursor.style.display = "none"; - } - } - - function scrollPosIntoView(cm, pos) { - for (;;) { - var changed = false, coords = cursorCoords(cm, pos); - var scrollPos = calculateScrollPos(cm, coords.left, coords.top, coords.left, coords.bottom); - var startTop = cm.view.scrollTop, startLeft = cm.view.scrollLeft; - if (scrollPos.scrollTop != null) { - setScrollTop(cm, scrollPos.scrollTop); - if (Math.abs(cm.view.scrollTop - startTop) > 1) changed = true; - } - if (scrollPos.scrollLeft != null) { - setScrollLeft(cm, scrollPos.scrollLeft); - if (Math.abs(cm.view.scrollLeft - startLeft) > 1) changed = true; - } - if (!changed) return coords; - } - } - - function scrollIntoView(cm, x1, y1, x2, y2) { - var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2); - if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop); - if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft); - } - - function calculateScrollPos(cm, x1, y1, x2, y2) { - var display = cm.display, pt = paddingTop(display); - y1 += pt; y2 += pt; - var screen = display.scroller.clientHeight - scrollerCutOff, screentop = display.scroller.scrollTop, result = {}; - var docBottom = cm.view.doc.height + 2 * pt; - var atTop = y1 < pt + 10, atBottom = y2 + pt > docBottom - 10; - if (y1 < screentop) result.scrollTop = atTop ? 0 : Math.max(0, y1); - else if (y2 > screentop + screen) result.scrollTop = (atBottom ? docBottom : y2) - screen; - - var screenw = display.scroller.clientWidth - scrollerCutOff, screenleft = display.scroller.scrollLeft; - x1 += display.gutters.offsetWidth; x2 += display.gutters.offsetWidth; - var gutterw = display.gutters.offsetWidth; - var atLeft = x1 < gutterw + 10; - if (x1 < screenleft + gutterw || atLeft) { - if (atLeft) x1 = 0; - result.scrollLeft = Math.max(0, x1 - 10 - gutterw); - } else if (x2 > screenw + screenleft - 3) { - result.scrollLeft = x2 + 10 - screenw; - } - return result; - } - - // API UTILITIES - - function indentLine(cm, n, how, aggressive) { - var doc = cm.view.doc; - if (!how) how = "add"; - if (how == "smart") { - if (!cm.view.mode.indent) how = "prev"; - else var state = getStateBefore(cm, n); - } - - var tabSize = cm.options.tabSize; - var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize); - var curSpaceString = line.text.match(/^\s*/)[0], indentation; - if (how == "smart") { - indentation = cm.view.mode.indent(state, line.text.slice(curSpaceString.length), line.text); - if (indentation == Pass) { - if (!aggressive) return; - how = "prev"; - } - } - if (how == "prev") { - if (n) indentation = countColumn(getLine(doc, n-1).text, null, tabSize); - else indentation = 0; - } - else if (how == "add") indentation = curSpace + cm.options.indentUnit; - else if (how == "subtract") indentation = curSpace - cm.options.indentUnit; - indentation = Math.max(0, indentation); - - var indentString = "", pos = 0; - if (cm.options.indentWithTabs) - for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t";} - if (pos < indentation) indentString += spaceStr(indentation - pos); - - if (indentString != curSpaceString) - replaceRange(cm, indentString, {line: n, ch: 0}, {line: n, ch: curSpaceString.length}, "input"); - line.stateAfter = null; - } - - function changeLine(cm, handle, op) { - var no = handle, line = handle, doc = cm.view.doc; - if (typeof handle == "number") line = getLine(doc, clipLine(doc, handle)); - else no = lineNo(handle); - if (no == null) return null; - if (op(line, no)) regChange(cm, no, no + 1); - else return null; - return line; - } - - function findPosH(cm, dir, unit, visually) { - var doc = cm.view.doc, end = cm.view.sel.head, line = end.line, ch = end.ch; - var lineObj = getLine(doc, line); - function findNextLine() { - var l = line + dir; - if (l < 0 || l == doc.size) return false; - line = l; - return lineObj = getLine(doc, l); - } - function moveOnce(boundToLine) { - var next = (visually ? moveVisually : moveLogically)(lineObj, ch, dir, true); - if (next == null) { - if (!boundToLine && findNextLine()) { - if (visually) ch = (dir < 0 ? lineRight : lineLeft)(lineObj); - else ch = dir < 0 ? lineObj.text.length : 0; - } else return false; - } else ch = next; - return true; - } - if (unit == "char") moveOnce(); - else if (unit == "column") moveOnce(true); - else if (unit == "word") { - var sawWord = false; - for (;;) { - if (dir < 0) if (!moveOnce()) break; - if (isWordChar(lineObj.text.charAt(ch))) sawWord = true; - else if (sawWord) {if (dir < 0) {dir = 1; moveOnce();} break;} - if (dir > 0) if (!moveOnce()) break; - } - } - return skipAtomic(cm, {line: line, ch: ch}, dir, true); - } - - function findWordAt(line, pos) { - var start = pos.ch, end = pos.ch; - if (line) { - if (pos.after === false || end == line.length) --start; else ++end; - var startChar = line.charAt(start); - var check = isWordChar(startChar) ? isWordChar : - /\s/.test(startChar) ? function(ch) {return /\s/.test(ch);} : - function(ch) {return !/\s/.test(ch) && !isWordChar(ch);}; - while (start > 0 && check(line.charAt(start - 1))) --start; - while (end < line.length && check(line.charAt(end))) ++end; - } - return {from: {line: pos.line, ch: start}, to: {line: pos.line, ch: end}}; - } - - function selectLine(cm, line) { - extendSelection(cm, {line: line, ch: 0}, clipPos(cm.view.doc, {line: line + 1, ch: 0})); - } - - // PROTOTYPE - - // The publicly visible API. Note that operation(null, f) means - // 'wrap f in an operation, performed on its `this` parameter' - - CodeMirror.prototype = { - getValue: function(lineSep) { - var text = [], doc = this.view.doc; - doc.iter(0, doc.size, function(line) { text.push(line.text); }); - return text.join(lineSep || "\n"); - }, - - setValue: operation(null, function(code) { - var doc = this.view.doc, top = {line: 0, ch: 0}, lastLen = getLine(doc, doc.size-1).text.length; - updateDocInner(this, top, {line: doc.size - 1, ch: lastLen}, splitLines(code), top, top, "setValue"); - }), - - getSelection: function(lineSep) { return this.getRange(this.view.sel.from, this.view.sel.to, lineSep); }, - - replaceSelection: operation(null, function(code, collapse, origin) { - var sel = this.view.sel; - updateDoc(this, sel.from, sel.to, splitLines(code), collapse || "around", origin); - }), - - focus: function(){window.focus(); focusInput(this); onFocus(this); fastPoll(this);}, - - setOption: function(option, value) { - var options = this.options, old = options[option]; - if (options[option] == value && option != "mode") return; - options[option] = value; - if (optionHandlers.hasOwnProperty(option)) - operation(this, optionHandlers[option])(this, value, old); - }, - - getOption: function(option) {return this.options[option];}, - - getMode: function() {return this.view.mode;}, - - addKeyMap: function(map) { - this.view.keyMaps.push(map); - }, - - removeKeyMap: function(map) { - var maps = this.view.keyMaps; - for (var i = 0; i < maps.length; ++i) - if ((typeof map == "string" ? maps[i].name : maps[i]) == map) { - maps.splice(i, 1); - return true; - } - }, - - undo: operation(null, function() {unredoHelper(this, "undo");}), - redo: operation(null, function() {unredoHelper(this, "redo");}), - - indentLine: operation(null, function(n, dir, aggressive) { - if (typeof dir != "string") { - if (dir == null) dir = this.options.smartIndent ? "smart" : "prev"; - else dir = dir ? "add" : "subtract"; - } - if (isLine(this.view.doc, n)) indentLine(this, n, dir, aggressive); - }), - - indentSelection: operation(null, function(how) { - var sel = this.view.sel; - if (posEq(sel.from, sel.to)) return indentLine(this, sel.from.line, how); - var e = sel.to.line - (sel.to.ch ? 0 : 1); - for (var i = sel.from.line; i <= e; ++i) indentLine(this, i, how); - }), - - historySize: function() { - var hist = this.view.history; - return {undo: hist.done.length, redo: hist.undone.length}; - }, - - clearHistory: function() {this.view.history = makeHistory();}, - - markClean: function() { - this.view.history.dirtyCounter = 0; - this.view.history.lastOp = this.view.history.lastOrigin = null; - }, - - isClean: function () {return this.view.history.dirtyCounter == 0;}, - - getHistory: function() { - var hist = this.view.history; - function cp(arr) { - for (var i = 0, nw = [], nwelt; i < arr.length; ++i) { - var set = arr[i]; - nw.push({events: nwelt = [], fromBefore: set.fromBefore, toBefore: set.toBefore, - fromAfter: set.fromAfter, toAfter: set.toAfter}); - for (var j = 0, elt = set.events; j < elt.length; ++j) { - var old = [], cur = elt[j]; - nwelt.push({start: cur.start, added: cur.added, old: old}); - for (var k = 0; k < cur.old.length; ++k) old.push(hlText(cur.old[k])); - } - } - return nw; - } - return {done: cp(hist.done), undone: cp(hist.undone)}; - }, - - setHistory: function(histData) { - var hist = this.view.history = makeHistory(); - hist.done = histData.done; - hist.undone = histData.undone; - }, - - // Fetch the parser token for a given character. Useful for hacks - // that want to inspect the mode state (say, for completion). - getTokenAt: function(pos) { - var doc = this.view.doc; - pos = clipPos(doc, pos); - var state = getStateBefore(this, pos.line), mode = this.view.mode; - var line = getLine(doc, pos.line); - var stream = new StringStream(line.text, this.options.tabSize); - while (stream.pos < pos.ch && !stream.eol()) { - stream.start = stream.pos; - var style = mode.token(stream, state); - } - return {start: stream.start, - end: stream.pos, - string: stream.current(), - className: style || null, // Deprecated, use 'type' instead - type: style || null, - state: state}; - }, - - getStateAfter: function(line) { - var doc = this.view.doc; - line = clipLine(doc, line == null ? doc.size - 1: line); - return getStateBefore(this, line + 1); - }, - - cursorCoords: function(start, mode) { - var pos, sel = this.view.sel; - if (start == null) pos = sel.head; - else if (typeof start == "object") pos = clipPos(this.view.doc, start); - else pos = start ? sel.from : sel.to; - return cursorCoords(this, pos, mode || "page"); - }, - - charCoords: function(pos, mode) { - return charCoords(this, clipPos(this.view.doc, pos), mode || "page"); - }, - - coordsChar: function(coords) { - var off = this.display.lineSpace.getBoundingClientRect(); - return coordsChar(this, coords.left - off.left, coords.top - off.top); - }, - - defaultTextHeight: function() { return textHeight(this.display); }, - - markText: operation(null, function(from, to, options) { - return markText(this, clipPos(this.view.doc, from), clipPos(this.view.doc, to), - options, "range"); - }), - - setBookmark: operation(null, function(pos, widget) { - pos = clipPos(this.view.doc, pos); - return markText(this, pos, pos, widget ? {replacedWith: widget} : {}, "bookmark"); - }), - - findMarksAt: function(pos) { - var doc = this.view.doc; - pos = clipPos(doc, pos); - var markers = [], spans = getLine(doc, pos.line).markedSpans; - if (spans) for (var i = 0; i < spans.length; ++i) { - var span = spans[i]; - if ((span.from == null || span.from <= pos.ch) && - (span.to == null || span.to >= pos.ch)) - markers.push(span.marker); - } - return markers; - }, - - setGutterMarker: operation(null, function(line, gutterID, value) { - return changeLine(this, line, function(line) { - var markers = line.gutterMarkers || (line.gutterMarkers = {}); - markers[gutterID] = value; - if (!value && isEmpty(markers)) line.gutterMarkers = null; - return true; - }); - }), - - clearGutter: operation(null, function(gutterID) { - var i = 0, cm = this, doc = cm.view.doc; - doc.iter(0, doc.size, function(line) { - if (line.gutterMarkers && line.gutterMarkers[gutterID]) { - line.gutterMarkers[gutterID] = null; - regChange(cm, i, i + 1); - if (isEmpty(line.gutterMarkers)) line.gutterMarkers = null; - } - ++i; - }); - }), - - addLineClass: operation(null, function(handle, where, cls) { - return changeLine(this, handle, function(line) { - var prop = where == "text" ? "textClass" : where == "background" ? "bgClass" : "wrapClass"; - if (!line[prop]) line[prop] = cls; - else if (new RegExp("\\b" + cls + "\\b").test(line[prop])) return false; - else line[prop] += " " + cls; - return true; - }); - }), - - removeLineClass: operation(null, function(handle, where, cls) { - return changeLine(this, handle, function(line) { - var prop = where == "text" ? "textClass" : where == "background" ? "bgClass" : "wrapClass"; - var cur = line[prop]; - if (!cur) return false; - else if (cls == null) line[prop] = null; - else { - var upd = cur.replace(new RegExp("^" + cls + "\\b\\s*|\\s*\\b" + cls + "\\b"), ""); - if (upd == cur) return false; - line[prop] = upd || null; - } - return true; - }); - }), - - addLineWidget: operation(null, function(handle, node, options) { - var widget = options || {}; - widget.node = node; - if (widget.noHScroll) this.display.alignWidgets = true; - changeLine(this, handle, function(line) { - (line.widgets || (line.widgets = [])).push(widget); - widget.line = line; - return true; - }); - return widget; - }), - - removeLineWidget: operation(null, function(widget) { - var ws = widget.line.widgets, no = lineNo(widget.line); - if (no == null) return; - for (var i = 0; i < ws.length; ++i) if (ws[i] == widget) ws.splice(i--, 1); - regChange(this, no, no + 1); - }), - - lineInfo: function(line) { - if (typeof line == "number") { - if (!isLine(this.view.doc, line)) return null; - var n = line; - line = getLine(this.view.doc, line); - if (!line) return null; - } else { - var n = lineNo(line); - if (n == null) return null; - } - return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers, - textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass, - widgets: line.widgets}; - }, - - getViewport: function() { return {from: this.display.showingFrom, to: this.display.showingTo};}, - - addWidget: function(pos, node, scroll, vert, horiz) { - var display = this.display; - pos = cursorCoords(this, clipPos(this.view.doc, pos)); - var top = pos.top, left = pos.left; - node.style.position = "absolute"; - display.sizer.appendChild(node); - if (vert == "over") top = pos.top; - else if (vert == "near") { - var vspace = Math.max(display.wrapper.clientHeight, this.view.doc.height), - hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth); - if (pos.bottom + node.offsetHeight > vspace && pos.top > node.offsetHeight) - top = pos.top - node.offsetHeight; - if (left + node.offsetWidth > hspace) - left = hspace - node.offsetWidth; - } - node.style.top = (top + paddingTop(display)) + "px"; - node.style.left = node.style.right = ""; - if (horiz == "right") { - left = display.sizer.clientWidth - node.offsetWidth; - node.style.right = "0px"; - } else { - if (horiz == "left") left = 0; - else if (horiz == "middle") left = (display.sizer.clientWidth - node.offsetWidth) / 2; - node.style.left = left + "px"; - } - if (scroll) - scrollIntoView(this, left, top, left + node.offsetWidth, top + node.offsetHeight); - }, - - lineCount: function() {return this.view.doc.size;}, - - clipPos: function(pos) {return clipPos(this.view.doc, pos);}, - - getCursor: function(start) { - var sel = this.view.sel, pos; - if (start == null || start == "head") pos = sel.head; - else if (start == "anchor") pos = sel.anchor; - else if (start == "end" || start === false) pos = sel.to; - else pos = sel.from; - return copyPos(pos); - }, - - somethingSelected: function() {return !posEq(this.view.sel.from, this.view.sel.to);}, - - setCursor: operation(null, function(line, ch, extend) { - var pos = clipPos(this.view.doc, typeof line == "number" ? {line: line, ch: ch || 0} : line); - if (extend) extendSelection(this, pos); - else setSelection(this, pos, pos); - }), - - setSelection: operation(null, function(anchor, head) { - var doc = this.view.doc; - setSelection(this, clipPos(doc, anchor), clipPos(doc, head || anchor)); - }), - - extendSelection: operation(null, function(from, to) { - var doc = this.view.doc; - extendSelection(this, clipPos(doc, from), to && clipPos(doc, to)); - }), - - setExtending: function(val) {this.view.sel.extend = val;}, - - getLine: function(line) {var l = this.getLineHandle(line); return l && l.text;}, - - getLineHandle: function(line) { - var doc = this.view.doc; - if (isLine(doc, line)) return getLine(doc, line); - }, - - getLineNumber: function(line) {return lineNo(line);}, - - setLine: operation(null, function(line, text) { - if (isLine(this.view.doc, line)) - replaceRange(this, text, {line: line, ch: 0}, {line: line, ch: getLine(this.view.doc, line).text.length}); - }), - - removeLine: operation(null, function(line) { - if (isLine(this.view.doc, line)) - replaceRange(this, "", {line: line, ch: 0}, clipPos(this.view.doc, {line: line+1, ch: 0})); - }), - - replaceRange: operation(null, function(code, from, to) { - var doc = this.view.doc; - from = clipPos(doc, from); - to = to ? clipPos(doc, to) : from; - return replaceRange(this, code, from, to); - }), - - getRange: function(from, to, lineSep) { - var doc = this.view.doc; - from = clipPos(doc, from); to = clipPos(doc, to); - var l1 = from.line, l2 = to.line; - if (l1 == l2) return getLine(doc, l1).text.slice(from.ch, to.ch); - var code = [getLine(doc, l1).text.slice(from.ch)]; - doc.iter(l1 + 1, l2, function(line) { code.push(line.text); }); - code.push(getLine(doc, l2).text.slice(0, to.ch)); - return code.join(lineSep || "\n"); - }, - - triggerOnKeyDown: operation(null, onKeyDown), - - execCommand: function(cmd) {return commands[cmd](this);}, - - // Stuff used by commands, probably not much use to outside code. - moveH: operation(null, function(dir, unit) { - var sel = this.view.sel, pos = dir < 0 ? sel.from : sel.to; - if (sel.shift || sel.extend || posEq(sel.from, sel.to)) pos = findPosH(this, dir, unit, true); - extendSelection(this, pos, pos, dir); - }), - - deleteH: operation(null, function(dir, unit) { - var sel = this.view.sel; - if (!posEq(sel.from, sel.to)) replaceRange(this, "", sel.from, sel.to, "delete"); - else replaceRange(this, "", sel.from, findPosH(this, dir, unit, false), "delete"); - this.curOp.userSelChange = true; - }), - - moveV: operation(null, function(dir, unit) { - var view = this.view, doc = view.doc, display = this.display; - var cur = view.sel.head, pos = cursorCoords(this, cur, "div"); - var x = pos.left, y; - if (view.goalColumn != null) x = view.goalColumn; - if (unit == "page") { - var pageSize = Math.min(display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight); - y = pos.top + dir * pageSize; - } else if (unit == "line") { - y = dir > 0 ? pos.bottom + 3 : pos.top - 3; - } - do { - var target = coordsChar(this, x, y); - y += dir * 5; - } while (target.outside && (dir < 0 ? y > 0 : y < doc.height)); - - if (unit == "page") display.scrollbarV.scrollTop += charCoords(this, target, "div").top - pos.top; - extendSelection(this, target, target, dir); - view.goalColumn = x; - }), - - toggleOverwrite: function() { - if (this.view.overwrite = !this.view.overwrite) - this.display.cursor.className += " CodeMirror-overwrite"; - else - this.display.cursor.className = this.display.cursor.className.replace(" CodeMirror-overwrite", ""); - }, - - posFromIndex: function(off) { - var lineNo = 0, ch, doc = this.view.doc; - doc.iter(0, doc.size, function(line) { - var sz = line.text.length + 1; - if (sz > off) { ch = off; return true; } - off -= sz; - ++lineNo; - }); - return clipPos(doc, {line: lineNo, ch: ch}); - }, - indexFromPos: function (coords) { - if (coords.line < 0 || coords.ch < 0) return 0; - var index = coords.ch; - this.view.doc.iter(0, coords.line, function (line) { - index += line.text.length + 1; - }); - return index; - }, - - scrollTo: function(x, y) { - if (x != null) this.display.scrollbarH.scrollLeft = this.display.scroller.scrollLeft = x; - if (y != null) this.display.scrollbarV.scrollTop = this.display.scroller.scrollTop = y; - updateDisplay(this, []); - }, - getScrollInfo: function() { - var scroller = this.display.scroller, co = scrollerCutOff; - return {left: scroller.scrollLeft, top: scroller.scrollTop, - height: scroller.scrollHeight - co, width: scroller.scrollWidth - co, - clientHeight: scroller.clientHeight - co, clientWidth: scroller.clientWidth - co}; - }, - - scrollIntoView: function(pos) { - if (typeof pos == "number") pos = {line: pos, ch: 0}; - pos = pos ? clipPos(this.view.doc, pos) : this.view.sel.head; - scrollPosIntoView(this, pos); - }, - - setSize: function(width, height) { - function interpret(val) { - return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; - } - if (width != null) this.display.wrapper.style.width = interpret(width); - if (height != null) this.display.wrapper.style.height = interpret(height); - this.refresh(); - }, - - on: function(type, f) {on(this, type, f);}, - off: function(type, f) {off(this, type, f);}, - - operation: function(f){return operation(this, f)();}, - - refresh: function() { - clearCaches(this); - if (this.display.scroller.scrollHeight > this.view.scrollTop) - this.display.scrollbarV.scrollTop = this.display.scroller.scrollTop = this.view.scrollTop; - updateDisplay(this, true); - }, - - getInputField: function(){return this.display.input;}, - getWrapperElement: function(){return this.display.wrapper;}, - getScrollerElement: function(){return this.display.scroller;}, - getGutterElement: function(){return this.display.gutters;} - }; - - // OPTION DEFAULTS - - var optionHandlers = CodeMirror.optionHandlers = {}; - - // The default configuration options. - var defaults = CodeMirror.defaults = {}; - - function option(name, deflt, handle, notOnInit) { - CodeMirror.defaults[name] = deflt; - if (handle) optionHandlers[name] = - notOnInit ? function(cm, val, old) {if (old != Init) handle(cm, val, old);} : handle; - } - - var Init = CodeMirror.Init = {toString: function(){return "CodeMirror.Init";}}; - - // These two are, on init, called from the constructor because they - // have to be initialized before the editor can start at all. - option("value", "", function(cm, val) {cm.setValue(val);}, true); - option("mode", null, loadMode, true); - - option("indentUnit", 2, loadMode, true); - option("indentWithTabs", false); - option("smartIndent", true); - option("tabSize", 4, function(cm) { - loadMode(cm); - clearCaches(cm); - updateDisplay(cm, true); - }, true); - option("electricChars", true); - - option("theme", "default", function(cm) { - themeChanged(cm); - guttersChanged(cm); - }, true); - option("keyMap", "default", keyMapChanged); - option("extraKeys", null); - - option("onKeyEvent", null); - option("onDragEvent", null); - - option("lineWrapping", false, wrappingChanged, true); - option("gutters", [], function(cm) { - setGuttersForLineNumbers(cm.options); - guttersChanged(cm); - }, true); - option("lineNumbers", false, function(cm) { - setGuttersForLineNumbers(cm.options); - guttersChanged(cm); - }, true); - option("firstLineNumber", 1, guttersChanged, true); - option("lineNumberFormatter", function(integer) {return integer;}, guttersChanged, true); - option("showCursorWhenSelecting", false, updateSelection, true); - - option("readOnly", false, function(cm, val) { - if (val == "nocursor") {onBlur(cm); cm.display.input.blur();} - else if (!val) resetInput(cm, true); - }); - option("dragDrop", true); - - option("cursorBlinkRate", 530); - option("cursorHeight", 1); - option("workTime", 100); - option("workDelay", 100); - option("flattenSpans", true); - option("pollInterval", 100); - option("undoDepth", 40); - option("viewportMargin", 10, function(cm){cm.refresh();}, true); - - option("tabindex", null, function(cm, val) { - cm.display.input.tabIndex = val || ""; - }); - option("autofocus", null); - - // MODE DEFINITION AND QUERYING - - // Known modes, by name and by MIME - var modes = CodeMirror.modes = {}, mimeModes = CodeMirror.mimeModes = {}; - - CodeMirror.defineMode = function(name, mode) { - if (!CodeMirror.defaults.mode && name != "null") CodeMirror.defaults.mode = name; - if (arguments.length > 2) { - mode.dependencies = []; - for (var i = 2; i < arguments.length; ++i) mode.dependencies.push(arguments[i]); - } - modes[name] = mode; - }; - - CodeMirror.defineMIME = function(mime, spec) { - mimeModes[mime] = spec; - }; - - CodeMirror.resolveMode = function(spec) { - if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) - spec = mimeModes[spec]; - else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) - return CodeMirror.resolveMode("application/xml"); - if (typeof spec == "string") return {name: spec}; - else return spec || {name: "null"}; - }; - - CodeMirror.getMode = function(options, spec) { - var spec = CodeMirror.resolveMode(spec); - var mfactory = modes[spec.name]; - if (!mfactory) return CodeMirror.getMode(options, "text/plain"); - var modeObj = mfactory(options, spec); - if (modeExtensions.hasOwnProperty(spec.name)) { - var exts = modeExtensions[spec.name]; - for (var prop in exts) { - if (!exts.hasOwnProperty(prop)) continue; - if (modeObj.hasOwnProperty(prop)) modeObj["_" + prop] = modeObj[prop]; - modeObj[prop] = exts[prop]; - } - } - modeObj.name = spec.name; - return modeObj; - }; - - CodeMirror.defineMode("null", function() { - return {token: function(stream) {stream.skipToEnd();}}; - }); - CodeMirror.defineMIME("text/plain", "null"); - - var modeExtensions = CodeMirror.modeExtensions = {}; - CodeMirror.extendMode = function(mode, properties) { - var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {}); - for (var prop in properties) if (properties.hasOwnProperty(prop)) - exts[prop] = properties[prop]; - }; - - // EXTENSIONS - - CodeMirror.defineExtension = function(name, func) { - CodeMirror.prototype[name] = func; - }; - - CodeMirror.defineOption = option; - - var initHooks = []; - CodeMirror.defineInitHook = function(f) {initHooks.push(f);}; - - // MODE STATE HANDLING - - // Utility functions for working with state. Exported because modes - // sometimes need to do this. - function copyState(mode, state) { - if (state === true) return state; - if (mode.copyState) return mode.copyState(state); - var nstate = {}; - for (var n in state) { - var val = state[n]; - if (val instanceof Array) val = val.concat([]); - nstate[n] = val; - } - return nstate; - } - CodeMirror.copyState = copyState; - - function startState(mode, a1, a2) { - return mode.startState ? mode.startState(a1, a2) : true; - } - CodeMirror.startState = startState; - - CodeMirror.innerMode = function(mode, state) { - while (mode.innerMode) { - var info = mode.innerMode(state); - state = info.state; - mode = info.mode; - } - return info || {mode: mode, state: state}; - }; - - // STANDARD COMMANDS - - var commands = CodeMirror.commands = { - selectAll: function(cm) {cm.setSelection({line: 0, ch: 0}, {line: cm.lineCount() - 1});}, - killLine: function(cm) { - var from = cm.getCursor(true), to = cm.getCursor(false), sel = !posEq(from, to); - if (!sel && cm.getLine(from.line).length == from.ch) - cm.replaceRange("", from, {line: from.line + 1, ch: 0}, "delete"); - else cm.replaceRange("", from, sel ? to : {line: from.line}, "delete"); - }, - deleteLine: function(cm) { - var l = cm.getCursor().line; - cm.replaceRange("", {line: l, ch: 0}, {line: l}, "delete"); - }, - undo: function(cm) {cm.undo();}, - redo: function(cm) {cm.redo();}, - goDocStart: function(cm) {cm.extendSelection({line: 0, ch: 0});}, - goDocEnd: function(cm) {cm.extendSelection({line: cm.lineCount() - 1});}, - goLineStart: function(cm) { - cm.extendSelection(lineStart(cm, cm.getCursor().line)); - }, - goLineStartSmart: function(cm) { - var cur = cm.getCursor(), start = lineStart(cm, cur.line); - var line = cm.getLineHandle(start.line); - var order = getOrder(line); - if (!order || order[0].level == 0) { - var firstNonWS = Math.max(0, line.text.search(/\S/)); - var inWS = cur.line == start.line && cur.ch <= firstNonWS && cur.ch; - cm.extendSelection({line: start.line, ch: inWS ? 0 : firstNonWS}); - } else cm.extendSelection(start); - }, - goLineEnd: function(cm) { - cm.extendSelection(lineEnd(cm, cm.getCursor().line)); - }, - goLineUp: function(cm) {cm.moveV(-1, "line");}, - goLineDown: function(cm) {cm.moveV(1, "line");}, - goPageUp: function(cm) {cm.moveV(-1, "page");}, - goPageDown: function(cm) {cm.moveV(1, "page");}, - goCharLeft: function(cm) {cm.moveH(-1, "char");}, - goCharRight: function(cm) {cm.moveH(1, "char");}, - goColumnLeft: function(cm) {cm.moveH(-1, "column");}, - goColumnRight: function(cm) {cm.moveH(1, "column");}, - goWordLeft: function(cm) {cm.moveH(-1, "word");}, - goWordRight: function(cm) {cm.moveH(1, "word");}, - delCharBefore: function(cm) {cm.deleteH(-1, "char");}, - delCharAfter: function(cm) {cm.deleteH(1, "char");}, - delWordBefore: function(cm) {cm.deleteH(-1, "word");}, - delWordAfter: function(cm) {cm.deleteH(1, "word");}, - indentAuto: function(cm) {cm.indentSelection("smart");}, - indentMore: function(cm) {cm.indentSelection("add");}, - indentLess: function(cm) {cm.indentSelection("subtract");}, - insertTab: function(cm) {cm.replaceSelection("\t", "end", "input");}, - defaultTab: function(cm) { - if (cm.somethingSelected()) cm.indentSelection("add"); - else cm.replaceSelection("\t", "end", "input"); - }, - transposeChars: function(cm) { - var cur = cm.getCursor(), line = cm.getLine(cur.line); - if (cur.ch > 0 && cur.ch < line.length - 1) - cm.replaceRange(line.charAt(cur.ch) + line.charAt(cur.ch - 1), - {line: cur.line, ch: cur.ch - 1}, {line: cur.line, ch: cur.ch + 1}); - }, - newlineAndIndent: function(cm) { - operation(cm, function() { - cm.replaceSelection("\n", "end", "input"); - cm.indentLine(cm.getCursor().line, null, true); - })(); - }, - toggleOverwrite: function(cm) {cm.toggleOverwrite();} - }; - - // STANDARD KEYMAPS - - var keyMap = CodeMirror.keyMap = {}; - keyMap.basic = { - "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown", - "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown", - "Delete": "delCharAfter", "Backspace": "delCharBefore", "Tab": "defaultTab", "Shift-Tab": "indentAuto", - "Enter": "newlineAndIndent", "Insert": "toggleOverwrite" - }; - // Note that the save and find-related commands aren't defined by - // default. Unknown commands are simply ignored. - keyMap.pcDefault = { - "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo", - "Ctrl-Home": "goDocStart", "Alt-Up": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Down": "goDocEnd", - "Ctrl-Left": "goWordLeft", "Ctrl-Right": "goWordRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd", - "Ctrl-Backspace": "delWordBefore", "Ctrl-Delete": "delWordAfter", "Ctrl-S": "save", "Ctrl-F": "find", - "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll", - "Ctrl-[": "indentLess", "Ctrl-]": "indentMore", - fallthrough: "basic" - }; - keyMap.macDefault = { - "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo", - "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goWordLeft", - "Alt-Right": "goWordRight", "Cmd-Left": "goLineStart", "Cmd-Right": "goLineEnd", "Alt-Backspace": "delWordBefore", - "Ctrl-Alt-Backspace": "delWordAfter", "Alt-Delete": "delWordAfter", "Cmd-S": "save", "Cmd-F": "find", - "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll", - "Cmd-[": "indentLess", "Cmd-]": "indentMore", - fallthrough: ["basic", "emacsy"] - }; - keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault; - keyMap.emacsy = { - "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown", - "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", - "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", - "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars" - }; - - // KEYMAP DISPATCH - - function getKeyMap(val) { - if (typeof val == "string") return keyMap[val]; - else return val; - } - - function lookupKey(name, maps, handle, stop) { - function lookup(map) { - map = getKeyMap(map); - var found = map[name]; - if (found === false) { - if (stop) stop(); - return true; - } - if (found != null && handle(found)) return true; - if (map.nofallthrough) { - if (stop) stop(); - return true; - } - var fallthrough = map.fallthrough; - if (fallthrough == null) return false; - if (Object.prototype.toString.call(fallthrough) != "[object Array]") - return lookup(fallthrough); - for (var i = 0, e = fallthrough.length; i < e; ++i) { - if (lookup(fallthrough[i])) return true; - } - return false; - } - - for (var i = 0; i < maps.length; ++i) - if (lookup(maps[i])) return true; - } - function isModifierKey(event) { - var name = keyNames[e_prop(event, "keyCode")]; - return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod"; - } - CodeMirror.isModifierKey = isModifierKey; - - // FROMTEXTAREA - - CodeMirror.fromTextArea = function(textarea, options) { - if (!options) options = {}; - options.value = textarea.value; - if (!options.tabindex && textarea.tabindex) - options.tabindex = textarea.tabindex; - // Set autofocus to true if this textarea is focused, or if it has - // autofocus and no other element is focused. - if (options.autofocus == null) { - var hasFocus = document.body; - // doc.activeElement occasionally throws on IE - try { hasFocus = document.activeElement; } catch(e) {} - options.autofocus = hasFocus == textarea || - textarea.getAttribute("autofocus") != null && hasFocus == document.body; - } - - function save() {textarea.value = cm.getValue();} - if (textarea.form) { - // Deplorable hack to make the submit method do the right thing. - on(textarea.form, "submit", save); - var form = textarea.form, realSubmit = form.submit; - try { - form.submit = function wrappedSubmit() { - save(); - form.submit = realSubmit; - form.submit(); - form.submit = wrappedSubmit; - }; - } catch(e) {} - } - - textarea.style.display = "none"; - var cm = CodeMirror(function(node) { - textarea.parentNode.insertBefore(node, textarea.nextSibling); - }, options); - cm.save = save; - cm.getTextArea = function() { return textarea; }; - cm.toTextArea = function() { - save(); - textarea.parentNode.removeChild(cm.getWrapperElement()); - textarea.style.display = ""; - if (textarea.form) { - off(textarea.form, "submit", save); - if (typeof textarea.form.submit == "function") - textarea.form.submit = realSubmit; - } - }; - return cm; - }; - - // STRING STREAM - - // Fed to the mode parsers, provides helper functions to make - // parsers more succinct. - - // The character stream used by a mode's parser. - function StringStream(string, tabSize) { - this.pos = this.start = 0; - this.string = string; - this.tabSize = tabSize || 8; - } - - StringStream.prototype = { - eol: function() {return this.pos >= this.string.length;}, - sol: function() {return this.pos == 0;}, - peek: function() {return this.string.charAt(this.pos) || undefined;}, - next: function() { - if (this.pos < this.string.length) - return this.string.charAt(this.pos++); - }, - eat: function(match) { - var ch = this.string.charAt(this.pos); - if (typeof match == "string") var ok = ch == match; - else var ok = ch && (match.test ? match.test(ch) : match(ch)); - if (ok) {++this.pos; return ch;} - }, - eatWhile: function(match) { - var start = this.pos; - while (this.eat(match)){} - return this.pos > start; - }, - eatSpace: function() { - var start = this.pos; - while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos; - return this.pos > start; - }, - skipToEnd: function() {this.pos = this.string.length;}, - skipTo: function(ch) { - var found = this.string.indexOf(ch, this.pos); - if (found > -1) {this.pos = found; return true;} - }, - backUp: function(n) {this.pos -= n;}, - column: function() {return countColumn(this.string, this.start, this.tabSize);}, - indentation: function() {return countColumn(this.string, null, this.tabSize);}, - match: function(pattern, consume, caseInsensitive) { - if (typeof pattern == "string") { - var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;}; - if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) { - if (consume !== false) this.pos += pattern.length; - return true; - } - } else { - var match = this.string.slice(this.pos).match(pattern); - if (match && match.index > 0) return null; - if (match && consume !== false) this.pos += match[0].length; - return match; - } - }, - current: function(){return this.string.slice(this.start, this.pos);} - }; - CodeMirror.StringStream = StringStream; - - // TEXTMARKERS - - function TextMarker(cm, type) { - this.lines = []; - this.type = type; - this.cm = cm; - } - - TextMarker.prototype.clear = function() { - if (this.explicitlyCleared) return; - startOperation(this.cm); - var min = null, max = null; - for (var i = 0; i < this.lines.length; ++i) { - var line = this.lines[i]; - var span = getMarkedSpanFor(line.markedSpans, this); - if (span.to != null) max = lineNo(line); - line.markedSpans = removeMarkedSpan(line.markedSpans, span); - if (span.from != null) - min = lineNo(line); - else if (this.collapsed && !lineIsHidden(line)) - updateLineHeight(line, textHeight(this.cm.display)); - } - if (min != null) regChange(this.cm, min, max + 1); - this.lines.length = 0; - this.explicitlyCleared = true; - if (this.collapsed && this.cm.view.cantEdit) { - this.cm.view.cantEdit = false; - reCheckSelection(this.cm); - } - endOperation(this.cm); - signalLater(this.cm, this, "clear"); - }; - - TextMarker.prototype.find = function() { - var from, to; - for (var i = 0; i < this.lines.length; ++i) { - var line = this.lines[i]; - var span = getMarkedSpanFor(line.markedSpans, this); - if (span.from != null || span.to != null) { - var found = lineNo(line); - if (span.from != null) from = {line: found, ch: span.from}; - if (span.to != null) to = {line: found, ch: span.to}; - } - } - if (this.type == "bookmark") return from; - return from && {from: from, to: to}; - }; - - function markText(cm, from, to, options, type) { - var doc = cm.view.doc; - var marker = new TextMarker(cm, type); - if (type == "range" && !posLess(from, to)) return marker; - if (options) for (var opt in options) if (options.hasOwnProperty(opt)) - marker[opt] = options[opt]; - if (marker.replacedWith) { - marker.collapsed = true; - marker.replacedWith = elt("span", [marker.replacedWith], "CodeMirror-widget"); - } - if (marker.collapsed) sawCollapsedSpans = true; - - var curLine = from.line, size = 0, collapsedAtStart, collapsedAtEnd; - doc.iter(curLine, to.line + 1, function(line) { - var span = {from: null, to: null, marker: marker}; - size += line.text.length; - if (curLine == from.line) {span.from = from.ch; size -= from.ch;} - if (curLine == to.line) {span.to = to.ch; size -= line.text.length - to.ch;} - if (marker.collapsed) { - if (curLine == to.line) collapsedAtEnd = collapsedSpanAt(line, to.ch); - if (curLine == from.line) collapsedAtStart = collapsedSpanAt(line, from.ch); - else updateLineHeight(line, 0); - } - addMarkedSpan(line, span); - if (marker.collapsed && curLine == from.line && lineIsHidden(line)) - updateLineHeight(line, 0); - ++curLine; - }); - - if (marker.readOnly) { - sawReadOnlySpans = true; - if (cm.view.history.done.length || cm.view.history.undone.length) - cm.clearHistory(); - } - if (marker.collapsed) { - if (collapsedAtStart != collapsedAtEnd) - throw new Error("Inserting collapsed marker overlapping an existing one"); - marker.size = size; - marker.atomic = true; - } - if (marker.className || marker.startStyle || marker.endStyle || marker.collapsed) - regChange(cm, from.line, to.line + 1); - if (marker.atomic) reCheckSelection(cm); - return marker; - } - - // TEXTMARKER SPANS - - function getMarkedSpanFor(spans, marker) { - if (spans) for (var i = 0; i < spans.length; ++i) { - var span = spans[i]; - if (span.marker == marker) return span; - } - } - function removeMarkedSpan(spans, span) { - for (var r, i = 0; i < spans.length; ++i) - if (spans[i] != span) (r || (r = [])).push(spans[i]); - return r; - } - function addMarkedSpan(line, span) { - line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]; - span.marker.lines.push(line); - } - - function markedSpansBefore(old, startCh) { - if (old) for (var i = 0, nw; i < old.length; ++i) { - var span = old[i], marker = span.marker; - var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh); - if (startsBefore || marker.type == "bookmark" && span.from == startCh) { - var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh); - (nw || (nw = [])).push({from: span.from, - to: endsAfter ? null : span.to, - marker: marker}); - } - } - return nw; - } - - function markedSpansAfter(old, startCh, endCh) { - if (old) for (var i = 0, nw; i < old.length; ++i) { - var span = old[i], marker = span.marker; - var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh); - if (endsAfter || marker.type == "bookmark" && span.from == endCh && span.from != startCh) { - var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh); - (nw || (nw = [])).push({from: startsBefore ? null : span.from - endCh, - to: span.to == null ? null : span.to - endCh, - marker: marker}); - } - } - return nw; - } - - function updateMarkedSpans(oldFirst, oldLast, startCh, endCh, newText) { - if (!oldFirst && !oldLast) return newText; - // Get the spans that 'stick out' on both sides - var first = markedSpansBefore(oldFirst, startCh); - var last = markedSpansAfter(oldLast, startCh, endCh); - - // Next, merge those two ends - var sameLine = newText.length == 1, offset = lst(newText).length + (sameLine ? startCh : 0); - if (first) { - // Fix up .to properties of first - for (var i = 0; i < first.length; ++i) { - var span = first[i]; - if (span.to == null) { - var found = getMarkedSpanFor(last, span.marker); - if (!found) span.to = startCh; - else if (sameLine) span.to = found.to == null ? null : found.to + offset; - } - } - } - if (last) { - // Fix up .from in last (or move them into first in case of sameLine) - for (var i = 0; i < last.length; ++i) { - var span = last[i]; - if (span.to != null) span.to += offset; - if (span.from == null) { - var found = getMarkedSpanFor(first, span.marker); - if (!found) { - span.from = offset; - if (sameLine) (first || (first = [])).push(span); - } - } else { - span.from += offset; - if (sameLine) (first || (first = [])).push(span); - } - } - } - - var newMarkers = [newHL(newText[0], first)]; - if (!sameLine) { - // Fill gap with whole-line-spans - var gap = newText.length - 2, gapMarkers; - if (gap > 0 && first) - for (var i = 0; i < first.length; ++i) - if (first[i].to == null) - (gapMarkers || (gapMarkers = [])).push({from: null, to: null, marker: first[i].marker}); - for (var i = 0; i < gap; ++i) - newMarkers.push(newHL(newText[i+1], gapMarkers)); - newMarkers.push(newHL(lst(newText), last)); - } - return newMarkers; - } - - function removeReadOnlyRanges(doc, from, to) { - var markers = null; - doc.iter(from.line, to.line + 1, function(line) { - if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) { - var mark = line.markedSpans[i].marker; - if (mark.readOnly && (!markers || indexOf(markers, mark) == -1)) - (markers || (markers = [])).push(mark); - } - }); - if (!markers) return null; - var parts = [{from: from, to: to}]; - for (var i = 0; i < markers.length; ++i) { - var m = markers[i].find(); - for (var j = 0; j < parts.length; ++j) { - var p = parts[j]; - if (!posLess(m.from, p.to) || posLess(m.to, p.from)) continue; - var newParts = [j, 1]; - if (posLess(p.from, m.from)) newParts.push({from: p.from, to: m.from}); - if (posLess(m.to, p.to)) newParts.push({from: m.to, to: p.to}); - parts.splice.apply(parts, newParts); - j += newParts.length - 1; - } - } - return parts; - } - - function collapsedSpanAt(line, ch) { - var sps = sawCollapsedSpans && line.markedSpans, found; - if (sps) for (var sp, i = 0; i < sps.length; ++i) { - sp = sps[i]; - if (!sp.marker.collapsed) continue; - if ((sp.from == null || sp.from < ch) && - (sp.to == null || sp.to > ch) && - (!found || found.width < sp.marker.width)) - found = sp.marker; - } - return found; - } - function collapsedSpanAtStart(line) { return collapsedSpanAt(line, -1); } - function collapsedSpanAtEnd(line) { return collapsedSpanAt(line, line.text.length + 1); } - - function visualLine(doc, line) { - var merged; - while (merged = collapsedSpanAtStart(line)) - line = getLine(doc, merged.find().from.line); - return line; - } - - function lineIsHidden(line) { - var sps = sawCollapsedSpans && line.markedSpans; - if (sps) for (var sp, i = 0; i < sps.length; ++i) { - sp = sps[i]; - if (!sp.marker.collapsed) continue; - if (sp.from == null) return true; - if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(line, sp)) - return true; - } - } - window.lineIsHidden = lineIsHidden; - function lineIsHiddenInner(line, span) { - if (span.to == null || span.marker.inclusiveRight && span.to == line.text.length) - return true; - for (var sp, i = 0; i < line.markedSpans.length; ++i) { - sp = line.markedSpans[i]; - if (sp.marker.collapsed && sp.from == span.to && - (sp.marker.inclusiveLeft || span.marker.inclusiveRight) && - lineIsHiddenInner(line, sp)) return true; - } - } - - // hl stands for history-line, a data structure that can be either a - // string (line without markers) or a {text, markedSpans} object. - function hlText(val) { return typeof val == "string" ? val : val.text; } - function hlSpans(val) { - if (typeof val == "string") return null; - var spans = val.markedSpans, out = null; - for (var i = 0; i < spans.length; ++i) { - if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); } - else if (out) out.push(spans[i]); - } - return !out ? spans : out.length ? out : null; - } - function newHL(text, spans) { return spans ? {text: text, markedSpans: spans} : text; } - - function detachMarkedSpans(line) { - var spans = line.markedSpans; - if (!spans) return; - for (var i = 0; i < spans.length; ++i) { - var lines = spans[i].marker.lines; - var ix = indexOf(lines, line); - lines.splice(ix, 1); - } - line.markedSpans = null; - } - - function attachMarkedSpans(line, spans) { - if (!spans) return; - for (var i = 0; i < spans.length; ++i) - spans[i].marker.lines.push(line); - line.markedSpans = spans; - } - - // LINE DATA STRUCTURE - - // Line objects. These hold state related to a line, including - // highlighting info (the styles array). - function makeLine(text, markedSpans, height) { - var line = {text: text, height: height}; - attachMarkedSpans(line, markedSpans); - if (lineIsHidden(line)) line.height = 0; - return line; - } - - function updateLine(cm, line, text, markedSpans) { - line.text = text; - line.stateAfter = line.styles = null; - if (line.order != null) line.order = null; - detachMarkedSpans(line); - attachMarkedSpans(line, markedSpans); - if (lineIsHidden(line)) line.height = 0; - else if (!line.height) line.height = textHeight(cm.display); - signalLater(cm, line, "change"); - } - - function cleanUpLine(line) { - line.parent = null; - detachMarkedSpans(line); - } - - // Run the given mode's parser over a line, update the styles - // array, which contains alternating fragments of text and CSS - // classes. - function highlightLine(cm, line, state) { - var mode = cm.view.mode, flattenSpans = cm.options.flattenSpans; - var changed = !line.styles, pos = 0, curText = "", curStyle = null; - var stream = new StringStream(line.text, cm.options.tabSize), st = line.styles || (line.styles = []); - if (line.text == "" && mode.blankLine) mode.blankLine(state); - while (!stream.eol()) { - var style = mode.token(stream, state), substr = stream.current(); - stream.start = stream.pos; - if (!flattenSpans || curStyle != style) { - if (curText) { - changed = changed || pos >= st.length || curText != st[pos] || curStyle != st[pos+1]; - st[pos++] = curText; st[pos++] = curStyle; - } - curText = substr; curStyle = style; - } else curText = curText + substr; - // Give up when line is ridiculously long - if (stream.pos > 5000) break; - } - if (curText) { - changed = changed || pos >= st.length || curText != st[pos] || curStyle != st[pos+1]; - st[pos++] = curText; st[pos++] = curStyle; - } - if (stream.pos > 5000) { st[pos++] = line.text.slice(stream.pos); st[pos++] = null; } - if (pos != st.length) { st.length = pos; changed = true; } - return changed; - } - - // Lightweight form of highlight -- proceed over this line and - // update state, but don't save a style array. - function processLine(cm, line, state) { - var mode = cm.view.mode; - var stream = new StringStream(line.text, cm.options.tabSize); - if (line.text == "" && mode.blankLine) mode.blankLine(state); - while (!stream.eol() && stream.pos <= 5000) { - mode.token(stream, state); - stream.start = stream.pos; - } - } - - var styleToClassCache = {}; - function styleToClass(style) { - if (!style) return null; - return styleToClassCache[style] || - (styleToClassCache[style] = "cm-" + style.replace(/ +/g, " cm-")); - } - - function lineContent(cm, realLine, measure) { - var merged, line = realLine, lineBefore, sawBefore, simple = true; - while (merged = collapsedSpanAtStart(line)) { - simple = false; - line = getLine(cm.view.doc, merged.find().from.line); - if (!lineBefore) lineBefore = line; - } - - var builder = {pre: elt("pre"), col: 0, pos: 0, display: !measure, - measure: null, addedOne: false, cm: cm}; - if (line.textClass) builder.pre.className = line.textClass; - - do { - if (!line.styles) - highlightLine(cm, line, line.stateAfter = getStateBefore(cm, lineNo(line))); - builder.measure = line == realLine && measure; - builder.pos = 0; - builder.addToken = builder.measure ? buildTokenMeasure : buildToken; - if (measure && sawBefore && line != realLine && !builder.addedOne) { - measure[0] = builder.pre.appendChild(zeroWidthElement(cm.display.measure)); - builder.addedOne = true; - } - var next = insertLineContent(line, builder); - sawBefore = line == lineBefore; - if (next) { - line = getLine(cm.view.doc, next.to.line); - simple = false; - } - } while (next); - - if (measure && !builder.addedOne) - measure[0] = builder.pre.appendChild(simple ? elt("span", "\u00a0") : zeroWidthElement(cm.display.measure)); - if (!builder.pre.firstChild && !lineIsHidden(realLine)) - builder.pre.appendChild(document.createTextNode("\u00a0")); - - return builder.pre; - } - - var tokenSpecialChars = /[\t\u0000-\u0019\u200b\u2028\u2029\uFEFF]/g; - function buildToken(builder, text, style, startStyle, endStyle) { - if (!text) return; - if (!tokenSpecialChars.test(text)) { - builder.col += text.length; - var content = document.createTextNode(text); - } else { - var content = document.createDocumentFragment(), pos = 0; - while (true) { - tokenSpecialChars.lastIndex = pos; - var m = tokenSpecialChars.exec(text); - var skipped = m ? m.index - pos : text.length - pos; - if (skipped) { - content.appendChild(document.createTextNode(text.slice(pos, pos + skipped))); - builder.col += skipped; - } - if (!m) break; - pos += skipped + 1; - if (m[0] == "\t") { - var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize; - content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")); - builder.col += tabWidth; - } else { - var token = elt("span", "\u2022", "cm-invalidchar"); - token.title = "\\u" + m[0].charCodeAt(0).toString(16); - content.appendChild(token); - builder.col += 1; - } - } - } - if (style || startStyle || endStyle || builder.measure) { - var fullStyle = style || ""; - if (startStyle) fullStyle += startStyle; - if (endStyle) fullStyle += endStyle; - return builder.pre.appendChild(elt("span", [content], fullStyle)); - } - builder.pre.appendChild(content); - } - - function buildTokenMeasure(builder, text, style, startStyle, endStyle) { - for (var i = 0; i < text.length; ++i) { - if (i && i < text.length - 1 && - builder.cm.options.lineWrapping && - spanAffectsWrapping.test(text.slice(i - 1, i + 1))) - builder.pre.appendChild(elt("wbr")); - builder.measure[builder.pos++] = - buildToken(builder, text.charAt(i), style, - i == 0 && startStyle, i == text.length - 1 && endStyle); - } - if (text.length) builder.addedOne = true; - } - - function buildCollapsedSpan(builder, size, widget) { - if (widget) { - if (!builder.display) widget = widget.cloneNode(true); - builder.pre.appendChild(widget); - if (builder.measure && size) { - builder.measure[builder.pos] = widget; - builder.addedOne = true; - } - } - builder.pos += size; - } - - // Outputs a number of spans to make up a line, taking highlighting - // and marked text into account. - function insertLineContent(line, builder) { - var st = line.styles, spans = line.markedSpans; - if (!spans) { - for (var i = 0; i < st.length; i+=2) - builder.addToken(builder, st[i], styleToClass(st[i+1])); - return; - } - - var allText = line.text, len = allText.length; - var pos = 0, i = 0, text = "", style; - var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed; - for (;;) { - if (nextChange == pos) { // Update current marker set - spanStyle = spanEndStyle = spanStartStyle = ""; - collapsed = null; nextChange = Infinity; - var foundBookmark = null; - for (var j = 0; j < spans.length; ++j) { - var sp = spans[j], m = sp.marker; - if (sp.from <= pos && (sp.to == null || sp.to > pos)) { - if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = ""; } - if (m.className) spanStyle += " " + m.className; - if (m.startStyle && sp.from == pos) spanStartStyle += " " + m.startStyle; - if (m.endStyle && sp.to == nextChange) spanEndStyle += " " + m.endStyle; - if (m.collapsed && (!collapsed || collapsed.marker.width < m.width)) - collapsed = sp; - } else if (sp.from > pos && nextChange > sp.from) { - nextChange = sp.from; - } - if (m.type == "bookmark" && sp.from == pos && m.replacedWith) - foundBookmark = m.replacedWith; - } - if (collapsed && (collapsed.from || 0) == pos) { - buildCollapsedSpan(builder, (collapsed.to == null ? len : collapsed.to) - pos, - collapsed.from != null && collapsed.marker.replacedWith); - if (collapsed.to == null) return collapsed.marker.find(); - } - if (foundBookmark && !collapsed) buildCollapsedSpan(builder, 0, foundBookmark); - } - if (pos >= len) break; - - var upto = Math.min(len, nextChange); - while (true) { - if (text) { - var end = pos + text.length; - if (!collapsed) { - var tokenText = end > upto ? text.slice(0, upto - pos) : text; - builder.addToken(builder, tokenText, style + spanStyle, - spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : ""); - } - if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;} - pos = end; - spanStartStyle = ""; - } - text = st[i++]; style = styleToClass(st[i++]); - } - } - } - - // DOCUMENT DATA STRUCTURE - - function LeafChunk(lines) { - this.lines = lines; - this.parent = null; - for (var i = 0, e = lines.length, height = 0; i < e; ++i) { - lines[i].parent = this; - height += lines[i].height; - } - this.height = height; - } - - LeafChunk.prototype = { - chunkSize: function() { return this.lines.length; }, - remove: function(at, n, cm) { - for (var i = at, e = at + n; i < e; ++i) { - var line = this.lines[i]; - this.height -= line.height; - cleanUpLine(line); - signalLater(cm, line, "delete"); - } - this.lines.splice(at, n); - }, - collapse: function(lines) { - lines.splice.apply(lines, [lines.length, 0].concat(this.lines)); - }, - insertHeight: function(at, lines, height) { - this.height += height; - this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at)); - for (var i = 0, e = lines.length; i < e; ++i) lines[i].parent = this; - }, - iterN: function(at, n, op) { - for (var e = at + n; at < e; ++at) - if (op(this.lines[at])) return true; - } - }; - - function BranchChunk(children) { - this.children = children; - var size = 0, height = 0; - for (var i = 0, e = children.length; i < e; ++i) { - var ch = children[i]; - size += ch.chunkSize(); height += ch.height; - ch.parent = this; - } - this.size = size; - this.height = height; - this.parent = null; - } - - BranchChunk.prototype = { - chunkSize: function() { return this.size; }, - remove: function(at, n, callbacks) { - this.size -= n; - for (var i = 0; i < this.children.length; ++i) { - var child = this.children[i], sz = child.chunkSize(); - if (at < sz) { - var rm = Math.min(n, sz - at), oldHeight = child.height; - child.remove(at, rm, callbacks); - this.height -= oldHeight - child.height; - if (sz == rm) { this.children.splice(i--, 1); child.parent = null; } - if ((n -= rm) == 0) break; - at = 0; - } else at -= sz; - } - if (this.size - n < 25) { - var lines = []; - this.collapse(lines); - this.children = [new LeafChunk(lines)]; - this.children[0].parent = this; - } - }, - collapse: function(lines) { - for (var i = 0, e = this.children.length; i < e; ++i) this.children[i].collapse(lines); - }, - insert: function(at, lines) { - var height = 0; - for (var i = 0, e = lines.length; i < e; ++i) height += lines[i].height; - this.insertHeight(at, lines, height); - }, - insertHeight: function(at, lines, height) { - this.size += lines.length; - this.height += height; - for (var i = 0, e = this.children.length; i < e; ++i) { - var child = this.children[i], sz = child.chunkSize(); - if (at <= sz) { - child.insertHeight(at, lines, height); - if (child.lines && child.lines.length > 50) { - while (child.lines.length > 50) { - var spilled = child.lines.splice(child.lines.length - 25, 25); - var newleaf = new LeafChunk(spilled); - child.height -= newleaf.height; - this.children.splice(i + 1, 0, newleaf); - newleaf.parent = this; - } - this.maybeSpill(); - } - break; - } - at -= sz; - } - }, - maybeSpill: function() { - if (this.children.length <= 10) return; - var me = this; - do { - var spilled = me.children.splice(me.children.length - 5, 5); - var sibling = new BranchChunk(spilled); - if (!me.parent) { // Become the parent node - var copy = new BranchChunk(me.children); - copy.parent = me; - me.children = [copy, sibling]; - me = copy; - } else { - me.size -= sibling.size; - me.height -= sibling.height; - var myIndex = indexOf(me.parent.children, me); - me.parent.children.splice(myIndex + 1, 0, sibling); - } - sibling.parent = me.parent; - } while (me.children.length > 10); - me.parent.maybeSpill(); - }, - iter: function(from, to, op) { this.iterN(from, to - from, op); }, - iterN: function(at, n, op) { - for (var i = 0, e = this.children.length; i < e; ++i) { - var child = this.children[i], sz = child.chunkSize(); - if (at < sz) { - var used = Math.min(n, sz - at); - if (child.iterN(at, used, op)) return true; - if ((n -= used) == 0) break; - at = 0; - } else at -= sz; - } - } - }; - - // LINE UTILITIES - - function getLine(chunk, n) { - while (!chunk.lines) { - for (var i = 0;; ++i) { - var child = chunk.children[i], sz = child.chunkSize(); - if (n < sz) { chunk = child; break; } - n -= sz; - } - } - return chunk.lines[n]; - } - - function updateLineHeight(line, height) { - var diff = height - line.height; - for (var n = line; n; n = n.parent) n.height += diff; - } - - function lineNo(line) { - if (line.parent == null) return null; - var cur = line.parent, no = indexOf(cur.lines, line); - for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { - for (var i = 0;; ++i) { - if (chunk.children[i] == cur) break; - no += chunk.children[i].chunkSize(); - } - } - return no; - } - - function lineAtHeight(chunk, h) { - var n = 0; - outer: do { - for (var i = 0, e = chunk.children.length; i < e; ++i) { - var child = chunk.children[i], ch = child.height; - if (h < ch) { chunk = child; continue outer; } - h -= ch; - n += child.chunkSize(); - } - return n; - } while (!chunk.lines); - for (var i = 0, e = chunk.lines.length; i < e; ++i) { - var line = chunk.lines[i], lh = line.height; - if (h < lh) break; - h -= lh; - } - return n + i; - } - - function heightAtLine(cm, lineObj) { - lineObj = visualLine(cm.view.doc, lineObj); - - var h = 0, chunk = lineObj.parent; - for (var i = 0; i < chunk.lines.length; ++i) { - var line = chunk.lines[i]; - if (line == lineObj) break; - else h += line.height; - } - for (var p = chunk.parent; p; chunk = p, p = chunk.parent) { - for (var i = 0; i < p.children.length; ++i) { - var cur = p.children[i]; - if (cur == chunk) break; - else h += cur.height; - } - } - return h; - } - - function getOrder(line) { - var order = line.order; - if (order == null) order = line.order = bidiOrdering(line.text); - return order; - } - - // HISTORY - - function makeHistory() { - return { - // Arrays of history events. Doing something adds an event to - // done and clears undo. Undoing moves events from done to - // undone, redoing moves them in the other direction. - done: [], undone: [], - // Used to track when changes can be merged into a single undo - // event - lastTime: 0, lastOp: null, lastOrigin: null, - // Used by the isClean() method - dirtyCounter: 0 - }; - } - - function addChange(cm, start, added, old, origin, fromBefore, toBefore, fromAfter, toAfter) { - var history = cm.view.history; - history.undone.length = 0; - var time = +new Date, cur = lst(history.done); - - if (cur && - (history.lastOp == cm.curOp.id || - history.lastOrigin == origin && (origin == "input" || origin == "delete") && - history.lastTime > time - 600)) { - // Merge this change into the last event - var last = lst(cur.events); - if (last.start > start + old.length || last.start + last.added < start) { - // Doesn't intersect with last sub-event, add new sub-event - cur.events.push({start: start, added: added, old: old}); - } else { - // Patch up the last sub-event - var startBefore = Math.max(0, last.start - start), - endAfter = Math.max(0, (start + old.length) - (last.start + last.added)); - for (var i = startBefore; i > 0; --i) last.old.unshift(old[i - 1]); - for (var i = endAfter; i > 0; --i) last.old.push(old[old.length - i]); - if (startBefore) last.start = start; - last.added += added - (old.length - startBefore - endAfter); - } - cur.fromAfter = fromAfter; cur.toAfter = toAfter; - } else { - // Can not be merged, start a new event. - cur = {events: [{start: start, added: added, old: old}], - fromBefore: fromBefore, toBefore: toBefore, fromAfter: fromAfter, toAfter: toAfter}; - history.done.push(cur); - while (history.done.length > cm.options.undoDepth) - history.done.shift(); - if (history.dirtyCounter < 0) - // The user has made a change after undoing past the last clean state. - // We can never get back to a clean state now until markClean() is called. - history.dirtyCounter = NaN; - else - history.dirtyCounter++; - } - history.lastTime = time; - history.lastOp = cm.curOp.id; - history.lastOrigin = origin; - } - - // EVENT OPERATORS - - function stopMethod() {e_stop(this);} - // Ensure an event has a stop method. - function addStop(event) { - if (!event.stop) event.stop = stopMethod; - return event; - } - - function e_preventDefault(e) { - if (e.preventDefault) e.preventDefault(); - else e.returnValue = false; - } - function e_stopPropagation(e) { - if (e.stopPropagation) e.stopPropagation(); - else e.cancelBubble = true; - } - function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);} - CodeMirror.e_stop = e_stop; - CodeMirror.e_preventDefault = e_preventDefault; - CodeMirror.e_stopPropagation = e_stopPropagation; - - function e_target(e) {return e.target || e.srcElement;} - function e_button(e) { - var b = e.which; - if (b == null) { - if (e.button & 1) b = 1; - else if (e.button & 2) b = 3; - else if (e.button & 4) b = 2; - } - if (mac && e.ctrlKey && b == 1) b = 3; - return b; - } - - // Allow 3rd-party code to override event properties by adding an override - // object to an event object. - function e_prop(e, prop) { - var overridden = e.override && e.override.hasOwnProperty(prop); - return overridden ? e.override[prop] : e[prop]; - } - - // EVENT HANDLING - - function on(emitter, type, f) { - if (emitter.addEventListener) - emitter.addEventListener(type, f, false); - else if (emitter.attachEvent) - emitter.attachEvent("on" + type, f); - else { - var map = emitter._handlers || (emitter._handlers = {}); - var arr = map[type] || (map[type] = []); - arr.push(f); - } - } - - function off(emitter, type, f) { - if (emitter.removeEventListener) - emitter.removeEventListener(type, f, false); - else if (emitter.detachEvent) - emitter.detachEvent("on" + type, f); - else { - var arr = emitter._handlers && emitter._handlers[type]; - if (!arr) return; - for (var i = 0; i < arr.length; ++i) - if (arr[i] == f) { arr.splice(i, 1); break; } - } - } - - function signal(emitter, type /*, values...*/) { - var arr = emitter._handlers && emitter._handlers[type]; - if (!arr) return; - var args = Array.prototype.slice.call(arguments, 2); - for (var i = 0; i < arr.length; ++i) arr[i].apply(null, args); - } - - function signalLater(cm, emitter, type /*, values...*/) { - var arr = emitter._handlers && emitter._handlers[type]; - if (!arr) return; - var args = Array.prototype.slice.call(arguments, 3), flist = cm.curOp && cm.curOp.delayedCallbacks; - function bnd(f) {return function(){f.apply(null, args);};}; - for (var i = 0; i < arr.length; ++i) - if (flist) flist.push(bnd(arr[i])); - else arr[i].apply(null, args); - } - - function hasHandler(emitter, type) { - var arr = emitter._handlers && emitter._handlers[type]; - return arr && arr.length > 0; - } - - CodeMirror.on = on; CodeMirror.off = off; CodeMirror.signal = signal; - - // MISC UTILITIES - - // Number of pixels added to scroller and sizer to hide scrollbar - var scrollerCutOff = 30; - - // Returned or thrown by various protocols to signal 'I'm not - // handling this'. - var Pass = CodeMirror.Pass = {toString: function(){return "CodeMirror.Pass";}}; - - function Delayed() {this.id = null;} - Delayed.prototype = {set: function(ms, f) {clearTimeout(this.id); this.id = setTimeout(f, ms);}}; - - // Counts the column offset in a string, taking tabs into account. - // Used mostly to find indentation. - function countColumn(string, end, tabSize) { - if (end == null) { - end = string.search(/[^\s\u00a0]/); - if (end == -1) end = string.length; - } - for (var i = 0, n = 0; i < end; ++i) { - if (string.charAt(i) == "\t") n += tabSize - (n % tabSize); - else ++n; - } - return n; - } - CodeMirror.countColumn = countColumn; - - var spaceStrs = [""]; - function spaceStr(n) { - while (spaceStrs.length <= n) - spaceStrs.push(lst(spaceStrs) + " "); - return spaceStrs[n]; - } - - function lst(arr) { return arr[arr.length-1]; } - - function selectInput(node) { - if (ios) { // Mobile Safari apparently has a bug where select() is broken. - node.selectionStart = 0; - node.selectionEnd = node.value.length; - } else node.select(); - } - - function indexOf(collection, elt) { - if (collection.indexOf) return collection.indexOf(elt); - for (var i = 0, e = collection.length; i < e; ++i) - if (collection[i] == elt) return i; - return -1; - } - - function emptyArray(size) { - for (var a = [], i = 0; i < size; ++i) a.push(undefined); - return a; - } - - function bind(f) { - var args = Array.prototype.slice.call(arguments, 1); - return function(){return f.apply(null, args);}; - } - - var nonASCIISingleCaseWordChar = /[\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc]/; - function isWordChar(ch) { - return /\w/.test(ch) || ch > "\x80" && - (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)); - } - - function isEmpty(obj) { - var c = 0; - for (var n in obj) if (obj.hasOwnProperty(n) && obj[n]) ++c; - return !c; - } - - var isExtendingChar = /[\u0300-\u036F\u0483-\u0487\u0488-\u0489\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\uA66F\uA670-\uA672\uA674-\uA67D\uA69F]/; - - // DOM UTILITIES - - function elt(tag, content, className, style) { - var e = document.createElement(tag); - if (className) e.className = className; - if (style) e.style.cssText = style; - if (typeof content == "string") setTextContent(e, content); - else if (content) for (var i = 0; i < content.length; ++i) e.appendChild(content[i]); - return e; - } - - function removeChildren(e) { - e.innerHTML = ""; - return e; - } - - function removeChildrenAndAdd(parent, e) { - return removeChildren(parent).appendChild(e); - } - - function setTextContent(e, str) { - if (ie_lt9) { - e.innerHTML = ""; - e.appendChild(document.createTextNode(str)); - } else e.textContent = str; - } - - // FEATURE DETECTION - - // Detect drag-and-drop - var dragAndDrop = function() { - // There is *some* kind of drag-and-drop support in IE6-8, but I - // couldn't get it to work yet. - if (ie_lt9) return false; - var div = elt('div'); - return "draggable" in div || "dragDrop" in div; - }(); - - // For a reason I have yet to figure out, some browsers disallow - // word wrapping between certain characters *only* if a new inline - // element is started between them. This makes it hard to reliably - // measure the position of things, since that requires inserting an - // extra span. This terribly fragile set of regexps matches the - // character combinations that suffer from this phenomenon on the - // various browsers. - var spanAffectsWrapping = /^$/; // Won't match any two-character string - if (gecko) spanAffectsWrapping = /$'/; - else if (safari) spanAffectsWrapping = /\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/; - else if (chrome) spanAffectsWrapping = /\-[^ \-\.?]|\?[^ \-\.?\]\}:;!'\"\),\/]|[\.!\"#&%\)*+,:;=>\]|\}~][\(\{\[<]|\$'/; - - var knownScrollbarWidth; - function scrollbarWidth(measure) { - if (knownScrollbarWidth != null) return knownScrollbarWidth; - var test = elt("div", null, null, "width: 50px; height: 50px; overflow-x: scroll"); - removeChildrenAndAdd(measure, test); - if (test.offsetWidth) - knownScrollbarWidth = test.offsetHeight - test.clientHeight; - return knownScrollbarWidth || 0; - } - - var zwspSupported; - function zeroWidthElement(measure) { - if (zwspSupported == null) { - var test = elt("span", "\u200b"); - removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])); - if (measure.firstChild.offsetHeight != 0) - zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !ie_lt8; - } - if (zwspSupported) return elt("span", "\u200b"); - else return elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px"); - } - - // See if "".split is the broken IE version, if so, provide an - // alternative way to split lines. - var splitLines = "\n\nb".split(/\n/).length != 3 ? function(string) { - var pos = 0, result = [], l = string.length; - while (pos <= l) { - var nl = string.indexOf("\n", pos); - if (nl == -1) nl = string.length; - var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl); - var rt = line.indexOf("\r"); - if (rt != -1) { - result.push(line.slice(0, rt)); - pos += rt + 1; - } else { - result.push(line); - pos = nl + 1; - } - } - return result; - } : function(string){return string.split(/\r\n?|\n/);}; - CodeMirror.splitLines = splitLines; - - var hasSelection = window.getSelection ? function(te) { - try { return te.selectionStart != te.selectionEnd; } - catch(e) { return false; } - } : function(te) { - try {var range = te.ownerDocument.selection.createRange();} - catch(e) {} - if (!range || range.parentElement() != te) return false; - return range.compareEndPoints("StartToEnd", range) != 0; - }; - - var hasCopyEvent = (function() { - var e = elt("div"); - if ("oncopy" in e) return true; - e.setAttribute("oncopy", "return;"); - return typeof e.oncopy == 'function'; - })(); - - // KEY NAMING - - var keyNames = {3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", - 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", - 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", - 46: "Delete", 59: ";", 91: "Mod", 92: "Mod", 93: "Mod", 109: "-", 107: "=", 127: "Delete", - 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", - 221: "]", 222: "'", 63276: "PageUp", 63277: "PageDown", 63275: "End", 63273: "Home", - 63234: "Left", 63232: "Up", 63235: "Right", 63233: "Down", 63302: "Insert", 63272: "Delete"}; - CodeMirror.keyNames = keyNames; - (function() { - // Number keys - for (var i = 0; i < 10; i++) keyNames[i + 48] = String(i); - // Alphabetic keys - for (var i = 65; i <= 90; i++) keyNames[i] = String.fromCharCode(i); - // Function keys - for (var i = 1; i <= 12; i++) keyNames[i + 111] = keyNames[i + 63235] = "F" + i; - })(); - - // BIDI HELPERS - - function iterateBidiSections(order, from, to, f) { - if (!order) return f(from, to, "ltr"); - for (var i = 0; i < order.length; ++i) { - var part = order[i]; - if (part.from < to && part.to > from) - f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr"); - } - } - - function bidiLeft(part) { return part.level % 2 ? part.to : part.from; } - function bidiRight(part) { return part.level % 2 ? part.from : part.to; } - - function lineLeft(line) { var order = getOrder(line); return order ? bidiLeft(order[0]) : 0; } - function lineRight(line) { - var order = getOrder(line); - if (!order) return line.text.length; - return bidiRight(lst(order)); - } - - function lineStart(cm, lineN) { - var line = getLine(cm.view.doc, lineN); - var visual = visualLine(cm.view.doc, line); - if (visual != line) lineN = lineNo(visual); - var order = getOrder(visual); - var ch = !order ? 0 : order[0].level % 2 ? lineRight(visual) : lineLeft(visual); - return {line: lineN, ch: ch}; - } - function lineEnd(cm, lineNo) { - var merged, line; - while (merged = collapsedSpanAtEnd(line = getLine(cm.view.doc, lineNo))) - lineNo = merged.find().to.line; - var order = getOrder(line); - var ch = !order ? line.text.length : order[0].level % 2 ? lineLeft(line) : lineRight(line); - return {line: lineNo, ch: ch}; - } - - // This is somewhat involved. It is needed in order to move - // 'visually' through bi-directional text -- i.e., pressing left - // should make the cursor go left, even when in RTL text. The - // tricky part is the 'jumps', where RTL and LTR text touch each - // other. This often requires the cursor offset to move more than - // one unit, in order to visually move one unit. - function moveVisually(line, start, dir, byUnit) { - var bidi = getOrder(line); - if (!bidi) return moveLogically(line, start, dir, byUnit); - var moveOneUnit = byUnit ? function(pos, dir) { - do pos += dir; - while (pos > 0 && isExtendingChar.test(line.text.charAt(pos))); - return pos; - } : function(pos, dir) { return pos + dir; }; - var linedir = bidi[0].level; - for (var i = 0; i < bidi.length; ++i) { - var part = bidi[i], sticky = part.level % 2 == linedir; - if ((part.from < start && part.to > start) || - (sticky && (part.from == start || part.to == start))) break; - } - var target = moveOneUnit(start, part.level % 2 ? -dir : dir); - - while (target != null) { - if (part.level % 2 == linedir) { - if (target < part.from || target > part.to) { - part = bidi[i += dir]; - target = part && (dir > 0 == part.level % 2 ? moveOneUnit(part.to, -1) : moveOneUnit(part.from, 1)); - } else break; - } else { - if (target == bidiLeft(part)) { - part = bidi[--i]; - target = part && bidiRight(part); - } else if (target == bidiRight(part)) { - part = bidi[++i]; - target = part && bidiLeft(part); - } else break; - } - } - - return target < 0 || target > line.text.length ? null : target; - } - - function moveLogically(line, start, dir, byUnit) { - var target = start + dir; - if (byUnit) while (target > 0 && isExtendingChar.test(line.text.charAt(target))) target += dir; - return target < 0 || target > line.text.length ? null : target; - } - - // Bidirectional ordering algorithm - // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm - // that this (partially) implements. - - // One-char codes used for character types: - // L (L): Left-to-Right - // R (R): Right-to-Left - // r (AL): Right-to-Left Arabic - // 1 (EN): European Number - // + (ES): European Number Separator - // % (ET): European Number Terminator - // n (AN): Arabic Number - // , (CS): Common Number Separator - // m (NSM): Non-Spacing Mark - // b (BN): Boundary Neutral - // s (B): Paragraph Separator - // t (S): Segment Separator - // w (WS): Whitespace - // N (ON): Other Neutrals - - // Returns null if characters are ordered as they appear - // (left-to-right), or an array of sections ({from, to, level} - // objects) in the order in which they occur visually. - var bidiOrdering = (function() { - // Character types for codepoints 0 to 0xff - var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL"; - // Character types for codepoints 0x600 to 0x6ff - var arabicTypes = "rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr"; - function charType(code) { - if (code <= 0xff) return lowTypes.charAt(code); - else if (0x590 <= code && code <= 0x5f4) return "R"; - else if (0x600 <= code && code <= 0x6ff) return arabicTypes.charAt(code - 0x600); - else if (0x700 <= code && code <= 0x8ac) return "r"; - else return "L"; - } - - var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/; - var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/; - - return function charOrdering(str) { - if (!bidiRE.test(str)) return false; - var len = str.length, types = [], startType = null; - for (var i = 0, type; i < len; ++i) { - types.push(type = charType(str.charCodeAt(i))); - if (startType == null) { - if (type == "L") startType = "L"; - else if (type == "R" || type == "r") startType = "R"; - } - } - if (startType == null) startType = "L"; - - // W1. Examine each non-spacing mark (NSM) in the level run, and - // change the type of the NSM to the type of the previous - // character. If the NSM is at the start of the level run, it will - // get the type of sor. - for (var i = 0, prev = startType; i < len; ++i) { - var type = types[i]; - if (type == "m") types[i] = prev; - else prev = type; - } - - // W2. Search backwards from each instance of a European number - // until the first strong type (R, L, AL, or sor) is found. If an - // AL is found, change the type of the European number to Arabic - // number. - // W3. Change all ALs to R. - for (var i = 0, cur = startType; i < len; ++i) { - var type = types[i]; - if (type == "1" && cur == "r") types[i] = "n"; - else if (isStrong.test(type)) { cur = type; if (type == "r") types[i] = "R"; } - } - - // W4. A single European separator between two European numbers - // changes to a European number. A single common separator between - // two numbers of the same type changes to that type. - for (var i = 1, prev = types[0]; i < len - 1; ++i) { - var type = types[i]; - if (type == "+" && prev == "1" && types[i+1] == "1") types[i] = "1"; - else if (type == "," && prev == types[i+1] && - (prev == "1" || prev == "n")) types[i] = prev; - prev = type; - } - - // W5. A sequence of European terminators adjacent to European - // numbers changes to all European numbers. - // W6. Otherwise, separators and terminators change to Other - // Neutral. - for (var i = 0; i < len; ++i) { - var type = types[i]; - if (type == ",") types[i] = "N"; - else if (type == "%") { - for (var end = i + 1; end < len && types[end] == "%"; ++end) {} - var replace = (i && types[i-1] == "!") || (end < len - 1 && types[end] == "1") ? "1" : "N"; - for (var j = i; j < end; ++j) types[j] = replace; - i = end - 1; - } - } - - // W7. Search backwards from each instance of a European number - // until the first strong type (R, L, or sor) is found. If an L is - // found, then change the type of the European number to L. - for (var i = 0, cur = startType; i < len; ++i) { - var type = types[i]; - if (cur == "L" && type == "1") types[i] = "L"; - else if (isStrong.test(type)) cur = type; - } - - // N1. A sequence of neutrals takes the direction of the - // surrounding strong text if the text on both sides has the same - // direction. European and Arabic numbers act as if they were R in - // terms of their influence on neutrals. Start-of-level-run (sor) - // and end-of-level-run (eor) are used at level run boundaries. - // N2. Any remaining neutrals take the embedding direction. - for (var i = 0; i < len; ++i) { - if (isNeutral.test(types[i])) { - for (var end = i + 1; end < len && isNeutral.test(types[end]); ++end) {} - var before = (i ? types[i-1] : startType) == "L"; - var after = (end < len - 1 ? types[end] : startType) == "L"; - var replace = before || after ? "L" : "R"; - for (var j = i; j < end; ++j) types[j] = replace; - i = end - 1; - } - } - - // Here we depart from the documented algorithm, in order to avoid - // building up an actual levels array. Since there are only three - // levels (0, 1, 2) in an implementation that doesn't take - // explicit embedding into account, we can build up the order on - // the fly, without following the level-based algorithm. - var order = [], m; - for (var i = 0; i < len;) { - if (countsAsLeft.test(types[i])) { - var start = i; - for (++i; i < len && countsAsLeft.test(types[i]); ++i) {} - order.push({from: start, to: i, level: 0}); - } else { - var pos = i, at = order.length; - for (++i; i < len && types[i] != "L"; ++i) {} - for (var j = pos; j < i;) { - if (countsAsNum.test(types[j])) { - if (pos < j) order.splice(at, 0, {from: pos, to: j, level: 1}); - var nstart = j; - for (++j; j < i && countsAsNum.test(types[j]); ++j) {} - order.splice(at, 0, {from: nstart, to: j, level: 2}); - pos = j; - } else ++j; - } - if (pos < i) order.splice(at, 0, {from: pos, to: i, level: 1}); - } - } - if (order[0].level == 1 && (m = str.match(/^\s+/))) { - order[0].from = m[0].length; - order.unshift({from: 0, to: m[0].length, level: 0}); - } - if (lst(order).level == 1 && (m = str.match(/\s+$/))) { - lst(order).to -= m[0].length; - order.push({from: len - m[0].length, to: len, level: 0}); - } - if (order[0].level != lst(order).level) - order.push({from: len, to: len, level: order[0].level}); - - return order; - }; - })(); - - // THE END - - CodeMirror.version = "3.0"; - - return CodeMirror; -})(); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/closetag.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/closetag.js deleted file mode 100644 index 7320c171847b51eac5d3373ec827a07877abd92e..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/closetag.js +++ /dev/null @@ -1,85 +0,0 @@ -/** - * Tag-closer extension for CodeMirror. - * - * This extension adds an "autoCloseTags" option that can be set to - * either true to get the default behavior, or an object to further - * configure its behavior. - * - * These are supported options: - * - * `whenClosing` (default true) - * Whether to autoclose when the '/' of a closing tag is typed. - * `whenOpening` (default true) - * Whether to autoclose the tag when the final '>' of an opening - * tag is typed. - * `dontCloseTags` (default is empty tags for HTML, none for XML) - * An array of tag names that should not be autoclosed. - * `indentTags` (default is block tags for HTML, none for XML) - * An array of tag names that should, when opened, cause a - * blank line to be added inside the tag, and the blank line and - * closing line to be indented. - * - * See demos/closetag.html for a usage example. - */ - -(function() { - CodeMirror.defineOption("autoCloseTags", false, function(cm, val, old) { - if (val && (old == CodeMirror.Init || !old)) { - var map = {name: "autoCloseTags"}; - if (typeof val != "object" || val.whenClosing) - map["'/'"] = function(cm) { autoCloseTag(cm, '/'); }; - if (typeof val != "object" || val.whenOpening) - map["'>'"] = function(cm) { autoCloseTag(cm, '>'); }; - cm.addKeyMap(map); - } else if (!val && (old != CodeMirror.Init && old)) { - cm.removeKeyMap("autoCloseTags"); - } - }); - - var htmlDontClose = ["area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", - "source", "track", "wbr"]; - var htmlIndent = ["applet", "blockquote", "body", "button", "div", "dl", "fieldset", "form", "frameset", "h1", "h2", "h3", "h4", - "h5", "h6", "head", "html", "iframe", "layer", "legend", "object", "ol", "p", "select", "table", "ul"]; - - function autoCloseTag(cm, ch) { - var pos = cm.getCursor(), tok = cm.getTokenAt(pos); - var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state; - if (inner.mode.name != "xml") throw CodeMirror.Pass; - - var opt = cm.getOption("autoCloseTags"), html = inner.mode.configuration == "html"; - var dontCloseTags = (typeof opt == "object" && opt.dontCloseTags) || (html && htmlDontClose); - var indentTags = (typeof opt == "object" && opt.indentTags) || (html && htmlIndent); - - if (ch == ">" && state.tagName) { - var tagName = state.tagName; - if (tok.end > pos.ch) tagName = tagName.slice(0, tagName.length - tok.end + pos.ch); - var lowerTagName = tagName.toLowerCase(); - // Don't process the '>' at the end of an end-tag or self-closing tag - if (tok.type == "tag" && state.type == "closeTag" || - /\/\s*$/.test(tok.string) || - dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1) - throw CodeMirror.Pass; - - var doIndent = indentTags && indexOf(indentTags, lowerTagName) > -1; - cm.replaceSelection(">" + (doIndent ? "\n\n" : "") + "</" + tagName + ">", - doIndent ? {line: pos.line + 1, ch: 0} : {line: pos.line, ch: pos.ch + 1}); - if (doIndent) { - cm.indentLine(pos.line + 1); - cm.indentLine(pos.line + 2); - } - return; - } else if (ch == "/" && tok.type == "tag" && tok.string == "<") { - var tagName = state.context && state.context.tagName; - if (tagName) cm.replaceSelection("/" + tagName + ">", "end"); - return; - } - throw CodeMirror.Pass; - } - - function indexOf(collection, elt) { - if (collection.indexOf) return collection.indexOf(elt); - for (var i = 0, e = collection.length; i < e; ++i) - if (collection[i] == elt) return i; - return -1; - } -})(); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/colorize.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/colorize.js deleted file mode 100644 index 62286d21e406fe90dfb7c28ac731245ca7ea5b29..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/colorize.js +++ /dev/null @@ -1,29 +0,0 @@ -CodeMirror.colorize = (function() { - - var isBlock = /^(p|li|div|h\\d|pre|blockquote|td)$/; - - function textContent(node, out) { - if (node.nodeType == 3) return out.push(node.nodeValue); - for (var ch = node.firstChild; ch; ch = ch.nextSibling) { - textContent(ch, out); - if (isBlock.test(node.nodeType)) out.push("\n"); - } - } - - return function(collection, defaultMode) { - if (!collection) collection = document.body.getElementsByTagName("pre"); - - for (var i = 0; i < collection.length; ++i) { - var node = collection[i]; - var mode = node.getAttribute("data-lang") || defaultMode; - if (!mode) continue; - - var text = []; - textContent(node, text); - node.innerHTML = ""; - CodeMirror.runMode(text.join(""), mode, node); - - node.className += " cm-s-default"; - } - }; -})(); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/continuecomment.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/continuecomment.js deleted file mode 100644 index dac83a81f69859ef91d7552d3001b11c256e071a..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/continuecomment.js +++ /dev/null @@ -1,36 +0,0 @@ -(function() { - var modes = ["clike", "css", "javascript"]; - for (var i = 0; i < modes.length; ++i) - CodeMirror.extendMode(modes[i], {blockCommentStart: "/*", - blockCommentEnd: "*/", - blockCommentContinue: " * "}); - - CodeMirror.commands.newlineAndIndentContinueComment = function(cm) { - var pos = cm.getCursor(), token = cm.getTokenAt(pos); - var mode = CodeMirror.innerMode(cm.getMode(), token.state).mode; - var space; - - if (token.type == "comment" && mode.blockCommentStart) { - var end = token.string.indexOf(mode.blockCommentEnd); - var full = cm.getRange({line: pos.line, ch: 0}, {line: pos.line, ch: token.end}), found; - if (end != -1 && end == token.string.length - mode.blockCommentEnd.length) { - // Comment ended, don't continue it - } else if (token.string.indexOf(mode.blockCommentStart) == 0) { - space = full.slice(0, token.start); - if (!/^\s*$/.test(space)) { - space = ""; - for (var i = 0; i < token.start; ++i) space += " "; - } - } else if ((found = full.indexOf(mode.blockCommentContinue)) != -1 && - found + mode.blockCommentContinue.length > token.start && - /^\s*$/.test(full.slice(0, found))) { - space = full.slice(0, found); - } - } - - if (space != null) - cm.replaceSelection("\n" + space + mode.blockCommentContinue, "end"); - else - cm.execCommand("newlineAndIndent"); - }; -})(); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/continuelist.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/continuelist.js deleted file mode 100644 index 33b343bb5370fff2dadf9914f2c1946330d31a15..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/continuelist.js +++ /dev/null @@ -1,28 +0,0 @@ -(function() { - CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) { - var pos = cm.getCursor(), token = cm.getTokenAt(pos); - var space; - if (token.className == "string") { - var full = cm.getRange({line: pos.line, ch: 0}, {line: pos.line, ch: token.end}); - var listStart = /\*|\d+\./, listContinue; - if (token.string.search(listStart) == 0) { - var reg = /^[\W]*(\d+)\./g; - var matches = reg.exec(full); - if(matches) - listContinue = (parseInt(matches[1]) + 1) + ". "; - else - listContinue = "* "; - space = full.slice(0, token.start); - if (!/^\s*$/.test(space)) { - space = ""; - for (var i = 0; i < token.start; ++i) space += " "; - } - } - } - - if (space != null) - cm.replaceSelection("\n" + space + listContinue, "end"); - else - cm.execCommand("newlineAndIndent"); - }; -})(); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/dialog.css b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/dialog.css deleted file mode 100644 index 2e7c0fc9b809b65a245a1645d954c4140cd1a408..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/dialog.css +++ /dev/null @@ -1,32 +0,0 @@ -.CodeMirror-dialog { - position: absolute; - left: 0; right: 0; - background: white; - z-index: 15; - padding: .1em .8em; - overflow: hidden; - color: #333; -} - -.CodeMirror-dialog-top { - border-bottom: 1px solid #eee; - top: 0; -} - -.CodeMirror-dialog-bottom { - border-top: 1px solid #eee; - bottom: 0; -} - -.CodeMirror-dialog input { - border: none; - outline: none; - background: transparent; - width: 20em; - color: inherit; - font-family: monospace; -} - -.CodeMirror-dialog button { - font-size: 70%; -} diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/dialog.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/dialog.js deleted file mode 100644 index 380b80455cba0af2e1b2dc383da469218279e30f..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/dialog.js +++ /dev/null @@ -1,75 +0,0 @@ -// Open simple dialogs on top of an editor. Relies on dialog.css. - -(function() { - function dialogDiv(cm, template, bottom) { - var wrap = cm.getWrapperElement(); - var dialog; - dialog = wrap.appendChild(document.createElement("div")); - if (bottom) { - dialog.className = "CodeMirror-dialog CodeMirror-dialog-bottom"; - } else { - dialog.className = "CodeMirror-dialog CodeMirror-dialog-top"; - } - dialog.innerHTML = template; - return dialog; - } - - CodeMirror.defineExtension("openDialog", function(template, callback, options) { - var dialog = dialogDiv(this, template, options && options.bottom); - var closed = false, me = this; - function close() { - if (closed) return; - closed = true; - dialog.parentNode.removeChild(dialog); - } - var inp = dialog.getElementsByTagName("input")[0], button; - if (inp) { - CodeMirror.on(inp, "keydown", function(e) { - if (e.keyCode == 13 || e.keyCode == 27) { - CodeMirror.e_stop(e); - close(); - me.focus(); - if (e.keyCode == 13) callback(inp.value); - } - }); - inp.focus(); - CodeMirror.on(inp, "blur", close); - } else if (button = dialog.getElementsByTagName("button")[0]) { - CodeMirror.on(button, "click", function() { - close(); - me.focus(); - }); - button.focus(); - CodeMirror.on(button, "blur", close); - } - return close; - }); - - CodeMirror.defineExtension("openConfirm", function(template, callbacks, options) { - var dialog = dialogDiv(this, template, options && options.bottom); - var buttons = dialog.getElementsByTagName("button"); - var closed = false, me = this, blurring = 1; - function close() { - if (closed) return; - closed = true; - dialog.parentNode.removeChild(dialog); - me.focus(); - } - buttons[0].focus(); - for (var i = 0; i < buttons.length; ++i) { - var b = buttons[i]; - (function(callback) { - CodeMirror.on(b, "click", function(e) { - CodeMirror.e_preventDefault(e); - close(); - if (callback) callback(me); - }); - })(callbacks[i]); - CodeMirror.on(b, "blur", function() { - --blurring; - setTimeout(function() { if (blurring <= 0) close(); }, 200); - }); - CodeMirror.on(b, "focus", function() { ++blurring; }); - } - }); -})(); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/foldcode.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/foldcode.js deleted file mode 100644 index 407bac2a5eaffb3822e4645289180bc6f879cbe0..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/foldcode.js +++ /dev/null @@ -1,182 +0,0 @@ -// the tagRangeFinder function is -// Copyright (C) 2011 by Daniel Glazman <daniel@glazman.org> -// released under the MIT license (../../LICENSE) like the rest of CodeMirror -CodeMirror.tagRangeFinder = function(cm, start) { - var nameStartChar = "A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"; - var nameChar = nameStartChar + "\-\:\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; - var xmlNAMERegExp = new RegExp("^[" + nameStartChar + "][" + nameChar + "]*"); - - var lineText = cm.getLine(start.line); - var found = false; - var tag = null; - var pos = start.ch; - while (!found) { - pos = lineText.indexOf("<", pos); - if (-1 == pos) // no tag on line - return; - if (pos + 1 < lineText.length && lineText[pos + 1] == "/") { // closing tag - pos++; - continue; - } - // ok we seem to have a start tag - if (!lineText.substr(pos + 1).match(xmlNAMERegExp)) { // not a tag name... - pos++; - continue; - } - var gtPos = lineText.indexOf(">", pos + 1); - if (-1 == gtPos) { // end of start tag not in line - var l = start.line + 1; - var foundGt = false; - var lastLine = cm.lineCount(); - while (l < lastLine && !foundGt) { - var lt = cm.getLine(l); - gtPos = lt.indexOf(">"); - if (-1 != gtPos) { // found a > - foundGt = true; - var slash = lt.lastIndexOf("/", gtPos); - if (-1 != slash && slash < gtPos) { - var str = lineText.substr(slash, gtPos - slash + 1); - if (!str.match( /\/\s*\>/ )) // yep, that's the end of empty tag - return; - } - } - l++; - } - found = true; - } - else { - var slashPos = lineText.lastIndexOf("/", gtPos); - if (-1 == slashPos) { // cannot be empty tag - found = true; - // don't continue - } - else { // empty tag? - // check if really empty tag - var str = lineText.substr(slashPos, gtPos - slashPos + 1); - if (!str.match( /\/\s*\>/ )) { // finally not empty - found = true; - // don't continue - } - } - } - if (found) { - var subLine = lineText.substr(pos + 1); - tag = subLine.match(xmlNAMERegExp); - if (tag) { - // we have an element name, wooohooo ! - tag = tag[0]; - // do we have the close tag on same line ??? - if (-1 != lineText.indexOf("</" + tag + ">", pos)) // yep - { - found = false; - } - // we don't, so we have a candidate... - } - else - found = false; - } - if (!found) - pos++; - } - - if (found) { - var startTag = "(\\<\\/" + tag + "\\>)|(\\<" + tag + "\\>)|(\\<" + tag + "\\s)|(\\<" + tag + "$)"; - var startTagRegExp = new RegExp(startTag); - var endTag = "</" + tag + ">"; - var depth = 1; - var l = start.line + 1; - var lastLine = cm.lineCount(); - while (l < lastLine) { - lineText = cm.getLine(l); - var match = lineText.match(startTagRegExp); - if (match) { - for (var i = 0; i < match.length; i++) { - if (match[i] == endTag) - depth--; - else - depth++; - if (!depth) return {from: {line: start.line, ch: gtPos + 1}, - to: {line: l, ch: match.index}}; - } - } - l++; - } - return; - } -}; - -CodeMirror.braceRangeFinder = function(cm, start) { - var line = start.line, lineText = cm.getLine(line); - var at = lineText.length, startChar, tokenType; - for (;;) { - var found = lineText.lastIndexOf("{", at); - if (found < start.ch) break; - tokenType = cm.getTokenAt({line: line, ch: found}).type; - if (!/^(comment|string)/.test(tokenType)) { startChar = found; break; } - at = found - 1; - } - if (startChar == null || lineText.lastIndexOf("}") > startChar) return; - var count = 1, lastLine = cm.lineCount(), end, endCh; - outer: for (var i = line + 1; i < lastLine; ++i) { - var text = cm.getLine(i), pos = 0; - for (;;) { - var nextOpen = text.indexOf("{", pos), nextClose = text.indexOf("}", pos); - if (nextOpen < 0) nextOpen = text.length; - if (nextClose < 0) nextClose = text.length; - pos = Math.min(nextOpen, nextClose); - if (pos == text.length) break; - if (cm.getTokenAt({line: i, ch: pos + 1}).type == tokenType) { - if (pos == nextOpen) ++count; - else if (!--count) { end = i; endCh = pos; break outer; } - } - ++pos; - } - } - if (end == null || end == line + 1) return; - return {from: {line: line, ch: startChar + 1}, - to: {line: end, ch: endCh}}; -}; - -CodeMirror.indentRangeFinder = function(cm, start) { - var tabSize = cm.getOption("tabSize"), firstLine = cm.getLine(start.line); - var myIndent = CodeMirror.countColumn(firstLine, null, tabSize); - for (var i = start.line + 1, end = cm.lineCount(); i < end; ++i) { - var curLine = cm.getLine(i); - if (CodeMirror.countColumn(curLine, null, tabSize) < myIndent) - return {from: {line: start.line, ch: firstLine.length}, - to: {line: i, ch: curLine.length}}; - } -}; - -CodeMirror.newFoldFunction = function(rangeFinder, widget) { - if (widget == null) widget = "\u2194"; - if (typeof widget == "string") { - var text = document.createTextNode(widget); - widget = document.createElement("span"); - widget.appendChild(text); - widget.className = "CodeMirror-foldmarker"; - } - - return function(cm, pos) { - if (typeof pos == "number") pos = {line: pos, ch: 0}; - var range = rangeFinder(cm, pos); - if (!range) return; - - var present = cm.findMarksAt(range.from), cleared = 0; - for (var i = 0; i < present.length; ++i) { - if (present[i].__isFold) { - ++cleared; - present[i].clear(); - } - } - if (cleared) return; - - var myWidget = widget.cloneNode(true); - CodeMirror.on(myWidget, "mousedown", function() {myRange.clear();}); - var myRange = cm.markText(range.from, range.to, { - replacedWith: myWidget, - clearOnEnter: true, - __isFold: true - }); - }; -}; diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/formatting.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/formatting.js deleted file mode 100644 index ccf2a9a6bb7898287567ed7f8a4c08b50ab3eb07..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/formatting.js +++ /dev/null @@ -1,108 +0,0 @@ -(function() { - - CodeMirror.extendMode("css", { - commentStart: "/*", - commentEnd: "*/", - newlineAfterToken: function(_type, content) { - return /^[;{}]$/.test(content); - } - }); - - CodeMirror.extendMode("javascript", { - commentStart: "/*", - commentEnd: "*/", - // FIXME semicolons inside of for - newlineAfterToken: function(_type, content, textAfter, state) { - if (this.jsonMode) { - return /^[\[,{]$/.test(content) || /^}/.test(textAfter); - } else { - if (content == ";" && state.lexical && state.lexical.type == ")") return false; - return /^[;{}]$/.test(content) && !/^;/.test(textAfter); - } - } - }); - - CodeMirror.extendMode("xml", { - commentStart: "<!--", - commentEnd: "-->", - newlineAfterToken: function(type, content, textAfter) { - return type == "tag" && />$/.test(content) || /^</.test(textAfter); - } - }); - - // Comment/uncomment the specified range - CodeMirror.defineExtension("commentRange", function (isComment, from, to) { - var cm = this, curMode = CodeMirror.innerMode(cm.getMode(), cm.getTokenAt(from).state).mode; - cm.operation(function() { - if (isComment) { // Comment range - cm.replaceRange(curMode.commentEnd, to); - cm.replaceRange(curMode.commentStart, from); - if (from.line == to.line && from.ch == to.ch) // An empty comment inserted - put cursor inside - cm.setCursor(from.line, from.ch + curMode.commentStart.length); - } else { // Uncomment range - var selText = cm.getRange(from, to); - var startIndex = selText.indexOf(curMode.commentStart); - var endIndex = selText.lastIndexOf(curMode.commentEnd); - if (startIndex > -1 && endIndex > -1 && endIndex > startIndex) { - // Take string till comment start - selText = selText.substr(0, startIndex) - // From comment start till comment end - + selText.substring(startIndex + curMode.commentStart.length, endIndex) - // From comment end till string end - + selText.substr(endIndex + curMode.commentEnd.length); - } - cm.replaceRange(selText, from, to); - } - }); - }); - - // Applies automatic mode-aware indentation to the specified range - CodeMirror.defineExtension("autoIndentRange", function (from, to) { - var cmInstance = this; - this.operation(function () { - for (var i = from.line; i <= to.line; i++) { - cmInstance.indentLine(i, "smart"); - } - }); - }); - - // Applies automatic formatting to the specified range - CodeMirror.defineExtension("autoFormatRange", function (from, to) { - var cm = this; - var outer = cm.getMode(), text = cm.getRange(from, to).split("\n"); - var state = CodeMirror.copyState(outer, cm.getTokenAt(from).state); - var tabSize = cm.getOption("tabSize"); - - var out = "", lines = 0, atSol = from.ch == 0; - function newline() { - out += "\n"; - atSol = true; - ++lines; - } - - for (var i = 0; i < text.length; ++i) { - var stream = new CodeMirror.StringStream(text[i], tabSize); - while (!stream.eol()) { - var inner = CodeMirror.innerMode(outer, state); - var style = outer.token(stream, state), cur = stream.current(); - stream.start = stream.pos; - if (!atSol || /\S/.test(cur)) { - out += cur; - atSol = false; - } - if (!atSol && inner.mode.newlineAfterToken && - inner.mode.newlineAfterToken(style, cur, stream.string.slice(stream.pos) || text[i+1] || "", inner.state)) - newline(); - } - if (!stream.pos && outer.blankLine) outer.blankLine(state); - if (!atSol) newline(); - } - - cm.operation(function () { - cm.replaceRange(out, from, to); - for (var cur = from.line + 1, end = from.line + lines; cur <= end; ++cur) - cm.indentLine(cur, "smart"); - cm.setSelection(from, cm.getCursor(false)); - }); - }); -})(); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/javascript-hint.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/javascript-hint.js deleted file mode 100644 index 07caba8766f6aaf89817d584b229d0b2d32dbc99..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/javascript-hint.js +++ /dev/null @@ -1,137 +0,0 @@ -(function () { - function forEach(arr, f) { - for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]); - } - - function arrayContains(arr, item) { - if (!Array.prototype.indexOf) { - var i = arr.length; - while (i--) { - if (arr[i] === item) { - return true; - } - } - return false; - } - return arr.indexOf(item) != -1; - } - - function scriptHint(editor, keywords, getToken, options) { - // Find the token at the cursor - var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token; - // If it's not a 'word-style' token, ignore the token. - if (!/^[\w$_]*$/.test(token.string)) { - token = tprop = {start: cur.ch, end: cur.ch, string: "", state: token.state, - type: token.string == "." ? "property" : null}; - } - // If it is a property, find out what it is a property of. - while (tprop.type == "property") { - tprop = getToken(editor, {line: cur.line, ch: tprop.start}); - if (tprop.string != ".") return; - tprop = getToken(editor, {line: cur.line, ch: tprop.start}); - if (tprop.string == ')') { - var level = 1; - do { - tprop = getToken(editor, {line: cur.line, ch: tprop.start}); - switch (tprop.string) { - case ')': level++; break; - case '(': level--; break; - default: break; - } - } while (level > 0); - tprop = getToken(editor, {line: cur.line, ch: tprop.start}); - if (tprop.type == 'variable') - tprop.type = 'function'; - else return; // no clue - } - if (!context) var context = []; - context.push(tprop); - } - return {list: getCompletions(token, context, keywords, options), - from: {line: cur.line, ch: token.start}, - to: {line: cur.line, ch: token.end}}; - } - - CodeMirror.javascriptHint = function(editor, options) { - return scriptHint(editor, javascriptKeywords, - function (e, cur) {return e.getTokenAt(cur);}, - options); - }; - - function getCoffeeScriptToken(editor, cur) { - // This getToken, it is for coffeescript, imitates the behavior of - // getTokenAt method in javascript.js, that is, returning "property" - // type and treat "." as indepenent token. - var token = editor.getTokenAt(cur); - if (cur.ch == token.start + 1 && token.string.charAt(0) == '.') { - token.end = token.start; - token.string = '.'; - token.type = "property"; - } - else if (/^\.[\w$_]*$/.test(token.string)) { - token.type = "property"; - token.start++; - token.string = token.string.replace(/\./, ''); - } - return token; - } - - CodeMirror.coffeescriptHint = function(editor, options) { - return scriptHint(editor, coffeescriptKeywords, getCoffeeScriptToken, options); - }; - - var stringProps = ("charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight " + - "toUpperCase toLowerCase split concat match replace search").split(" "); - var arrayProps = ("length concat join splice push pop shift unshift slice reverse sort indexOf " + - "lastIndexOf every some filter forEach map reduce reduceRight ").split(" "); - var funcProps = "prototype apply call bind".split(" "); - var javascriptKeywords = ("break case catch continue debugger default delete do else false finally for function " + - "if in instanceof new null return switch throw true try typeof var void while with").split(" "); - var coffeescriptKeywords = ("and break catch class continue delete do else extends false finally for " + - "if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes").split(" "); - - function getCompletions(token, context, keywords, options) { - var found = [], start = token.string; - function maybeAdd(str) { - if (str.indexOf(start) == 0 && !arrayContains(found, str)) found.push(str); - } - function gatherCompletions(obj) { - if (typeof obj == "string") forEach(stringProps, maybeAdd); - else if (obj instanceof Array) forEach(arrayProps, maybeAdd); - else if (obj instanceof Function) forEach(funcProps, maybeAdd); - for (var name in obj) maybeAdd(name); - } - - if (context) { - // If this is a property, see if it belongs to some object we can - // find in the current environment. - var obj = context.pop(), base; - if (obj.type == "variable") { - if (options && options.additionalContext) - base = options.additionalContext[obj.string]; - base = base || window[obj.string]; - } else if (obj.type == "string") { - base = ""; - } else if (obj.type == "atom") { - base = 1; - } else if (obj.type == "function") { - if (window.jQuery != null && (obj.string == '$' || obj.string == 'jQuery') && - (typeof window.jQuery == 'function')) - base = window.jQuery(); - else if (window._ != null && (obj.string == '_') && (typeof window._ == 'function')) - base = window._(); - } - while (base != null && context.length) - base = base[context.pop().string]; - if (base != null) gatherCompletions(base); - } - else { - // If not, just look in the window object and any local scope - // (reading into JS mode internals to get at the local variables) - for (var v = token.state.localVars; v; v = v.next) maybeAdd(v.name); - gatherCompletions(window); - forEach(keywords, maybeAdd); - } - return found; - } -})(); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/loadmode.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/loadmode.js deleted file mode 100644 index 60fafbb17824516db4e434b42bb030b66fc34c7f..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/loadmode.js +++ /dev/null @@ -1,51 +0,0 @@ -(function() { - if (!CodeMirror.modeURL) CodeMirror.modeURL = "../mode/%N/%N.js"; - - var loading = {}; - function splitCallback(cont, n) { - var countDown = n; - return function() { if (--countDown == 0) cont(); }; - } - function ensureDeps(mode, cont) { - var deps = CodeMirror.modes[mode].dependencies; - if (!deps) return cont(); - var missing = []; - for (var i = 0; i < deps.length; ++i) { - if (!CodeMirror.modes.hasOwnProperty(deps[i])) - missing.push(deps[i]); - } - if (!missing.length) return cont(); - var split = splitCallback(cont, missing.length); - for (var i = 0; i < missing.length; ++i) - CodeMirror.requireMode(missing[i], split); - } - - CodeMirror.requireMode = function(mode, cont) { - if (typeof mode != "string") mode = mode.name; - if (CodeMirror.modes.hasOwnProperty(mode)) return ensureDeps(mode, cont); - if (loading.hasOwnProperty(mode)) return loading[mode].push(cont); - - var script = document.createElement("script"); - script.src = CodeMirror.modeURL.replace(/%N/g, mode); - var others = document.getElementsByTagName("script")[0]; - others.parentNode.insertBefore(script, others); - var list = loading[mode] = [cont]; - var count = 0, poll = setInterval(function() { - if (++count > 100) return clearInterval(poll); - if (CodeMirror.modes.hasOwnProperty(mode)) { - clearInterval(poll); - loading[mode] = null; - ensureDeps(mode, function() { - for (var i = 0; i < list.length; ++i) list[i](); - }); - } - }, 200); - }; - - CodeMirror.autoLoadMode = function(instance, mode) { - if (!CodeMirror.modes.hasOwnProperty(mode)) - CodeMirror.requireMode(mode, function() { - instance.setOption("mode", instance.getOption("mode")); - }); - }; -}()); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/match-highlighter.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/match-highlighter.js deleted file mode 100644 index bb93ebca46fb9038619a9b31e0bcf75560f739d1..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/match-highlighter.js +++ /dev/null @@ -1,46 +0,0 @@ -// Define match-highlighter commands. Depends on searchcursor.js -// Use by attaching the following function call to the cursorActivity event: - //myCodeMirror.matchHighlight(minChars); -// And including a special span.CodeMirror-matchhighlight css class (also optionally a separate one for .CodeMirror-focused -- see demo matchhighlighter.html) - -(function() { - var DEFAULT_MIN_CHARS = 2; - - function MatchHighlightState() { - this.marked = []; - } - function getMatchHighlightState(cm) { - return cm._matchHighlightState || (cm._matchHighlightState = new MatchHighlightState()); - } - - function clearMarks(cm) { - var state = getMatchHighlightState(cm); - for (var i = 0; i < state.marked.length; ++i) - state.marked[i].clear(); - state.marked = []; - } - - function markDocument(cm, className, minChars) { - clearMarks(cm); - minChars = (typeof minChars !== 'undefined' ? minChars : DEFAULT_MIN_CHARS); - if (cm.somethingSelected() && cm.getSelection().replace(/^\s+|\s+$/g, "").length >= minChars) { - var state = getMatchHighlightState(cm); - var query = cm.getSelection(); - cm.operation(function() { - if (cm.lineCount() < 2000) { // This is too expensive on big documents. - for (var cursor = cm.getSearchCursor(query); cursor.findNext();) { - //Only apply matchhighlight to the matches other than the one actually selected - if (cursor.from().line !== cm.getCursor(true).line || - cursor.from().ch !== cm.getCursor(true).ch) - state.marked.push(cm.markText(cursor.from(), cursor.to(), - {className: className})); - } - } - }); - } - } - - CodeMirror.defineExtension("matchHighlight", function(className, minChars) { - markDocument(this, className, minChars); - }); -})(); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/matchbrackets.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/matchbrackets.js deleted file mode 100644 index 2df2fbb35f6a928e23c86b80ced8bddbae7e9269..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/matchbrackets.js +++ /dev/null @@ -1,63 +0,0 @@ -(function() { - var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"}; - function findMatchingBracket(cm) { - var cur = cm.getCursor(), line = cm.getLineHandle(cur.line), pos = cur.ch - 1; - var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)]; - if (!match) return null; - var forward = match.charAt(1) == ">", d = forward ? 1 : -1; - var style = cm.getTokenAt({line: cur.line, ch: pos + 1}).type; - - var stack = [line.text.charAt(pos)], re = /[(){}[\]]/; - function scan(line, lineNo, start) { - if (!line.text) return; - var pos = forward ? 0 : line.text.length - 1, end = forward ? line.text.length : -1; - if (start != null) pos = start + d; - for (; pos != end; pos += d) { - var ch = line.text.charAt(pos); - if (re.test(ch) && cm.getTokenAt({line: lineNo, ch: pos + 1}).type == style) { - var match = matching[ch]; - if (match.charAt(1) == ">" == forward) stack.push(ch); - else if (stack.pop() != match.charAt(0)) return {pos: pos, match: false}; - else if (!stack.length) return {pos: pos, match: true}; - } - } - } - for (var i = cur.line, found, e = forward ? Math.min(i + 100, cm.lineCount()) : Math.max(-1, i - 100); i != e; i+=d) { - if (i == cur.line) found = scan(line, i, pos); - else found = scan(cm.getLineHandle(i), i); - if (found) break; - } - return {from: {line: cur.line, ch: pos}, to: found && {line: i, ch: found.pos}, match: found && found.match}; - } - - function matchBrackets(cm, autoclear) { - var found = findMatchingBracket(cm); - if (!found) return; - var style = found.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket"; - var one = cm.markText(found.from, {line: found.from.line, ch: found.from.ch + 1}, - {className: style}); - var two = found.to && cm.markText(found.to, {line: found.to.line, ch: found.to.ch + 1}, - {className: style}); - var clear = function() { - cm.operation(function() { one.clear(); two && two.clear(); }); - }; - if (autoclear) setTimeout(clear, 800); - else return clear; - } - - var currentlyHighlighted = null; - function doMatchBrackets(cm) { - cm.operation(function() { - if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;} - if (!cm.somethingSelected()) currentlyHighlighted = matchBrackets(cm, false); - }); - } - - CodeMirror.defineOption("matchBrackets", false, function(cm, val) { - if (val) cm.on("cursorActivity", doMatchBrackets); - else cm.off("cursorActivity", doMatchBrackets); - }); - - CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);}); - CodeMirror.defineExtension("findMatchingBracket", function(){return findMatchingBracket(this);}); -})(); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/multiplex.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/multiplex.js deleted file mode 100644 index e77ff2a9c379ac55c92a81732282caee67c0535d..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/multiplex.js +++ /dev/null @@ -1,95 +0,0 @@ -CodeMirror.multiplexingMode = function(outer /*, others */) { - // Others should be {open, close, mode [, delimStyle]} objects - var others = Array.prototype.slice.call(arguments, 1); - var n_others = others.length; - - function indexOf(string, pattern, from) { - if (typeof pattern == "string") return string.indexOf(pattern, from); - var m = pattern.exec(from ? string.slice(from) : string); - return m ? m.index + from : -1; - } - - return { - startState: function() { - return { - outer: CodeMirror.startState(outer), - innerActive: null, - inner: null - }; - }, - - copyState: function(state) { - return { - outer: CodeMirror.copyState(outer, state.outer), - innerActive: state.innerActive, - inner: state.innerActive && CodeMirror.copyState(state.innerActive.mode, state.inner) - }; - }, - - token: function(stream, state) { - if (!state.innerActive) { - var cutOff = Infinity, oldContent = stream.string; - for (var i = 0; i < n_others; ++i) { - var other = others[i]; - var found = indexOf(oldContent, other.open, stream.pos); - if (found == stream.pos) { - stream.match(other.open); - state.innerActive = other; - state.inner = CodeMirror.startState(other.mode, outer.indent ? outer.indent(state.outer, "") : 0); - return other.delimStyle; - } else if (found != -1 && found < cutOff) { - cutOff = found; - } - } - if (cutOff != Infinity) stream.string = oldContent.slice(0, cutOff); - var outerToken = outer.token(stream, state.outer); - if (cutOff != Infinity) stream.string = oldContent; - return outerToken; - } else { - var curInner = state.innerActive, oldContent = stream.string; - var found = indexOf(oldContent, curInner.close, stream.pos); - if (found == stream.pos) { - stream.match(curInner.close); - state.innerActive = state.inner = null; - return curInner.delimStyle; - } - if (found > -1) stream.string = oldContent.slice(0, found); - var innerToken = curInner.mode.token(stream, state.inner); - if (found > -1) stream.string = oldContent; - var cur = stream.current(), found = cur.indexOf(curInner.close); - if (found > -1) stream.backUp(cur.length - found); - return innerToken; - } - }, - - indent: function(state, textAfter) { - var mode = state.innerActive ? state.innerActive.mode : outer; - if (!mode.indent) return CodeMirror.Pass; - return mode.indent(state.innerActive ? state.inner : state.outer, textAfter); - }, - - blankLine: function(state) { - var mode = state.innerActive ? state.innerActive.mode : outer; - if (mode.blankLine) { - mode.blankLine(state.innerActive ? state.inner : state.outer); - } - if (!state.innerActive) { - for (var i = 0; i < n_others; ++i) { - var other = others[i]; - if (other.open === "\n") { - state.innerActive = other; - state.inner = CodeMirror.startState(other.mode, mode.indent ? mode.indent(state.outer, "") : 0); - } - } - } else if (mode.close === "\n") { - state.innerActive = state.inner = null; - } - }, - - electricChars: outer.electricChars, - - innerMode: function(state) { - return state.inner ? {state: state.inner, mode: state.innerActive.mode} : {state: state.outer, mode: outer}; - } - }; -}; diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/overlay.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/overlay.js deleted file mode 100644 index fba38987bbf8a357881bfd84758abac24efdaca2..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/overlay.js +++ /dev/null @@ -1,59 +0,0 @@ -// Utility function that allows modes to be combined. The mode given -// as the base argument takes care of most of the normal mode -// functionality, but a second (typically simple) mode is used, which -// can override the style of text. Both modes get to parse all of the -// text, but when both assign a non-null style to a piece of code, the -// overlay wins, unless the combine argument was true, in which case -// the styles are combined. - -// overlayParser is the old, deprecated name -CodeMirror.overlayMode = CodeMirror.overlayParser = function(base, overlay, combine) { - return { - startState: function() { - return { - base: CodeMirror.startState(base), - overlay: CodeMirror.startState(overlay), - basePos: 0, baseCur: null, - overlayPos: 0, overlayCur: null - }; - }, - copyState: function(state) { - return { - base: CodeMirror.copyState(base, state.base), - overlay: CodeMirror.copyState(overlay, state.overlay), - basePos: state.basePos, baseCur: null, - overlayPos: state.overlayPos, overlayCur: null - }; - }, - - token: function(stream, state) { - if (stream.start == state.basePos) { - state.baseCur = base.token(stream, state.base); - state.basePos = stream.pos; - } - if (stream.start == state.overlayPos) { - stream.pos = stream.start; - state.overlayCur = overlay.token(stream, state.overlay); - state.overlayPos = stream.pos; - } - stream.pos = Math.min(state.basePos, state.overlayPos); - if (stream.eol()) state.basePos = state.overlayPos = 0; - - if (state.overlayCur == null) return state.baseCur; - if (state.baseCur != null && combine) return state.baseCur + " " + state.overlayCur; - else return state.overlayCur; - }, - - indent: base.indent && function(state, textAfter) { - return base.indent(state.base, textAfter); - }, - electricChars: base.electricChars, - - innerMode: function(state) { return {state: state.base, mode: base}; }, - - blankLine: function(state) { - if (base.blankLine) base.blankLine(state.base); - if (overlay.blankLine) overlay.blankLine(state.overlay); - } - }; -}; diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/pig-hint.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/pig-hint.js deleted file mode 100644 index 149b468158836bd7038e2d8a38f502960a22d2fc..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/pig-hint.js +++ /dev/null @@ -1,117 +0,0 @@ -(function () { - function forEach(arr, f) { - for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]); - } - - function arrayContains(arr, item) { - if (!Array.prototype.indexOf) { - var i = arr.length; - while (i--) { - if (arr[i] === item) { - return true; - } - } - return false; - } - return arr.indexOf(item) != -1; - } - - function scriptHint(editor, _keywords, getToken) { - // Find the token at the cursor - var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token; - // If it's not a 'word-style' token, ignore the token. - - if (!/^[\w$_]*$/.test(token.string)) { - token = tprop = {start: cur.ch, end: cur.ch, string: "", state: token.state, - className: token.string == ":" ? "pig-type" : null}; - } - - if (!context) var context = []; - context.push(tprop); - - var completionList = getCompletions(token, context); - completionList = completionList.sort(); - //prevent autocomplete for last word, instead show dropdown with one word - if(completionList.length == 1) { - completionList.push(" "); - } - - return {list: completionList, - from: {line: cur.line, ch: token.start}, - to: {line: cur.line, ch: token.end}}; - } - - CodeMirror.pigHint = function(editor) { - return scriptHint(editor, pigKeywordsU, function (e, cur) {return e.getTokenAt(cur);}); - }; - - var pigKeywords = "VOID IMPORT RETURNS DEFINE LOAD FILTER FOREACH ORDER CUBE DISTINCT COGROUP " - + "JOIN CROSS UNION SPLIT INTO IF OTHERWISE ALL AS BY USING INNER OUTER ONSCHEMA PARALLEL " - + "PARTITION GROUP AND OR NOT GENERATE FLATTEN ASC DESC IS STREAM THROUGH STORE MAPREDUCE " - + "SHIP CACHE INPUT OUTPUT STDERROR STDIN STDOUT LIMIT SAMPLE LEFT RIGHT FULL EQ GT LT GTE LTE " - + "NEQ MATCHES TRUE FALSE"; - var pigKeywordsU = pigKeywords.split(" "); - var pigKeywordsL = pigKeywords.toLowerCase().split(" "); - - var pigTypes = "BOOLEAN INT LONG FLOAT DOUBLE CHARARRAY BYTEARRAY BAG TUPLE MAP"; - var pigTypesU = pigTypes.split(" "); - var pigTypesL = pigTypes.toLowerCase().split(" "); - - var pigBuiltins = "ABS ACOS ARITY ASIN ATAN AVG BAGSIZE BINSTORAGE BLOOM BUILDBLOOM CBRT CEIL " - + "CONCAT COR COS COSH COUNT COUNT_STAR COV CONSTANTSIZE CUBEDIMENSIONS DIFF DISTINCT DOUBLEABS " - + "DOUBLEAVG DOUBLEBASE DOUBLEMAX DOUBLEMIN DOUBLEROUND DOUBLESUM EXP FLOOR FLOATABS FLOATAVG " - + "FLOATMAX FLOATMIN FLOATROUND FLOATSUM GENERICINVOKER INDEXOF INTABS INTAVG INTMAX INTMIN " - + "INTSUM INVOKEFORDOUBLE INVOKEFORFLOAT INVOKEFORINT INVOKEFORLONG INVOKEFORSTRING INVOKER " - + "ISEMPTY JSONLOADER JSONMETADATA JSONSTORAGE LAST_INDEX_OF LCFIRST LOG LOG10 LOWER LONGABS " - + "LONGAVG LONGMAX LONGMIN LONGSUM MAX MIN MAPSIZE MONITOREDUDF NONDETERMINISTIC OUTPUTSCHEMA " - + "PIGSTORAGE PIGSTREAMING RANDOM REGEX_EXTRACT REGEX_EXTRACT_ALL REPLACE ROUND SIN SINH SIZE " - + "SQRT STRSPLIT SUBSTRING SUM STRINGCONCAT STRINGMAX STRINGMIN STRINGSIZE TAN TANH TOBAG " - + "TOKENIZE TOMAP TOP TOTUPLE TRIM TEXTLOADER TUPLESIZE UCFIRST UPPER UTF8STORAGECONVERTER"; - var pigBuiltinsU = pigBuiltins.split(" ").join("() ").split(" "); - var pigBuiltinsL = pigBuiltins.toLowerCase().split(" ").join("() ").split(" "); - var pigBuiltinsC = ("BagSize BinStorage Bloom BuildBloom ConstantSize CubeDimensions DoubleAbs " - + "DoubleAvg DoubleBase DoubleMax DoubleMin DoubleRound DoubleSum FloatAbs FloatAvg FloatMax " - + "FloatMin FloatRound FloatSum GenericInvoker IntAbs IntAvg IntMax IntMin IntSum " - + "InvokeForDouble InvokeForFloat InvokeForInt InvokeForLong InvokeForString Invoker " - + "IsEmpty JsonLoader JsonMetadata JsonStorage LongAbs LongAvg LongMax LongMin LongSum MapSize " - + "MonitoredUDF Nondeterministic OutputSchema PigStorage PigStreaming StringConcat StringMax " - + "StringMin StringSize TextLoader TupleSize Utf8StorageConverter").split(" ").join("() ").split(" "); - - function getCompletions(token, context) { - var found = [], start = token.string; - function maybeAdd(str) { - if (str.indexOf(start) == 0 && !arrayContains(found, str)) found.push(str); - } - - function gatherCompletions(obj) { - if(obj == ":") { - forEach(pigTypesL, maybeAdd); - } - else { - forEach(pigBuiltinsU, maybeAdd); - forEach(pigBuiltinsL, maybeAdd); - forEach(pigBuiltinsC, maybeAdd); - forEach(pigTypesU, maybeAdd); - forEach(pigTypesL, maybeAdd); - forEach(pigKeywordsU, maybeAdd); - forEach(pigKeywordsL, maybeAdd); - } - } - - if (context) { - // If this is a property, see if it belongs to some object we can - // find in the current environment. - var obj = context.pop(), base; - - if (obj.type == "variable") - base = obj.string; - else if(obj.type == "variable-3") - base = ":" + obj.string; - - while (base != null && context.length) - base = base[context.pop().string]; - if (base != null) gatherCompletions(base); - } - return found; - } -})(); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/runmode-standalone.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/runmode-standalone.js deleted file mode 100644 index afdf044d8d5c5e86f24f0ecc9f69e917c65469f7..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/runmode-standalone.js +++ /dev/null @@ -1,90 +0,0 @@ -/* Just enough of CodeMirror to run runMode under node.js */ - -function splitLines(string){ return string.split(/\r?\n|\r/); }; - -function StringStream(string) { - this.pos = this.start = 0; - this.string = string; -} -StringStream.prototype = { - eol: function() {return this.pos >= this.string.length;}, - sol: function() {return this.pos == 0;}, - peek: function() {return this.string.charAt(this.pos) || null;}, - next: function() { - if (this.pos < this.string.length) - return this.string.charAt(this.pos++); - }, - eat: function(match) { - var ch = this.string.charAt(this.pos); - if (typeof match == "string") var ok = ch == match; - else var ok = ch && (match.test ? match.test(ch) : match(ch)); - if (ok) {++this.pos; return ch;} - }, - eatWhile: function(match) { - var start = this.pos; - while (this.eat(match)){} - return this.pos > start; - }, - eatSpace: function() { - var start = this.pos; - while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos; - return this.pos > start; - }, - skipToEnd: function() {this.pos = this.string.length;}, - skipTo: function(ch) { - var found = this.string.indexOf(ch, this.pos); - if (found > -1) {this.pos = found; return true;} - }, - backUp: function(n) {this.pos -= n;}, - column: function() {return this.start;}, - indentation: function() {return 0;}, - match: function(pattern, consume, caseInsensitive) { - if (typeof pattern == "string") { - function cased(str) {return caseInsensitive ? str.toLowerCase() : str;} - if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) { - if (consume !== false) this.pos += pattern.length; - return true; - } - } - else { - var match = this.string.slice(this.pos).match(pattern); - if (match && consume !== false) this.pos += match[0].length; - return match; - } - }, - current: function(){return this.string.slice(this.start, this.pos);} -}; -exports.StringStream = StringStream; - -exports.startState = function(mode, a1, a2) { - return mode.startState ? mode.startState(a1, a2) : true; -}; - -var modes = exports.modes = {}, mimeModes = exports.mimeModes = {}; -exports.defineMode = function(name, mode) { modes[name] = mode; }; -exports.defineMIME = function(mime, spec) { mimeModes[mime] = spec; }; -exports.getMode = function(options, spec) { - if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) - spec = mimeModes[spec]; - if (typeof spec == "string") - var mname = spec, config = {}; - else if (spec != null) - var mname = spec.name, config = spec; - var mfactory = modes[mname]; - if (!mfactory) throw new Error("Unknown mode: " + spec); - return mfactory(options, config || {}); -}; - -exports.runMode = function(string, modespec, callback) { - var mode = exports.getMode({indentUnit: 2}, modespec); - var lines = splitLines(string), state = exports.startState(mode); - for (var i = 0, e = lines.length; i < e; ++i) { - if (i) callback("\n"); - var stream = new exports.StringStream(lines[i]); - while (!stream.eol()) { - var style = mode.token(stream, state); - callback(stream.current(), style, i, stream.start); - stream.start = stream.pos; - } - } -}; diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/runmode.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/runmode.js deleted file mode 100644 index 3e1bed736153c203738b03d684c5cc46e2f7df19..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/runmode.js +++ /dev/null @@ -1,52 +0,0 @@ -CodeMirror.runMode = function(string, modespec, callback, options) { - var mode = CodeMirror.getMode(CodeMirror.defaults, modespec); - - if (callback.nodeType == 1) { - var tabSize = (options && options.tabSize) || CodeMirror.defaults.tabSize; - var node = callback, col = 0; - node.innerHTML = ""; - callback = function(text, style) { - if (text == "\n") { - node.appendChild(document.createElement("br")); - col = 0; - return; - } - var content = ""; - // replace tabs - for (var pos = 0;;) { - var idx = text.indexOf("\t", pos); - if (idx == -1) { - content += text.slice(pos); - col += text.length - pos; - break; - } else { - col += idx - pos; - content += text.slice(pos, idx); - var size = tabSize - col % tabSize; - col += size; - for (var i = 0; i < size; ++i) content += " "; - pos = idx + 1; - } - } - - if (style) { - var sp = node.appendChild(document.createElement("span")); - sp.className = "cm-" + style.replace(/ +/g, " cm-"); - sp.appendChild(document.createTextNode(content)); - } else { - node.appendChild(document.createTextNode(content)); - } - }; - } - - var lines = CodeMirror.splitLines(string), state = CodeMirror.startState(mode); - for (var i = 0, e = lines.length; i < e; ++i) { - if (i) callback("\n"); - var stream = new CodeMirror.StringStream(lines[i]); - while (!stream.eol()) { - var style = mode.token(stream, state); - callback(stream.current(), style, i, stream.start); - stream.start = stream.pos; - } - } -}; diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/search.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/search.js deleted file mode 100644 index 266b2c92ee4f1e2c79227dc7b9bd9887dc67388a..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/search.js +++ /dev/null @@ -1,119 +0,0 @@ -// Define search commands. Depends on dialog.js or another -// implementation of the openDialog method. - -// Replace works a little oddly -- it will do the replace on the next -// Ctrl-G (or whatever is bound to findNext) press. You prevent a -// replace by making sure the match is no longer selected when hitting -// Ctrl-G. - -(function() { - function SearchState() { - this.posFrom = this.posTo = this.query = null; - this.marked = []; - } - function getSearchState(cm) { - return cm._searchState || (cm._searchState = new SearchState()); - } - function getSearchCursor(cm, query, pos) { - // Heuristic: if the query string is all lowercase, do a case insensitive search. - return cm.getSearchCursor(query, pos, typeof query == "string" && query == query.toLowerCase()); - } - function dialog(cm, text, shortText, f) { - if (cm.openDialog) cm.openDialog(text, f); - else f(prompt(shortText, "")); - } - function confirmDialog(cm, text, shortText, fs) { - if (cm.openConfirm) cm.openConfirm(text, fs); - else if (confirm(shortText)) fs[0](); - } - function parseQuery(query) { - var isRE = query.match(/^\/(.*)\/([a-z]*)$/); - return isRE ? new RegExp(isRE[1], isRE[2].indexOf("i") == -1 ? "" : "i") : query; - } - var queryDialog = - 'Search: <input type="text" style="width: 10em"/> <span style="color: #888">(Use /re/ syntax for regexp search)</span>'; - function doSearch(cm, rev) { - var state = getSearchState(cm); - if (state.query) return findNext(cm, rev); - dialog(cm, queryDialog, "Search for:", function(query) { - cm.operation(function() { - if (!query || state.query) return; - state.query = parseQuery(query); - if (cm.lineCount() < 2000) { // This is too expensive on big documents. - for (var cursor = getSearchCursor(cm, state.query); cursor.findNext();) - state.marked.push(cm.markText(cursor.from(), cursor.to(), - {className: "CodeMirror-searching"})); - } - state.posFrom = state.posTo = cm.getCursor(); - findNext(cm, rev); - }); - }); - } - function findNext(cm, rev) {cm.operation(function() { - var state = getSearchState(cm); - var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo); - if (!cursor.find(rev)) { - cursor = getSearchCursor(cm, state.query, rev ? {line: cm.lineCount() - 1} : {line: 0, ch: 0}); - if (!cursor.find(rev)) return; - } - cm.setSelection(cursor.from(), cursor.to()); - state.posFrom = cursor.from(); state.posTo = cursor.to(); - });} - function clearSearch(cm) {cm.operation(function() { - var state = getSearchState(cm); - if (!state.query) return; - state.query = null; - for (var i = 0; i < state.marked.length; ++i) state.marked[i].clear(); - state.marked.length = 0; - });} - - var replaceQueryDialog = - 'Replace: <input type="text" style="width: 10em"/> <span style="color: #888">(Use /re/ syntax for regexp search)</span>'; - var replacementQueryDialog = 'With: <input type="text" style="width: 10em"/>'; - var doReplaceConfirm = "Replace? <button>Yes</button> <button>No</button> <button>Stop</button>"; - function replace(cm, all) { - dialog(cm, replaceQueryDialog, "Replace:", function(query) { - if (!query) return; - query = parseQuery(query); - dialog(cm, replacementQueryDialog, "Replace with:", function(text) { - if (all) { - cm.operation(function() { - for (var cursor = getSearchCursor(cm, query); cursor.findNext();) { - if (typeof query != "string") { - var match = cm.getRange(cursor.from(), cursor.to()).match(query); - cursor.replace(text.replace(/\$(\d)/, function(_, i) {return match[i];})); - } else cursor.replace(text); - } - }); - } else { - clearSearch(cm); - var cursor = getSearchCursor(cm, query, cm.getCursor()); - function advance() { - var start = cursor.from(), match; - if (!(match = cursor.findNext())) { - cursor = getSearchCursor(cm, query); - if (!(match = cursor.findNext()) || - (start && cursor.from().line == start.line && cursor.from().ch == start.ch)) return; - } - cm.setSelection(cursor.from(), cursor.to()); - confirmDialog(cm, doReplaceConfirm, "Replace?", - [function() {doReplace(match);}, advance]); - } - function doReplace(match) { - cursor.replace(typeof query == "string" ? text : - text.replace(/\$(\d)/, function(_, i) {return match[i];})); - advance(); - } - advance(); - } - }); - }); - } - - CodeMirror.commands.find = function(cm) {clearSearch(cm); doSearch(cm);}; - CodeMirror.commands.findNext = doSearch; - CodeMirror.commands.findPrev = function(cm) {doSearch(cm, true);}; - CodeMirror.commands.clearSearch = clearSearch; - CodeMirror.commands.replace = replace; - CodeMirror.commands.replaceAll = function(cm) {replace(cm, true);}; -})(); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/searchcursor.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/searchcursor.js deleted file mode 100644 index 58fed74d0056b1c879ef4a0ca16e2b50269993b1..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/searchcursor.js +++ /dev/null @@ -1,119 +0,0 @@ -(function(){ - function SearchCursor(cm, query, pos, caseFold) { - this.atOccurrence = false; this.cm = cm; - if (caseFold == null && typeof query == "string") caseFold = false; - - pos = pos ? cm.clipPos(pos) : {line: 0, ch: 0}; - this.pos = {from: pos, to: pos}; - - // The matches method is filled in based on the type of query. - // It takes a position and a direction, and returns an object - // describing the next occurrence of the query, or null if no - // more matches were found. - if (typeof query != "string") { // Regexp match - if (!query.global) query = new RegExp(query.source, query.ignoreCase ? "ig" : "g"); - this.matches = function(reverse, pos) { - if (reverse) { - query.lastIndex = 0; - var line = cm.getLine(pos.line).slice(0, pos.ch), match = query.exec(line), start = 0; - while (match) { - start += match.index + 1; - line = line.slice(start); - query.lastIndex = 0; - var newmatch = query.exec(line); - if (newmatch) match = newmatch; - else break; - } - start--; - } else { - query.lastIndex = pos.ch; - var line = cm.getLine(pos.line), match = query.exec(line), - start = match && match.index; - } - if (match) - return {from: {line: pos.line, ch: start}, - to: {line: pos.line, ch: start + match[0].length}, - match: match}; - }; - } else { // String query - if (caseFold) query = query.toLowerCase(); - var fold = caseFold ? function(str){return str.toLowerCase();} : function(str){return str;}; - var target = query.split("\n"); - // Different methods for single-line and multi-line queries - if (target.length == 1) - this.matches = function(reverse, pos) { - var line = fold(cm.getLine(pos.line)), len = query.length, match; - if (reverse ? (pos.ch >= len && (match = line.lastIndexOf(query, pos.ch - len)) != -1) - : (match = line.indexOf(query, pos.ch)) != -1) - return {from: {line: pos.line, ch: match}, - to: {line: pos.line, ch: match + len}}; - }; - else - this.matches = function(reverse, pos) { - var ln = pos.line, idx = (reverse ? target.length - 1 : 0), match = target[idx], line = fold(cm.getLine(ln)); - var offsetA = (reverse ? line.indexOf(match) + match.length : line.lastIndexOf(match)); - if (reverse ? offsetA >= pos.ch || offsetA != match.length - : offsetA <= pos.ch || offsetA != line.length - match.length) - return; - for (;;) { - if (reverse ? !ln : ln == cm.lineCount() - 1) return; - line = fold(cm.getLine(ln += reverse ? -1 : 1)); - match = target[reverse ? --idx : ++idx]; - if (idx > 0 && idx < target.length - 1) { - if (line != match) return; - else continue; - } - var offsetB = (reverse ? line.lastIndexOf(match) : line.indexOf(match) + match.length); - if (reverse ? offsetB != line.length - match.length : offsetB != match.length) - return; - var start = {line: pos.line, ch: offsetA}, end = {line: ln, ch: offsetB}; - return {from: reverse ? end : start, to: reverse ? start : end}; - } - }; - } - } - - SearchCursor.prototype = { - findNext: function() {return this.find(false);}, - findPrevious: function() {return this.find(true);}, - - find: function(reverse) { - var self = this, pos = this.cm.clipPos(reverse ? this.pos.from : this.pos.to); - function savePosAndFail(line) { - var pos = {line: line, ch: 0}; - self.pos = {from: pos, to: pos}; - self.atOccurrence = false; - return false; - } - - for (;;) { - if (this.pos = this.matches(reverse, pos)) { - this.atOccurrence = true; - return this.pos.match || true; - } - if (reverse) { - if (!pos.line) return savePosAndFail(0); - pos = {line: pos.line-1, ch: this.cm.getLine(pos.line-1).length}; - } - else { - var maxLine = this.cm.lineCount(); - if (pos.line == maxLine - 1) return savePosAndFail(maxLine); - pos = {line: pos.line+1, ch: 0}; - } - } - }, - - from: function() {if (this.atOccurrence) return this.pos.from;}, - to: function() {if (this.atOccurrence) return this.pos.to;}, - - replace: function(newText) { - var self = this; - if (this.atOccurrence) - self.pos.to = this.cm.replaceRange(newText, self.pos.from, self.pos.to); - } - }; - - CodeMirror.defineExtension("getSearchCursor", function(query, pos, caseFold) { - return new SearchCursor(this, query, pos, caseFold); - }); -})(); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/simple-hint.css b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/simple-hint.css deleted file mode 100644 index 4387cb94113c6b839df50a4b05752f81e0bf0628..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/simple-hint.css +++ /dev/null @@ -1,16 +0,0 @@ -.CodeMirror-completions { - position: absolute; - z-index: 10; - overflow: hidden; - -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2); - -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2); - box-shadow: 2px 3px 5px rgba(0,0,0,.2); -} -.CodeMirror-completions select { - background: #fafafa; - outline: none; - border: none; - padding: 0; - margin: 0; - font-family: monospace; -} diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/simple-hint.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/simple-hint.js deleted file mode 100644 index 1565bd4785d8a26a0d560bf3b31a0e1ba3f07d59..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/simple-hint.js +++ /dev/null @@ -1,102 +0,0 @@ -(function() { - CodeMirror.simpleHint = function(editor, getHints, givenOptions) { - // Determine effective options based on given values and defaults. - var options = {}, defaults = CodeMirror.simpleHint.defaults; - for (var opt in defaults) - if (defaults.hasOwnProperty(opt)) - options[opt] = (givenOptions && givenOptions.hasOwnProperty(opt) ? givenOptions : defaults)[opt]; - - function collectHints(previousToken) { - // We want a single cursor position. - if (editor.somethingSelected()) return; - - var tempToken = editor.getTokenAt(editor.getCursor()); - - // Don't show completions if token has changed and the option is set. - if (options.closeOnTokenChange && previousToken != null && - (tempToken.start != previousToken.start || tempToken.type != previousToken.type)) { - return; - } - - var result = getHints(editor, givenOptions); - if (!result || !result.list.length) return; - var completions = result.list; - function insert(str) { - editor.replaceRange(str, result.from, result.to); - } - // When there is only one completion, use it directly. - if (options.completeSingle && completions.length == 1) { - insert(completions[0]); - return true; - } - - // Build the select widget - var complete = document.createElement("div"); - complete.className = "CodeMirror-completions"; - var sel = complete.appendChild(document.createElement("select")); - // Opera doesn't move the selection when pressing up/down in a - // multi-select, but it does properly support the size property on - // single-selects, so no multi-select is necessary. - if (!window.opera) sel.multiple = true; - for (var i = 0; i < completions.length; ++i) { - var opt = sel.appendChild(document.createElement("option")); - opt.appendChild(document.createTextNode(completions[i])); - } - sel.firstChild.selected = true; - sel.size = Math.min(10, completions.length); - var pos = editor.cursorCoords(options.alignWithWord ? result.from : null); - complete.style.left = pos.left + "px"; - complete.style.top = pos.bottom + "px"; - document.body.appendChild(complete); - // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor. - var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth); - if(winW - pos.left < sel.clientWidth) - complete.style.left = (pos.left - sel.clientWidth) + "px"; - // Hack to hide the scrollbar. - if (completions.length <= 10) - complete.style.width = (sel.clientWidth - 1) + "px"; - - var done = false; - function close() { - if (done) return; - done = true; - complete.parentNode.removeChild(complete); - } - function pick() { - insert(completions[sel.selectedIndex]); - close(); - setTimeout(function(){editor.focus();}, 50); - } - CodeMirror.on(sel, "blur", close); - CodeMirror.on(sel, "keydown", function(event) { - var code = event.keyCode; - // Enter - if (code == 13) {CodeMirror.e_stop(event); pick();} - // Escape - else if (code == 27) {CodeMirror.e_stop(event); close(); editor.focus();} - else if (code != 38 && code != 40 && code != 33 && code != 34 && !CodeMirror.isModifierKey(event)) { - close(); editor.focus(); - // Pass the event to the CodeMirror instance so that it can handle things like backspace properly. - editor.triggerOnKeyDown(event); - // Don't show completions if the code is backspace and the option is set. - if (!options.closeOnBackspace || code != 8) { - setTimeout(function(){collectHints(tempToken);}, 50); - } - } - }); - CodeMirror.on(sel, "dblclick", pick); - - sel.focus(); - // Opera sometimes ignores focusing a freshly created node - if (window.opera) setTimeout(function(){if (!done) sel.focus();}, 100); - return true; - } - return collectHints(); - }; - CodeMirror.simpleHint.defaults = { - closeOnBackspace: true, - closeOnTokenChange: false, - completeSingle: true, - alignWithWord: true - }; -})(); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/xml-hint.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/xml-hint.js deleted file mode 100644 index e9ec6b7fdb707d3d66539399835eacc66881c9f9..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/lib/util/xml-hint.js +++ /dev/null @@ -1,131 +0,0 @@ - -(function() { - - CodeMirror.xmlHints = []; - - CodeMirror.xmlHint = function(cm, simbol) { - - if(simbol.length > 0) { - var cursor = cm.getCursor(); - cm.replaceSelection(simbol); - cursor = {line: cursor.line, ch: cursor.ch + 1}; - cm.setCursor(cursor); - } - - CodeMirror.simpleHint(cm, getHint); - }; - - var getHint = function(cm) { - - var cursor = cm.getCursor(); - - if (cursor.ch > 0) { - - var text = cm.getRange({line: 0, ch: 0}, cursor); - var typed = ''; - var simbol = ''; - for(var i = text.length - 1; i >= 0; i--) { - if(text[i] == ' ' || text[i] == '<') { - simbol = text[i]; - break; - } - else { - typed = text[i] + typed; - } - } - - text = text.slice(0, text.length - typed.length); - - var path = getActiveElement(text) + simbol; - var hints = CodeMirror.xmlHints[path]; - - if(typeof hints === 'undefined') - hints = ['']; - else { - hints = hints.slice(0); - for (var i = hints.length - 1; i >= 0; i--) { - if(hints[i].indexOf(typed) != 0) - hints.splice(i, 1); - } - } - - return { - list: hints, - from: { line: cursor.line, ch: cursor.ch - typed.length }, - to: cursor - }; - }; - }; - - var getActiveElement = function(text) { - - var element = ''; - - if(text.length >= 0) { - - var regex = new RegExp('<([^!?][^\\s/>]*).*?>', 'g'); - - var matches = []; - var match; - while ((match = regex.exec(text)) != null) { - matches.push({ - tag: match[1], - selfclose: (match[0].slice(match[0].length - 2) === '/>') - }); - } - - for (var i = matches.length - 1, skip = 0; i >= 0; i--) { - - var item = matches[i]; - - if (item.tag[0] == '/') - { - skip++; - } - else if (item.selfclose == false) - { - if (skip > 0) - { - skip--; - } - else - { - element = '<' + item.tag + '>' + element; - } - } - } - - element += getOpenTag(text); - } - - return element; - }; - - var getOpenTag = function(text) { - - var open = text.lastIndexOf('<'); - var close = text.lastIndexOf('>'); - - if (close < open) - { - text = text.slice(open); - - if(text != '<') { - - var space = text.indexOf(' '); - if(space < 0) - space = text.indexOf('\t'); - if(space < 0) - space = text.indexOf('\n'); - - if (space < 0) - space = text.length; - - return text.slice(0, space); - } - } - - return ''; - }; - -})(); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/clike/clike.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/clike/clike.js deleted file mode 100644 index 4d1484a7080d2f833bb9ab0187b20ab77070e1b9..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/clike/clike.js +++ /dev/null @@ -1,300 +0,0 @@ -CodeMirror.defineMode("clike", function(config, parserConfig) { - var indentUnit = config.indentUnit, - statementIndentUnit = parserConfig.statementIndentUnit || indentUnit, - keywords = parserConfig.keywords || {}, - builtin = parserConfig.builtin || {}, - blockKeywords = parserConfig.blockKeywords || {}, - atoms = parserConfig.atoms || {}, - hooks = parserConfig.hooks || {}, - multiLineStrings = parserConfig.multiLineStrings; - var isOperatorChar = /[+\-*&%=<>!?|\/]/; - - var curPunc; - - function tokenBase(stream, state) { - var ch = stream.next(); - if (hooks[ch]) { - var result = hooks[ch](stream, state); - if (result !== false) return result; - } - if (ch == '"' || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - curPunc = ch; - return null; - } - if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return "number"; - } - if (ch == "/") { - if (stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - } - if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "operator"; - } - stream.eatWhile(/[\w\$_]/); - var cur = stream.current(); - if (keywords.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "keyword"; - } - if (builtin.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "builtin"; - } - if (atoms.propertyIsEnumerable(cur)) return "atom"; - return "variable"; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && next == "\\"; - } - if (end || !(escaped || multiLineStrings)) - state.tokenize = null; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = null; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - function pushContext(state, col, type) { - var indent = state.indented; - if (state.context && state.context.type == "statement") - indent = state.context.indented; - return state.context = new Context(indent, col, type, null, state.context); - } - function popContext(state) { - var t = state.context.type; - if (t == ")" || t == "]" || t == "}") - state.indented = state.context.indented; - return state.context = state.context.prev; - } - - // Interface - - return { - startState: function(basecolumn) { - return { - tokenize: null, - context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), - indented: 0, - startOfLine: true - }; - }, - - token: function(stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - } - if (stream.eatSpace()) return null; - curPunc = null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style == "comment" || style == "meta") return style; - if (ctx.align == null) ctx.align = true; - - if ((curPunc == ";" || curPunc == ":" || curPunc == ",") && ctx.type == "statement") popContext(state); - else if (curPunc == "{") pushContext(state, stream.column(), "}"); - else if (curPunc == "[") pushContext(state, stream.column(), "]"); - else if (curPunc == "(") pushContext(state, stream.column(), ")"); - else if (curPunc == "}") { - while (ctx.type == "statement") ctx = popContext(state); - if (ctx.type == "}") ctx = popContext(state); - while (ctx.type == "statement") ctx = popContext(state); - } - else if (curPunc == ctx.type) popContext(state); - else if (((ctx.type == "}" || ctx.type == "top") && curPunc != ';') || (ctx.type == "statement" && curPunc == "newstatement")) - pushContext(state, stream.column(), "statement"); - state.startOfLine = false; - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass; - var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); - if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev; - var closing = firstChar == ctx.type; - if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit); - else if (ctx.align) return ctx.column + (closing ? 0 : 1); - else return ctx.indented + (closing ? 0 : indentUnit); - }, - - electricChars: "{}" - }; -}); - -(function() { - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - var cKeywords = "auto if break int case long char register continue return default short do sizeof " + - "double static else struct entry switch extern typedef float union for unsigned " + - "goto while enum void const signed volatile"; - - function cppHook(stream, state) { - if (!state.startOfLine) return false; - for (;;) { - if (stream.skipTo("\\")) { - stream.next(); - if (stream.eol()) { - state.tokenize = cppHook; - break; - } - } else { - stream.skipToEnd(); - state.tokenize = null; - break; - } - } - return "meta"; - } - - // C#-style strings where "" escapes a quote. - function tokenAtString(stream, state) { - var next; - while ((next = stream.next()) != null) { - if (next == '"' && !stream.eat('"')) { - state.tokenize = null; - break; - } - } - return "string"; - } - - function mimes(ms, mode) { - for (var i = 0; i < ms.length; ++i) CodeMirror.defineMIME(ms[i], mode); - } - - mimes(["text/x-csrc", "text/x-c", "text/x-chdr"], { - name: "clike", - keywords: words(cKeywords), - blockKeywords: words("case do else for if switch while struct"), - atoms: words("null"), - hooks: {"#": cppHook} - }); - mimes(["text/x-c++src", "text/x-c++hdr"], { - name: "clike", - keywords: words(cKeywords + " asm dynamic_cast namespace reinterpret_cast try bool explicit new " + - "static_cast typeid catch operator template typename class friend private " + - "this using const_cast inline public throw virtual delete mutable protected " + - "wchar_t"), - blockKeywords: words("catch class do else finally for if struct switch try while"), - atoms: words("true false null"), - hooks: {"#": cppHook} - }); - CodeMirror.defineMIME("text/x-java", { - name: "clike", - keywords: words("abstract assert boolean break byte case catch char class const continue default " + - "do double else enum extends final finally float for goto if implements import " + - "instanceof int interface long native new package private protected public " + - "return short static strictfp super switch synchronized this throw throws transient " + - "try void volatile while"), - blockKeywords: words("catch class do else finally for if switch try while"), - atoms: words("true false null"), - hooks: { - "@": function(stream) { - stream.eatWhile(/[\w\$_]/); - return "meta"; - } - } - }); - CodeMirror.defineMIME("text/x-csharp", { - name: "clike", - keywords: words("abstract as base break case catch checked class const continue" + - " default delegate do else enum event explicit extern finally fixed for" + - " foreach goto if implicit in interface internal is lock namespace new" + - " operator out override params private protected public readonly ref return sealed" + - " sizeof stackalloc static struct switch this throw try typeof unchecked" + - " unsafe using virtual void volatile while add alias ascending descending dynamic from get" + - " global group into join let orderby partial remove select set value var yield"), - blockKeywords: words("catch class do else finally for foreach if struct switch try while"), - builtin: words("Boolean Byte Char DateTime DateTimeOffset Decimal Double" + - " Guid Int16 Int32 Int64 Object SByte Single String TimeSpan UInt16 UInt32" + - " UInt64 bool byte char decimal double short int long object" + - " sbyte float string ushort uint ulong"), - atoms: words("true false null"), - hooks: { - "@": function(stream, state) { - if (stream.eat('"')) { - state.tokenize = tokenAtString; - return tokenAtString(stream, state); - } - stream.eatWhile(/[\w\$_]/); - return "meta"; - } - } - }); - CodeMirror.defineMIME("text/x-scala", { - name: "clike", - keywords: words( - - /* scala */ - "abstract case catch class def do else extends false final finally for forSome if " + - "implicit import lazy match new null object override package private protected return " + - "sealed super this throw trait try trye type val var while with yield _ : = => <- <: " + - "<% >: # @ " + - - /* package scala */ - "assert assume require print println printf readLine readBoolean readByte readShort " + - "readChar readInt readLong readFloat readDouble " + - - "AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either " + - "Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable " + - "Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering " + - "Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder " + - "StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector :: #:: " + - - /* package java.lang */ - "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " + - "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " + - "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " + - "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void" - - - ), - blockKeywords: words("catch class do else finally for forSome if match switch try while"), - atoms: words("true false null"), - hooks: { - "@": function(stream) { - stream.eatWhile(/[\w\$_]/); - return "meta"; - } - } - }); -}()); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/clike/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/clike/index.html deleted file mode 100644 index ca10c4bc23a9cba1d55597f2ecd2ce72710702c7..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/clike/index.html +++ /dev/null @@ -1,103 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: C-like mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="../../lib/util/matchbrackets.js"></script> - <script src="clike.js"></script> - <link rel="stylesheet" href="../../doc/docs.css"> - <style>.CodeMirror {border: 2px inset #dee;}</style> - </head> - <body> - <h1>CodeMirror: C-like mode</h1> - -<form><textarea id="code" name="code"> -/* C demo code */ - -#include <zmq.h> -#include <pthread.h> -#include <semaphore.h> -#include <time.h> -#include <stdio.h> -#include <fcntl.h> -#include <malloc.h> - -typedef struct { - void* arg_socket; - zmq_msg_t* arg_msg; - char* arg_string; - unsigned long arg_len; - int arg_int, arg_command; - - int signal_fd; - int pad; - void* context; - sem_t sem; -} acl_zmq_context; - -#define p(X) (context->arg_##X) - -void* zmq_thread(void* context_pointer) { - acl_zmq_context* context = (acl_zmq_context*)context_pointer; - char ok = 'K', err = 'X'; - int res; - - while (1) { - while ((res = sem_wait(&context->sem)) == EINTR); - if (res) {write(context->signal_fd, &err, 1); goto cleanup;} - switch(p(command)) { - case 0: goto cleanup; - case 1: p(socket) = zmq_socket(context->context, p(int)); break; - case 2: p(int) = zmq_close(p(socket)); break; - case 3: p(int) = zmq_bind(p(socket), p(string)); break; - case 4: p(int) = zmq_connect(p(socket), p(string)); break; - case 5: p(int) = zmq_getsockopt(p(socket), p(int), (void*)p(string), &p(len)); break; - case 6: p(int) = zmq_setsockopt(p(socket), p(int), (void*)p(string), p(len)); break; - case 7: p(int) = zmq_send(p(socket), p(msg), p(int)); break; - case 8: p(int) = zmq_recv(p(socket), p(msg), p(int)); break; - case 9: p(int) = zmq_poll(p(socket), p(int), p(len)); break; - } - p(command) = errno; - write(context->signal_fd, &ok, 1); - } - cleanup: - close(context->signal_fd); - free(context_pointer); - return 0; -} - -void* zmq_thread_init(void* zmq_context, int signal_fd) { - acl_zmq_context* context = malloc(sizeof(acl_zmq_context)); - pthread_t thread; - - context->context = zmq_context; - context->signal_fd = signal_fd; - sem_init(&context->sem, 1, 0); - pthread_create(&thread, 0, &zmq_thread, context); - pthread_detach(thread); - return context; -} -</textarea></form> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - matchBrackets: true, - mode: "text/x-csrc" - }); - </script> - - <p>Simple mode that tries to handle C-like languages as well as it - can. Takes two configuration parameters: <code>keywords</code>, an - object whose property names are the keywords in the language, - and <code>useCPP</code>, which determines whether C preprocessor - directives are recognized.</p> - - <p><strong>MIME types defined:</strong> <code>text/x-csrc</code> - (C code), <code>text/x-c++src</code> (C++ - code), <code>text/x-java</code> (Java - code), <code>text/x-csharp</code> (C#).</p> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/clike/scala.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/clike/scala.html deleted file mode 100644 index 39115967ab8b452c649a17f0309695a673dcf318..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/clike/scala.html +++ /dev/null @@ -1,767 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: C-like mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <link rel="stylesheet" href="../../theme/ambiance.css"> - <script src="../../lib/codemirror.js"></script> - <script src="../../lib/util/matchbrackets.js"></script> - <script src="clike.js"></script> - <link rel="stylesheet" href="../../doc/docs.css"> - <style> - body - { - margin: 0; - padding: 0; - max-width:inherit; - height: 100%; - } - html, form, .CodeMirror, .CodeMirror-scroll - { - height: 100%; - } - </style> - </head> - <body> -<form> -<textarea id="code" name="code"> - - /* __ *\ - ** ________ ___ / / ___ Scala API ** - ** / __/ __// _ | / / / _ | (c) 2003-2011, LAMP/EPFL ** - ** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** - ** /____/\___/_/ |_/____/_/ | | ** - ** |/ ** - \* */ - - package scala.collection - - import generic._ - import mutable.{ Builder, ListBuffer } - import annotation.{tailrec, migration, bridge} - import annotation.unchecked.{ uncheckedVariance => uV } - import parallel.ParIterable - - /** A template trait for traversable collections of type `Traversable[A]`. - * - * $traversableInfo - * @define mutability - * @define traversableInfo - * This is a base trait of all kinds of $mutability Scala collections. It - * implements the behavior common to all collections, in terms of a method - * `foreach` with signature: - * {{{ - * def foreach[U](f: Elem => U): Unit - * }}} - * Collection classes mixing in this trait provide a concrete - * `foreach` method which traverses all the - * elements contained in the collection, applying a given function to each. - * They also need to provide a method `newBuilder` - * which creates a builder for collections of the same kind. - * - * A traversable class might or might not have two properties: strictness - * and orderedness. Neither is represented as a type. - * - * The instances of a strict collection class have all their elements - * computed before they can be used as values. By contrast, instances of - * a non-strict collection class may defer computation of some of their - * elements until after the instance is available as a value. - * A typical example of a non-strict collection class is a - * <a href="../immutable/Stream.html" target="ContentFrame"> - * `scala.collection.immutable.Stream`</a>. - * A more general class of examples are `TraversableViews`. - * - * If a collection is an instance of an ordered collection class, traversing - * its elements with `foreach` will always visit elements in the - * same order, even for different runs of the program. If the class is not - * ordered, `foreach` can visit elements in different orders for - * different runs (but it will keep the same order in the same run).' - * - * A typical example of a collection class which is not ordered is a - * `HashMap` of objects. The traversal order for hash maps will - * depend on the hash codes of its elements, and these hash codes might - * differ from one run to the next. By contrast, a `LinkedHashMap` - * is ordered because it's `foreach` method visits elements in the - * order they were inserted into the `HashMap`. - * - * @author Martin Odersky - * @version 2.8 - * @since 2.8 - * @tparam A the element type of the collection - * @tparam Repr the type of the actual collection containing the elements. - * - * @define Coll Traversable - * @define coll traversable collection - */ - trait TraversableLike[+A, +Repr] extends HasNewBuilder[A, Repr] - with FilterMonadic[A, Repr] - with TraversableOnce[A] - with GenTraversableLike[A, Repr] - with Parallelizable[A, ParIterable[A]] - { - self => - - import Traversable.breaks._ - - /** The type implementing this traversable */ - protected type Self = Repr - - /** The collection of type $coll underlying this `TraversableLike` object. - * By default this is implemented as the `TraversableLike` object itself, - * but this can be overridden. - */ - def repr: Repr = this.asInstanceOf[Repr] - - /** The underlying collection seen as an instance of `$Coll`. - * By default this is implemented as the current collection object itself, - * but this can be overridden. - */ - protected[this] def thisCollection: Traversable[A] = this.asInstanceOf[Traversable[A]] - - /** A conversion from collections of type `Repr` to `$Coll` objects. - * By default this is implemented as just a cast, but this can be overridden. - */ - protected[this] def toCollection(repr: Repr): Traversable[A] = repr.asInstanceOf[Traversable[A]] - - /** Creates a new builder for this collection type. - */ - protected[this] def newBuilder: Builder[A, Repr] - - protected[this] def parCombiner = ParIterable.newCombiner[A] - - /** Applies a function `f` to all elements of this $coll. - * - * Note: this method underlies the implementation of most other bulk operations. - * It's important to implement this method in an efficient way. - * - * - * @param f the function that is applied for its side-effect to every element. - * The result of function `f` is discarded. - * - * @tparam U the type parameter describing the result of function `f`. - * This result will always be ignored. Typically `U` is `Unit`, - * but this is not necessary. - * - * @usecase def foreach(f: A => Unit): Unit - */ - def foreach[U](f: A => U): Unit - - /** Tests whether this $coll is empty. - * - * @return `true` if the $coll contain no elements, `false` otherwise. - */ - def isEmpty: Boolean = { - var result = true - breakable { - for (x <- this) { - result = false - break - } - } - result - } - - /** Tests whether this $coll is known to have a finite size. - * All strict collections are known to have finite size. For a non-strict collection - * such as `Stream`, the predicate returns `true` if all elements have been computed. - * It returns `false` if the stream is not yet evaluated to the end. - * - * Note: many collection methods will not work on collections of infinite sizes. - * - * @return `true` if this collection is known to have finite size, `false` otherwise. - */ - def hasDefiniteSize = true - - def ++[B >: A, That](that: GenTraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = { - val b = bf(repr) - if (that.isInstanceOf[IndexedSeqLike[_, _]]) b.sizeHint(this, that.seq.size) - b ++= thisCollection - b ++= that.seq - b.result - } - - @bridge - def ++[B >: A, That](that: TraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = - ++(that: GenTraversableOnce[B])(bf) - - /** Concatenates this $coll with the elements of a traversable collection. - * It differs from ++ in that the right operand determines the type of the - * resulting collection rather than the left one. - * - * @param that the traversable to append. - * @tparam B the element type of the returned collection. - * @tparam That $thatinfo - * @param bf $bfinfo - * @return a new collection of type `That` which contains all elements - * of this $coll followed by all elements of `that`. - * - * @usecase def ++:[B](that: TraversableOnce[B]): $Coll[B] - * - * @return a new $coll which contains all elements of this $coll - * followed by all elements of `that`. - */ - def ++:[B >: A, That](that: TraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = { - val b = bf(repr) - if (that.isInstanceOf[IndexedSeqLike[_, _]]) b.sizeHint(this, that.size) - b ++= that - b ++= thisCollection - b.result - } - - /** This overload exists because: for the implementation of ++: we should reuse - * that of ++ because many collections override it with more efficient versions. - * Since TraversableOnce has no '++' method, we have to implement that directly, - * but Traversable and down can use the overload. - */ - def ++:[B >: A, That](that: Traversable[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = - (that ++ seq)(breakOut) - - def map[B, That](f: A => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = { - val b = bf(repr) - b.sizeHint(this) - for (x <- this) b += f(x) - b.result - } - - def flatMap[B, That](f: A => GenTraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = { - val b = bf(repr) - for (x <- this) b ++= f(x).seq - b.result - } - - /** Selects all elements of this $coll which satisfy a predicate. - * - * @param p the predicate used to test elements. - * @return a new $coll consisting of all elements of this $coll that satisfy the given - * predicate `p`. The order of the elements is preserved. - */ - def filter(p: A => Boolean): Repr = { - val b = newBuilder - for (x <- this) - if (p(x)) b += x - b.result - } - - /** Selects all elements of this $coll which do not satisfy a predicate. - * - * @param p the predicate used to test elements. - * @return a new $coll consisting of all elements of this $coll that do not satisfy the given - * predicate `p`. The order of the elements is preserved. - */ - def filterNot(p: A => Boolean): Repr = filter(!p(_)) - - def collect[B, That](pf: PartialFunction[A, B])(implicit bf: CanBuildFrom[Repr, B, That]): That = { - val b = bf(repr) - for (x <- this) if (pf.isDefinedAt(x)) b += pf(x) - b.result - } - - /** Builds a new collection by applying an option-valued function to all - * elements of this $coll on which the function is defined. - * - * @param f the option-valued function which filters and maps the $coll. - * @tparam B the element type of the returned collection. - * @tparam That $thatinfo - * @param bf $bfinfo - * @return a new collection of type `That` resulting from applying the option-valued function - * `f` to each element and collecting all defined results. - * The order of the elements is preserved. - * - * @usecase def filterMap[B](f: A => Option[B]): $Coll[B] - * - * @param pf the partial function which filters and maps the $coll. - * @return a new $coll resulting from applying the given option-valued function - * `f` to each element and collecting all defined results. - * The order of the elements is preserved. - def filterMap[B, That](f: A => Option[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = { - val b = bf(repr) - for (x <- this) - f(x) match { - case Some(y) => b += y - case _ => - } - b.result - } - */ - - /** Partitions this $coll in two ${coll}s according to a predicate. - * - * @param p the predicate on which to partition. - * @return a pair of ${coll}s: the first $coll consists of all elements that - * satisfy the predicate `p` and the second $coll consists of all elements - * that don't. The relative order of the elements in the resulting ${coll}s - * is the same as in the original $coll. - */ - def partition(p: A => Boolean): (Repr, Repr) = { - val l, r = newBuilder - for (x <- this) (if (p(x)) l else r) += x - (l.result, r.result) - } - - def groupBy[K](f: A => K): immutable.Map[K, Repr] = { - val m = mutable.Map.empty[K, Builder[A, Repr]] - for (elem <- this) { - val key = f(elem) - val bldr = m.getOrElseUpdate(key, newBuilder) - bldr += elem - } - val b = immutable.Map.newBuilder[K, Repr] - for ((k, v) <- m) - b += ((k, v.result)) - - b.result - } - - /** Tests whether a predicate holds for all elements of this $coll. - * - * $mayNotTerminateInf - * - * @param p the predicate used to test elements. - * @return `true` if the given predicate `p` holds for all elements - * of this $coll, otherwise `false`. - */ - def forall(p: A => Boolean): Boolean = { - var result = true - breakable { - for (x <- this) - if (!p(x)) { result = false; break } - } - result - } - - /** Tests whether a predicate holds for some of the elements of this $coll. - * - * $mayNotTerminateInf - * - * @param p the predicate used to test elements. - * @return `true` if the given predicate `p` holds for some of the - * elements of this $coll, otherwise `false`. - */ - def exists(p: A => Boolean): Boolean = { - var result = false - breakable { - for (x <- this) - if (p(x)) { result = true; break } - } - result - } - - /** Finds the first element of the $coll satisfying a predicate, if any. - * - * $mayNotTerminateInf - * $orderDependent - * - * @param p the predicate used to test elements. - * @return an option value containing the first element in the $coll - * that satisfies `p`, or `None` if none exists. - */ - def find(p: A => Boolean): Option[A] = { - var result: Option[A] = None - breakable { - for (x <- this) - if (p(x)) { result = Some(x); break } - } - result - } - - def scan[B >: A, That](z: B)(op: (B, B) => B)(implicit cbf: CanBuildFrom[Repr, B, That]): That = scanLeft(z)(op) - - def scanLeft[B, That](z: B)(op: (B, A) => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = { - val b = bf(repr) - b.sizeHint(this, 1) - var acc = z - b += acc - for (x <- this) { acc = op(acc, x); b += acc } - b.result - } - - @migration(2, 9, - "This scanRight definition has changed in 2.9.\n" + - "The previous behavior can be reproduced with scanRight.reverse." - ) - def scanRight[B, That](z: B)(op: (A, B) => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = { - var scanned = List(z) - var acc = z - for (x <- reversed) { - acc = op(x, acc) - scanned ::= acc - } - val b = bf(repr) - for (elem <- scanned) b += elem - b.result - } - - /** Selects the first element of this $coll. - * $orderDependent - * @return the first element of this $coll. - * @throws `NoSuchElementException` if the $coll is empty. - */ - def head: A = { - var result: () => A = () => throw new NoSuchElementException - breakable { - for (x <- this) { - result = () => x - break - } - } - result() - } - - /** Optionally selects the first element. - * $orderDependent - * @return the first element of this $coll if it is nonempty, `None` if it is empty. - */ - def headOption: Option[A] = if (isEmpty) None else Some(head) - - /** Selects all elements except the first. - * $orderDependent - * @return a $coll consisting of all elements of this $coll - * except the first one. - * @throws `UnsupportedOperationException` if the $coll is empty. - */ - override def tail: Repr = { - if (isEmpty) throw new UnsupportedOperationException("empty.tail") - drop(1) - } - - /** Selects the last element. - * $orderDependent - * @return The last element of this $coll. - * @throws NoSuchElementException If the $coll is empty. - */ - def last: A = { - var lst = head - for (x <- this) - lst = x - lst - } - - /** Optionally selects the last element. - * $orderDependent - * @return the last element of this $coll$ if it is nonempty, `None` if it is empty. - */ - def lastOption: Option[A] = if (isEmpty) None else Some(last) - - /** Selects all elements except the last. - * $orderDependent - * @return a $coll consisting of all elements of this $coll - * except the last one. - * @throws `UnsupportedOperationException` if the $coll is empty. - */ - def init: Repr = { - if (isEmpty) throw new UnsupportedOperationException("empty.init") - var lst = head - var follow = false - val b = newBuilder - b.sizeHint(this, -1) - for (x <- this.seq) { - if (follow) b += lst - else follow = true - lst = x - } - b.result - } - - def take(n: Int): Repr = slice(0, n) - - def drop(n: Int): Repr = - if (n <= 0) { - val b = newBuilder - b.sizeHint(this) - b ++= thisCollection result - } - else sliceWithKnownDelta(n, Int.MaxValue, -n) - - def slice(from: Int, until: Int): Repr = sliceWithKnownBound(math.max(from, 0), until) - - // Precondition: from >= 0, until > 0, builder already configured for building. - private[this] def sliceInternal(from: Int, until: Int, b: Builder[A, Repr]): Repr = { - var i = 0 - breakable { - for (x <- this.seq) { - if (i >= from) b += x - i += 1 - if (i >= until) break - } - } - b.result - } - // Precondition: from >= 0 - private[scala] def sliceWithKnownDelta(from: Int, until: Int, delta: Int): Repr = { - val b = newBuilder - if (until <= from) b.result - else { - b.sizeHint(this, delta) - sliceInternal(from, until, b) - } - } - // Precondition: from >= 0 - private[scala] def sliceWithKnownBound(from: Int, until: Int): Repr = { - val b = newBuilder - if (until <= from) b.result - else { - b.sizeHintBounded(until - from, this) - sliceInternal(from, until, b) - } - } - - def takeWhile(p: A => Boolean): Repr = { - val b = newBuilder - breakable { - for (x <- this) { - if (!p(x)) break - b += x - } - } - b.result - } - - def dropWhile(p: A => Boolean): Repr = { - val b = newBuilder - var go = false - for (x <- this) { - if (!p(x)) go = true - if (go) b += x - } - b.result - } - - def span(p: A => Boolean): (Repr, Repr) = { - val l, r = newBuilder - var toLeft = true - for (x <- this) { - toLeft = toLeft && p(x) - (if (toLeft) l else r) += x - } - (l.result, r.result) - } - - def splitAt(n: Int): (Repr, Repr) = { - val l, r = newBuilder - l.sizeHintBounded(n, this) - if (n >= 0) r.sizeHint(this, -n) - var i = 0 - for (x <- this) { - (if (i < n) l else r) += x - i += 1 - } - (l.result, r.result) - } - - /** Iterates over the tails of this $coll. The first value will be this - * $coll and the final one will be an empty $coll, with the intervening - * values the results of successive applications of `tail`. - * - * @return an iterator over all the tails of this $coll - * @example `List(1,2,3).tails = Iterator(List(1,2,3), List(2,3), List(3), Nil)` - */ - def tails: Iterator[Repr] = iterateUntilEmpty(_.tail) - - /** Iterates over the inits of this $coll. The first value will be this - * $coll and the final one will be an empty $coll, with the intervening - * values the results of successive applications of `init`. - * - * @return an iterator over all the inits of this $coll - * @example `List(1,2,3).inits = Iterator(List(1,2,3), List(1,2), List(1), Nil)` - */ - def inits: Iterator[Repr] = iterateUntilEmpty(_.init) - - /** Copies elements of this $coll to an array. - * Fills the given array `xs` with at most `len` elements of - * this $coll, starting at position `start`. - * Copying will stop once either the end of the current $coll is reached, - * or the end of the array is reached, or `len` elements have been copied. - * - * $willNotTerminateInf - * - * @param xs the array to fill. - * @param start the starting index. - * @param len the maximal number of elements to copy. - * @tparam B the type of the elements of the array. - * - * - * @usecase def copyToArray(xs: Array[A], start: Int, len: Int): Unit - */ - def copyToArray[B >: A](xs: Array[B], start: Int, len: Int) { - var i = start - val end = (start + len) min xs.length - breakable { - for (x <- this) { - if (i >= end) break - xs(i) = x - i += 1 - } - } - } - - def toTraversable: Traversable[A] = thisCollection - def toIterator: Iterator[A] = toStream.iterator - def toStream: Stream[A] = toBuffer.toStream - - /** Converts this $coll to a string. - * - * @return a string representation of this collection. By default this - * string consists of the `stringPrefix` of this $coll, - * followed by all elements separated by commas and enclosed in parentheses. - */ - override def toString = mkString(stringPrefix + "(", ", ", ")") - - /** Defines the prefix of this object's `toString` representation. - * - * @return a string representation which starts the result of `toString` - * applied to this $coll. By default the string prefix is the - * simple name of the collection class $coll. - */ - def stringPrefix : String = { - var string = repr.asInstanceOf[AnyRef].getClass.getName - val idx1 = string.lastIndexOf('.' : Int) - if (idx1 != -1) string = string.substring(idx1 + 1) - val idx2 = string.indexOf('$') - if (idx2 != -1) string = string.substring(0, idx2) - string - } - - /** Creates a non-strict view of this $coll. - * - * @return a non-strict view of this $coll. - */ - def view = new TraversableView[A, Repr] { - protected lazy val underlying = self.repr - override def foreach[U](f: A => U) = self foreach f - } - - /** Creates a non-strict view of a slice of this $coll. - * - * Note: the difference between `view` and `slice` is that `view` produces - * a view of the current $coll, whereas `slice` produces a new $coll. - * - * Note: `view(from, to)` is equivalent to `view.slice(from, to)` - * $orderDependent - * - * @param from the index of the first element of the view - * @param until the index of the element following the view - * @return a non-strict view of a slice of this $coll, starting at index `from` - * and extending up to (but not including) index `until`. - */ - def view(from: Int, until: Int): TraversableView[A, Repr] = view.slice(from, until) - - /** Creates a non-strict filter of this $coll. - * - * Note: the difference between `c filter p` and `c withFilter p` is that - * the former creates a new collection, whereas the latter only - * restricts the domain of subsequent `map`, `flatMap`, `foreach`, - * and `withFilter` operations. - * $orderDependent - * - * @param p the predicate used to test elements. - * @return an object of class `WithFilter`, which supports - * `map`, `flatMap`, `foreach`, and `withFilter` operations. - * All these operations apply to those elements of this $coll which - * satisfy the predicate `p`. - */ - def withFilter(p: A => Boolean): FilterMonadic[A, Repr] = new WithFilter(p) - - /** A class supporting filtered operations. Instances of this class are - * returned by method `withFilter`. - */ - class WithFilter(p: A => Boolean) extends FilterMonadic[A, Repr] { - - /** Builds a new collection by applying a function to all elements of the - * outer $coll containing this `WithFilter` instance that satisfy predicate `p`. - * - * @param f the function to apply to each element. - * @tparam B the element type of the returned collection. - * @tparam That $thatinfo - * @param bf $bfinfo - * @return a new collection of type `That` resulting from applying - * the given function `f` to each element of the outer $coll - * that satisfies predicate `p` and collecting the results. - * - * @usecase def map[B](f: A => B): $Coll[B] - * - * @return a new $coll resulting from applying the given function - * `f` to each element of the outer $coll that satisfies - * predicate `p` and collecting the results. - */ - def map[B, That](f: A => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = { - val b = bf(repr) - for (x <- self) - if (p(x)) b += f(x) - b.result - } - - /** Builds a new collection by applying a function to all elements of the - * outer $coll containing this `WithFilter` instance that satisfy - * predicate `p` and concatenating the results. - * - * @param f the function to apply to each element. - * @tparam B the element type of the returned collection. - * @tparam That $thatinfo - * @param bf $bfinfo - * @return a new collection of type `That` resulting from applying - * the given collection-valued function `f` to each element - * of the outer $coll that satisfies predicate `p` and - * concatenating the results. - * - * @usecase def flatMap[B](f: A => TraversableOnce[B]): $Coll[B] - * - * @return a new $coll resulting from applying the given collection-valued function - * `f` to each element of the outer $coll that satisfies predicate `p` and concatenating the results. - */ - def flatMap[B, That](f: A => GenTraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = { - val b = bf(repr) - for (x <- self) - if (p(x)) b ++= f(x).seq - b.result - } - - /** Applies a function `f` to all elements of the outer $coll containing - * this `WithFilter` instance that satisfy predicate `p`. - * - * @param f the function that is applied for its side-effect to every element. - * The result of function `f` is discarded. - * - * @tparam U the type parameter describing the result of function `f`. - * This result will always be ignored. Typically `U` is `Unit`, - * but this is not necessary. - * - * @usecase def foreach(f: A => Unit): Unit - */ - def foreach[U](f: A => U): Unit = - for (x <- self) - if (p(x)) f(x) - - /** Further refines the filter for this $coll. - * - * @param q the predicate used to test elements. - * @return an object of class `WithFilter`, which supports - * `map`, `flatMap`, `foreach`, and `withFilter` operations. - * All these operations apply to those elements of this $coll which - * satisfy the predicate `q` in addition to the predicate `p`. - */ - def withFilter(q: A => Boolean): WithFilter = - new WithFilter(x => p(x) && q(x)) - } - - // A helper for tails and inits. - private def iterateUntilEmpty(f: Traversable[A @uV] => Traversable[A @uV]): Iterator[Repr] = { - val it = Iterator.iterate(thisCollection)(f) takeWhile (x => !x.isEmpty) - it ++ Iterator(Nil) map (newBuilder ++= _ result) - } - } - - -</textarea> -</form> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - matchBrackets: true, - theme: "ambiance", - mode: "text/x-scala" - }); - </script> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/clojure/clojure.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/clojure/clojure.js deleted file mode 100644 index 3fdabd263a03f6b2258b27f8036afebf0264d17a..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/clojure/clojure.js +++ /dev/null @@ -1,206 +0,0 @@ -/** - * Author: Hans Engel - * Branched from CodeMirror's Scheme mode (by Koh Zi Han, based on implementation by Koh Zi Chun) - */ -CodeMirror.defineMode("clojure", function () { - var BUILTIN = "builtin", COMMENT = "comment", STRING = "string", - ATOM = "atom", NUMBER = "number", BRACKET = "bracket", KEYWORD = "keyword"; - var INDENT_WORD_SKIP = 2; - - function makeKeywords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var atoms = makeKeywords("true false nil"); - - var keywords = makeKeywords( - "defn defn- def def- defonce defmulti defmethod defmacro defstruct deftype defprotocol defrecord defproject deftest slice defalias defhinted defmacro- defn-memo defnk defnk defonce- defunbound defunbound- defvar defvar- let letfn do case cond condp for loop recur when when-not when-let when-first if if-let if-not . .. -> ->> doto and or dosync doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars binding gen-class gen-and-load-class gen-and-save-class handler-case handle"); - - var builtins = makeKeywords( - "* *1 *2 *3 *agent* *allow-unresolved-vars* *assert *clojure-version* *command-line-args* *compile-files* *compile-path* *e *err* *file* *flush-on-newline* *in* *macro-meta* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *use-context-classloader* *warn-on-reflection* + - / < <= = == > >= accessor aclone agent agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* butlast byte byte-array bytes case cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec decimal? declare definline defmacro defmethod defmulti defn defn- defonce defstruct delay delay? deliver deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall doc dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while empty empty? ensure enumeration-seq eval even? every? extend extend-protocol extend-type extends? extenders false? ffirst file-seq filter find find-doc find-ns find-var first float float-array float? floats flush fn fn? fnext for force format future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator hash hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map? mapcat max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod name namespace neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext num number? odd? or parents partial partition pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-doc print-dup print-method print-namespace-doc print-simple print-special-doc print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string reify reduce ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure release-pending-sends rem remove remove-method remove-ns repeat repeatedly replace replicate require reset! reset-meta! resolve rest resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? seque sequence sequential? set set-validator! set? short short-array shorts shutdown-agents slurp some sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-form-anchor special-symbol? split-at split-with str stream? string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync syntax-symbol-anchor take take-last take-nth take-while test the-ns time to-array to-array-2d trampoline transient tree-seq true? type unchecked-add unchecked-dec unchecked-divide unchecked-inc unchecked-multiply unchecked-negate unchecked-remainder unchecked-subtract underive unquote unquote-splicing update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector? when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision xml-seq"); - - var indentKeys = makeKeywords( - // Built-ins - "ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type try catch " + - - // Binding forms - "let letfn binding loop for doseq dotimes when-let if-let " + - - // Data structures - "defstruct struct-map assoc " + - - // clojure.test - "testing deftest " + - - // contrib - "handler-case handle dotrace deftrace"); - - var tests = { - digit: /\d/, - digit_or_colon: /[\d:]/, - hex: /[0-9a-f]/i, - sign: /[+-]/, - exponent: /e/i, - keyword_char: /[^\s\(\[\;\)\]]/, - basic: /[\w\$_\-]/, - lang_keyword: /[\w*+!\-_?:\/]/ - }; - - function stateStack(indent, type, prev) { // represents a state stack object - this.indent = indent; - this.type = type; - this.prev = prev; - } - - function pushStack(state, indent, type) { - state.indentStack = new stateStack(indent, type, state.indentStack); - } - - function popStack(state) { - state.indentStack = state.indentStack.prev; - } - - function isNumber(ch, stream){ - // hex - if ( ch === '0' && stream.eat(/x/i) ) { - stream.eatWhile(tests.hex); - return true; - } - - // leading sign - if ( ( ch == '+' || ch == '-' ) && ( tests.digit.test(stream.peek()) ) ) { - stream.eat(tests.sign); - ch = stream.next(); - } - - if ( tests.digit.test(ch) ) { - stream.eat(ch); - stream.eatWhile(tests.digit); - - if ( '.' == stream.peek() ) { - stream.eat('.'); - stream.eatWhile(tests.digit); - } - - if ( stream.eat(tests.exponent) ) { - stream.eat(tests.sign); - stream.eatWhile(tests.digit); - } - - return true; - } - - return false; - } - - return { - startState: function () { - return { - indentStack: null, - indentation: 0, - mode: false - }; - }, - - token: function (stream, state) { - if (state.indentStack == null && stream.sol()) { - // update indentation, but only if indentStack is empty - state.indentation = stream.indentation(); - } - - // skip spaces - if (stream.eatSpace()) { - return null; - } - var returnType = null; - - switch(state.mode){ - case "string": // multi-line string parsing mode - var next, escaped = false; - while ((next = stream.next()) != null) { - if (next == "\"" && !escaped) { - - state.mode = false; - break; - } - escaped = !escaped && next == "\\"; - } - returnType = STRING; // continue on in string mode - break; - default: // default parsing mode - var ch = stream.next(); - - if (ch == "\"") { - state.mode = "string"; - returnType = STRING; - } else if (ch == "'" && !( tests.digit_or_colon.test(stream.peek()) )) { - returnType = ATOM; - } else if (ch == ";") { // comment - stream.skipToEnd(); // rest of the line is a comment - returnType = COMMENT; - } else if (isNumber(ch,stream)){ - returnType = NUMBER; - } else if (ch == "(" || ch == "[") { - var keyWord = '', indentTemp = stream.column(), letter; - /** - Either - (indent-word .. - (non-indent-word .. - (;something else, bracket, etc. - */ - - if (ch == "(") while ((letter = stream.eat(tests.keyword_char)) != null) { - keyWord += letter; - } - - if (keyWord.length > 0 && (indentKeys.propertyIsEnumerable(keyWord) || - /^(?:def|with)/.test(keyWord))) { // indent-word - pushStack(state, indentTemp + INDENT_WORD_SKIP, ch); - } else { // non-indent word - // we continue eating the spaces - stream.eatSpace(); - if (stream.eol() || stream.peek() == ";") { - // nothing significant after - // we restart indentation 1 space after - pushStack(state, indentTemp + 1, ch); - } else { - pushStack(state, indentTemp + stream.current().length, ch); // else we match - } - } - stream.backUp(stream.current().length - 1); // undo all the eating - - returnType = BRACKET; - } else if (ch == ")" || ch == "]") { - returnType = BRACKET; - if (state.indentStack != null && state.indentStack.type == (ch == ")" ? "(" : "[")) { - popStack(state); - } - } else if ( ch == ":" ) { - stream.eatWhile(tests.lang_keyword); - return ATOM; - } else { - stream.eatWhile(tests.basic); - - if (keywords && keywords.propertyIsEnumerable(stream.current())) { - returnType = KEYWORD; - } else if (builtins && builtins.propertyIsEnumerable(stream.current())) { - returnType = BUILTIN; - } else if (atoms && atoms.propertyIsEnumerable(stream.current())) { - returnType = ATOM; - } else returnType = null; - } - } - - return returnType; - }, - - indent: function (state) { - if (state.indentStack == null) return state.indentation; - return state.indentStack.indent; - } - }; -}); - -CodeMirror.defineMIME("text/x-clojure", "clojure"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/clojure/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/clojure/index.html deleted file mode 100644 index bce0473530db036d84f2ee1379c6a656a349f3c1..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/clojure/index.html +++ /dev/null @@ -1,67 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Clojure mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="clojure.js"></script> - <style>.CodeMirror {background: #f8f8f8;}</style> - <link rel="stylesheet" href="../../doc/docs.css"> - </head> - <body> - <h1>CodeMirror: Clojure mode</h1> - <form><textarea id="code" name="code"> -; Conway's Game of Life, based on the work of: -;; Laurent Petit https://gist.github.com/1200343 -;; Christophe Grand http://clj-me.cgrand.net/2011/08/19/conways-game-of-life - -(ns ^{:doc "Conway's Game of Life."} - game-of-life) - -;; Core game of life's algorithm functions - -(defn neighbours - "Given a cell's coordinates, returns the coordinates of its neighbours." - [[x y]] - (for [dx [-1 0 1] dy (if (zero? dx) [-1 1] [-1 0 1])] - [(+ dx x) (+ dy y)])) - -(defn step - "Given a set of living cells, computes the new set of living cells." - [cells] - (set (for [[cell n] (frequencies (mapcat neighbours cells)) - :when (or (= n 3) (and (= n 2) (cells cell)))] - cell))) - -;; Utility methods for displaying game on a text terminal - -(defn print-board - "Prints a board on *out*, representing a step in the game." - [board w h] - (doseq [x (range (inc w)) y (range (inc h))] - (if (= y 0) (print "\n")) - (print (if (board [x y]) "[X]" " . ")))) - -(defn display-grids - "Prints a squence of boards on *out*, representing several steps." - [grids w h] - (doseq [board grids] - (print-board board w h) - (print "\n"))) - -;; Launches an example board - -(def - ^{:doc "board represents the initial set of living cells"} - board #{[2 1] [2 2] [2 3]}) - -(display-grids (take 3 (iterate step board)) 5 5) </textarea></form> - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), {}); - </script> - - <p><strong>MIME types defined:</strong> <code>text/x-clojure</code>.</p> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/coffeescript/LICENSE b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/coffeescript/LICENSE deleted file mode 100644 index 977e284e0f2bc785c3ec89030af88796b99ed1af..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/coffeescript/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License - -Copyright (c) 2011 Jeff Pickhardt -Modified from the Python CodeMirror mode, Copyright (c) 2010 Timothy Farrell - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/coffeescript/coffeescript.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/coffeescript/coffeescript.js deleted file mode 100644 index 670e01f99905f8f31b97cb47e3faf5fd3291af2d..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/coffeescript/coffeescript.js +++ /dev/null @@ -1,346 +0,0 @@ -/** - * Link to the project's GitHub page: - * https://github.com/pickhardt/coffeescript-codemirror-mode - */ -CodeMirror.defineMode('coffeescript', function(conf) { - var ERRORCLASS = 'error'; - - function wordRegexp(words) { - return new RegExp("^((" + words.join(")|(") + "))\\b"); - } - - var singleOperators = new RegExp("^[\\+\\-\\*/%&|\\^~<>!\?]"); - var singleDelimiters = new RegExp('^[\\(\\)\\[\\]\\{\\},:`=;\\.]'); - var doubleOperators = new RegExp("^((\->)|(\=>)|(\\+\\+)|(\\+\\=)|(\\-\\-)|(\\-\\=)|(\\*\\*)|(\\*\\=)|(\\/\\/)|(\\/\\=)|(==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//))"); - var doubleDelimiters = new RegExp("^((\\.\\.)|(\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"); - var tripleDelimiters = new RegExp("^((\\.\\.\\.)|(//=)|(>>=)|(<<=)|(\\*\\*=))"); - var identifiers = new RegExp("^[_A-Za-z$][_A-Za-z$0-9]*"); - var properties = new RegExp("^(@|this\.)[_A-Za-z$][_A-Za-z$0-9]*"); - - var wordOperators = wordRegexp(['and', 'or', 'not', - 'is', 'isnt', 'in', - 'instanceof', 'typeof']); - var indentKeywords = ['for', 'while', 'loop', 'if', 'unless', 'else', - 'switch', 'try', 'catch', 'finally', 'class']; - var commonKeywords = ['break', 'by', 'continue', 'debugger', 'delete', - 'do', 'in', 'of', 'new', 'return', 'then', - 'this', 'throw', 'when', 'until']; - - var keywords = wordRegexp(indentKeywords.concat(commonKeywords)); - - indentKeywords = wordRegexp(indentKeywords); - - - var stringPrefixes = new RegExp("^('{3}|\"{3}|['\"])"); - var regexPrefixes = new RegExp("^(/{3}|/)"); - var commonConstants = ['Infinity', 'NaN', 'undefined', 'null', 'true', 'false', 'on', 'off', 'yes', 'no']; - var constants = wordRegexp(commonConstants); - - // Tokenizers - function tokenBase(stream, state) { - // Handle scope changes - if (stream.sol()) { - var scopeOffset = state.scopes[0].offset; - if (stream.eatSpace()) { - var lineOffset = stream.indentation(); - if (lineOffset > scopeOffset) { - return 'indent'; - } else if (lineOffset < scopeOffset) { - return 'dedent'; - } - return null; - } else { - if (scopeOffset > 0) { - dedent(stream, state); - } - } - } - if (stream.eatSpace()) { - return null; - } - - var ch = stream.peek(); - - // Handle docco title comment (single line) - if (stream.match("####")) { - stream.skipToEnd(); - return 'comment'; - } - - // Handle multi line comments - if (stream.match("###")) { - state.tokenize = longComment; - return state.tokenize(stream, state); - } - - // Single line comment - if (ch === '#') { - stream.skipToEnd(); - return 'comment'; - } - - // Handle number literals - if (stream.match(/^-?[0-9\.]/, false)) { - var floatLiteral = false; - // Floats - if (stream.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)) { - floatLiteral = true; - } - if (stream.match(/^-?\d+\.\d*/)) { - floatLiteral = true; - } - if (stream.match(/^-?\.\d+/)) { - floatLiteral = true; - } - - if (floatLiteral) { - // prevent from getting extra . on 1.. - if (stream.peek() == "."){ - stream.backUp(1); - } - return 'number'; - } - // Integers - var intLiteral = false; - // Hex - if (stream.match(/^-?0x[0-9a-f]+/i)) { - intLiteral = true; - } - // Decimal - if (stream.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)) { - intLiteral = true; - } - // Zero by itself with no other piece of number. - if (stream.match(/^-?0(?![\dx])/i)) { - intLiteral = true; - } - if (intLiteral) { - return 'number'; - } - } - - // Handle strings - if (stream.match(stringPrefixes)) { - state.tokenize = tokenFactory(stream.current(), 'string'); - return state.tokenize(stream, state); - } - // Handle regex literals - if (stream.match(regexPrefixes)) { - if (stream.current() != '/' || stream.match(/^.*\//, false)) { // prevent highlight of division - state.tokenize = tokenFactory(stream.current(), 'string-2'); - return state.tokenize(stream, state); - } else { - stream.backUp(1); - } - } - - // Handle operators and delimiters - if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) { - return 'punctuation'; - } - if (stream.match(doubleOperators) - || stream.match(singleOperators) - || stream.match(wordOperators)) { - return 'operator'; - } - if (stream.match(singleDelimiters)) { - return 'punctuation'; - } - - if (stream.match(constants)) { - return 'atom'; - } - - if (stream.match(keywords)) { - return 'keyword'; - } - - if (stream.match(identifiers)) { - return 'variable'; - } - - if (stream.match(properties)) { - return 'property'; - } - - // Handle non-detected items - stream.next(); - return ERRORCLASS; - } - - function tokenFactory(delimiter, outclass) { - var singleline = delimiter.length == 1; - return function tokenString(stream, state) { - while (!stream.eol()) { - stream.eatWhile(/[^'"\/\\]/); - if (stream.eat('\\')) { - stream.next(); - if (singleline && stream.eol()) { - return outclass; - } - } else if (stream.match(delimiter)) { - state.tokenize = tokenBase; - return outclass; - } else { - stream.eat(/['"\/]/); - } - } - if (singleline) { - if (conf.mode.singleLineStringErrors) { - outclass = ERRORCLASS; - } else { - state.tokenize = tokenBase; - } - } - return outclass; - }; - } - - function longComment(stream, state) { - while (!stream.eol()) { - stream.eatWhile(/[^#]/); - if (stream.match("###")) { - state.tokenize = tokenBase; - break; - } - stream.eatWhile("#"); - } - return "comment"; - } - - function indent(stream, state, type) { - type = type || 'coffee'; - var indentUnit = 0; - if (type === 'coffee') { - for (var i = 0; i < state.scopes.length; i++) { - if (state.scopes[i].type === 'coffee') { - indentUnit = state.scopes[i].offset + conf.indentUnit; - break; - } - } - } else { - indentUnit = stream.column() + stream.current().length; - } - state.scopes.unshift({ - offset: indentUnit, - type: type - }); - } - - function dedent(stream, state) { - if (state.scopes.length == 1) return; - if (state.scopes[0].type === 'coffee') { - var _indent = stream.indentation(); - var _indent_index = -1; - for (var i = 0; i < state.scopes.length; ++i) { - if (_indent === state.scopes[i].offset) { - _indent_index = i; - break; - } - } - if (_indent_index === -1) { - return true; - } - while (state.scopes[0].offset !== _indent) { - state.scopes.shift(); - } - return false; - } else { - state.scopes.shift(); - return false; - } - } - - function tokenLexer(stream, state) { - var style = state.tokenize(stream, state); - var current = stream.current(); - - // Handle '.' connected identifiers - if (current === '.') { - style = state.tokenize(stream, state); - current = stream.current(); - if (style === 'variable') { - return 'variable'; - } else { - return ERRORCLASS; - } - } - - // Handle scope changes. - if (current === 'return') { - state.dedent += 1; - } - if (((current === '->' || current === '=>') && - !state.lambda && - state.scopes[0].type == 'coffee' && - stream.peek() === '') - || style === 'indent') { - indent(stream, state); - } - var delimiter_index = '[({'.indexOf(current); - if (delimiter_index !== -1) { - indent(stream, state, '])}'.slice(delimiter_index, delimiter_index+1)); - } - if (indentKeywords.exec(current)){ - indent(stream, state); - } - if (current == 'then'){ - dedent(stream, state); - } - - - if (style === 'dedent') { - if (dedent(stream, state)) { - return ERRORCLASS; - } - } - delimiter_index = '])}'.indexOf(current); - if (delimiter_index !== -1) { - if (dedent(stream, state)) { - return ERRORCLASS; - } - } - if (state.dedent > 0 && stream.eol() && state.scopes[0].type == 'coffee') { - if (state.scopes.length > 1) state.scopes.shift(); - state.dedent -= 1; - } - - return style; - } - - var external = { - startState: function(basecolumn) { - return { - tokenize: tokenBase, - scopes: [{offset:basecolumn || 0, type:'coffee'}], - lastToken: null, - lambda: false, - dedent: 0 - }; - }, - - token: function(stream, state) { - var style = tokenLexer(stream, state); - - state.lastToken = {style:style, content: stream.current()}; - - if (stream.eol() && stream.lambda) { - state.lambda = false; - } - - return style; - }, - - indent: function(state) { - if (state.tokenize != tokenBase) { - return 0; - } - - return state.scopes[0].offset; - } - - }; - return external; -}); - -CodeMirror.defineMIME('text/x-coffeescript', 'coffeescript'); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/coffeescript/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/coffeescript/index.html deleted file mode 100644 index ee72b8d2f22bcb41923d0177fad7d91134f4d6f8..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/coffeescript/index.html +++ /dev/null @@ -1,728 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: CoffeeScript mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="coffeescript.js"></script> - <style>.CodeMirror {border-top: 1px solid silver; border-bottom: 1px solid silver;}</style> - <link rel="stylesheet" href="../../doc/docs.css"> - </head> - <body> - <h1>CodeMirror: CoffeeScript mode</h1> - <form><textarea id="code" name="code"> -# CoffeeScript mode for CodeMirror -# Copyright (c) 2011 Jeff Pickhardt, released under -# the MIT License. -# -# Modified from the Python CodeMirror mode, which also is -# under the MIT License Copyright (c) 2010 Timothy Farrell. -# -# The following script, Underscore.coffee, is used to -# demonstrate CoffeeScript mode for CodeMirror. -# -# To download CoffeeScript mode for CodeMirror, go to: -# https://github.com/pickhardt/coffeescript-codemirror-mode - -# **Underscore.coffee -# (c) 2011 Jeremy Ashkenas, DocumentCloud Inc.** -# Underscore is freely distributable under the terms of the -# [MIT license](http://en.wikipedia.org/wiki/MIT_License). -# Portions of Underscore are inspired by or borrowed from -# [Prototype.js](http://prototypejs.org/api), Oliver Steele's -# [Functional](http://osteele.com), and John Resig's -# [Micro-Templating](http://ejohn.org). -# For all details and documentation: -# http://documentcloud.github.com/underscore/ - - -# Baseline setup -# -------------- - -# Establish the root object, `window` in the browser, or `global` on the server. -root = this - - -# Save the previous value of the `_` variable. -previousUnderscore = root._ - -### Multiline - comment -### - -# Establish the object that gets thrown to break out of a loop iteration. -# `StopIteration` is SOP on Mozilla. -breaker = if typeof(StopIteration) is 'undefined' then '__break__' else StopIteration - - -#### Docco style single line comment (title) - - -# Helper function to escape **RegExp** contents, because JS doesn't have one. -escapeRegExp = (string) -> string.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1') - - -# Save bytes in the minified (but not gzipped) version: -ArrayProto = Array.prototype -ObjProto = Object.prototype - - -# Create quick reference variables for speed access to core prototypes. -slice = ArrayProto.slice -unshift = ArrayProto.unshift -toString = ObjProto.toString -hasOwnProperty = ObjProto.hasOwnProperty -propertyIsEnumerable = ObjProto.propertyIsEnumerable - - -# All **ECMA5** native implementations we hope to use are declared here. -nativeForEach = ArrayProto.forEach -nativeMap = ArrayProto.map -nativeReduce = ArrayProto.reduce -nativeReduceRight = ArrayProto.reduceRight -nativeFilter = ArrayProto.filter -nativeEvery = ArrayProto.every -nativeSome = ArrayProto.some -nativeIndexOf = ArrayProto.indexOf -nativeLastIndexOf = ArrayProto.lastIndexOf -nativeIsArray = Array.isArray -nativeKeys = Object.keys - - -# Create a safe reference to the Underscore object for use below. -_ = (obj) -> new wrapper(obj) - - -# Export the Underscore object for **CommonJS**. -if typeof(exports) != 'undefined' then exports._ = _ - - -# Export Underscore to global scope. -root._ = _ - - -# Current version. -_.VERSION = '1.1.0' - - -# Collection Functions -# -------------------- - -# The cornerstone, an **each** implementation. -# Handles objects implementing **forEach**, arrays, and raw objects. -_.each = (obj, iterator, context) -> - try - if nativeForEach and obj.forEach is nativeForEach - obj.forEach iterator, context - else if _.isNumber obj.length - iterator.call context, obj[i], i, obj for i in [0...obj.length] - else - iterator.call context, val, key, obj for own key, val of obj - catch e - throw e if e isnt breaker - obj - - -# Return the results of applying the iterator to each element. Use JavaScript -# 1.6's version of **map**, if possible. -_.map = (obj, iterator, context) -> - return obj.map(iterator, context) if nativeMap and obj.map is nativeMap - results = [] - _.each obj, (value, index, list) -> - results.push iterator.call context, value, index, list - results - - -# **Reduce** builds up a single result from a list of values. Also known as -# **inject**, or **foldl**. Uses JavaScript 1.8's version of **reduce**, if possible. -_.reduce = (obj, iterator, memo, context) -> - if nativeReduce and obj.reduce is nativeReduce - iterator = _.bind iterator, context if context - return obj.reduce iterator, memo - _.each obj, (value, index, list) -> - memo = iterator.call context, memo, value, index, list - memo - - -# The right-associative version of **reduce**, also known as **foldr**. Uses -# JavaScript 1.8's version of **reduceRight**, if available. -_.reduceRight = (obj, iterator, memo, context) -> - if nativeReduceRight and obj.reduceRight is nativeReduceRight - iterator = _.bind iterator, context if context - return obj.reduceRight iterator, memo - reversed = _.clone(_.toArray(obj)).reverse() - _.reduce reversed, iterator, memo, context - - -# Return the first value which passes a truth test. -_.detect = (obj, iterator, context) -> - result = null - _.each obj, (value, index, list) -> - if iterator.call context, value, index, list - result = value - _.breakLoop() - result - - -# Return all the elements that pass a truth test. Use JavaScript 1.6's -# **filter**, if it exists. -_.filter = (obj, iterator, context) -> - return obj.filter iterator, context if nativeFilter and obj.filter is nativeFilter - results = [] - _.each obj, (value, index, list) -> - results.push value if iterator.call context, value, index, list - results - - -# Return all the elements for which a truth test fails. -_.reject = (obj, iterator, context) -> - results = [] - _.each obj, (value, index, list) -> - results.push value if not iterator.call context, value, index, list - results - - -# Determine whether all of the elements match a truth test. Delegate to -# JavaScript 1.6's **every**, if it is present. -_.every = (obj, iterator, context) -> - iterator ||= _.identity - return obj.every iterator, context if nativeEvery and obj.every is nativeEvery - result = true - _.each obj, (value, index, list) -> - _.breakLoop() unless (result = result and iterator.call(context, value, index, list)) - result - - -# Determine if at least one element in the object matches a truth test. Use -# JavaScript 1.6's **some**, if it exists. -_.some = (obj, iterator, context) -> - iterator ||= _.identity - return obj.some iterator, context if nativeSome and obj.some is nativeSome - result = false - _.each obj, (value, index, list) -> - _.breakLoop() if (result = iterator.call(context, value, index, list)) - result - - -# Determine if a given value is included in the array or object, -# based on `===`. -_.include = (obj, target) -> - return _.indexOf(obj, target) isnt -1 if nativeIndexOf and obj.indexOf is nativeIndexOf - return true for own key, val of obj when val is target - false - - -# Invoke a method with arguments on every item in a collection. -_.invoke = (obj, method) -> - args = _.rest arguments, 2 - (if method then val[method] else val).apply(val, args) for val in obj - - -# Convenience version of a common use case of **map**: fetching a property. -_.pluck = (obj, key) -> - _.map(obj, (val) -> val[key]) - - -# Return the maximum item or (item-based computation). -_.max = (obj, iterator, context) -> - return Math.max.apply(Math, obj) if not iterator and _.isArray(obj) - result = computed: -Infinity - _.each obj, (value, index, list) -> - computed = if iterator then iterator.call(context, value, index, list) else value - computed >= result.computed and (result = {value: value, computed: computed}) - result.value - - -# Return the minimum element (or element-based computation). -_.min = (obj, iterator, context) -> - return Math.min.apply(Math, obj) if not iterator and _.isArray(obj) - result = computed: Infinity - _.each obj, (value, index, list) -> - computed = if iterator then iterator.call(context, value, index, list) else value - computed < result.computed and (result = {value: value, computed: computed}) - result.value - - -# Sort the object's values by a criterion produced by an iterator. -_.sortBy = (obj, iterator, context) -> - _.pluck(((_.map obj, (value, index, list) -> - {value: value, criteria: iterator.call(context, value, index, list)} - ).sort((left, right) -> - a = left.criteria; b = right.criteria - if a < b then -1 else if a > b then 1 else 0 - )), 'value') - - -# Use a comparator function to figure out at what index an object should -# be inserted so as to maintain order. Uses binary search. -_.sortedIndex = (array, obj, iterator) -> - iterator ||= _.identity - low = 0 - high = array.length - while low < high - mid = (low + high) >> 1 - if iterator(array[mid]) < iterator(obj) then low = mid + 1 else high = mid - low - - -# Convert anything iterable into a real, live array. -_.toArray = (iterable) -> - return [] if (!iterable) - return iterable.toArray() if (iterable.toArray) - return iterable if (_.isArray(iterable)) - return slice.call(iterable) if (_.isArguments(iterable)) - _.values(iterable) - - -# Return the number of elements in an object. -_.size = (obj) -> _.toArray(obj).length - - -# Array Functions -# --------------- - -# Get the first element of an array. Passing `n` will return the first N -# values in the array. Aliased as **head**. The `guard` check allows it to work -# with **map**. -_.first = (array, n, guard) -> - if n and not guard then slice.call(array, 0, n) else array[0] - - -# Returns everything but the first entry of the array. Aliased as **tail**. -# Especially useful on the arguments object. Passing an `index` will return -# the rest of the values in the array from that index onward. The `guard` -# check allows it to work with **map**. -_.rest = (array, index, guard) -> - slice.call(array, if _.isUndefined(index) or guard then 1 else index) - - -# Get the last element of an array. -_.last = (array) -> array[array.length - 1] - - -# Trim out all falsy values from an array. -_.compact = (array) -> item for item in array when item - - -# Return a completely flattened version of an array. -_.flatten = (array) -> - _.reduce array, (memo, value) -> - return memo.concat(_.flatten(value)) if _.isArray value - memo.push value - memo - , [] - - -# Return a version of the array that does not contain the specified value(s). -_.without = (array) -> - values = _.rest arguments - val for val in _.toArray(array) when not _.include values, val - - -# Produce a duplicate-free version of the array. If the array has already -# been sorted, you have the option of using a faster algorithm. -_.uniq = (array, isSorted) -> - memo = [] - for el, i in _.toArray array - memo.push el if i is 0 || (if isSorted is true then _.last(memo) isnt el else not _.include(memo, el)) - memo - - -# Produce an array that contains every item shared between all the -# passed-in arrays. -_.intersect = (array) -> - rest = _.rest arguments - _.select _.uniq(array), (item) -> - _.all rest, (other) -> - _.indexOf(other, item) >= 0 - - -# Zip together multiple lists into a single array -- elements that share -# an index go together. -_.zip = -> - length = _.max _.pluck arguments, 'length' - results = new Array length - for i in [0...length] - results[i] = _.pluck arguments, String i - results - - -# If the browser doesn't supply us with **indexOf** (I'm looking at you, MSIE), -# we need this function. Return the position of the first occurrence of an -# item in an array, or -1 if the item is not included in the array. -_.indexOf = (array, item) -> - return array.indexOf item if nativeIndexOf and array.indexOf is nativeIndexOf - i = 0; l = array.length - while l - i - if array[i] is item then return i else i++ - -1 - - -# Provide JavaScript 1.6's **lastIndexOf**, delegating to the native function, -# if possible. -_.lastIndexOf = (array, item) -> - return array.lastIndexOf(item) if nativeLastIndexOf and array.lastIndexOf is nativeLastIndexOf - i = array.length - while i - if array[i] is item then return i else i-- - -1 - - -# Generate an integer Array containing an arithmetic progression. A port of -# [the native Python **range** function](http://docs.python.org/library/functions.html#range). -_.range = (start, stop, step) -> - a = arguments - solo = a.length <= 1 - i = start = if solo then 0 else a[0] - stop = if solo then a[0] else a[1] - step = a[2] or 1 - len = Math.ceil((stop - start) / step) - return [] if len <= 0 - range = new Array len - idx = 0 - loop - return range if (if step > 0 then i - stop else stop - i) >= 0 - range[idx] = i - idx++ - i+= step - - -# Function Functions -# ------------------ - -# Create a function bound to a given object (assigning `this`, and arguments, -# optionally). Binding with arguments is also known as **curry**. -_.bind = (func, obj) -> - args = _.rest arguments, 2 - -> func.apply obj or root, args.concat arguments - - -# Bind all of an object's methods to that object. Useful for ensuring that -# all callbacks defined on an object belong to it. -_.bindAll = (obj) -> - funcs = if arguments.length > 1 then _.rest(arguments) else _.functions(obj) - _.each funcs, (f) -> obj[f] = _.bind obj[f], obj - obj - - -# Delays a function for the given number of milliseconds, and then calls -# it with the arguments supplied. -_.delay = (func, wait) -> - args = _.rest arguments, 2 - setTimeout((-> func.apply(func, args)), wait) - - -# Memoize an expensive function by storing its results. -_.memoize = (func, hasher) -> - memo = {} - hasher or= _.identity - -> - key = hasher.apply this, arguments - return memo[key] if key of memo - memo[key] = func.apply this, arguments - - -# Defers a function, scheduling it to run after the current call stack has -# cleared. -_.defer = (func) -> - _.delay.apply _, [func, 1].concat _.rest arguments - - -# Returns the first function passed as an argument to the second, -# allowing you to adjust arguments, run code before and after, and -# conditionally execute the original function. -_.wrap = (func, wrapper) -> - -> wrapper.apply wrapper, [func].concat arguments - - -# Returns a function that is the composition of a list of functions, each -# consuming the return value of the function that follows. -_.compose = -> - funcs = arguments - -> - args = arguments - for i in [funcs.length - 1..0] by -1 - args = [funcs[i].apply(this, args)] - args[0] - - -# Object Functions -# ---------------- - -# Retrieve the names of an object's properties. -_.keys = nativeKeys or (obj) -> - return _.range 0, obj.length if _.isArray(obj) - key for key, val of obj - - -# Retrieve the values of an object's properties. -_.values = (obj) -> - _.map obj, _.identity - - -# Return a sorted list of the function names available in Underscore. -_.functions = (obj) -> - _.filter(_.keys(obj), (key) -> _.isFunction(obj[key])).sort() - - -# Extend a given object with all of the properties in a source object. -_.extend = (obj) -> - for source in _.rest(arguments) - obj[key] = val for key, val of source - obj - - -# Create a (shallow-cloned) duplicate of an object. -_.clone = (obj) -> - return obj.slice 0 if _.isArray obj - _.extend {}, obj - - -# Invokes interceptor with the obj, and then returns obj. -# The primary purpose of this method is to "tap into" a method chain, -# in order to perform operations on intermediate results within - the chain. -_.tap = (obj, interceptor) -> - interceptor obj - obj - - -# Perform a deep comparison to check if two objects are equal. -_.isEqual = (a, b) -> - # Check object identity. - return true if a is b - # Different types? - atype = typeof(a); btype = typeof(b) - return false if atype isnt btype - # Basic equality test (watch out for coercions). - return true if `a == b` - # One is falsy and the other truthy. - return false if (!a and b) or (a and !b) - # One of them implements an `isEqual()`? - return a.isEqual(b) if a.isEqual - # Check dates' integer values. - return a.getTime() is b.getTime() if _.isDate(a) and _.isDate(b) - # Both are NaN? - return false if _.isNaN(a) and _.isNaN(b) - # Compare regular expressions. - if _.isRegExp(a) and _.isRegExp(b) - return a.source is b.source and - a.global is b.global and - a.ignoreCase is b.ignoreCase and - a.multiline is b.multiline - # If a is not an object by this point, we can't handle it. - return false if atype isnt 'object' - # Check for different array lengths before comparing contents. - return false if a.length and (a.length isnt b.length) - # Nothing else worked, deep compare the contents. - aKeys = _.keys(a); bKeys = _.keys(b) - # Different object sizes? - return false if aKeys.length isnt bKeys.length - # Recursive comparison of contents. - return false for key, val of a when !(key of b) or !_.isEqual(val, b[key]) - true - - -# Is a given array or object empty? -_.isEmpty = (obj) -> - return obj.length is 0 if _.isArray(obj) or _.isString(obj) - return false for own key of obj - true - - -# Is a given value a DOM element? -_.isElement = (obj) -> obj and obj.nodeType is 1 - - -# Is a given value an array? -_.isArray = nativeIsArray or (obj) -> !!(obj and obj.concat and obj.unshift and not obj.callee) - - -# Is a given variable an arguments object? -_.isArguments = (obj) -> obj and obj.callee - - -# Is the given value a function? -_.isFunction = (obj) -> !!(obj and obj.constructor and obj.call and obj.apply) - - -# Is the given value a string? -_.isString = (obj) -> !!(obj is '' or (obj and obj.charCodeAt and obj.substr)) - - -# Is a given value a number? -_.isNumber = (obj) -> (obj is +obj) or toString.call(obj) is '[object Number]' - - -# Is a given value a boolean? -_.isBoolean = (obj) -> obj is true or obj is false - - -# Is a given value a Date? -_.isDate = (obj) -> !!(obj and obj.getTimezoneOffset and obj.setUTCFullYear) - - -# Is the given value a regular expression? -_.isRegExp = (obj) -> !!(obj and obj.exec and (obj.ignoreCase or obj.ignoreCase is false)) - - -# Is the given value NaN -- this one is interesting. `NaN != NaN`, and -# `isNaN(undefined) == true`, so we make sure it's a number first. -_.isNaN = (obj) -> _.isNumber(obj) and window.isNaN(obj) - - -# Is a given value equal to null? -_.isNull = (obj) -> obj is null - - -# Is a given variable undefined? -_.isUndefined = (obj) -> typeof obj is 'undefined' - - -# Utility Functions -# ----------------- - -# Run Underscore.js in noConflict mode, returning the `_` variable to its -# previous owner. Returns a reference to the Underscore object. -_.noConflict = -> - root._ = previousUnderscore - this - - -# Keep the identity function around for default iterators. -_.identity = (value) -> value - - -# Run a function `n` times. -_.times = (n, iterator, context) -> - iterator.call context, i for i in [0...n] - - -# Break out of the middle of an iteration. -_.breakLoop = -> throw breaker - - -# Add your own custom functions to the Underscore object, ensuring that -# they're correctly added to the OOP wrapper as well. -_.mixin = (obj) -> - for name in _.functions(obj) - addToWrapper name, _[name] = obj[name] - - -# Generate a unique integer id (unique within the entire client session). -# Useful for temporary DOM ids. -idCounter = 0 -_.uniqueId = (prefix) -> - (prefix or '') + idCounter++ - - -# By default, Underscore uses **ERB**-style template delimiters, change the -# following template settings to use alternative delimiters. -_.templateSettings = { - start: '<%' - end: '%>' - interpolate: /<%=(.+?)%>/g -} - - -# JavaScript templating a-la **ERB**, pilfered from John Resig's -# *Secrets of the JavaScript Ninja*, page 83. -# Single-quote fix from Rick Strahl. -# With alterations for arbitrary delimiters, and to preserve whitespace. -_.template = (str, data) -> - c = _.templateSettings - endMatch = new RegExp("'(?=[^"+c.end.substr(0, 1)+"]*"+escapeRegExp(c.end)+")","g") - fn = new Function 'obj', - 'var p=[],print=function(){p.push.apply(p,arguments);};' + - 'with(obj||{}){p.push(\'' + - str.replace(/\r/g, '\\r') - .replace(/\n/g, '\\n') - .replace(/\t/g, '\\t') - .replace(endMatch,"���") - .split("'").join("\\'") - .split("���").join("'") - .replace(c.interpolate, "',$1,'") - .split(c.start).join("');") - .split(c.end).join("p.push('") + - "');}return p.join('');" - if data then fn(data) else fn - - -# Aliases -# ------- - -_.forEach = _.each -_.foldl = _.inject = _.reduce -_.foldr = _.reduceRight -_.select = _.filter -_.all = _.every -_.any = _.some -_.contains = _.include -_.head = _.first -_.tail = _.rest -_.methods = _.functions - - -# Setup the OOP Wrapper -# --------------------- - -# If Underscore is called as a function, it returns a wrapped object that -# can be used OO-style. This wrapper holds altered versions of all the -# underscore functions. Wrapped objects may be chained. -wrapper = (obj) -> - this._wrapped = obj - this - - -# Helper function to continue chaining intermediate results. -result = (obj, chain) -> - if chain then _(obj).chain() else obj - - -# A method to easily add functions to the OOP wrapper. -addToWrapper = (name, func) -> - wrapper.prototype[name] = -> - args = _.toArray arguments - unshift.call args, this._wrapped - result func.apply(_, args), this._chain - - -# Add all ofthe Underscore functions to the wrapper object. -_.mixin _ - - -# Add all mutator Array functions to the wrapper. -_.each ['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], (name) -> - method = Array.prototype[name] - wrapper.prototype[name] = -> - method.apply(this._wrapped, arguments) - result(this._wrapped, this._chain) - - -# Add all accessor Array functions to the wrapper. -_.each ['concat', 'join', 'slice'], (name) -> - method = Array.prototype[name] - wrapper.prototype[name] = -> - result(method.apply(this._wrapped, arguments), this._chain) - - -# Start chaining a wrapped Underscore object. -wrapper::chain = -> - this._chain = true - this - - -# Extracts the result from a wrapped and chained object. -wrapper::value = -> this._wrapped -</textarea></form> - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), {}); - </script> - - <p><strong>MIME types defined:</strong> <code>text/x-coffeescript</code>.</p> - - <p>The CoffeeScript mode was written by Jeff Pickhardt (<a href="LICENSE">license</a>).</p> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/commonlisp/commonlisp.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/commonlisp/commonlisp.js deleted file mode 100644 index eeba759668f3fbc4e605607d16c5babf8d59109d..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/commonlisp/commonlisp.js +++ /dev/null @@ -1,101 +0,0 @@ -CodeMirror.defineMode("commonlisp", function (config) { - var assumeBody = /^with|^def|^do|^prog|case$|^cond$|bind$|when$|unless$/; - var numLiteral = /^(?:[+\-]?(?:\d+|\d*\.\d+)(?:[efd][+\-]?\d+)?|[+\-]?\d+(?:\/[+\-]?\d+)?|#b[+\-]?[01]+|#o[+\-]?[0-7]+|#x[+\-]?[\da-f]+)/; - var symbol = /[^\s'`,@()\[\]";]/; - var type; - - function readSym(stream) { - var ch; - while (ch = stream.next()) { - if (ch == "\\") stream.next(); - else if (!symbol.test(ch)) { stream.backUp(1); break; } - } - return stream.current(); - } - - function base(stream, state) { - if (stream.eatSpace()) {type = "ws"; return null;} - if (stream.match(numLiteral)) return "number"; - var ch = stream.next(); - if (ch == "\\") ch = stream.next(); - - if (ch == '"') return (state.tokenize = inString)(stream, state); - else if (ch == "(") { type = "open"; return "bracket"; } - else if (ch == ")" || ch == "]") { type = "close"; return "bracket"; } - else if (ch == ";") { stream.skipToEnd(); type = "ws"; return "comment"; } - else if (/['`,@]/.test(ch)) return null; - else if (ch == "|") { - if (stream.skipTo("|")) { stream.next(); return "symbol"; } - else { stream.skipToEnd(); return "error"; } - } else if (ch == "#") { - var ch = stream.next(); - if (ch == "[") { type = "open"; return "bracket"; } - else if (/[+\-=\.']/.test(ch)) return null; - else if (/\d/.test(ch) && stream.match(/^\d*#/)) return null; - else if (ch == "|") return (state.tokenize = inComment)(stream, state); - else if (ch == ":") { readSym(stream); return "meta"; } - else return "error"; - } else { - var name = readSym(stream); - if (name == ".") return null; - type = "symbol"; - if (name == "nil" || name == "t") return "atom"; - if (name.charAt(0) == ":") return "keyword"; - if (name.charAt(0) == "&") return "variable-2"; - return "variable"; - } - } - - function inString(stream, state) { - var escaped = false, next; - while (next = stream.next()) { - if (next == '"' && !escaped) { state.tokenize = base; break; } - escaped = !escaped && next == "\\"; - } - return "string"; - } - - function inComment(stream, state) { - var next, last; - while (next = stream.next()) { - if (next == "#" && last == "|") { state.tokenize = base; break; } - last = next; - } - type = "ws"; - return "comment"; - } - - return { - startState: function () { - return {ctx: {prev: null, start: 0, indentTo: 0}, tokenize: base}; - }, - - token: function (stream, state) { - if (stream.sol() && typeof state.ctx.indentTo != "number") - state.ctx.indentTo = state.ctx.start + 1; - - type = null; - var style = state.tokenize(stream, state); - if (type != "ws") { - if (state.ctx.indentTo == null) { - if (type == "symbol" && assumeBody.test(stream.current())) - state.ctx.indentTo = state.ctx.start + config.indentUnit; - else - state.ctx.indentTo = "next"; - } else if (state.ctx.indentTo == "next") { - state.ctx.indentTo = stream.column(); - } - } - if (type == "open") state.ctx = {prev: state.ctx, start: stream.column(), indentTo: null}; - else if (type == "close") state.ctx = state.ctx.prev || state.ctx; - return style; - }, - - indent: function (state, _textAfter) { - var i = state.ctx.indentTo; - return typeof i == "number" ? i : state.ctx.start + 1; - } - }; -}); - -CodeMirror.defineMIME("text/x-common-lisp", "commonlisp"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/commonlisp/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/commonlisp/index.html deleted file mode 100644 index f9766a844ce5948e91966c5f13346533f8632134..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/commonlisp/index.html +++ /dev/null @@ -1,165 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Common Lisp mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="commonlisp.js"></script> - <style>.CodeMirror {background: #f8f8f8;}</style> - <link rel="stylesheet" href="../../doc/docs.css"> - </head> - <body> - <h1>CodeMirror: Common Lisp mode</h1> - <form><textarea id="code" name="code">(in-package :cl-postgres) - -;; These are used to synthesize reader and writer names for integer -;; reading/writing functions when the amount of bytes and the -;; signedness is known. Both the macro that creates the functions and -;; some macros that use them create names this way. -(eval-when (:compile-toplevel :load-toplevel :execute) - (defun integer-reader-name (bytes signed) - (intern (with-standard-io-syntax - (format nil "~a~a~a~a" '#:read- (if signed "" '#:u) '#:int bytes)))) - (defun integer-writer-name (bytes signed) - (intern (with-standard-io-syntax - (format nil "~a~a~a~a" '#:write- (if signed "" '#:u) '#:int bytes))))) - -(defmacro integer-reader (bytes) - "Create a function to read integers from a binary stream." - (let ((bits (* bytes 8))) - (labels ((return-form (signed) - (if signed - `(if (logbitp ,(1- bits) result) - (dpb result (byte ,(1- bits) 0) -1) - result) - `result)) - (generate-reader (signed) - `(defun ,(integer-reader-name bytes signed) (socket) - (declare (type stream socket) - #.*optimize*) - ,(if (= bytes 1) - `(let ((result (the (unsigned-byte 8) (read-byte socket)))) - (declare (type (unsigned-byte 8) result)) - ,(return-form signed)) - `(let ((result 0)) - (declare (type (unsigned-byte ,bits) result)) - ,@(loop :for byte :from (1- bytes) :downto 0 - :collect `(setf (ldb (byte 8 ,(* 8 byte)) result) - (the (unsigned-byte 8) (read-byte socket)))) - ,(return-form signed)))))) - `(progn -;; This causes weird errors on SBCL in some circumstances. Disabled for now. -;; (declaim (inline ,(integer-reader-name bytes t) -;; ,(integer-reader-name bytes nil))) - (declaim (ftype (function (t) (signed-byte ,bits)) - ,(integer-reader-name bytes t))) - ,(generate-reader t) - (declaim (ftype (function (t) (unsigned-byte ,bits)) - ,(integer-reader-name bytes nil))) - ,(generate-reader nil))))) - -(defmacro integer-writer (bytes) - "Create a function to write integers to a binary stream." - (let ((bits (* 8 bytes))) - `(progn - (declaim (inline ,(integer-writer-name bytes t) - ,(integer-writer-name bytes nil))) - (defun ,(integer-writer-name bytes nil) (socket value) - (declare (type stream socket) - (type (unsigned-byte ,bits) value) - #.*optimize*) - ,@(if (= bytes 1) - `((write-byte value socket)) - (loop :for byte :from (1- bytes) :downto 0 - :collect `(write-byte (ldb (byte 8 ,(* byte 8)) value) - socket))) - (values)) - (defun ,(integer-writer-name bytes t) (socket value) - (declare (type stream socket) - (type (signed-byte ,bits) value) - #.*optimize*) - ,@(if (= bytes 1) - `((write-byte (ldb (byte 8 0) value) socket)) - (loop :for byte :from (1- bytes) :downto 0 - :collect `(write-byte (ldb (byte 8 ,(* byte 8)) value) - socket))) - (values))))) - -;; All the instances of the above that we need. - -(integer-reader 1) -(integer-reader 2) -(integer-reader 4) -(integer-reader 8) - -(integer-writer 1) -(integer-writer 2) -(integer-writer 4) - -(defun write-bytes (socket bytes) - "Write a byte-array to a stream." - (declare (type stream socket) - (type (simple-array (unsigned-byte 8)) bytes) - #.*optimize*) - (write-sequence bytes socket)) - -(defun write-str (socket string) - "Write a null-terminated string to a stream \(encoding it when UTF-8 -support is enabled.)." - (declare (type stream socket) - (type string string) - #.*optimize*) - (enc-write-string string socket) - (write-uint1 socket 0)) - -(declaim (ftype (function (t unsigned-byte) - (simple-array (unsigned-byte 8) (*))) - read-bytes)) -(defun read-bytes (socket length) - "Read a byte array of the given length from a stream." - (declare (type stream socket) - (type fixnum length) - #.*optimize*) - (let ((result (make-array length :element-type '(unsigned-byte 8)))) - (read-sequence result socket) - result)) - -(declaim (ftype (function (t) string) read-str)) -(defun read-str (socket) - "Read a null-terminated string from a stream. Takes care of encoding -when UTF-8 support is enabled." - (declare (type stream socket) - #.*optimize*) - (enc-read-string socket :null-terminated t)) - -(defun skip-bytes (socket length) - "Skip a given number of bytes in a binary stream." - (declare (type stream socket) - (type (unsigned-byte 32) length) - #.*optimize*) - (dotimes (i length) - (read-byte socket))) - -(defun skip-str (socket) - "Skip a null-terminated string." - (declare (type stream socket) - #.*optimize*) - (loop :for char :of-type fixnum = (read-byte socket) - :until (zerop char))) - -(defun ensure-socket-is-closed (socket &key abort) - (when (open-stream-p socket) - (handler-case - (close socket :abort abort) - (error (error) - (warn "Ignoring the error which happened while trying to close PostgreSQL socket: ~A" error))))) -</textarea></form> - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), {lineNumbers: true}); - </script> - - <p><strong>MIME types defined:</strong> <code>text/x-common-lisp</code>.</p> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/css/css.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/css/css.js deleted file mode 100644 index f4ce9f9d778a186de1f6099514eaf9721606a681..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/css/css.js +++ /dev/null @@ -1,465 +0,0 @@ -CodeMirror.defineMode("css", function(config) { - var indentUnit = config.indentUnit, type; - - var atMediaTypes = keySet([ - "all", "aural", "braille", "handheld", "print", "projection", "screen", - "tty", "tv", "embossed" - ]); - - var atMediaFeatures = keySet([ - "width", "min-width", "max-width", "height", "min-height", "max-height", - "device-width", "min-device-width", "max-device-width", "device-height", - "min-device-height", "max-device-height", "aspect-ratio", - "min-aspect-ratio", "max-aspect-ratio", "device-aspect-ratio", - "min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color", - "max-color", "color-index", "min-color-index", "max-color-index", - "monochrome", "min-monochrome", "max-monochrome", "resolution", - "min-resolution", "max-resolution", "scan", "grid" - ]); - - var propertyKeywords = keySet([ - "align-content", "align-items", "align-self", "alignment-adjust", - "alignment-baseline", "anchor-point", "animation", "animation-delay", - "animation-direction", "animation-duration", "animation-iteration-count", - "animation-name", "animation-play-state", "animation-timing-function", - "appearance", "azimuth", "backface-visibility", "background", - "background-attachment", "background-clip", "background-color", - "background-image", "background-origin", "background-position", - "background-repeat", "background-size", "baseline-shift", "binding", - "bleed", "bookmark-label", "bookmark-level", "bookmark-state", - "bookmark-target", "border", "border-bottom", "border-bottom-color", - "border-bottom-left-radius", "border-bottom-right-radius", - "border-bottom-style", "border-bottom-width", "border-collapse", - "border-color", "border-image", "border-image-outset", - "border-image-repeat", "border-image-slice", "border-image-source", - "border-image-width", "border-left", "border-left-color", - "border-left-style", "border-left-width", "border-radius", "border-right", - "border-right-color", "border-right-style", "border-right-width", - "border-spacing", "border-style", "border-top", "border-top-color", - "border-top-left-radius", "border-top-right-radius", "border-top-style", - "border-top-width", "border-width", "bottom", "box-decoration-break", - "box-shadow", "box-sizing", "break-after", "break-before", "break-inside", - "caption-side", "clear", "clip", "color", "color-profile", "column-count", - "column-fill", "column-gap", "column-rule", "column-rule-color", - "column-rule-style", "column-rule-width", "column-span", "column-width", - "columns", "content", "counter-increment", "counter-reset", "crop", "cue", - "cue-after", "cue-before", "cursor", "direction", "display", - "dominant-baseline", "drop-initial-after-adjust", - "drop-initial-after-align", "drop-initial-before-adjust", - "drop-initial-before-align", "drop-initial-size", "drop-initial-value", - "elevation", "empty-cells", "fit", "fit-position", "flex", "flex-basis", - "flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap", - "float", "float-offset", "font", "font-feature-settings", "font-family", - "font-kerning", "font-language-override", "font-size", "font-size-adjust", - "font-stretch", "font-style", "font-synthesis", "font-variant", - "font-variant-alternates", "font-variant-caps", "font-variant-east-asian", - "font-variant-ligatures", "font-variant-numeric", "font-variant-position", - "font-weight", "grid-cell", "grid-column", "grid-column-align", - "grid-column-sizing", "grid-column-span", "grid-columns", "grid-flow", - "grid-row", "grid-row-align", "grid-row-sizing", "grid-row-span", - "grid-rows", "grid-template", "hanging-punctuation", "height", "hyphens", - "icon", "image-orientation", "image-rendering", "image-resolution", - "inline-box-align", "justify-content", "left", "letter-spacing", - "line-break", "line-height", "line-stacking", "line-stacking-ruby", - "line-stacking-shift", "line-stacking-strategy", "list-style", - "list-style-image", "list-style-position", "list-style-type", "margin", - "margin-bottom", "margin-left", "margin-right", "margin-top", - "marker-offset", "marks", "marquee-direction", "marquee-loop", - "marquee-play-count", "marquee-speed", "marquee-style", "max-height", - "max-width", "min-height", "min-width", "move-to", "nav-down", "nav-index", - "nav-left", "nav-right", "nav-up", "opacity", "order", "orphans", "outline", - "outline-color", "outline-offset", "outline-style", "outline-width", - "overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y", - "padding", "padding-bottom", "padding-left", "padding-right", "padding-top", - "page", "page-break-after", "page-break-before", "page-break-inside", - "page-policy", "pause", "pause-after", "pause-before", "perspective", - "perspective-origin", "pitch", "pitch-range", "play-during", "position", - "presentation-level", "punctuation-trim", "quotes", "rendering-intent", - "resize", "rest", "rest-after", "rest-before", "richness", "right", - "rotation", "rotation-point", "ruby-align", "ruby-overhang", - "ruby-position", "ruby-span", "size", "speak", "speak-as", "speak-header", - "speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set", - "tab-size", "table-layout", "target", "target-name", "target-new", - "target-position", "text-align", "text-align-last", "text-decoration", - "text-decoration-color", "text-decoration-line", "text-decoration-skip", - "text-decoration-style", "text-emphasis", "text-emphasis-color", - "text-emphasis-position", "text-emphasis-style", "text-height", - "text-indent", "text-justify", "text-outline", "text-shadow", - "text-space-collapse", "text-transform", "text-underline-position", - "text-wrap", "top", "transform", "transform-origin", "transform-style", - "transition", "transition-delay", "transition-duration", - "transition-property", "transition-timing-function", "unicode-bidi", - "vertical-align", "visibility", "voice-balance", "voice-duration", - "voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress", - "voice-volume", "volume", "white-space", "widows", "width", "word-break", - "word-spacing", "word-wrap", "z-index" - ]); - - var colorKeywords = keySet([ - "black", "silver", "gray", "white", "maroon", "red", "purple", "fuchsia", - "green", "lime", "olive", "yellow", "navy", "blue", "teal", "aqua" - ]); - - var valueKeywords = keySet([ - "above", "absolute", "activeborder", "activecaption", "afar", - "after-white-space", "ahead", "alias", "all", "all-scroll", "alternate", - "always", "amharic", "amharic-abegede", "antialiased", "appworkspace", - "arabic-indic", "armenian", "asterisks", "auto", "avoid", "background", - "backwards", "baseline", "below", "bidi-override", "binary", "bengali", - "blink", "block", "block-axis", "bold", "bolder", "border", "border-box", - "both", "bottom", "break-all", "break-word", "button", "button-bevel", - "buttonface", "buttonhighlight", "buttonshadow", "buttontext", "cambodian", - "capitalize", "caps-lock-indicator", "caption", "captiontext", "caret", - "cell", "center", "checkbox", "circle", "cjk-earthly-branch", - "cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote", - "col-resize", "collapse", "compact", "condensed", "contain", "content", - "content-box", "context-menu", "continuous", "copy", "cover", "crop", - "cross", "crosshair", "currentcolor", "cursive", "dashed", "decimal", - "decimal-leading-zero", "default", "default-button", "destination-atop", - "destination-in", "destination-out", "destination-over", "devanagari", - "disc", "discard", "document", "dot-dash", "dot-dot-dash", "dotted", - "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out", - "element", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede", - "ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er", - "ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er", - "ethiopic-halehame-aa-et", "ethiopic-halehame-am-et", - "ethiopic-halehame-gez", "ethiopic-halehame-om-et", - "ethiopic-halehame-sid-et", "ethiopic-halehame-so-et", - "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", - "ethiopic-halehame-tig", "ew-resize", "expanded", "extra-condensed", - "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "footnotes", - "forwards", "from", "geometricPrecision", "georgian", "graytext", "groove", - "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew", - "help", "hidden", "hide", "higher", "highlight", "highlighttext", - "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore", - "inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite", - "infobackground", "infotext", "inherit", "initial", "inline", "inline-axis", - "inline-block", "inline-table", "inset", "inside", "intrinsic", "invert", - "italic", "justify", "kannada", "katakana", "katakana-iroha", "khmer", - "landscape", "lao", "large", "larger", "left", "level", "lighter", - "line-through", "linear", "lines", "list-item", "listbox", "listitem", - "local", "logical", "loud", "lower", "lower-alpha", "lower-armenian", - "lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian", - "lower-roman", "lowercase", "ltr", "malayalam", "match", - "media-controls-background", "media-current-time-display", - "media-fullscreen-button", "media-mute-button", "media-play-button", - "media-return-to-realtime-button", "media-rewind-button", - "media-seek-back-button", "media-seek-forward-button", "media-slider", - "media-sliderthumb", "media-time-remaining-display", "media-volume-slider", - "media-volume-slider-container", "media-volume-sliderthumb", "medium", - "menu", "menulist", "menulist-button", "menulist-text", - "menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic", - "mix", "mongolian", "monospace", "move", "multiple", "myanmar", "n-resize", - "narrower", "navy", "ne-resize", "nesw-resize", "no-close-quote", "no-drop", - "no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap", - "ns-resize", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote", - "optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset", - "outside", "overlay", "overline", "padding", "padding-box", "painted", - "paused", "persian", "plus-darker", "plus-lighter", "pointer", "portrait", - "pre", "pre-line", "pre-wrap", "preserve-3d", "progress", "push-button", - "radio", "read-only", "read-write", "read-write-plaintext-only", "relative", - "repeat", "repeat-x", "repeat-y", "reset", "reverse", "rgb", "rgba", - "ridge", "right", "round", "row-resize", "rtl", "run-in", "running", - "s-resize", "sans-serif", "scroll", "scrollbar", "se-resize", "searchfield", - "searchfield-cancel-button", "searchfield-decoration", - "searchfield-results-button", "searchfield-results-decoration", - "semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama", - "single", "skip-white-space", "slide", "slider-horizontal", - "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow", - "small", "small-caps", "small-caption", "smaller", "solid", "somali", - "source-atop", "source-in", "source-out", "source-over", "space", "square", - "square-button", "start", "static", "status-bar", "stretch", "stroke", - "sub", "subpixel-antialiased", "super", "sw-resize", "table", - "table-caption", "table-cell", "table-column", "table-column-group", - "table-footer-group", "table-header-group", "table-row", "table-row-group", - "telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai", - "thick", "thin", "threeddarkshadow", "threedface", "threedhighlight", - "threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er", - "tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top", - "transparent", "ultra-condensed", "ultra-expanded", "underline", "up", - "upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal", - "upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url", - "vertical", "vertical-text", "visible", "visibleFill", "visiblePainted", - "visibleStroke", "visual", "w-resize", "wait", "wave", "white", "wider", - "window", "windowframe", "windowtext", "x-large", "x-small", "xor", - "xx-large", "xx-small", "yellow" - ]); - - function keySet(array) { var keys = {}; for (var i = 0; i < array.length; ++i) keys[array[i]] = true; return keys; } - function ret(style, tp) {type = tp; return style;} - - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == "@") {stream.eatWhile(/[\w\\\-]/); return ret("def", stream.current());} - else if (ch == "/" && stream.eat("*")) { - state.tokenize = tokenCComment; - return tokenCComment(stream, state); - } - else if (ch == "<" && stream.eat("!")) { - state.tokenize = tokenSGMLComment; - return tokenSGMLComment(stream, state); - } - else if (ch == "=") ret(null, "compare"); - else if ((ch == "~" || ch == "|") && stream.eat("=")) return ret(null, "compare"); - else if (ch == "\"" || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - else if (ch == "#") { - stream.eatWhile(/[\w\\\-]/); - return ret("atom", "hash"); - } - else if (ch == "!") { - stream.match(/^\s*\w*/); - return ret("keyword", "important"); - } - else if (/\d/.test(ch)) { - stream.eatWhile(/[\w.%]/); - return ret("number", "unit"); - } - else if (ch === "-") { - if (/\d/.test(stream.peek())) { - stream.eatWhile(/[\w.%]/); - return ret("number", "unit"); - } else if (stream.match(/^[^-]+-/)) { - return ret("meta", type); - } - } - else if (/[,+>*\/]/.test(ch)) { - return ret(null, "select-op"); - } - else if (ch == "." && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) { - return ret("qualifier", type); - } - else if (ch == ":") { - return ret("operator", ch); - } - else if (/[;{}\[\]\(\)]/.test(ch)) { - return ret(null, ch); - } - else if (ch == "u" && stream.match("rl(")) { - stream.backUp(1); - state.tokenize = tokenParenthesized; - return ret("property", "variable"); - } - else { - stream.eatWhile(/[\w\\\-]/); - return ret("property", "variable"); - } - } - - function tokenCComment(stream, state) { - var maybeEnd = false, ch; - while ((ch = stream.next()) != null) { - if (maybeEnd && ch == "/") { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return ret("comment", "comment"); - } - - function tokenSGMLComment(stream, state) { - var dashes = 0, ch; - while ((ch = stream.next()) != null) { - if (dashes >= 2 && ch == ">") { - state.tokenize = tokenBase; - break; - } - dashes = (ch == "-") ? dashes + 1 : 0; - } - return ret("comment", "comment"); - } - - function tokenString(quote, nonInclusive) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) - break; - escaped = !escaped && ch == "\\"; - } - if (!escaped) { - if (nonInclusive) stream.backUp(1); - state.tokenize = tokenBase; - } - return ret("string", "string"); - }; - } - - function tokenParenthesized(stream, state) { - stream.next(); // Must be '(' - if (!stream.match(/\s*[\"\']/, false)) - state.tokenize = tokenString(")", true); - else - state.tokenize = tokenBase; - return ret(null, "("); - } - - return { - startState: function(base) { - return {tokenize: tokenBase, - baseIndent: base || 0, - stack: []}; - }, - - token: function(stream, state) { - - // Use these terms when applicable (see http://www.xanthir.com/blog/b4E50) - // - // rule** or **ruleset: - // A selector + braces combo, or an at-rule. - // - // declaration block: - // A sequence of declarations. - // - // declaration: - // A property + colon + value combo. - // - // property value: - // The entire value of a property. - // - // component value: - // A single piece of a property value. Like the 5px in - // text-shadow: 0 0 5px blue;. Can also refer to things that are - // multiple terms, like the 1-4 terms that make up the background-size - // portion of the background shorthand. - // - // term: - // The basic unit of author-facing CSS, like a single number (5), - // dimension (5px), string ("foo"), or function. Officially defined - // by the CSS 2.1 grammar (look for the 'term' production) - // - // - // simple selector: - // A single atomic selector, like a type selector, an attr selector, a - // class selector, etc. - // - // compound selector: - // One or more simple selectors without a combinator. div.example is - // compound, div > .example is not. - // - // complex selector: - // One or more compound selectors chained with combinators. - // - // combinator: - // The parts of selectors that express relationships. There are four - // currently - the space (descendant combinator), the greater-than - // bracket (child combinator), the plus sign (next sibling combinator), - // and the tilda (following sibling combinator). - // - // sequence of selectors: - // One or more of the named type of selector chained with commas. - - if (state.tokenize == tokenBase && stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - - // Changing style returned based on context - var context = state.stack[state.stack.length-1]; - if (style == "property") { - if (context == "propertyValue"){ - if (valueKeywords[stream.current()]) { - style = "string-2"; - } else if (colorKeywords[stream.current()]) { - style = "keyword"; - } else { - style = "variable-2"; - } - } else if (context == "rule") { - if (!propertyKeywords[stream.current()]) { - style += " error"; - } - } else if (!context || context == "@media{") { - style = "tag"; - } else if (context == "@media") { - if (atMediaTypes[stream.current()]) { - style = "attribute"; // Known attribute - } else if (/^(only|not)$/i.test(stream.current())) { - style = "keyword"; - } else if (stream.current().toLowerCase() == "and") { - style = "error"; // "and" is only allowed in @mediaType - } else if (atMediaFeatures[stream.current()]) { - style = "error"; // Known property, should be in @mediaType( - } else { - // Unknown, expecting keyword or attribute, assuming attribute - style = "attribute error"; - } - } else if (context == "@mediaType") { - if (atMediaTypes[stream.current()]) { - style = "attribute"; - } else if (stream.current().toLowerCase() == "and") { - style = "operator"; - } else if (/^(only|not)$/i.test(stream.current())) { - style = "error"; // Only allowed in @media - } else if (atMediaFeatures[stream.current()]) { - style = "error"; // Known property, should be in parentheses - } else { - // Unknown attribute or property, but expecting property (preceded - // by "and"). Should be in parentheses - style = "error"; - } - } else if (context == "@mediaType(") { - if (propertyKeywords[stream.current()]) { - // do nothing, remains "property" - } else if (atMediaTypes[stream.current()]) { - style = "error"; // Known property, should be in parentheses - } else if (stream.current().toLowerCase() == "and") { - style = "operator"; - } else if (/^(only|not)$/i.test(stream.current())) { - style = "error"; // Only allowed in @media - } else { - style += " error"; - } - } else { - style = "error"; - } - } else if (style == "atom") { - if(!context || context == "@media{") { - style = "builtin"; - } else if (context == "propertyValue") { - if (!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(stream.current())) { - style += " error"; - } - } else { - style = "error"; - } - } else if (context == "@media" && type == "{") { - style = "error"; - } - - // Push/pop context stack - if (type == "{") { - if (context == "@media" || context == "@mediaType") { - state.stack.pop(); - state.stack[state.stack.length-1] = "@media{"; - } - else state.stack.push("rule"); - } - else if (type == "}") { - state.stack.pop(); - if (context == "propertyValue") state.stack.pop(); - } - else if (type == "@media") state.stack.push("@media"); - else if (context == "@media" && /\b(keyword|attribute)\b/.test(style)) - state.stack.push("@mediaType"); - else if (context == "@mediaType" && stream.current() == ",") state.stack.pop(); - else if (context == "@mediaType" && type == "(") state.stack.push("@mediaType("); - else if (context == "@mediaType(" && type == ")") state.stack.pop(); - else if (context == "rule" && type == ":") state.stack.push("propertyValue"); - else if (context == "propertyValue" && type == ";") state.stack.pop(); - return style; - }, - - indent: function(state, textAfter) { - var n = state.stack.length; - if (/^\}/.test(textAfter)) - n -= state.stack[state.stack.length-1] == "propertyValue" ? 2 : 1; - return state.baseIndent + n * indentUnit; - }, - - electricChars: "}" - }; -}); - -CodeMirror.defineMIME("text/css", "css"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/css/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/css/index.html deleted file mode 100644 index ae2c3bfcee37e8021ea405c814cbea0a45495981..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/css/index.html +++ /dev/null @@ -1,58 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: CSS mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="css.js"></script> - <style>.CodeMirror {background: #f8f8f8;}</style> - <link rel="stylesheet" href="../../doc/docs.css"> - </head> - <body> - <h1>CodeMirror: CSS mode</h1> - <form><textarea id="code" name="code"> -/* Some example CSS */ - -@import url("something.css"); - -body { - margin: 0; - padding: 3em 6em; - font-family: tahoma, arial, sans-serif; - color: #000; -} - -#navigation a { - font-weight: bold; - text-decoration: none !important; -} - -h1 { - font-size: 2.5em; -} - -h2 { - font-size: 1.7em; -} - -h1:before, h2:before { - content: "::"; -} - -code { - font-family: courier, monospace; - font-size: 80%; - color: #418A8A; -} -</textarea></form> - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), {}); - </script> - - <p><strong>MIME types defined:</strong> <code>text/css</code>.</p> - - <p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#css_*">normal</a>, <a href="../../test/index.html#verbose,css_*">verbose</a>.</p> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/css/test.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/css/test.js deleted file mode 100644 index fd6a4b8aa8b6a32a86d8dd6955d5d8b6803fbe00..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/css/test.js +++ /dev/null @@ -1,501 +0,0 @@ -// Initiate ModeTest and set defaults -var MT = ModeTest; -MT.modeName = 'css'; -MT.modeOptions = {}; - -// Requires at least one media query -MT.testMode( - 'atMediaEmpty', - '@media { }', - [ - 'def', '@media', - null, ' ', - 'error', '{', - null, ' }' - ] -); - -MT.testMode( - 'atMediaMultiple', - '@media not screen and (color), not print and (color) { }', - [ - 'def', '@media', - null, ' ', - 'keyword', 'not', - null, ' ', - 'attribute', 'screen', - null, ' ', - 'operator', 'and', - null, ' (', - 'property', 'color', - null, '), ', - 'keyword', 'not', - null, ' ', - 'attribute', 'print', - null, ' ', - 'operator', 'and', - null, ' (', - 'property', 'color', - null, ') { }' - ] -); - -MT.testMode( - 'atMediaCheckStack', - '@media screen { } foo { }', - [ - 'def', '@media', - null, ' ', - 'attribute', 'screen', - null, ' { } ', - 'tag', 'foo', - null, ' { }' - ] -); - -MT.testMode( - 'atMediaCheckStack', - '@media screen (color) { } foo { }', - [ - 'def', '@media', - null, ' ', - 'attribute', 'screen', - null, ' (', - 'property', 'color', - null, ') { } ', - 'tag', 'foo', - null, ' { }' - ] -); - -MT.testMode( - 'atMediaCheckStackInvalidAttribute', - '@media foobarhello { } foo { }', - [ - 'def', '@media', - null, ' ', - 'attribute error', 'foobarhello', - null, ' { } ', - 'tag', 'foo', - null, ' { }' - ] -); - -// Error, because "and" is only allowed immediately preceding a media expression -MT.testMode( - 'atMediaInvalidAttribute', - '@media foobarhello { }', - [ - 'def', '@media', - null, ' ', - 'attribute error', 'foobarhello', - null, ' { }' - ] -); - -// Error, because "and" is only allowed immediately preceding a media expression -MT.testMode( - 'atMediaInvalidAnd', - '@media and screen { }', - [ - 'def', '@media', - null, ' ', - 'error', 'and', - null, ' ', - 'attribute', 'screen', - null, ' { }' - ] -); - -// Error, because "not" is only allowed as the first item in each media query -MT.testMode( - 'atMediaInvalidNot', - '@media screen not (not) { }', - [ - 'def', '@media', - null, ' ', - 'attribute', 'screen', - null, ' ', - 'error', 'not', - null, ' (', - 'error', 'not', - null, ') { }' - ] -); - -// Error, because "only" is only allowed as the first item in each media query -MT.testMode( - 'atMediaInvalidOnly', - '@media screen only (only) { }', - [ - 'def', '@media', - null, ' ', - 'attribute', 'screen', - null, ' ', - 'error', 'only', - null, ' (', - 'error', 'only', - null, ') { }' - ] -); - -// Error, because "foobarhello" is neither a known type or property, but -// property was expected (after "and"), and it should be in parenthese. -MT.testMode( - 'atMediaUnknownType', - '@media screen and foobarhello { }', - [ - 'def', '@media', - null, ' ', - 'attribute', 'screen', - null, ' ', - 'operator', 'and', - null, ' ', - 'error', 'foobarhello', - null, ' { }' - ] -); - -// Error, because "color" is not a known type, but is a known property, and -// should be in parentheses. -MT.testMode( - 'atMediaInvalidType', - '@media screen and color { }', - [ - 'def', '@media', - null, ' ', - 'attribute', 'screen', - null, ' ', - 'operator', 'and', - null, ' ', - 'error', 'color', - null, ' { }' - ] -); - -// Error, because "print" is not a known property, but is a known type, -// and should not be in parenthese. -MT.testMode( - 'atMediaInvalidProperty', - '@media screen and (print) { }', - [ - 'def', '@media', - null, ' ', - 'attribute', 'screen', - null, ' ', - 'operator', 'and', - null, ' (', - 'error', 'print', - null, ') { }' - ] -); - -// Soft error, because "foobarhello" is not a known property or type. -MT.testMode( - 'atMediaUnknownProperty', - '@media screen and (foobarhello) { }', - [ - 'def', '@media', - null, ' ', - 'attribute', 'screen', - null, ' ', - 'operator', 'and', - null, ' (', - 'property error', 'foobarhello', - null, ') { }' - ] -); - -MT.testMode( - 'tagSelector', - 'foo { }', - [ - 'tag', 'foo', - null, ' { }' - ] -); - -MT.testMode( - 'classSelector', - '.foo-bar_hello { }', - [ - 'qualifier', '.foo-bar_hello', - null, ' { }' - ] -); - -MT.testMode( - 'idSelector', - '#foo { #foo }', - [ - 'builtin', '#foo', - null, ' { ', - 'error', '#foo', - null, ' }' - ] -); - -MT.testMode( - 'tagSelectorUnclosed', - 'foo { margin: 0 } bar { }', - [ - 'tag', 'foo', - null, ' { ', - 'property', 'margin', - 'operator', ':', - null, ' ', - 'number', '0', - null, ' } ', - 'tag', 'bar', - null, ' { }' - ] -); - -MT.testMode( - 'tagStringNoQuotes', - 'foo { font-family: hello world; }', - [ - 'tag', 'foo', - null, ' { ', - 'property', 'font-family', - 'operator', ':', - null, ' ', - 'variable-2', 'hello', - null, ' ', - 'variable-2', 'world', - null, '; }' - ] -); - -MT.testMode( - 'tagStringDouble', - 'foo { font-family: "hello world"; }', - [ - 'tag', 'foo', - null, ' { ', - 'property', 'font-family', - 'operator', ':', - null, ' ', - 'string', '"hello world"', - null, '; }' - ] -); - -MT.testMode( - 'tagStringSingle', - 'foo { font-family: \'hello world\'; }', - [ - 'tag', 'foo', - null, ' { ', - 'property', 'font-family', - 'operator', ':', - null, ' ', - 'string', '\'hello world\'', - null, '; }' - ] -); - -MT.testMode( - 'tagColorKeyword', - 'foo { color: black; }', - [ - 'tag', 'foo', - null, ' { ', - 'property', 'color', - 'operator', ':', - null, ' ', - 'keyword', 'black', - null, '; }' - ] -); - -MT.testMode( - 'tagColorHex3', - 'foo { background: #fff; }', - [ - 'tag', 'foo', - null, ' { ', - 'property', 'background', - 'operator', ':', - null, ' ', - 'atom', '#fff', - null, '; }' - ] -); - -MT.testMode( - 'tagColorHex6', - 'foo { background: #ffffff; }', - [ - 'tag', 'foo', - null, ' { ', - 'property', 'background', - 'operator', ':', - null, ' ', - 'atom', '#ffffff', - null, '; }' - ] -); - -MT.testMode( - 'tagColorHex4', - 'foo { background: #ffff; }', - [ - 'tag', 'foo', - null, ' { ', - 'property', 'background', - 'operator', ':', - null, ' ', - 'atom error', '#ffff', - null, '; }' - ] -); - -MT.testMode( - 'tagColorHexInvalid', - 'foo { background: #ffg; }', - [ - 'tag', 'foo', - null, ' { ', - 'property', 'background', - 'operator', ':', - null, ' ', - 'atom error', '#ffg', - null, '; }' - ] -); - -MT.testMode( - 'tagNegativeNumber', - 'foo { margin: -5px; }', - [ - 'tag', 'foo', - null, ' { ', - 'property', 'margin', - 'operator', ':', - null, ' ', - 'number', '-5px', - null, '; }' - ] -); - -MT.testMode( - 'tagPositiveNumber', - 'foo { padding: 5px; }', - [ - 'tag', 'foo', - null, ' { ', - 'property', 'padding', - 'operator', ':', - null, ' ', - 'number', '5px', - null, '; }' - ] -); - -MT.testMode( - 'tagVendor', - 'foo { -foo-box-sizing: -foo-border-box; }', - [ - 'tag', 'foo', - null, ' { ', - 'meta', '-foo-', - 'property', 'box-sizing', - 'operator', ':', - null, ' ', - 'meta', '-foo-', - 'string-2', 'border-box', - null, '; }' - ] -); - -MT.testMode( - 'tagBogusProperty', - 'foo { barhelloworld: 0; }', - [ - 'tag', 'foo', - null, ' { ', - 'property error', 'barhelloworld', - 'operator', ':', - null, ' ', - 'number', '0', - null, '; }' - ] -); - -MT.testMode( - 'tagTwoProperties', - 'foo { margin: 0; padding: 0; }', - [ - 'tag', 'foo', - null, ' { ', - 'property', 'margin', - 'operator', ':', - null, ' ', - 'number', '0', - null, '; ', - 'property', 'padding', - 'operator', ':', - null, ' ', - 'number', '0', - null, '; }' - ] -); -// -//MT.testMode( -// 'tagClass', -// '@media only screen and (min-width: 500px), print {foo.bar#hello { color: black !important; background: #f00; margin: -5px; padding: 5px; -foo-box-sizing: border-box; } /* world */}', -// [ -// 'def', '@media', -// null, ' ', -// 'keyword', 'only', -// null, ' ', -// 'attribute', 'screen', -// null, ' ', -// 'operator', 'and', -// null, ' ', -// 'bracket', '(', -// 'property', 'min-width', -// 'operator', ':', -// null, ' ', -// 'number', '500px', -// 'bracket', ')', -// null, ', ', -// 'attribute', 'print', -// null, ' {', -// 'tag', 'foo', -// 'qualifier', '.bar', -// 'header', '#hello', -// null, ' { ', -// 'property', 'color', -// 'operator', ':', -// null, ' ', -// 'keyword', 'black', -// null, ' ', -// 'keyword', '!important', -// null, '; ', -// 'property', 'background', -// 'operator', ':', -// null, ' ', -// 'atom', '#f00', -// null, '; ', -// 'property', 'padding', -// 'operator', ':', -// null, ' ', -// 'number', '5px', -// null, '; ', -// 'property', 'margin', -// 'operator', ':', -// null, ' ', -// 'number', '-5px', -// null, '; ', -// 'meta', '-foo-', -// 'property', 'box-sizing', -// 'operator', ':', -// null, ' ', -// 'string-2', 'border-box', -// null, '; } ', -// 'comment', '/* world */', -// null, '}' -// ] -//); \ No newline at end of file diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/diff/diff.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/diff/diff.js deleted file mode 100644 index 9a0d90ea55da8c4edf4c364ced87a4d5cb4fcae9..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/diff/diff.js +++ /dev/null @@ -1,32 +0,0 @@ -CodeMirror.defineMode("diff", function() { - - var TOKEN_NAMES = { - '+': 'positive', - '-': 'negative', - '@': 'meta' - }; - - return { - token: function(stream) { - var tw_pos = stream.string.search(/[\t ]+?$/); - - if (!stream.sol() || tw_pos === 0) { - stream.skipToEnd(); - return ("error " + ( - TOKEN_NAMES[stream.string.charAt(0)] || '')).replace(/ $/, ''); - } - - var token_name = TOKEN_NAMES[stream.peek()] || stream.skipToEnd(); - - if (tw_pos === -1) { - stream.skipToEnd(); - } else { - stream.pos = tw_pos; - } - - return token_name; - } - }; -}); - -CodeMirror.defineMIME("text/x-diff", "diff"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/diff/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/diff/index.html deleted file mode 100644 index 556025204df0c99f5ca3ba54622d2cb9ea5c2fa0..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/diff/index.html +++ /dev/null @@ -1,105 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Diff mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="diff.js"></script> - <style> - .CodeMirror {border-top: 1px solid #ddd; border-bottom: 1px solid #ddd;} - span.cm-meta {color: #a0b !important;} - span.cm-error { background-color: black; opacity: 0.4;} - span.cm-error.cm-string { background-color: red; } - span.cm-error.cm-tag { background-color: #2b2; } - </style> - <link rel="stylesheet" href="../../doc/docs.css"> - </head> - <body> - <h1>CodeMirror: Diff mode</h1> - <form><textarea id="code" name="code"> -diff --git a/index.html b/index.html -index c1d9156..7764744 100644 ---- a/index.html -+++ b/index.html -@@ -95,7 +95,8 @@ StringStream.prototype = { - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, -- autoMatchBrackets: true -+ autoMatchBrackets: true, -+ onGutterClick: function(x){console.log(x);} - }); - </script> - </body> -diff --git a/lib/codemirror.js b/lib/codemirror.js -index 04646a9..9a39cc7 100644 ---- a/lib/codemirror.js -+++ b/lib/codemirror.js -@@ -399,10 +399,16 @@ var CodeMirror = (function() { - } - - function onMouseDown(e) { -- var start = posFromMouse(e), last = start; -+ var start = posFromMouse(e), last = start, target = e.target(); - if (!start) return; - setCursor(start.line, start.ch, false); - if (e.button() != 1) return; -+ if (target.parentNode == gutter) { -+ if (options.onGutterClick) -+ options.onGutterClick(indexOf(gutter.childNodes, target) + showingFrom); -+ return; -+ } -+ - if (!focused) onFocus(); - - e.stop(); -@@ -808,7 +814,7 @@ var CodeMirror = (function() { - for (var i = showingFrom; i < showingTo; ++i) { - var marker = lines[i].gutterMarker; - if (marker) html.push('<div class="' + marker.style + '">' + htmlEscape(marker.text) + '</div>'); -- else html.push("<div>" + (options.lineNumbers ? i + 1 : "\u00a0") + "</div>"); -+ else html.push("<div>" + (options.lineNumbers ? i + options.firstLineNumber : "\u00a0") + "</div>"); - } - gutter.style.display = "none"; // TODO test whether this actually helps - gutter.innerHTML = html.join(""); -@@ -1371,10 +1377,8 @@ var CodeMirror = (function() { - if (option == "parser") setParser(value); - else if (option === "lineNumbers") setLineNumbers(value); - else if (option === "gutter") setGutter(value); -- else if (option === "readOnly") options.readOnly = value; -- else if (option === "indentUnit") {options.indentUnit = indentUnit = value; setParser(options.parser);} -- else if (/^(?:enterMode|tabMode|indentWithTabs|readOnly|autoMatchBrackets|undoDepth)$/.test(option)) options[option] = value; -- else throw new Error("Can't set option " + option); -+ else if (option === "indentUnit") {options.indentUnit = value; setParser(options.parser);} -+ else options[option] = value; - }, - cursorCoords: cursorCoords, - undo: operation(undo), -@@ -1402,7 +1406,8 @@ var CodeMirror = (function() { - replaceRange: operation(replaceRange), - - operation: function(f){return operation(f)();}, -- refresh: function(){updateDisplay([{from: 0, to: lines.length}]);} -+ refresh: function(){updateDisplay([{from: 0, to: lines.length}]);}, -+ getInputField: function(){return input;} - }; - return instance; - } -@@ -1420,6 +1425,7 @@ var CodeMirror = (function() { - readOnly: false, - onChange: null, - onCursorActivity: null, -+ onGutterClick: null, - autoMatchBrackets: false, - workTime: 200, - workDelay: 300, -</textarea></form> - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), {}); - </script> - - <p><strong>MIME types defined:</strong> <code>text/x-diff</code>.</p> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/ecl/ecl.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/ecl/ecl.js deleted file mode 100644 index 3ee7a681de40a1cb685e43ce657e16a3328f7b3c..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/ecl/ecl.js +++ /dev/null @@ -1,192 +0,0 @@ -CodeMirror.defineMode("ecl", function(config) { - - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - function metaHook(stream, state) { - if (!state.startOfLine) return false; - stream.skipToEnd(); - return "meta"; - } - - var indentUnit = config.indentUnit; - var keyword = words("abs acos allnodes ascii asin asstring atan atan2 ave case choose choosen choosesets clustersize combine correlation cos cosh count covariance cron dataset dedup define denormalize distribute distributed distribution ebcdic enth error evaluate event eventextra eventname exists exp failcode failmessage fetch fromunicode getisvalid global graph group hash hash32 hash64 hashcrc hashmd5 having if index intformat isvalid iterate join keyunicode length library limit ln local log loop map matched matchlength matchposition matchtext matchunicode max merge mergejoin min nolocal nonempty normalize parse pipe power preload process project pull random range rank ranked realformat recordof regexfind regexreplace regroup rejected rollup round roundup row rowdiff sample set sin sinh sizeof soapcall sort sorted sqrt stepped stored sum table tan tanh thisnode topn tounicode transfer trim truncate typeof ungroup unicodeorder variance which workunit xmldecode xmlencode xmltext xmlunicode"); - var variable = words("apply assert build buildindex evaluate fail keydiff keypatch loadxml nothor notify output parallel sequential soapcall wait"); - var variable_2 = words("__compressed__ all and any as atmost before beginc++ best between case const counter csv descend encrypt end endc++ endmacro except exclusive expire export extend false few first flat from full function group header heading hole ifblock import in interface joined keep keyed last left limit load local locale lookup macro many maxcount maxlength min skew module named nocase noroot noscan nosort not of only opt or outer overwrite packed partition penalty physicallength pipe quote record relationship repeat return right scan self separator service shared skew skip sql store terminator thor threshold token transform trim true type unicodeorder unsorted validate virtual whole wild within xml xpath"); - var variable_3 = words("ascii big_endian boolean data decimal ebcdic integer pattern qstring real record rule set of string token udecimal unicode unsigned varstring varunicode"); - var builtin = words("checkpoint deprecated failcode failmessage failure global independent onwarning persist priority recovery stored success wait when"); - var blockKeywords = words("catch class do else finally for if switch try while"); - var atoms = words("true false null"); - var hooks = {"#": metaHook}; - var multiLineStrings; - var isOperatorChar = /[+\-*&%=<>!?|\/]/; - - var curPunc; - - function tokenBase(stream, state) { - var ch = stream.next(); - if (hooks[ch]) { - var result = hooks[ch](stream, state); - if (result !== false) return result; - } - if (ch == '"' || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - curPunc = ch; - return null; - } - if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return "number"; - } - if (ch == "/") { - if (stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - } - if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "operator"; - } - stream.eatWhile(/[\w\$_]/); - var cur = stream.current().toLowerCase(); - if (keyword.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "keyword"; - } else if (variable.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "variable"; - } else if (variable_2.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "variable-2"; - } else if (variable_3.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "variable-3"; - } else if (builtin.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "builtin"; - } else { //Data types are of from KEYWORD## - var i = cur.length - 1; - while(i >= 0 && (!isNaN(cur[i]) || cur[i] == '_')) - --i; - - if (i > 0) { - var cur2 = cur.substr(0, i + 1); - if (variable_3.propertyIsEnumerable(cur2)) { - if (blockKeywords.propertyIsEnumerable(cur2)) curPunc = "newstatement"; - return "variable-3"; - } - } - } - if (atoms.propertyIsEnumerable(cur)) return "atom"; - return null; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && next == "\\"; - } - if (end || !(escaped || multiLineStrings)) - state.tokenize = tokenBase; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - function pushContext(state, col, type) { - return state.context = new Context(state.indented, col, type, null, state.context); - } - function popContext(state) { - var t = state.context.type; - if (t == ")" || t == "]" || t == "}") - state.indented = state.context.indented; - return state.context = state.context.prev; - } - - // Interface - - return { - startState: function(basecolumn) { - return { - tokenize: null, - context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), - indented: 0, - startOfLine: true - }; - }, - - token: function(stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - } - if (stream.eatSpace()) return null; - curPunc = null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style == "comment" || style == "meta") return style; - if (ctx.align == null) ctx.align = true; - - if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state); - else if (curPunc == "{") pushContext(state, stream.column(), "}"); - else if (curPunc == "[") pushContext(state, stream.column(), "]"); - else if (curPunc == "(") pushContext(state, stream.column(), ")"); - else if (curPunc == "}") { - while (ctx.type == "statement") ctx = popContext(state); - if (ctx.type == "}") ctx = popContext(state); - while (ctx.type == "statement") ctx = popContext(state); - } - else if (curPunc == ctx.type) popContext(state); - else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement")) - pushContext(state, stream.column(), "statement"); - state.startOfLine = false; - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase && state.tokenize != null) return 0; - var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); - if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev; - var closing = firstChar == ctx.type; - if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : indentUnit); - else if (ctx.align) return ctx.column + (closing ? 0 : 1); - else return ctx.indented + (closing ? 0 : indentUnit); - }, - - electricChars: "{}" - }; -}); - -CodeMirror.defineMIME("text/x-ecl", "ecl"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/ecl/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/ecl/index.html deleted file mode 100644 index 0ba88c39956320ff384b6da6bb26b1181d0fe2e5..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/ecl/index.html +++ /dev/null @@ -1,39 +0,0 @@ -<!doctype html> -<html> - <head> - <title>CodeMirror: ECL mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="ecl.js"></script> - <link rel="stylesheet" href="../../doc/docs.css"> - <style>.CodeMirror {border: 1px solid black;}</style> - </head> - <body> - <h1>CodeMirror: ECL mode</h1> - <form><textarea id="code" name="code"> -/* -sample useless code to demonstrate ecl syntax highlighting -this is a multiline comment! -*/ - -// this is a singleline comment! - -import ut; -r := - record - string22 s1 := '123'; - integer4 i1 := 123; - end; -#option('tmp', true); -d := dataset('tmp::qb', r, thor); -output(d); -</textarea></form> - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), {}); - </script> - - <p>Based on CodeMirror's clike mode. For more information see <a href="http://hpccsystems.com">HPCC Systems</a> web site.</p> - <p><strong>MIME types defined:</strong> <code>text/x-ecl</code>.</p> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/erlang/erlang.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/erlang/erlang.js deleted file mode 100644 index accf24e6703443aeb345b758759374857030d7b6..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/erlang/erlang.js +++ /dev/null @@ -1,463 +0,0 @@ -// block; "begin", "case", "fun", "if", "receive", "try": closed by "end" -// block internal; "after", "catch", "of" -// guard; "when", closed by "->" -// "->" opens a clause, closed by ";" or "." -// "<<" opens a binary, closed by ">>" -// "," appears in arglists, lists, tuples and terminates lines of code -// "." resets indentation to 0 -// obsolete; "cond", "let", "query" - -CodeMirror.defineMIME("text/x-erlang", "erlang"); - -CodeMirror.defineMode("erlang", function(cmCfg) { - - function rval(state,stream,type) { - // distinguish between "." as terminator and record field operator - if (type == "record") { - state.context = "record"; - }else{ - state.context = false; - } - - // remember last significant bit on last line for indenting - if (type != "whitespace" && type != "comment") { - state.lastToken = stream.current(); - } - // erlang -> CodeMirror tag - switch (type) { - case "atom": return "atom"; - case "attribute": return "attribute"; - case "builtin": return "builtin"; - case "comment": return "comment"; - case "fun": return "meta"; - case "function": return "tag"; - case "guard": return "property"; - case "keyword": return "keyword"; - case "macro": return "variable-2"; - case "number": return "number"; - case "operator": return "operator"; - case "record": return "bracket"; - case "string": return "string"; - case "type": return "def"; - case "variable": return "variable"; - case "error": return "error"; - case "separator": return null; - case "open_paren": return null; - case "close_paren": return null; - default: return null; - } - } - - var typeWords = [ - "-type", "-spec", "-export_type", "-opaque"]; - - var keywordWords = [ - "after","begin","catch","case","cond","end","fun","if", - "let","of","query","receive","try","when"]; - - var separatorWords = [ - "->",";",":",".",","]; - - var operatorWords = [ - "and","andalso","band","bnot","bor","bsl","bsr","bxor", - "div","not","or","orelse","rem","xor"]; - - var symbolWords = [ - "+","-","*","/",">",">=","<","=<","=:=","==","=/=","/=","||","<-"]; - - var openParenWords = [ - "<<","(","[","{"]; - - var closeParenWords = [ - "}","]",")",">>"]; - - var guardWords = [ - "is_atom","is_binary","is_bitstring","is_boolean","is_float", - "is_function","is_integer","is_list","is_number","is_pid", - "is_port","is_record","is_reference","is_tuple", - "atom","binary","bitstring","boolean","function","integer","list", - "number","pid","port","record","reference","tuple"]; - - var bifWords = [ - "abs","adler32","adler32_combine","alive","apply","atom_to_binary", - "atom_to_list","binary_to_atom","binary_to_existing_atom", - "binary_to_list","binary_to_term","bit_size","bitstring_to_list", - "byte_size","check_process_code","contact_binary","crc32", - "crc32_combine","date","decode_packet","delete_module", - "disconnect_node","element","erase","exit","float","float_to_list", - "garbage_collect","get","get_keys","group_leader","halt","hd", - "integer_to_list","internal_bif","iolist_size","iolist_to_binary", - "is_alive","is_atom","is_binary","is_bitstring","is_boolean", - "is_float","is_function","is_integer","is_list","is_number","is_pid", - "is_port","is_process_alive","is_record","is_reference","is_tuple", - "length","link","list_to_atom","list_to_binary","list_to_bitstring", - "list_to_existing_atom","list_to_float","list_to_integer", - "list_to_pid","list_to_tuple","load_module","make_ref","module_loaded", - "monitor_node","node","node_link","node_unlink","nodes","notalive", - "now","open_port","pid_to_list","port_close","port_command", - "port_connect","port_control","pre_loaded","process_flag", - "process_info","processes","purge_module","put","register", - "registered","round","self","setelement","size","spawn","spawn_link", - "spawn_monitor","spawn_opt","split_binary","statistics", - "term_to_binary","time","throw","tl","trunc","tuple_size", - "tuple_to_list","unlink","unregister","whereis"]; - - // ignored for indenting purposes - var ignoreWords = [ - ",", ":", "catch", "after", "of", "cond", "let", "query"]; - - - var smallRE = /[a-z_]/; - var largeRE = /[A-Z_]/; - var digitRE = /[0-9]/; - var octitRE = /[0-7]/; - var anumRE = /[a-z_A-Z0-9]/; - var symbolRE = /[\+\-\*\/<>=\|:]/; - var openParenRE = /[<\(\[\{]/; - var closeParenRE = /[>\)\]\}]/; - var sepRE = /[\->\.,:;]/; - - function isMember(element,list) { - return (-1 < list.indexOf(element)); - } - - function isPrev(stream,string) { - var start = stream.start; - var len = string.length; - if (len <= start) { - var word = stream.string.slice(start-len,start); - return word == string; - }else{ - return false; - } - } - - function tokenize(stream, state) { - if (stream.eatSpace()) { - return rval(state,stream,"whitespace"); - } - - // attributes and type specs - if ((peekToken(state).token == "" || peekToken(state).token == ".") && - stream.peek() == '-') { - stream.next(); - if (stream.eat(smallRE) && stream.eatWhile(anumRE)) { - if (isMember(stream.current(),typeWords)) { - return rval(state,stream,"type"); - }else{ - return rval(state,stream,"attribute"); - } - } - stream.backUp(1); - } - - var ch = stream.next(); - - // comment - if (ch == '%') { - stream.skipToEnd(); - return rval(state,stream,"comment"); - } - - // macro - if (ch == '?') { - stream.eatWhile(anumRE); - return rval(state,stream,"macro"); - } - - // record - if ( ch == "#") { - stream.eatWhile(anumRE); - return rval(state,stream,"record"); - } - - // char - if ( ch == "$") { - if (stream.next() == "\\") { - if (!stream.eatWhile(octitRE)) { - stream.next(); - } - } - return rval(state,stream,"string"); - } - - // quoted atom - if (ch == '\'') { - if (singleQuote(stream)) { - return rval(state,stream,"atom"); - }else{ - return rval(state,stream,"error"); - } - } - - // string - if (ch == '"') { - if (doubleQuote(stream)) { - return rval(state,stream,"string"); - }else{ - return rval(state,stream,"error"); - } - } - - // variable - if (largeRE.test(ch)) { - stream.eatWhile(anumRE); - return rval(state,stream,"variable"); - } - - // atom/keyword/BIF/function - if (smallRE.test(ch)) { - stream.eatWhile(anumRE); - - if (stream.peek() == "/") { - stream.next(); - if (stream.eatWhile(digitRE)) { - return rval(state,stream,"fun"); // f/0 style fun - }else{ - stream.backUp(1); - return rval(state,stream,"atom"); - } - } - - var w = stream.current(); - - if (isMember(w,keywordWords)) { - pushToken(state,stream); - return rval(state,stream,"keyword"); - } - if (stream.peek() == "(") { - // 'put' and 'erlang:put' are bifs, 'foo:put' is not - if (isMember(w,bifWords) && - (!isPrev(stream,":") || isPrev(stream,"erlang:"))) { - return rval(state,stream,"builtin"); - }else{ - return rval(state,stream,"function"); - } - } - if (isMember(w,guardWords)) { - return rval(state,stream,"guard"); - } - if (isMember(w,operatorWords)) { - return rval(state,stream,"operator"); - } - if (stream.peek() == ":") { - if (w == "erlang") { - return rval(state,stream,"builtin"); - } else { - return rval(state,stream,"function"); - } - } - return rval(state,stream,"atom"); - } - - // number - if (digitRE.test(ch)) { - stream.eatWhile(digitRE); - if (stream.eat('#')) { - stream.eatWhile(digitRE); // 16#10 style integer - } else { - if (stream.eat('.')) { // float - stream.eatWhile(digitRE); - } - if (stream.eat(/[eE]/)) { - stream.eat(/[-+]/); // float with exponent - stream.eatWhile(digitRE); - } - } - return rval(state,stream,"number"); // normal integer - } - - // open parens - if (nongreedy(stream,openParenRE,openParenWords)) { - pushToken(state,stream); - return rval(state,stream,"open_paren"); - } - - // close parens - if (nongreedy(stream,closeParenRE,closeParenWords)) { - pushToken(state,stream); - return rval(state,stream,"close_paren"); - } - - // separators - if (greedy(stream,sepRE,separatorWords)) { - // distinguish between "." as terminator and record field operator - if (state.context == false) { - pushToken(state,stream); - } - return rval(state,stream,"separator"); - } - - // operators - if (greedy(stream,symbolRE,symbolWords)) { - return rval(state,stream,"operator"); - } - - return rval(state,stream,null); - } - - function nongreedy(stream,re,words) { - if (stream.current().length == 1 && re.test(stream.current())) { - stream.backUp(1); - while (re.test(stream.peek())) { - stream.next(); - if (isMember(stream.current(),words)) { - return true; - } - } - stream.backUp(stream.current().length-1); - } - return false; - } - - function greedy(stream,re,words) { - if (stream.current().length == 1 && re.test(stream.current())) { - while (re.test(stream.peek())) { - stream.next(); - } - while (0 < stream.current().length) { - if (isMember(stream.current(),words)) { - return true; - }else{ - stream.backUp(1); - } - } - stream.next(); - } - return false; - } - - function doubleQuote(stream) { - return quote(stream, '"', '\\'); - } - - function singleQuote(stream) { - return quote(stream,'\'','\\'); - } - - function quote(stream,quoteChar,escapeChar) { - while (!stream.eol()) { - var ch = stream.next(); - if (ch == quoteChar) { - return true; - }else if (ch == escapeChar) { - stream.next(); - } - } - return false; - } - - function Token(stream) { - this.token = stream ? stream.current() : ""; - this.column = stream ? stream.column() : 0; - this.indent = stream ? stream.indentation() : 0; - } - - function myIndent(state,textAfter) { - var indent = cmCfg.indentUnit; - var outdentWords = ["after","catch"]; - var token = (peekToken(state)).token; - var wordAfter = takewhile(textAfter,/[^a-z]/); - - if (isMember(token,openParenWords)) { - return (peekToken(state)).column+token.length; - }else if (token == "." || token == ""){ - return 0; - }else if (token == "->") { - if (wordAfter == "end") { - return peekToken(state,2).column; - }else if (peekToken(state,2).token == "fun") { - return peekToken(state,2).column+indent; - }else{ - return (peekToken(state)).indent+indent; - } - }else if (isMember(wordAfter,outdentWords)) { - return (peekToken(state)).indent; - }else{ - return (peekToken(state)).column+indent; - } - } - - function takewhile(str,re) { - var m = str.match(re); - return m ? str.slice(0,m.index) : str; - } - - function popToken(state) { - return state.tokenStack.pop(); - } - - function peekToken(state,depth) { - var len = state.tokenStack.length; - var dep = (depth ? depth : 1); - if (len < dep) { - return new Token; - }else{ - return state.tokenStack[len-dep]; - } - } - - function pushToken(state,stream) { - var token = stream.current(); - var prev_token = peekToken(state).token; - if (isMember(token,ignoreWords)) { - return false; - }else if (drop_both(prev_token,token)) { - popToken(state); - return false; - }else if (drop_first(prev_token,token)) { - popToken(state); - return pushToken(state,stream); - }else{ - state.tokenStack.push(new Token(stream)); - return true; - } - } - - function drop_first(open, close) { - switch (open+" "+close) { - case "when ->": return true; - case "-> end": return true; - case "-> .": return true; - case ". .": return true; - default: return false; - } - } - - function drop_both(open, close) { - switch (open+" "+close) { - case "( )": return true; - case "[ ]": return true; - case "{ }": return true; - case "<< >>": return true; - case "begin end": return true; - case "case end": return true; - case "fun end": return true; - case "if end": return true; - case "receive end": return true; - case "try end": return true; - case "-> ;": return true; - default: return false; - } - } - - return { - startState: - function() { - return {tokenStack: [], - context: false, - lastToken: null}; - }, - - token: - function(stream, state) { - return tokenize(stream, state); - }, - - indent: - function(state, textAfter) { -// console.log(state.tokenStack); - return myIndent(state,textAfter); - } - }; -}); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/erlang/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/erlang/index.html deleted file mode 100644 index f6bee8f7233615e06bc23760856a88ea91fe1803..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/erlang/index.html +++ /dev/null @@ -1,64 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Erlang mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="../../lib/util/matchbrackets.js"></script> - <script src="erlang.js"></script> - <link rel="stylesheet" href="../../theme/erlang-dark.css"> - <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> - <link rel="stylesheet" href="../../doc/docs.css"> - </head> - <body> - <h1>CodeMirror: Erlang mode</h1> - -<form><textarea id="code" name="code"> -%% -*- mode: erlang; erlang-indent-level: 2 -*- -%%% Created : 7 May 2012 by mats cronqvist <masse@klarna.com> - -%% @doc -%% Demonstrates how to print a record. -%% @end - --module('ex'). --author('mats cronqvist'). --export([demo/0, - rec_info/1]). - --record(demo,{a="One",b="Two",c="Three",d="Four"}). - -rec_info(demo) -> record_info(fields,demo). - -demo() -> expand_recs(?MODULE,#demo{a="A",b="BB"}). - -expand_recs(M,List) when is_list(List) -> - [expand_recs(M,L)||L<-List]; -expand_recs(M,Tup) when is_tuple(Tup) -> - case tuple_size(Tup) of - L when L < 1 -> Tup; - L -> - try Fields = M:rec_info(element(1,Tup)), - L = length(Fields)+1, - lists:zip(Fields,expand_recs(M,tl(tuple_to_list(Tup)))) - catch _:_ -> - list_to_tuple(expand_recs(M,tuple_to_list(Tup))) - end - end; -expand_recs(_,Term) -> - Term. -</textarea></form> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - matchBrackets: true, - extraKeys: {"Tab": "indentAuto"}, - theme: "erlang-dark" - }); - </script> - - <p><strong>MIME types defined:</strong> <code>text/x-erlang</code>.</p> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/gfm/gfm.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/gfm/gfm.js deleted file mode 100644 index 6ff557f26699d4d1296f71daef3a263d22a7d2af..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/gfm/gfm.js +++ /dev/null @@ -1,94 +0,0 @@ -CodeMirror.defineMode("gfm", function(config) { - var codeDepth = 0; - function blankLine(state) { - state.code = false; - return null; - } - var gfmOverlay = { - startState: function() { - return { - code: false, - codeBlock: false, - ateSpace: false - }; - }, - copyState: function(s) { - return { - code: s.code, - codeBlock: s.codeBlock, - ateSpace: s.ateSpace - }; - }, - token: function(stream, state) { - // Hack to prevent formatting override inside code blocks (block and inline) - if (state.codeBlock) { - if (stream.match(/^```/)) { - state.codeBlock = false; - return null; - } - stream.skipToEnd(); - return null; - } - if (stream.sol()) { - state.code = false; - } - if (stream.sol() && stream.match(/^```/)) { - stream.skipToEnd(); - state.codeBlock = true; - return null; - } - // If this block is changed, it may need to be updated in Markdown mode - if (stream.peek() === '`') { - stream.next(); - var before = stream.pos; - stream.eatWhile('`'); - var difference = 1 + stream.pos - before; - if (!state.code) { - codeDepth = difference; - state.code = true; - } else { - if (difference === codeDepth) { // Must be exact - state.code = false; - } - } - return null; - } else if (state.code) { - stream.next(); - return null; - } - // Check if space. If so, links can be formatted later on - if (stream.eatSpace()) { - state.ateSpace = true; - return null; - } - if (stream.sol() || state.ateSpace) { - state.ateSpace = false; - if(stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/)) { - // User/Project@SHA - // User@SHA - // SHA - return "link"; - } else if (stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/)) { - // User/Project#Num - // User#Num - // #Num - return "link"; - } - } - if (stream.match(/^((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i)) { - // URLs - // Taken from http://daringfireball.net/2010/07/improved_regex_for_matching_urls - return "link"; - } - stream.next(); - return null; - }, - blankLine: blankLine - }; - CodeMirror.defineMIME("gfmBase", { - name: "markdown", - underscoresBreakWords: false, - fencedCodeBlocks: true - }); - return CodeMirror.overlayMode(CodeMirror.getMode(config, "gfmBase"), gfmOverlay); -}, "markdown"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/gfm/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/gfm/index.html deleted file mode 100644 index e4ea473571d1e6fb41ea959560101fa596a67b0c..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/gfm/index.html +++ /dev/null @@ -1,70 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: GFM mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="../../lib/util/overlay.js"></script> - <script src="../xml/xml.js"></script> - <script src="../markdown/markdown.js"></script> - <script src="gfm.js"></script> - - <!-- Code block highlighting modes --> - <script src="../javascript/javascript.js"></script> - <script src="../css/css.js"></script> - <script src="../htmlmixed/htmlmixed.js"></script> - <script src="../clike/clike.js"></script> - - <link rel="stylesheet" href="../markdown/markdown.css"> - <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> - <link rel="stylesheet" href="../../doc/docs.css"> - </head> - <body> - <h1>CodeMirror: GFM mode</h1> - -<form><textarea id="code" name="code"> -GitHub Flavored Markdown -======================== - -Everything from markdown plus GFM features: - -## URL autolinking - -Underscores_are_allowed_between_words. - -## Fenced code blocks (and syntax highlighting) - -```javascript -for (var i = 0; i < items.length; i++) { - console.log(items[i], i); // log them -} -``` - -## A bit of GitHub spice - -* SHA: be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2 -* User@SHA ref: mojombo@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2 -* User/Project@SHA: mojombo/god@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2 -* \#Num: #1 -* User/#Num: mojombo#1 -* User/Project#Num: mojombo/god#1 - -See http://github.github.com/github-flavored-markdown/. - -</textarea></form> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - mode: 'gfm', - lineNumbers: true, - theme: "default" - }); - </script> - - <p>Optionally depends on other modes for properly highlighted code blocks.</p> - - <p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#gfm_*">normal</a>, <a href="../../test/index.html#verbose,gfm_*">verbose</a>.</p> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/gfm/test.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/gfm/test.js deleted file mode 100644 index 3a261f8f77f2f103ec25ecb6ffca750750877831..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/gfm/test.js +++ /dev/null @@ -1,225 +0,0 @@ -// Initiate ModeTest and set defaults -var MT = ModeTest; -MT.modeName = 'gfm'; -MT.modeOptions = {}; - -// Emphasis characters within a word -MT.testMode( - 'emInWordAsterisk', - 'foo*bar*hello', - [ - null, 'foo', - 'em', '*bar*', - null, 'hello' - ] -); -MT.testMode( - 'emInWordUnderscore', - 'foo_bar_hello', - [ - null, 'foo_bar_hello' - ] -); -MT.testMode( - 'emStrongUnderscore', - '___foo___ bar', - [ - 'strong', '__', - 'emstrong', '_foo__', - 'em', '_', - null, ' bar' - ] -); - -// Fenced code blocks -MT.testMode( - 'fencedCodeBlocks', - '```\nfoo\n\n```\nbar', - [ - 'comment', '```', - 'comment', 'foo', - 'comment', '```', - null, 'bar' - ] -); -// Fenced code block mode switching -MT.testMode( - 'fencedCodeBlockModeSwitching', - '```javascript\nfoo\n\n```\nbar', - [ - 'comment', '```javascript', - 'variable', 'foo', - 'comment', '```', - null, 'bar' - ] -); - -// SHA -MT.testMode( - 'SHA', - 'foo be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2 bar', - [ - null, 'foo ', - 'link', 'be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2', - null, ' bar' - ] -); -// GitHub highlights hashes 7-40 chars in length -MT.testMode( - 'shortSHA', - 'foo be6a8cc bar', - [ - null, 'foo ', - 'link', 'be6a8cc', - null, ' bar' - ] -); -// Invalid SHAs -// -// GitHub does not highlight hashes shorter than 7 chars -MT.testMode( - 'tooShortSHA', - 'foo be6a8c bar', - [ - null, 'foo be6a8c bar' - ] -); -// GitHub does not highlight hashes longer than 40 chars -MT.testMode( - 'longSHA', - 'foo be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd22 bar', - [ - null, 'foo be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd22 bar' - ] -); -MT.testMode( - 'badSHA', - 'foo be6a8cc1c1ecfe9489fb51e4869af15a13fc2cg2 bar', - [ - null, 'foo be6a8cc1c1ecfe9489fb51e4869af15a13fc2cg2 bar' - ] -); -// User@SHA -MT.testMode( - 'userSHA', - 'foo bar@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2 hello', - [ - null, 'foo ', - 'link', 'bar@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2', - null, ' hello' - ] -); -// User/Project@SHA -MT.testMode( - 'userProjectSHA', - 'foo bar/hello@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2 world', - [ - null, 'foo ', - 'link', 'bar/hello@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2', - null, ' world' - ] -); - -// #Num -MT.testMode( - 'num', - 'foo #1 bar', - [ - null, 'foo ', - 'link', '#1', - null, ' bar' - ] -); -// bad #Num -MT.testMode( - 'badNum', - 'foo #1bar hello', - [ - null, 'foo #1bar hello' - ] -); -// User#Num -MT.testMode( - 'userNum', - 'foo bar#1 hello', - [ - null, 'foo ', - 'link', 'bar#1', - null, ' hello' - ] -); -// User/Project#Num -MT.testMode( - 'userProjectNum', - 'foo bar/hello#1 world', - [ - null, 'foo ', - 'link', 'bar/hello#1', - null, ' world' - ] -); - -// Vanilla links -MT.testMode( - 'vanillaLink', - 'foo http://www.example.com/ bar', - [ - null, 'foo ', - 'link', 'http://www.example.com/', - null, ' bar' - ] -); -MT.testMode( - 'vanillaLinkPunctuation', - 'foo http://www.example.com/. bar', - [ - null, 'foo ', - 'link', 'http://www.example.com/', - null, '. bar' - ] -); -MT.testMode( - 'vanillaLinkExtension', - 'foo http://www.example.com/index.html bar', - [ - null, 'foo ', - 'link', 'http://www.example.com/index.html', - null, ' bar' - ] -); -// Not a link -MT.testMode( - 'notALink', - '```css\nfoo {color:black;}\n```http://www.example.com/', - [ - 'comment', '```css', - 'tag', 'foo', - null, ' {', - 'property', 'color', - 'operator', ':', - 'keyword', 'black', - null, ';}', - 'comment', '```', - 'link', 'http://www.example.com/' - ] -); -// Not a link -MT.testMode( - 'notALink', - '``foo `bar` http://www.example.com/`` hello', - [ - 'comment', '``foo `bar` http://www.example.com/``', - null, ' hello' - ] -); -// Not a link -MT.testMode( - 'notALink', - '`foo\nhttp://www.example.com/\n`foo\n\nhttp://www.example.com/', - [ - 'comment', '`foo', - 'link', 'http://www.example.com/', - 'comment', '`foo', - 'link', 'http://www.example.com/' - ] -); \ No newline at end of file diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/go/go.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/go/go.js deleted file mode 100644 index 8b84a5ca42def13bf909dca6bb5553c7539b987e..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/go/go.js +++ /dev/null @@ -1,165 +0,0 @@ -CodeMirror.defineMode("go", function(config) { - var indentUnit = config.indentUnit; - - var keywords = { - "break":true, "case":true, "chan":true, "const":true, "continue":true, - "default":true, "defer":true, "else":true, "fallthrough":true, "for":true, - "func":true, "go":true, "goto":true, "if":true, "import":true, - "interface":true, "map":true, "package":true, "range":true, "return":true, - "select":true, "struct":true, "switch":true, "type":true, "var":true, - "bool":true, "byte":true, "complex64":true, "complex128":true, - "float32":true, "float64":true, "int8":true, "int16":true, "int32":true, - "int64":true, "string":true, "uint8":true, "uint16":true, "uint32":true, - "uint64":true, "int":true, "uint":true, "uintptr":true - }; - - var atoms = { - "true":true, "false":true, "iota":true, "nil":true, "append":true, - "cap":true, "close":true, "complex":true, "copy":true, "imag":true, - "len":true, "make":true, "new":true, "panic":true, "print":true, - "println":true, "real":true, "recover":true - }; - - var isOperatorChar = /[+\-*&^%:=<>!|\/]/; - - var curPunc; - - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"' || ch == "'" || ch == "`") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - if (/[\d\.]/.test(ch)) { - if (ch == ".") { - stream.match(/^[0-9]+([eE][\-+]?[0-9]+)?/); - } else if (ch == "0") { - stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/); - } else { - stream.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/); - } - return "number"; - } - if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - curPunc = ch; - return null; - } - if (ch == "/") { - if (stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - } - if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "operator"; - } - stream.eatWhile(/[\w\$_]/); - var cur = stream.current(); - if (keywords.propertyIsEnumerable(cur)) { - if (cur == "case" || cur == "default") curPunc = "case"; - return "keyword"; - } - if (atoms.propertyIsEnumerable(cur)) return "atom"; - return "variable"; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && next == "\\"; - } - if (end || !(escaped || quote == "`")) - state.tokenize = tokenBase; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - function pushContext(state, col, type) { - return state.context = new Context(state.indented, col, type, null, state.context); - } - function popContext(state) { - var t = state.context.type; - if (t == ")" || t == "]" || t == "}") - state.indented = state.context.indented; - return state.context = state.context.prev; - } - - // Interface - - return { - startState: function(basecolumn) { - return { - tokenize: null, - context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), - indented: 0, - startOfLine: true - }; - }, - - token: function(stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - if (ctx.type == "case") ctx.type = "}"; - } - if (stream.eatSpace()) return null; - curPunc = null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style == "comment") return style; - if (ctx.align == null) ctx.align = true; - - if (curPunc == "{") pushContext(state, stream.column(), "}"); - else if (curPunc == "[") pushContext(state, stream.column(), "]"); - else if (curPunc == "(") pushContext(state, stream.column(), ")"); - else if (curPunc == "case") ctx.type = "case"; - else if (curPunc == "}" && ctx.type == "}") ctx = popContext(state); - else if (curPunc == ctx.type) popContext(state); - state.startOfLine = false; - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase && state.tokenize != null) return 0; - var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); - if (ctx.type == "case" && /^(?:case|default)\b/.test(textAfter)) { - state.context.type = "}"; - return ctx.indented; - } - var closing = firstChar == ctx.type; - if (ctx.align) return ctx.column + (closing ? 0 : 1); - else return ctx.indented + (closing ? 0 : indentUnit); - }, - - electricChars: "{}:" - }; -}); - -CodeMirror.defineMIME("text/x-go", "go"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/go/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/go/index.html deleted file mode 100644 index 1a9ef53852f40a7de0ea50be12e60a53f78b7da0..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/go/index.html +++ /dev/null @@ -1,74 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Go mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <link rel="stylesheet" href="../../theme/elegant.css"> - <script src="../../lib/codemirror.js"></script> - <script src="../../lib/util/matchbrackets.js"></script> - <script src="go.js"></script> - <link rel="stylesheet" href="../../doc/docs.css"> - <style>.CodeMirror {border:1px solid #999; background:#ffc}</style> - </head> - <body> - <h1>CodeMirror: Go mode</h1> - -<form><textarea id="code" name="code"> -// Prime Sieve in Go. -// Taken from the Go specification. -// Copyright © The Go Authors. - -package main - -import "fmt" - -// Send the sequence 2, 3, 4, ... to channel 'ch'. -func generate(ch chan<- int) { - for i := 2; ; i++ { - ch <- i // Send 'i' to channel 'ch' - } -} - -// Copy the values from channel 'src' to channel 'dst', -// removing those divisible by 'prime'. -func filter(src <-chan int, dst chan<- int, prime int) { - for i := range src { // Loop over values received from 'src'. - if i%prime != 0 { - dst <- i // Send 'i' to channel 'dst'. - } - } -} - -// The prime sieve: Daisy-chain filter processes together. -func sieve() { - ch := make(chan int) // Create a new channel. - go generate(ch) // Start generate() as a subprocess. - for { - prime := <-ch - fmt.Print(prime, "\n") - ch1 := make(chan int) - go filter(ch, ch1, prime) - ch = ch1 - } -} - -func main() { - sieve() -} -</textarea></form> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - theme: "elegant", - matchBrackets: true, - indentUnit: 8, - tabSize: 8, - indentWithTabs: true, - mode: "text/x-go" - }); - </script> - - <p><strong>MIME type:</strong> <code>text/x-go</code></p> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/groovy/groovy.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/groovy/groovy.js deleted file mode 100644 index 92b948192efff6629365078b33eafa67ea4ae491..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/groovy/groovy.js +++ /dev/null @@ -1,210 +0,0 @@ -CodeMirror.defineMode("groovy", function(config) { - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - var keywords = words( - "abstract as assert boolean break byte case catch char class const continue def default " + - "do double else enum extends final finally float for goto if implements import in " + - "instanceof int interface long native new package private protected public return " + - "short static strictfp super switch synchronized threadsafe throw throws transient " + - "try void volatile while"); - var blockKeywords = words("catch class do else finally for if switch try while enum interface def"); - var atoms = words("null true false this"); - - var curPunc; - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"' || ch == "'") { - return startString(ch, stream, state); - } - if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - curPunc = ch; - return null; - } - if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - if (stream.eat(/eE/)) { stream.eat(/\+\-/); stream.eatWhile(/\d/); } - return "number"; - } - if (ch == "/") { - if (stream.eat("*")) { - state.tokenize.push(tokenComment); - return tokenComment(stream, state); - } - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - if (expectExpression(state.lastToken)) { - return startString(ch, stream, state); - } - } - if (ch == "-" && stream.eat(">")) { - curPunc = "->"; - return null; - } - if (/[+\-*&%=<>!?|\/~]/.test(ch)) { - stream.eatWhile(/[+\-*&%=<>|~]/); - return "operator"; - } - stream.eatWhile(/[\w\$_]/); - if (ch == "@") { stream.eatWhile(/[\w\$_\.]/); return "meta"; } - if (state.lastToken == ".") return "property"; - if (stream.eat(":")) { curPunc = "proplabel"; return "property"; } - var cur = stream.current(); - if (atoms.propertyIsEnumerable(cur)) { return "atom"; } - if (keywords.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "keyword"; - } - return "variable"; - } - tokenBase.isBase = true; - - function startString(quote, stream, state) { - var tripleQuoted = false; - if (quote != "/" && stream.eat(quote)) { - if (stream.eat(quote)) tripleQuoted = true; - else return "string"; - } - function t(stream, state) { - var escaped = false, next, end = !tripleQuoted; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) { - if (!tripleQuoted) { break; } - if (stream.match(quote + quote)) { end = true; break; } - } - if (quote == '"' && next == "$" && !escaped && stream.eat("{")) { - state.tokenize.push(tokenBaseUntilBrace()); - return "string"; - } - escaped = !escaped && next == "\\"; - } - if (end) state.tokenize.pop(); - return "string"; - } - state.tokenize.push(t); - return t(stream, state); - } - - function tokenBaseUntilBrace() { - var depth = 1; - function t(stream, state) { - if (stream.peek() == "}") { - depth--; - if (depth == 0) { - state.tokenize.pop(); - return state.tokenize[state.tokenize.length-1](stream, state); - } - } else if (stream.peek() == "{") { - depth++; - } - return tokenBase(stream, state); - } - t.isBase = true; - return t; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize.pop(); - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function expectExpression(last) { - return !last || last == "operator" || last == "->" || /[\.\[\{\(,;:]/.test(last) || - last == "newstatement" || last == "keyword" || last == "proplabel"; - } - - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - function pushContext(state, col, type) { - return state.context = new Context(state.indented, col, type, null, state.context); - } - function popContext(state) { - var t = state.context.type; - if (t == ")" || t == "]" || t == "}") - state.indented = state.context.indented; - return state.context = state.context.prev; - } - - // Interface - - return { - startState: function(basecolumn) { - return { - tokenize: [tokenBase], - context: new Context((basecolumn || 0) - config.indentUnit, 0, "top", false), - indented: 0, - startOfLine: true, - lastToken: null - }; - }, - - token: function(stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - // Automatic semicolon insertion - if (ctx.type == "statement" && !expectExpression(state.lastToken)) { - popContext(state); ctx = state.context; - } - } - if (stream.eatSpace()) return null; - curPunc = null; - var style = state.tokenize[state.tokenize.length-1](stream, state); - if (style == "comment") return style; - if (ctx.align == null) ctx.align = true; - - if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state); - // Handle indentation for {x -> \n ... } - else if (curPunc == "->" && ctx.type == "statement" && ctx.prev.type == "}") { - popContext(state); - state.context.align = false; - } - else if (curPunc == "{") pushContext(state, stream.column(), "}"); - else if (curPunc == "[") pushContext(state, stream.column(), "]"); - else if (curPunc == "(") pushContext(state, stream.column(), ")"); - else if (curPunc == "}") { - while (ctx.type == "statement") ctx = popContext(state); - if (ctx.type == "}") ctx = popContext(state); - while (ctx.type == "statement") ctx = popContext(state); - } - else if (curPunc == ctx.type) popContext(state); - else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement")) - pushContext(state, stream.column(), "statement"); - state.startOfLine = false; - state.lastToken = curPunc || style; - return style; - }, - - indent: function(state, textAfter) { - if (!state.tokenize[state.tokenize.length-1].isBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), ctx = state.context; - if (ctx.type == "statement" && !expectExpression(state.lastToken)) ctx = ctx.prev; - var closing = firstChar == ctx.type; - if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : config.indentUnit); - else if (ctx.align) return ctx.column + (closing ? 0 : 1); - else return ctx.indented + (closing ? 0 : config.indentUnit); - }, - - electricChars: "{}" - }; -}); - -CodeMirror.defineMIME("text/x-groovy", "groovy"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/groovy/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/groovy/index.html deleted file mode 100644 index d0d76bfa90f8c0f44defdd1fcd8fefce9ec258f3..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/groovy/index.html +++ /dev/null @@ -1,73 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Groovy mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="../../lib/util/matchbrackets.js"></script> - <script src="groovy.js"></script> - <link rel="stylesheet" href="../../doc/docs.css"> - <style>.CodeMirror {border-top: 1px solid #500; border-bottom: 1px solid #500;}</style> - </head> - <body> - <h1>CodeMirror: Groovy mode</h1> - -<form><textarea id="code" name="code"> -//Pattern for groovy script -def p = ~/.*\.groovy/ -new File( 'd:\\scripts' ).eachFileMatch(p) {f -> - // imports list - def imports = [] - f.eachLine { - // condition to detect an import instruction - ln -> if ( ln =~ '^import .*' ) { - imports << "${ln - 'import '}" - } - } - // print thmen - if ( ! imports.empty ) { - println f - imports.each{ println " $it" } - } -} - -/* Coin changer demo code from http://groovy.codehaus.org */ - -enum UsCoin { - quarter(25), dime(10), nickel(5), penny(1) - UsCoin(v) { value = v } - final value -} - -enum OzzieCoin { - fifty(50), twenty(20), ten(10), five(5) - OzzieCoin(v) { value = v } - final value -} - -def plural(word, count) { - if (count == 1) return word - word[-1] == 'y' ? word[0..-2] + "ies" : word + "s" -} - -def change(currency, amount) { - currency.values().inject([]){ list, coin -> - int count = amount / coin.value - amount = amount % coin.value - list += "$count ${plural(coin.toString(), count)}" - } -} -</textarea></form> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - matchBrackets: true, - mode: "text/x-groovy" - }); - </script> - - <p><strong>MIME types defined:</strong> <code>text/x-groovy</code></p> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/haskell/haskell.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/haskell/haskell.js deleted file mode 100644 index 71235f4ee934358d87be73ad6125ce72e877fbcd..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/haskell/haskell.js +++ /dev/null @@ -1,242 +0,0 @@ -CodeMirror.defineMode("haskell", function() { - - function switchState(source, setState, f) { - setState(f); - return f(source, setState); - } - - // These should all be Unicode extended, as per the Haskell 2010 report - var smallRE = /[a-z_]/; - var largeRE = /[A-Z]/; - var digitRE = /[0-9]/; - var hexitRE = /[0-9A-Fa-f]/; - var octitRE = /[0-7]/; - var idRE = /[a-z_A-Z0-9']/; - var symbolRE = /[-!#$%&*+.\/<=>?@\\^|~:]/; - var specialRE = /[(),;[\]`{}]/; - var whiteCharRE = /[ \t\v\f]/; // newlines are handled in tokenizer - - function normal(source, setState) { - if (source.eatWhile(whiteCharRE)) { - return null; - } - - var ch = source.next(); - if (specialRE.test(ch)) { - if (ch == '{' && source.eat('-')) { - var t = "comment"; - if (source.eat('#')) { - t = "meta"; - } - return switchState(source, setState, ncomment(t, 1)); - } - return null; - } - - if (ch == '\'') { - if (source.eat('\\')) { - source.next(); // should handle other escapes here - } - else { - source.next(); - } - if (source.eat('\'')) { - return "string"; - } - return "error"; - } - - if (ch == '"') { - return switchState(source, setState, stringLiteral); - } - - if (largeRE.test(ch)) { - source.eatWhile(idRE); - if (source.eat('.')) { - return "qualifier"; - } - return "variable-2"; - } - - if (smallRE.test(ch)) { - source.eatWhile(idRE); - return "variable"; - } - - if (digitRE.test(ch)) { - if (ch == '0') { - if (source.eat(/[xX]/)) { - source.eatWhile(hexitRE); // should require at least 1 - return "integer"; - } - if (source.eat(/[oO]/)) { - source.eatWhile(octitRE); // should require at least 1 - return "number"; - } - } - source.eatWhile(digitRE); - var t = "number"; - if (source.eat('.')) { - t = "number"; - source.eatWhile(digitRE); // should require at least 1 - } - if (source.eat(/[eE]/)) { - t = "number"; - source.eat(/[-+]/); - source.eatWhile(digitRE); // should require at least 1 - } - return t; - } - - if (symbolRE.test(ch)) { - if (ch == '-' && source.eat(/-/)) { - source.eatWhile(/-/); - if (!source.eat(symbolRE)) { - source.skipToEnd(); - return "comment"; - } - } - var t = "variable"; - if (ch == ':') { - t = "variable-2"; - } - source.eatWhile(symbolRE); - return t; - } - - return "error"; - } - - function ncomment(type, nest) { - if (nest == 0) { - return normal; - } - return function(source, setState) { - var currNest = nest; - while (!source.eol()) { - var ch = source.next(); - if (ch == '{' && source.eat('-')) { - ++currNest; - } - else if (ch == '-' && source.eat('}')) { - --currNest; - if (currNest == 0) { - setState(normal); - return type; - } - } - } - setState(ncomment(type, currNest)); - return type; - }; - } - - function stringLiteral(source, setState) { - while (!source.eol()) { - var ch = source.next(); - if (ch == '"') { - setState(normal); - return "string"; - } - if (ch == '\\') { - if (source.eol() || source.eat(whiteCharRE)) { - setState(stringGap); - return "string"; - } - if (source.eat('&')) { - } - else { - source.next(); // should handle other escapes here - } - } - } - setState(normal); - return "error"; - } - - function stringGap(source, setState) { - if (source.eat('\\')) { - return switchState(source, setState, stringLiteral); - } - source.next(); - setState(normal); - return "error"; - } - - - var wellKnownWords = (function() { - var wkw = {}; - function setType(t) { - return function () { - for (var i = 0; i < arguments.length; i++) - wkw[arguments[i]] = t; - }; - } - - setType("keyword")( - "case", "class", "data", "default", "deriving", "do", "else", "foreign", - "if", "import", "in", "infix", "infixl", "infixr", "instance", "let", - "module", "newtype", "of", "then", "type", "where", "_"); - - setType("keyword")( - "\.\.", ":", "::", "=", "\\", "\"", "<-", "->", "@", "~", "=>"); - - setType("builtin")( - "!!", "$!", "$", "&&", "+", "++", "-", ".", "/", "/=", "<", "<=", "=<<", - "==", ">", ">=", ">>", ">>=", "^", "^^", "||", "*", "**"); - - setType("builtin")( - "Bool", "Bounded", "Char", "Double", "EQ", "Either", "Enum", "Eq", - "False", "FilePath", "Float", "Floating", "Fractional", "Functor", "GT", - "IO", "IOError", "Int", "Integer", "Integral", "Just", "LT", "Left", - "Maybe", "Monad", "Nothing", "Num", "Ord", "Ordering", "Rational", "Read", - "ReadS", "Real", "RealFloat", "RealFrac", "Right", "Show", "ShowS", - "String", "True"); - - setType("builtin")( - "abs", "acos", "acosh", "all", "and", "any", "appendFile", "asTypeOf", - "asin", "asinh", "atan", "atan2", "atanh", "break", "catch", "ceiling", - "compare", "concat", "concatMap", "const", "cos", "cosh", "curry", - "cycle", "decodeFloat", "div", "divMod", "drop", "dropWhile", "either", - "elem", "encodeFloat", "enumFrom", "enumFromThen", "enumFromThenTo", - "enumFromTo", "error", "even", "exp", "exponent", "fail", "filter", - "flip", "floatDigits", "floatRadix", "floatRange", "floor", "fmap", - "foldl", "foldl1", "foldr", "foldr1", "fromEnum", "fromInteger", - "fromIntegral", "fromRational", "fst", "gcd", "getChar", "getContents", - "getLine", "head", "id", "init", "interact", "ioError", "isDenormalized", - "isIEEE", "isInfinite", "isNaN", "isNegativeZero", "iterate", "last", - "lcm", "length", "lex", "lines", "log", "logBase", "lookup", "map", - "mapM", "mapM_", "max", "maxBound", "maximum", "maybe", "min", "minBound", - "minimum", "mod", "negate", "not", "notElem", "null", "odd", "or", - "otherwise", "pi", "pred", "print", "product", "properFraction", - "putChar", "putStr", "putStrLn", "quot", "quotRem", "read", "readFile", - "readIO", "readList", "readLn", "readParen", "reads", "readsPrec", - "realToFrac", "recip", "rem", "repeat", "replicate", "return", "reverse", - "round", "scaleFloat", "scanl", "scanl1", "scanr", "scanr1", "seq", - "sequence", "sequence_", "show", "showChar", "showList", "showParen", - "showString", "shows", "showsPrec", "significand", "signum", "sin", - "sinh", "snd", "span", "splitAt", "sqrt", "subtract", "succ", "sum", - "tail", "take", "takeWhile", "tan", "tanh", "toEnum", "toInteger", - "toRational", "truncate", "uncurry", "undefined", "unlines", "until", - "unwords", "unzip", "unzip3", "userError", "words", "writeFile", "zip", - "zip3", "zipWith", "zipWith3"); - - return wkw; - })(); - - - - return { - startState: function () { return { f: normal }; }, - copyState: function (s) { return { f: s.f }; }, - - token: function(stream, state) { - var t = state.f(stream, function(s) { state.f = s; }); - var w = stream.current(); - return (w in wellKnownWords) ? wellKnownWords[w] : t; - } - }; - -}); - -CodeMirror.defineMIME("text/x-haskell", "haskell"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/haskell/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/haskell/index.html deleted file mode 100644 index b304a2768284e5361fcdd123854181abde109030..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/haskell/index.html +++ /dev/null @@ -1,62 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Haskell mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="../../lib/util/matchbrackets.js"></script> - <script src="haskell.js"></script> - <link rel="stylesheet" href="../../theme/elegant.css"> - <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> - <link rel="stylesheet" href="../../doc/docs.css"> - </head> - <body> - <h1>CodeMirror: Haskell mode</h1> - -<form><textarea id="code" name="code"> -module UniquePerms ( - uniquePerms - ) -where - --- | Find all unique permutations of a list where there might be duplicates. -uniquePerms :: (Eq a) => [a] -> [[a]] -uniquePerms = permBag . makeBag - --- | An unordered collection where duplicate values are allowed, --- but represented with a single value and a count. -type Bag a = [(a, Int)] - -makeBag :: (Eq a) => [a] -> Bag a -makeBag [] = [] -makeBag (a:as) = mix a $ makeBag as - where - mix a [] = [(a,1)] - mix a (bn@(b,n):bs) | a == b = (b,n+1):bs - | otherwise = bn : mix a bs - -permBag :: Bag a -> [[a]] -permBag [] = [[]] -permBag bs = concatMap (\(f,cs) -> map (f:) $ permBag cs) . oneOfEach $ bs - where - oneOfEach [] = [] - oneOfEach (an@(a,n):bs) = - let bs' = if n == 1 then bs else (a,n-1):bs - in (a,bs') : mapSnd (an:) (oneOfEach bs) - - apSnd f (a,b) = (a, f b) - mapSnd = map . apSnd -</textarea></form> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - matchBrackets: true, - theme: "elegant" - }); - </script> - - <p><strong>MIME types defined:</strong> <code>text/x-haskell</code>.</p> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/haxe/haxe.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/haxe/haxe.js deleted file mode 100644 index c99074bdaa06fa2f2164864e72ca2e5e946d7f67..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/haxe/haxe.js +++ /dev/null @@ -1,429 +0,0 @@ -CodeMirror.defineMode("haxe", function(config, parserConfig) { - var indentUnit = config.indentUnit; - - // Tokenizer - - var keywords = function(){ - function kw(type) {return {type: type, style: "keyword"};} - var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"); - var operator = kw("operator"), atom = {type: "atom", style: "atom"}, attribute = {type:"attribute", style: "attribute"}; - var type = kw("typedef"); - return { - "if": A, "while": A, "else": B, "do": B, "try": B, - "return": C, "break": C, "continue": C, "new": C, "throw": C, - "var": kw("var"), "inline":attribute, "static": attribute, "using":kw("import"), - "public": attribute, "private": attribute, "cast": kw("cast"), "import": kw("import"), "macro": kw("macro"), - "function": kw("function"), "catch": kw("catch"), "untyped": kw("untyped"), "callback": kw("cb"), - "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), - "in": operator, "never": kw("property_access"), "trace":kw("trace"), - "class": type, "enum":type, "interface":type, "typedef":type, "extends":type, "implements":type, "dynamic":type, - "true": atom, "false": atom, "null": atom - }; - }(); - - var isOperatorChar = /[+\-*&%=<>!?|]/; - - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - - function nextUntilUnescaped(stream, end) { - var escaped = false, next; - while ((next = stream.next()) != null) { - if (next == end && !escaped) - return false; - escaped = !escaped && next == "\\"; - } - return escaped; - } - - // Used as scratch variables to communicate multiple values without - // consing up tons of objects. - var type, content; - function ret(tp, style, cont) { - type = tp; content = cont; - return style; - } - - function haxeTokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"' || ch == "'") - return chain(stream, state, haxeTokenString(ch)); - else if (/[\[\]{}\(\),;\:\.]/.test(ch)) - return ret(ch); - else if (ch == "0" && stream.eat(/x/i)) { - stream.eatWhile(/[\da-f]/i); - return ret("number", "number"); - } - else if (/\d/.test(ch) || ch == "-" && stream.eat(/\d/)) { - stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/); - return ret("number", "number"); - } - else if (state.reAllowed && (ch == "~" && stream.eat(/\//))) { - nextUntilUnescaped(stream, "/"); - stream.eatWhile(/[gimsu]/); - return ret("regexp", "string-2"); - } - else if (ch == "/") { - if (stream.eat("*")) { - return chain(stream, state, haxeTokenComment); - } - else if (stream.eat("/")) { - stream.skipToEnd(); - return ret("comment", "comment"); - } - else { - stream.eatWhile(isOperatorChar); - return ret("operator", null, stream.current()); - } - } - else if (ch == "#") { - stream.skipToEnd(); - return ret("conditional", "meta"); - } - else if (ch == "@") { - stream.eat(/:/); - stream.eatWhile(/[\w_]/); - return ret ("metadata", "meta"); - } - else if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return ret("operator", null, stream.current()); - } - else { - var word; - if(/[A-Z]/.test(ch)) - { - stream.eatWhile(/[\w_<>]/); - word = stream.current(); - return ret("type", "variable-3", word); - } - else - { - stream.eatWhile(/[\w_]/); - var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word]; - return (known && state.kwAllowed) ? ret(known.type, known.style, word) : - ret("variable", "variable", word); - } - } - } - - function haxeTokenString(quote) { - return function(stream, state) { - if (!nextUntilUnescaped(stream, quote)) - state.tokenize = haxeTokenBase; - return ret("string", "string"); - }; - } - - function haxeTokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = haxeTokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return ret("comment", "comment"); - } - - // Parser - - var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true}; - - function HaxeLexical(indented, column, type, align, prev, info) { - this.indented = indented; - this.column = column; - this.type = type; - this.prev = prev; - this.info = info; - if (align != null) this.align = align; - } - - function inScope(state, varname) { - for (var v = state.localVars; v; v = v.next) - if (v.name == varname) return true; - } - - function parseHaxe(state, style, type, content, stream) { - var cc = state.cc; - // Communicate our context to the combinators. - // (Less wasteful than consing up a hundred closures on every call.) - cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; - - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = true; - - while(true) { - var combinator = cc.length ? cc.pop() : statement; - if (combinator(type, content)) { - while(cc.length && cc[cc.length - 1].lex) - cc.pop()(); - if (cx.marked) return cx.marked; - if (type == "variable" && inScope(state, content)) return "variable-2"; - if (type == "variable" && imported(state, content)) return "variable-3"; - return style; - } - } - } - - function imported(state, typename) - { - if (/[a-z]/.test(typename.charAt(0))) - return false; - var len = state.importedtypes.length; - for (var i = 0; i<len; i++) - if(state.importedtypes[i]==typename) return true; - } - - - function registerimport(importname) { - var state = cx.state; - for (var t = state.importedtypes; t; t = t.next) - if(t.name == importname) return; - state.importedtypes = { name: importname, next: state.importedtypes }; - } - // Combinator utils - - var cx = {state: null, column: null, marked: null, cc: null}; - function pass() { - for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); - } - function cont() { - pass.apply(null, arguments); - return true; - } - function register(varname) { - var state = cx.state; - if (state.context) { - cx.marked = "def"; - for (var v = state.localVars; v; v = v.next) - if (v.name == varname) return; - state.localVars = {name: varname, next: state.localVars}; - } - } - - // Combinators - - var defaultVars = {name: "this", next: null}; - function pushcontext() { - if (!cx.state.context) cx.state.localVars = defaultVars; - cx.state.context = {prev: cx.state.context, vars: cx.state.localVars}; - } - function popcontext() { - cx.state.localVars = cx.state.context.vars; - cx.state.context = cx.state.context.prev; - } - function pushlex(type, info) { - var result = function() { - var state = cx.state; - state.lexical = new HaxeLexical(state.indented, cx.stream.column(), type, null, state.lexical, info); - }; - result.lex = true; - return result; - } - function poplex() { - var state = cx.state; - if (state.lexical.prev) { - if (state.lexical.type == ")") - state.indented = state.lexical.indented; - state.lexical = state.lexical.prev; - } - } - poplex.lex = true; - - function expect(wanted) { - return function expecting(type) { - if (type == wanted) return cont(); - else if (wanted == ";") return pass(); - else return cont(arguments.callee); - }; - } - - function statement(type) { - if (type == "@") return cont(metadef); - if (type == "var") return cont(pushlex("vardef"), vardef1, expect(";"), poplex); - if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex); - if (type == "keyword b") return cont(pushlex("form"), statement, poplex); - if (type == "{") return cont(pushlex("}"), pushcontext, block, poplex, popcontext); - if (type == ";") return cont(); - if (type == "attribute") return cont(maybeattribute); - if (type == "function") return cont(functiondef); - if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"), - poplex, statement, poplex); - if (type == "variable") return cont(pushlex("stat"), maybelabel); - if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), - block, poplex, poplex); - if (type == "case") return cont(expression, expect(":")); - if (type == "default") return cont(expect(":")); - if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), - statement, poplex, popcontext); - if (type == "import") return cont(importdef, expect(";")); - if (type == "typedef") return cont(typedef); - return pass(pushlex("stat"), expression, expect(";"), poplex); - } - function expression(type) { - if (atomicTypes.hasOwnProperty(type)) return cont(maybeoperator); - if (type == "function") return cont(functiondef); - if (type == "keyword c") return cont(maybeexpression); - if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeoperator); - if (type == "operator") return cont(expression); - if (type == "[") return cont(pushlex("]"), commasep(expression, "]"), poplex, maybeoperator); - if (type == "{") return cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator); - return cont(); - } - function maybeexpression(type) { - if (type.match(/[;\}\)\],]/)) return pass(); - return pass(expression); - } - - function maybeoperator(type, value) { - if (type == "operator" && /\+\+|--/.test(value)) return cont(maybeoperator); - if (type == "operator" || type == ":") return cont(expression); - if (type == ";") return; - if (type == "(") return cont(pushlex(")"), commasep(expression, ")"), poplex, maybeoperator); - if (type == ".") return cont(property, maybeoperator); - if (type == "[") return cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator); - } - - function maybeattribute(type) { - if (type == "attribute") return cont(maybeattribute); - if (type == "function") return cont(functiondef); - if (type == "var") return cont(vardef1); - } - - function metadef(type) { - if(type == ":") return cont(metadef); - if(type == "variable") return cont(metadef); - if(type == "(") return cont(pushlex(")"), comasep(metaargs, ")"), poplex, statement); - } - function metaargs(type) { - if(type == "variable") return cont(); - } - - function importdef (type, value) { - if(type == "variable" && /[A-Z]/.test(value.charAt(0))) { registerimport(value); return cont(); } - else if(type == "variable" || type == "property" || type == ".") return cont(importdef); - } - - function typedef (type, value) - { - if(type == "variable" && /[A-Z]/.test(value.charAt(0))) { registerimport(value); return cont(); } - } - - function maybelabel(type) { - if (type == ":") return cont(poplex, statement); - return pass(maybeoperator, expect(";"), poplex); - } - function property(type) { - if (type == "variable") {cx.marked = "property"; return cont();} - } - function objprop(type) { - if (type == "variable") cx.marked = "property"; - if (atomicTypes.hasOwnProperty(type)) return cont(expect(":"), expression); - } - function commasep(what, end) { - function proceed(type) { - if (type == ",") return cont(what, proceed); - if (type == end) return cont(); - return cont(expect(end)); - } - return function commaSeparated(type) { - if (type == end) return cont(); - else return pass(what, proceed); - }; - } - function block(type) { - if (type == "}") return cont(); - return pass(statement, block); - } - function vardef1(type, value) { - if (type == "variable"){register(value); return cont(typeuse, vardef2);} - return cont(); - } - function vardef2(type, value) { - if (value == "=") return cont(expression, vardef2); - if (type == ",") return cont(vardef1); - } - function forspec1(type, value) { - if (type == "variable") { - register(value); - } - return cont(pushlex(")"), pushcontext, forin, expression, poplex, statement, popcontext); - } - function forin(_type, value) { - if (value == "in") return cont(); - } - function functiondef(type, value) { - if (type == "variable") {register(value); return cont(functiondef);} - if (value == "new") return cont(functiondef); - if (type == "(") return cont(pushlex(")"), pushcontext, commasep(funarg, ")"), poplex, typeuse, statement, popcontext); - } - function typeuse(type) { - if(type == ":") return cont(typestring); - } - function typestring(type) { - if(type == "type") return cont(); - if(type == "variable") return cont(); - if(type == "{") return cont(pushlex("}"), commasep(typeprop, "}"), poplex); - } - function typeprop(type) { - if(type == "variable") return cont(typeuse); - } - function funarg(type, value) { - if (type == "variable") {register(value); return cont(typeuse);} - } - - // Interface - - return { - startState: function(basecolumn) { - var defaulttypes = ["Int", "Float", "String", "Void", "Std", "Bool", "Dynamic", "Array"]; - return { - tokenize: haxeTokenBase, - reAllowed: true, - kwAllowed: true, - cc: [], - lexical: new HaxeLexical((basecolumn || 0) - indentUnit, 0, "block", false), - localVars: parserConfig.localVars, - importedtypes: defaulttypes, - context: parserConfig.localVars && {vars: parserConfig.localVars}, - indented: 0 - }; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = false; - state.indented = stream.indentation(); - } - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - if (type == "comment") return style; - state.reAllowed = !!(type == "operator" || type == "keyword c" || type.match(/^[\[{}\(,;:]$/)); - state.kwAllowed = type != '.'; - return parseHaxe(state, style, type, content, stream); - }, - - indent: function(state, textAfter) { - if (state.tokenize != haxeTokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical; - if (lexical.type == "stat" && firstChar == "}") lexical = lexical.prev; - var type = lexical.type, closing = firstChar == type; - if (type == "vardef") return lexical.indented + 4; - else if (type == "form" && firstChar == "{") return lexical.indented; - else if (type == "stat" || type == "form") return lexical.indented + indentUnit; - else if (lexical.info == "switch" && !closing) - return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit); - else if (lexical.align) return lexical.column + (closing ? 0 : 1); - else return lexical.indented + (closing ? 0 : indentUnit); - }, - - electricChars: "{}" - }; -}); - -CodeMirror.defineMIME("text/x-haxe", "haxe"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/haxe/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/haxe/index.html deleted file mode 100644 index 1125741ad570d2a66ae8e4566be49774245572e6..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/haxe/index.html +++ /dev/null @@ -1,90 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Haxe mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="haxe.js"></script> - <link rel="stylesheet" href="../../doc/docs.css"> - <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> - </head> - <body> - <h1>CodeMirror: Haxe mode</h1> - -<div><textarea id="code" name="code"> -import one.two.Three; - -@attr("test") -class Foo<T> extends Three -{ - public function new() - { - noFoo = 12; - } - - public static inline function doFoo(obj:{k:Int, l:Float}):Int - { - for(i in 0...10) - { - obj.k++; - trace(i); - var var1 = new Array(); - if(var1.length > 1) - throw "Error"; - } - // The following line should not be colored, the variable is scoped out - var1; - /* Multi line - * Comment test - */ - return obj.k; - } - private function bar():Void - { - #if flash - var t1:String = "1.21"; - #end - try { - doFoo({k:3, l:1.2}); - } - catch (e : String) { - trace(e); - } - var t2:Float = cast(3.2); - var t3:haxe.Timer = new haxe.Timer(); - var t4 = {k:Std.int(t2), l:Std.parseFloat(t1)}; - var t5 = ~/123+.*$/i; - doFoo(t4); - untyped t1 = 4; - bob = new Foo<Int> - } - public var okFoo(default, never):Float; - var noFoo(getFoo, null):Int; - function getFoo():Int { - return noFoo; - } - - public var three:Int; -} -enum Color -{ - red; - green; - blue; - grey( v : Int ); - rgb (r:Int,g:Int,b:Int); -} -</textarea></div> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - indentUnit: 4, - indentWithTabs: true - }); - </script> - - <p><strong>MIME types defined:</strong> <code>text/x-haxe</code>.</p> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/htmlembedded/htmlembedded.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/htmlembedded/htmlembedded.js deleted file mode 100644 index e183d6746712242d66cc42186e7eb289238069bd..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/htmlembedded/htmlembedded.js +++ /dev/null @@ -1,73 +0,0 @@ -CodeMirror.defineMode("htmlembedded", function(config, parserConfig) { - - //config settings - var scriptStartRegex = parserConfig.scriptStartRegex || /^<%/i, - scriptEndRegex = parserConfig.scriptEndRegex || /^%>/i; - - //inner modes - var scriptingMode, htmlMixedMode; - - //tokenizer when in html mode - function htmlDispatch(stream, state) { - if (stream.match(scriptStartRegex, false)) { - state.token=scriptingDispatch; - return scriptingMode.token(stream, state.scriptState); - } - else - return htmlMixedMode.token(stream, state.htmlState); - } - - //tokenizer when in scripting mode - function scriptingDispatch(stream, state) { - if (stream.match(scriptEndRegex, false)) { - state.token=htmlDispatch; - return htmlMixedMode.token(stream, state.htmlState); - } - else - return scriptingMode.token(stream, state.scriptState); - } - - - return { - startState: function() { - scriptingMode = scriptingMode || CodeMirror.getMode(config, parserConfig.scriptingModeSpec); - htmlMixedMode = htmlMixedMode || CodeMirror.getMode(config, "htmlmixed"); - return { - token : parserConfig.startOpen ? scriptingDispatch : htmlDispatch, - htmlState : CodeMirror.startState(htmlMixedMode), - scriptState : CodeMirror.startState(scriptingMode) - }; - }, - - token: function(stream, state) { - return state.token(stream, state); - }, - - indent: function(state, textAfter) { - if (state.token == htmlDispatch) - return htmlMixedMode.indent(state.htmlState, textAfter); - else if (scriptingMode.indent) - return scriptingMode.indent(state.scriptState, textAfter); - }, - - copyState: function(state) { - return { - token : state.token, - htmlState : CodeMirror.copyState(htmlMixedMode, state.htmlState), - scriptState : CodeMirror.copyState(scriptingMode, state.scriptState) - }; - }, - - electricChars: "/{}:", - - innerMode: function(state) { - if (state.token == scriptingDispatch) return {state: state.scriptState, mode: scriptingMode}; - else return {state: state.htmlState, mode: htmlMixedMode}; - } - }; -}, "htmlmixed"); - -CodeMirror.defineMIME("application/x-ejs", { name: "htmlembedded", scriptingModeSpec:"javascript"}); -CodeMirror.defineMIME("application/x-aspx", { name: "htmlembedded", scriptingModeSpec:"text/x-csharp"}); -CodeMirror.defineMIME("application/x-jsp", { name: "htmlembedded", scriptingModeSpec:"text/x-java"}); -CodeMirror.defineMIME("application/x-erb", { name: "htmlembedded", scriptingModeSpec:"ruby"}); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/htmlembedded/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/htmlembedded/index.html deleted file mode 100644 index 5a37dd637dfe12b331a269b6dc0a77cbecf1a9dd..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/htmlembedded/index.html +++ /dev/null @@ -1,49 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Html Embedded Scripts mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="../xml/xml.js"></script> - <script src="../javascript/javascript.js"></script> - <script src="../css/css.js"></script> - <script src="../htmlmixed/htmlmixed.js"></script> - <script src="htmlembedded.js"></script> - <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> - <link rel="stylesheet" href="../../doc/docs.css"> - </head> - <body> - <h1>CodeMirror: Html Embedded Scripts mode</h1> - -<form><textarea id="code" name="code"> -<% -function hello(who) { - return "Hello " + who; -} -%> -This is an example of EJS (embedded javascript) -<p>The program says <%= hello("world") %>.</p> -<script> - alert("And here is some normal JS code"); // also colored -</script> -</textarea></form> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - mode: "application/x-ejs", - indentUnit: 4, - indentWithTabs: true, - enterMode: "keep", - tabMode: "shift" - }); - </script> - - <p>Mode for html embedded scripts like JSP and ASP.NET. Depends on HtmlMixed which in turn depends on - JavaScript, CSS and XML.<br />Other dependancies include those of the scriping language chosen.</p> - - <p><strong>MIME types defined:</strong> <code>application/x-aspx</code> (ASP.NET), - <code>application/x-ejs</code> (Embedded Javascript), <code>application/x-jsp</code> (JavaServer Pages)</p> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/htmlmixed/htmlmixed.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/htmlmixed/htmlmixed.js deleted file mode 100644 index f2dd01dd914dce19d8e5d8c16d7d14ac9ca474cd..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/htmlmixed/htmlmixed.js +++ /dev/null @@ -1,84 +0,0 @@ -CodeMirror.defineMode("htmlmixed", function(config) { - var htmlMode = CodeMirror.getMode(config, {name: "xml", htmlMode: true}); - var jsMode = CodeMirror.getMode(config, "javascript"); - var cssMode = CodeMirror.getMode(config, "css"); - - function html(stream, state) { - var style = htmlMode.token(stream, state.htmlState); - if (/(?:^|\s)tag(?:\s|$)/.test(style) && stream.current() == ">" && state.htmlState.context) { - if (/^script$/i.test(state.htmlState.context.tagName)) { - state.token = javascript; - state.localState = jsMode.startState(htmlMode.indent(state.htmlState, "")); - } - else if (/^style$/i.test(state.htmlState.context.tagName)) { - state.token = css; - state.localState = cssMode.startState(htmlMode.indent(state.htmlState, "")); - } - } - return style; - } - function maybeBackup(stream, pat, style) { - var cur = stream.current(); - var close = cur.search(pat), m; - if (close > -1) stream.backUp(cur.length - close); - else if (m = cur.match(/<\/?$/)) { - stream.backUp(cur.length); - if (!stream.match(pat, false)) stream.match(cur[0]); - } - return style; - } - function javascript(stream, state) { - if (stream.match(/^<\/\s*script\s*>/i, false)) { - state.token = html; - state.localState = null; - return html(stream, state); - } - return maybeBackup(stream, /<\/\s*script\s*>/, - jsMode.token(stream, state.localState)); - } - function css(stream, state) { - if (stream.match(/^<\/\s*style\s*>/i, false)) { - state.token = html; - state.localState = null; - return html(stream, state); - } - return maybeBackup(stream, /<\/\s*style\s*>/, - cssMode.token(stream, state.localState)); - } - - return { - startState: function() { - var state = htmlMode.startState(); - return {token: html, localState: null, mode: "html", htmlState: state}; - }, - - copyState: function(state) { - if (state.localState) - var local = CodeMirror.copyState(state.token == css ? cssMode : jsMode, state.localState); - return {token: state.token, localState: local, mode: state.mode, - htmlState: CodeMirror.copyState(htmlMode, state.htmlState)}; - }, - - token: function(stream, state) { - return state.token(stream, state); - }, - - indent: function(state, textAfter) { - if (state.token == html || /^\s*<\//.test(textAfter)) - return htmlMode.indent(state.htmlState, textAfter); - else if (state.token == javascript) - return jsMode.indent(state.localState, textAfter); - else - return cssMode.indent(state.localState, textAfter); - }, - - electricChars: "/{}:", - - innerMode: function(state) { - var mode = state.token == html ? htmlMode : state.token == javascript ? jsMode : cssMode; - return {state: state.localState || state.htmlState, mode: mode}; - } - }; -}, "xml", "javascript", "css"); - -CodeMirror.defineMIME("text/html", "htmlmixed"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/htmlmixed/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/htmlmixed/index.html deleted file mode 100644 index 45a9c03983d4d561cad083934faf03818f994ded..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/htmlmixed/index.html +++ /dev/null @@ -1,52 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: HTML mixed mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="../xml/xml.js"></script> - <script src="../javascript/javascript.js"></script> - <script src="../css/css.js"></script> - <script src="htmlmixed.js"></script> - <link rel="stylesheet" href="../../doc/docs.css"> - <style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> - </head> - <body> - <h1>CodeMirror: HTML mixed mode</h1> - <form><textarea id="code" name="code"> -<html style="color: green"> - <!-- this is a comment --> - <head> - <title>Mixed HTML Example</title> - <style type="text/css"> - h1 {font-family: comic sans; color: #f0f;} - div {background: yellow !important;} - body { - max-width: 50em; - margin: 1em 2em 1em 5em; - } - </style> - </head> - <body> - <h1>Mixed HTML Example</h1> - <script> - function jsFunc(arg1, arg2) { - if (arg1 && arg2) document.body.innerHTML = "achoo"; - } - </script> - </body> -</html> -</textarea></form> - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), {mode: "text/html", tabMode: "indent"}); - </script> - - <p>The HTML mixed mode depends on the XML, JavaScript, and CSS modes.</p> - - <p><strong>MIME types defined:</strong> <code>text/html</code> - (redefined, only takes effect if you load this parser after the - XML parser).</p> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/http/http.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/http/http.js deleted file mode 100644 index 5a5163602766be8f71354f75f0f10db5b5ad2b3f..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/http/http.js +++ /dev/null @@ -1,98 +0,0 @@ -CodeMirror.defineMode("http", function() { - function failFirstLine(stream, state) { - stream.skipToEnd(); - state.cur = header; - return "error"; - } - - function start(stream, state) { - if (stream.match(/^HTTP\/\d\.\d/)) { - state.cur = responseStatusCode; - return "keyword"; - } else if (stream.match(/^[A-Z]+/) && /[ \t]/.test(stream.peek())) { - state.cur = requestPath; - return "keyword"; - } else { - return failFirstLine(stream, state); - } - } - - function responseStatusCode(stream, state) { - var code = stream.match(/^\d+/); - if (!code) return failFirstLine(stream, state); - - state.cur = responseStatusText; - var status = Number(code[0]); - if (status >= 100 && status < 200) { - return "positive informational"; - } else if (status >= 200 && status < 300) { - return "positive success"; - } else if (status >= 300 && status < 400) { - return "positive redirect"; - } else if (status >= 400 && status < 500) { - return "negative client-error"; - } else if (status >= 500 && status < 600) { - return "negative server-error"; - } else { - return "error"; - } - } - - function responseStatusText(stream, state) { - stream.skipToEnd(); - state.cur = header; - return null; - } - - function requestPath(stream, state) { - stream.eatWhile(/\S/); - state.cur = requestProtocol; - return "string-2"; - } - - function requestProtocol(stream, state) { - if (stream.match(/^HTTP\/\d\.\d$/)) { - state.cur = header; - return "keyword"; - } else { - return failFirstLine(stream, state); - } - } - - function header(stream) { - if (stream.sol() && !stream.eat(/[ \t]/)) { - if (stream.match(/^.*?:/)) { - return "atom"; - } else { - stream.skipToEnd(); - return "error"; - } - } else { - stream.skipToEnd(); - return "string"; - } - } - - function body(stream) { - stream.skipToEnd(); - return null; - } - - return { - token: function(stream, state) { - var cur = state.cur; - if (cur != header && cur != body && stream.eatSpace()) return null; - return cur(stream, state); - }, - - blankLine: function(state) { - state.cur = body; - }, - - startState: function() { - return {cur: start}; - } - }; -}); - -CodeMirror.defineMIME("message/http", "http"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/http/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/http/index.html deleted file mode 100644 index 124eb84f95abd5d66e728c0b9ad7531b71b84dd4..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/http/index.html +++ /dev/null @@ -1,32 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: HTTP mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="http.js"></script> - <link rel="stylesheet" href="../../doc/docs.css"> - <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> - </head> - <body> - <h1>CodeMirror: HTTP mode</h1> - -<div><textarea id="code" name="code"> -POST /somewhere HTTP/1.1 -Host: example.com -If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT -Content-Type: application/x-www-form-urlencoded; - charset=utf-8 -User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.11 (KHTML, like Gecko) Ubuntu/12.04 Chromium/20.0.1132.47 Chrome/20.0.1132.47 Safari/536.11 - -This is the request body! -</textarea></div> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), {}); - </script> - - <p><strong>MIME types defined:</strong> <code>message/http</code>.</p> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/javascript/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/javascript/index.html deleted file mode 100644 index d81413c0a658e162e0bf0c050d6e9f870adff64f..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/javascript/index.html +++ /dev/null @@ -1,88 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: JavaScript mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="../../lib/util/matchbrackets.js"></script> - <script src="../../lib/util/continuecomment.js"></script> - <script src="javascript.js"></script> - <link rel="stylesheet" href="../../doc/docs.css"> - <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> - </head> - <body> - <h1>CodeMirror: JavaScript mode</h1> - -<div><textarea id="code" name="code"> -// Demo code (the actual new parser character stream implementation) - -function StringStream(string) { - this.pos = 0; - this.string = string; -} - -StringStream.prototype = { - done: function() {return this.pos >= this.string.length;}, - peek: function() {return this.string.charAt(this.pos);}, - next: function() { - if (this.pos < this.string.length) - return this.string.charAt(this.pos++); - }, - eat: function(match) { - var ch = this.string.charAt(this.pos); - if (typeof match == "string") var ok = ch == match; - else var ok = ch && match.test ? match.test(ch) : match(ch); - if (ok) {this.pos++; return ch;} - }, - eatWhile: function(match) { - var start = this.pos; - while (this.eat(match)); - if (this.pos > start) return this.string.slice(start, this.pos); - }, - backUp: function(n) {this.pos -= n;}, - column: function() {return this.pos;}, - eatSpace: function() { - var start = this.pos; - while (/\s/.test(this.string.charAt(this.pos))) this.pos++; - return this.pos - start; - }, - match: function(pattern, consume, caseInsensitive) { - if (typeof pattern == "string") { - function cased(str) {return caseInsensitive ? str.toLowerCase() : str;} - if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) { - if (consume !== false) this.pos += str.length; - return true; - } - } - else { - var match = this.string.slice(this.pos).match(pattern); - if (match && consume !== false) this.pos += match[0].length; - return match; - } - } -}; -</textarea></div> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - matchBrackets: true, - extraKeys: {"Enter": "newlineAndIndentContinueComment"} - }); - </script> - - <p> - JavaScript mode supports a two configuration - options: - <ul> - <li><code>json</code> which will set the mode to expect JSON data rather than a JavaScript program.</li> - <li> - <code>typescript</code> which will activate additional syntax highlighting and some other things for TypeScript code (<a href="typescript.html">demo</a>). - </li> - </ul> - </p> - - <p><strong>MIME types defined:</strong> <code>text/javascript</code>, <code>application/json</code>, <code>text/typescript</code>, <code>application/typescript</code>.</p> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/javascript/javascript.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/javascript/javascript.js deleted file mode 100644 index f00be91e86e80e53d46af6c7f6306a68fd804948..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/javascript/javascript.js +++ /dev/null @@ -1,411 +0,0 @@ -// TODO actually recognize syntax of TypeScript constructs - -CodeMirror.defineMode("javascript", function(config, parserConfig) { - var indentUnit = config.indentUnit; - var jsonMode = parserConfig.json; - var isTS = parserConfig.typescript; - - // Tokenizer - - var keywords = function(){ - function kw(type) {return {type: type, style: "keyword"};} - var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"); - var operator = kw("operator"), atom = {type: "atom", style: "atom"}; - - var jsKeywords = { - "if": A, "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B, - "return": C, "break": C, "continue": C, "new": C, "delete": C, "throw": C, - "var": kw("var"), "const": kw("var"), "let": kw("var"), - "function": kw("function"), "catch": kw("catch"), - "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), - "in": operator, "typeof": operator, "instanceof": operator, - "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom - }; - - // Extend the 'normal' keywords with the TypeScript language extensions - if (isTS) { - var type = {type: "variable", style: "variable-3"}; - var tsKeywords = { - // object-like things - "interface": kw("interface"), - "class": kw("class"), - "extends": kw("extends"), - "constructor": kw("constructor"), - - // scope modifiers - "public": kw("public"), - "private": kw("private"), - "protected": kw("protected"), - "static": kw("static"), - - "super": kw("super"), - - // types - "string": type, "number": type, "bool": type, "any": type - }; - - for (var attr in tsKeywords) { - jsKeywords[attr] = tsKeywords[attr]; - } - } - - return jsKeywords; - }(); - - var isOperatorChar = /[+\-*&%=<>!?|]/; - - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - - function nextUntilUnescaped(stream, end) { - var escaped = false, next; - while ((next = stream.next()) != null) { - if (next == end && !escaped) - return false; - escaped = !escaped && next == "\\"; - } - return escaped; - } - - // Used as scratch variables to communicate multiple values without - // consing up tons of objects. - var type, content; - function ret(tp, style, cont) { - type = tp; content = cont; - return style; - } - - function jsTokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"' || ch == "'") - return chain(stream, state, jsTokenString(ch)); - else if (/[\[\]{}\(\),;\:\.]/.test(ch)) - return ret(ch); - else if (ch == "0" && stream.eat(/x/i)) { - stream.eatWhile(/[\da-f]/i); - return ret("number", "number"); - } - else if (/\d/.test(ch) || ch == "-" && stream.eat(/\d/)) { - stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/); - return ret("number", "number"); - } - else if (ch == "/") { - if (stream.eat("*")) { - return chain(stream, state, jsTokenComment); - } - else if (stream.eat("/")) { - stream.skipToEnd(); - return ret("comment", "comment"); - } - else if (state.lastType == "operator" || state.lastType == "keyword c" || - /^[\[{}\(,;:]$/.test(state.lastType)) { - nextUntilUnescaped(stream, "/"); - stream.eatWhile(/[gimy]/); // 'y' is "sticky" option in Mozilla - return ret("regexp", "string-2"); - } - else { - stream.eatWhile(isOperatorChar); - return ret("operator", null, stream.current()); - } - } - else if (ch == "#") { - stream.skipToEnd(); - return ret("error", "error"); - } - else if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return ret("operator", null, stream.current()); - } - else { - stream.eatWhile(/[\w\$_]/); - var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word]; - return (known && state.lastType != ".") ? ret(known.type, known.style, word) : - ret("variable", "variable", word); - } - } - - function jsTokenString(quote) { - return function(stream, state) { - if (!nextUntilUnescaped(stream, quote)) - state.tokenize = jsTokenBase; - return ret("string", "string"); - }; - } - - function jsTokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = jsTokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return ret("comment", "comment"); - } - - // Parser - - var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true}; - - function JSLexical(indented, column, type, align, prev, info) { - this.indented = indented; - this.column = column; - this.type = type; - this.prev = prev; - this.info = info; - if (align != null) this.align = align; - } - - function inScope(state, varname) { - for (var v = state.localVars; v; v = v.next) - if (v.name == varname) return true; - } - - function parseJS(state, style, type, content, stream) { - var cc = state.cc; - // Communicate our context to the combinators. - // (Less wasteful than consing up a hundred closures on every call.) - cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; - - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = true; - - while(true) { - var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement; - if (combinator(type, content)) { - while(cc.length && cc[cc.length - 1].lex) - cc.pop()(); - if (cx.marked) return cx.marked; - if (type == "variable" && inScope(state, content)) return "variable-2"; - return style; - } - } - } - - // Combinator utils - - var cx = {state: null, column: null, marked: null, cc: null}; - function pass() { - for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); - } - function cont() { - pass.apply(null, arguments); - return true; - } - function register(varname) { - var state = cx.state; - if (state.context) { - cx.marked = "def"; - for (var v = state.localVars; v; v = v.next) - if (v.name == varname) return; - state.localVars = {name: varname, next: state.localVars}; - } - } - - // Combinators - - var defaultVars = {name: "this", next: {name: "arguments"}}; - function pushcontext() { - cx.state.context = {prev: cx.state.context, vars: cx.state.localVars}; - cx.state.localVars = defaultVars; - } - function popcontext() { - cx.state.localVars = cx.state.context.vars; - cx.state.context = cx.state.context.prev; - } - function pushlex(type, info) { - var result = function() { - var state = cx.state; - state.lexical = new JSLexical(state.indented, cx.stream.column(), type, null, state.lexical, info); - }; - result.lex = true; - return result; - } - function poplex() { - var state = cx.state; - if (state.lexical.prev) { - if (state.lexical.type == ")") - state.indented = state.lexical.indented; - state.lexical = state.lexical.prev; - } - } - poplex.lex = true; - - function expect(wanted) { - return function expecting(type) { - if (type == wanted) return cont(); - else if (wanted == ";") return pass(); - else return cont(arguments.callee); - }; - } - - function statement(type) { - if (type == "var") return cont(pushlex("vardef"), vardef1, expect(";"), poplex); - if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex); - if (type == "keyword b") return cont(pushlex("form"), statement, poplex); - if (type == "{") return cont(pushlex("}"), block, poplex); - if (type == ";") return cont(); - if (type == "function") return cont(functiondef); - if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"), - poplex, statement, poplex); - if (type == "variable") return cont(pushlex("stat"), maybelabel); - if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), - block, poplex, poplex); - if (type == "case") return cont(expression, expect(":")); - if (type == "default") return cont(expect(":")); - if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), - statement, poplex, popcontext); - return pass(pushlex("stat"), expression, expect(";"), poplex); - } - function expression(type) { - if (atomicTypes.hasOwnProperty(type)) return cont(maybeoperator); - if (type == "function") return cont(functiondef); - if (type == "keyword c") return cont(maybeexpression); - if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeoperator); - if (type == "operator") return cont(expression); - if (type == "[") return cont(pushlex("]"), commasep(expression, "]"), poplex, maybeoperator); - if (type == "{") return cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator); - return cont(); - } - function maybeexpression(type) { - if (type.match(/[;\}\)\],]/)) return pass(); - return pass(expression); - } - - function maybeoperator(type, value) { - if (type == "operator" && /\+\+|--/.test(value)) return cont(maybeoperator); - if (type == "operator" && value == "?") return cont(expression, expect(":"), expression); - if (type == ";") return; - if (type == "(") return cont(pushlex(")"), commasep(expression, ")"), poplex, maybeoperator); - if (type == ".") return cont(property, maybeoperator); - if (type == "[") return cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator); - } - function maybelabel(type) { - if (type == ":") return cont(poplex, statement); - return pass(maybeoperator, expect(";"), poplex); - } - function property(type) { - if (type == "variable") {cx.marked = "property"; return cont();} - } - function objprop(type) { - if (type == "variable") cx.marked = "property"; - if (atomicTypes.hasOwnProperty(type)) return cont(expect(":"), expression); - } - function commasep(what, end) { - function proceed(type) { - if (type == ",") return cont(what, proceed); - if (type == end) return cont(); - return cont(expect(end)); - } - return function commaSeparated(type) { - if (type == end) return cont(); - else return pass(what, proceed); - }; - } - function block(type) { - if (type == "}") return cont(); - return pass(statement, block); - } - function maybetype(type) { - if (type == ":") return cont(typedef); - return pass(); - } - function typedef(type) { - if (type == "variable"){cx.marked = "variable-3"; return cont();} - return pass(); - } - function vardef1(type, value) { - if (type == "variable") { - register(value); - return isTS ? cont(maybetype, vardef2) : cont(vardef2); - } - return pass(); - } - function vardef2(type, value) { - if (value == "=") return cont(expression, vardef2); - if (type == ",") return cont(vardef1); - } - function forspec1(type) { - if (type == "var") return cont(vardef1, expect(";"), forspec2); - if (type == ";") return cont(forspec2); - if (type == "variable") return cont(formaybein); - return cont(forspec2); - } - function formaybein(_type, value) { - if (value == "in") return cont(expression); - return cont(maybeoperator, forspec2); - } - function forspec2(type, value) { - if (type == ";") return cont(forspec3); - if (value == "in") return cont(expression); - return cont(expression, expect(";"), forspec3); - } - function forspec3(type) { - if (type != ")") cont(expression); - } - function functiondef(type, value) { - if (type == "variable") {register(value); return cont(functiondef);} - if (type == "(") return cont(pushlex(")"), pushcontext, commasep(funarg, ")"), poplex, statement, popcontext); - } - function funarg(type, value) { - if (type == "variable") {register(value); return isTS ? cont(maybetype) : cont();} - } - - // Interface - - return { - startState: function(basecolumn) { - return { - tokenize: jsTokenBase, - lastType: null, - cc: [], - lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false), - localVars: parserConfig.localVars, - context: parserConfig.localVars && {vars: parserConfig.localVars}, - indented: 0 - }; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = false; - state.indented = stream.indentation(); - } - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - if (type == "comment") return style; - state.lastType = type; - return parseJS(state, style, type, content, stream); - }, - - indent: function(state, textAfter) { - if (state.tokenize == jsTokenComment) return CodeMirror.Pass; - if (state.tokenize != jsTokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical; - if (lexical.type == "stat" && firstChar == "}") lexical = lexical.prev; - var type = lexical.type, closing = firstChar == type; - if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? 4 : 0); - else if (type == "form" && firstChar == "{") return lexical.indented; - else if (type == "form") return lexical.indented + indentUnit; - else if (type == "stat") - return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? indentUnit : 0); - else if (lexical.info == "switch" && !closing) - return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit); - else if (lexical.align) return lexical.column + (closing ? 0 : 1); - else return lexical.indented + (closing ? 0 : indentUnit); - }, - - electricChars: ":{}", - - jsonMode: jsonMode - }; -}); - -CodeMirror.defineMIME("text/javascript", "javascript"); -CodeMirror.defineMIME("application/json", {name: "javascript", json: true}); -CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true }); -CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true }); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/javascript/typescript.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/javascript/typescript.html deleted file mode 100644 index 58315e7ac7d90db43a9082a0f5b714313c8d90e2..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/javascript/typescript.html +++ /dev/null @@ -1,48 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: TypeScript mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="javascript.js"></script> - <link rel="stylesheet" href="../../doc/docs.css"> - <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> - </head> - <body> - <h1>CodeMirror: TypeScript mode</h1> - -<div><textarea id="code" name="code"> -class Greeter { - greeting: string; - constructor (message: string) { - this.greeting = message; - } - greet() { - return "Hello, " + this.greeting; - } -} - -var greeter = new Greeter("world"); - -var button = document.createElement('button') -button.innerText = "Say Hello" -button.onclick = function() { - alert(greeter.greet()) -} - -document.body.appendChild(button) - -</textarea></div> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - matchBrackets: true, - mode: "text/typescript" - }); - </script> - - <p>This is a specialization of the <a href="index.html">JavaScript mode</a>.</p> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/jinja2/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/jinja2/index.html deleted file mode 100644 index 7cd1da2335a245730dc5fe94ca6d74d5e9e444a5..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/jinja2/index.html +++ /dev/null @@ -1,38 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Jinja2 mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="jinja2.js"></script> - <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> - <link rel="stylesheet" href="../../doc/docs.css"> - </head> - <body> - <h1>CodeMirror: Jinja2 mode</h1> - <form><textarea id="code" name="code"> -<html style="color: green"> - <!-- this is a comment --> - <head> - <title>Jinja2 Example</title> - </head> - <body> - <ul> - {# this is a comment #} - {%- for item in li -%} - <li> - {{ item.label }} - </li> - {% endfor -%} - </ul> - </body> -</html> -</textarea></form> - <script> - var editor = - CodeMirror.fromTextArea(document.getElementById("code"), {mode: - {name: "jinja2", htmlMode: true}}); - </script> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/jinja2/jinja2.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/jinja2/jinja2.js deleted file mode 100644 index 1472d398f2fc2b480991a35a12f39f57baffb860..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/jinja2/jinja2.js +++ /dev/null @@ -1,42 +0,0 @@ -CodeMirror.defineMode("jinja2", function() { - var keywords = ["block", "endblock", "for", "endfor", "in", "true", "false", - "loop", "none", "self", "super", "if", "as", "not", "and", - "else", "import", "with", "without", "context"]; - keywords = new RegExp("^((" + keywords.join(")|(") + "))\\b"); - - function tokenBase (stream, state) { - var ch = stream.next(); - if (ch == "{") { - if (ch = stream.eat(/\{|%|#/)) { - stream.eat("-"); - state.tokenize = inTag(ch); - return "tag"; - } - } - } - function inTag (close) { - if (close == "{") { - close = "}"; - } - return function (stream, state) { - var ch = stream.next(); - if ((ch == close || (ch == "-" && stream.eat(close))) - && stream.eat("}")) { - state.tokenize = tokenBase; - return "tag"; - } - if (stream.match(keywords)) { - return "keyword"; - } - return close == "#" ? "comment" : "string"; - }; - } - return { - startState: function () { - return {tokenize: tokenBase}; - }, - token: function (stream, state) { - return state.tokenize(stream, state); - } - }; -}); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/less/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/less/index.html deleted file mode 100644 index 7f27cf30e95aa14a5f206be15923543cdfbc8f4c..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/less/index.html +++ /dev/null @@ -1,741 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: LESS mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="../../lib/util/matchbrackets.js"></script> - <script src="less.js"></script> - <style>.CodeMirror {background: #f8f8f8; border: 1px solid #ddd; font-size:12px; height: 400px}</style> - <link rel="stylesheet" href="../../doc/docs.css"> - <link rel="stylesheet" href="../../theme/lesser-dark.css"> - </head> - <body> - <h1>CodeMirror: LESS mode</h1> - <form><textarea id="code" name="code">@media screen and (device-aspect-ratio: 16/9) { … } -@media screen and (device-aspect-ratio: 32/18) { … } -@media screen and (device-aspect-ratio: 1280/720) { … } -@media screen and (device-aspect-ratio: 2560/1440) { … } - -html:lang(fr-be) -html:lang(de) -:lang(fr-be) > q -:lang(de) > q - -tr:nth-child(2n+1) /* represents every odd row of an HTML table */ -tr:nth-child(odd) /* same */ -tr:nth-child(2n+0) /* represents every even row of an HTML table */ -tr:nth-child(even) /* same */ - -/* Alternate paragraph colours in CSS */ -p:nth-child(4n+1) { color: navy; } -p:nth-child(4n+2) { color: green; } -p:nth-child(4n+3) { color: maroon; } -p:nth-child(4n+4) { color: purple; } - -:nth-child(10n-1) /* represents the 9th, 19th, 29th, etc, element */ -:nth-child(10n+9) /* Same */ -:nth-child(10n+-1) /* Syntactically invalid, and would be ignored */ - -:nth-child( 3n + 1 ) -:nth-child( +3n - 2 ) -:nth-child( -n+ 6) -:nth-child( +6 ) - -html|tr:nth-child(-n+6) /* represents the 6 first rows of XHTML tables */ - -img:nth-of-type(2n+1) { float: right; } -img:nth-of-type(2n) { float: left; } - -body > h2:nth-of-type(n+2):nth-last-of-type(n+2) -body > h2:not(:first-of-type):not(:last-of-type) - -html|*:not(:link):not(:visited) -*|*:not(:hover) -p::first-line { text-transform: uppercase } - -p { color: red; font-size: 12pt } -p::first-letter { color: green; font-size: 200% } -p::first-line { color: blue } - -p { line-height: 1.1 } -p::first-letter { font-size: 3em; font-weight: normal } -span { font-weight: bold } - -* /* a=0 b=0 c=0 -> specificity = 0 */ -LI /* a=0 b=0 c=1 -> specificity = 1 */ -UL LI /* a=0 b=0 c=2 -> specificity = 2 */ -UL OL+LI /* a=0 b=0 c=3 -> specificity = 3 */ -H1 + *[REL=up] /* a=0 b=1 c=1 -> specificity = 11 */ -UL OL LI.red /* a=0 b=1 c=3 -> specificity = 13 */ -LI.red.level /* a=0 b=2 c=1 -> specificity = 21 */ -#x34y /* a=1 b=0 c=0 -> specificity = 100 */ -#s12:not(FOO) /* a=1 b=0 c=1 -> specificity = 101 */ - -@namespace foo url(http://www.example.com); -foo|h1 { color: blue } /* first rule */ -foo|* { color: yellow } /* second rule */ -|h1 { color: red } /* ...*/ -*|h1 { color: green } -h1 { color: green } - -span[hello="Ocean"][goodbye="Land"] - -a[rel~="copyright"] { ... } -a[href="http://www.w3.org/"] { ... } - -DIALOGUE[character=romeo] -DIALOGUE[character=juliet] - -[att^=val] -[att$=val] -[att*=val] - -@namespace foo "http://www.example.com"; -[foo|att=val] { color: blue } -[*|att] { color: yellow } -[|att] { color: green } -[att] { color: green } - - -*:target { color : red } -*:target::before { content : url(target.png) } - -E[foo]{ - padding:65px; -} -E[foo] ~ F{ - padding:65px; -} -E#myid{ - padding:65px; -} -input[type="search"]::-webkit-search-decoration, -input[type="search"]::-webkit-search-cancel-button { - -webkit-appearance: none; // Inner-padding issues in Chrome OSX, Safari 5 -} -button::-moz-focus-inner, -input::-moz-focus-inner { // Inner padding and border oddities in FF3/4 - padding: 0; - border: 0; -} -.btn { - // reset here as of 2.0.3 due to Recess property order - border-color: #ccc; - border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25); -} -fieldset span button, fieldset span input[type="file"] { - font-size:12px; - font-family:Arial, Helvetica, sans-serif; -} -.el tr:nth-child(even):last-child td:first-child{ - -moz-border-radius-bottomleft:3px; - -webkit-border-bottom-left-radius:3px; - border-bottom-left-radius:3px; -} - -/* Some LESS code */ - -button { - width: 32px; - height: 32px; - border: 0; - margin: 4px; - cursor: pointer; -} -button.icon-plus { background: url(http://dahlström.net/tmp/sharp-icons/svg-icon-target.svg#plus) no-repeat; } -button.icon-chart { background: url(http://dahlström.net/tmp/sharp-icons/svg-icon-target.svg#chart) no-repeat; } - -button:hover { background-color: #999; } -button:active { background-color: #666; } - -@test_a: #eeeQQQ;//this is not a valid hex value and thus parsed as an element id -@test_b: #eeeFFF //this is a valid hex value but the declaration doesn't end with a semicolon and thus parsed as an element id - -#eee aaa .box -{ - #test bbb { - width: 500px; - height: 250px; - background-image: url(dir/output/sheep.png), url( betweengrassandsky.png ); - background-position: center bottom, left top; - background-repeat: no-repeat; - } -} - -@base: #f938ab; - -.box-shadow(@style, @c) when (iscolor(@c)) { - box-shadow: @style @c; - -webkit-box-shadow: @style @c; - -moz-box-shadow: @style @c; -} -.box-shadow(@style, @alpha: 50%) when (isnumber(@alpha)) { - .box-shadow(@style, rgba(0, 0, 0, @alpha)); -} - -@color: #4D926F; - -#header { - color: @color; - color: #000000; -} -h2 { - color: @color; -} - -.rounded-corners (@radius: 5px) { - border-radius: @radius; - -webkit-border-radius: @radius; - -moz-border-radius: @radius; -} - -#header { - .rounded-corners; -} -#footer { - .rounded-corners(10px); -} - -.box-shadow (@x: 0, @y: 0, @blur: 1px, @alpha) { - @val: @x @y @blur rgba(0, 0, 0, @alpha); - - box-shadow: @val; - -webkit-box-shadow: @val; - -moz-box-shadow: @val; -} -.box { @base: #f938ab; - color: saturate(@base, 5%); - border-color: lighten(@base, 30%); - div { .box-shadow(0, 0, 5px, 0.4) } -} - -@import url("something.css"); - -@light-blue: hsl(190, 50%, 65%); -@light-yellow: desaturate(#fefec8, 10%); -@dark-yellow: desaturate(darken(@light-yellow, 10%), 40%); -@darkest: hsl(20, 0%, 15%); -@dark: hsl(190, 20%, 30%); -@medium: hsl(10, 60%, 30%); -@light: hsl(90, 40%, 20%); -@lightest: hsl(90, 20%, 90%); -@highlight: hsl(80, 50%, 90%); -@blue: hsl(210, 60%, 20%); -@alpha-blue: hsla(210, 60%, 40%, 0.5); - -.box-shadow (@x, @y, @blur, @alpha) { - @value: @x @y @blur rgba(0, 0, 0, @alpha); - box-shadow: @value; - -moz-box-shadow: @value; - -webkit-box-shadow: @value; -} -.border-radius (@radius) { - border-radius: @radius; - -moz-border-radius: @radius; - -webkit-border-radius: @radius; -} - -.border-radius (@radius, bottom) { - border-top-right-radius: 0; - border-top-left-radius: 0; - -moz-border-top-right-radius: 0; - -moz-border-top-left-radius: 0; - -webkit-border-top-left-radius: 0; - -webkit-border-top-right-radius: 0; -} -.border-radius (@radius, right) { - border-bottom-left-radius: 0; - border-top-left-radius: 0; - -moz-border-bottom-left-radius: 0; - -moz-border-top-left-radius: 0; - -webkit-border-bottom-left-radius: 0; - -webkit-border-top-left-radius: 0; -} -.box-shadow-inset (@x, @y, @blur, @color) { - box-shadow: @x @y @blur @color inset; - -moz-box-shadow: @x @y @blur @color inset; - -webkit-box-shadow: @x @y @blur @color inset; -} -.code () { - font-family: 'Bitstream Vera Sans Mono', - 'DejaVu Sans Mono', - 'Monaco', - Courier, - monospace !important; -} -.wrap () { - text-wrap: wrap; - white-space: pre-wrap; /* css-3 */ - white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ - white-space: -pre-wrap; /* Opera 4-6 */ - white-space: -o-pre-wrap; /* Opera 7 */ - word-wrap: break-word; /* Internet Explorer 5.5+ */ -} - -html { margin: 0 } -body { - background-color: @darkest; - margin: 0 auto; - font-family: Arial, sans-serif; - font-size: 100%; - overflow-x: hidden; -} -nav, header, footer, section, article { - display: block; -} -a { - color: #b83000; -} -h1 a { - color: black; - text-decoration: none; -} -a:hover { - text-decoration: underline; -} -h1, h2, h3, h4 { - margin: 0; - font-weight: normal; -} -ul, li { - list-style-type: none; -} -code { .code; } -code { - .string, .regexp { color: @dark } - .keyword { font-weight: bold } - .comment { color: rgba(0, 0, 0, 0.5) } - .number { color: @blue } - .class, .special { color: rgba(0, 50, 100, 0.8) } -} -pre { - padding: 0 30px; - .wrap; -} -blockquote { - font-style: italic; -} -body > footer { - text-align: left; - margin-left: 10px; - font-style: italic; - font-size: 18px; - color: #888; -} - -#logo { - margin-top: 30px; - margin-bottom: 30px; - display: block; - width: 199px; - height: 81px; - background: url(/images/logo.png) no-repeat; -} -nav { - margin-left: 15px; -} -nav a, #dropdown li { - display: inline-block; - color: white; - line-height: 42px; - margin: 0; - padding: 0px 15px; - text-shadow: -1px -1px 1px rgba(0, 0, 0, 0.5); - text-decoration: none; - border: 2px solid transparent; - border-width: 0 2px; - &:hover { - .dark-red; - text-decoration: none; - } -} -.dark-red { - @red: @medium; - border: 2px solid darken(@red, 25%); - border-left-color: darken(@red, 15%); - border-right-color: darken(@red, 15%); - border-bottom: 0; - border-top: 0; - background-color: darken(@red, 10%); -} - -.content { - margin: 0 auto; - width: 980px; -} - -#menu { - position: absolute; - width: 100%; - z-index: 3; - clear: both; - display: block; - background-color: @blue; - height: 42px; - border-top: 2px solid lighten(@alpha-blue, 20%); - border-bottom: 2px solid darken(@alpha-blue, 25%); - .box-shadow(0, 1px, 8px, 0.6); - -moz-box-shadow: 0 0 0 #000; // Because firefox sucks. - - &.docked { - background-color: hsla(210, 60%, 40%, 0.4); - } - &:hover { - background-color: @blue; - } - - #dropdown { - margin: 0 0 0 117px; - padding: 0; - padding-top: 5px; - display: none; - width: 190px; - border-top: 2px solid @medium; - color: @highlight; - border: 2px solid darken(@medium, 25%); - border-left-color: darken(@medium, 15%); - border-right-color: darken(@medium, 15%); - border-top-width: 0; - background-color: darken(@medium, 10%); - ul { - padding: 0px; - } - li { - font-size: 14px; - display: block; - text-align: left; - padding: 0; - border: 0; - a { - display: block; - padding: 0px 15px; - text-decoration: none; - color: white; - &:hover { - background-color: darken(@medium, 15%); - text-decoration: none; - } - } - } - .border-radius(5px, bottom); - .box-shadow(0, 6px, 8px, 0.5); - } -} - -#main { - margin: 0 auto; - width: 100%; - background-color: @light-blue; - border-top: 8px solid darken(@light-blue, 5%); - - #intro { - background-color: lighten(@light-blue, 25%); - float: left; - margin-top: -8px; - margin-right: 5px; - - height: 380px; - position: relative; - z-index: 2; - font-family: 'Droid Serif', 'Georgia'; - width: 395px; - padding: 45px 20px 23px 30px; - border: 2px dashed darken(@light-blue, 10%); - .box-shadow(1px, 0px, 6px, 0.5); - border-bottom: 0; - border-top: 0; - #download { color: transparent; border: 0; float: left; display: inline-block; margin: 15px 0 15px -5px; } - #download img { display: inline-block} - #download-info { - code { - font-size: 13px; - } - color: @blue + #333; display: inline; float: left; margin: 36px 0 0 15px } - } - h2 { - span { - color: @medium; - } - color: @blue; - margin: 20px 0; - font-size: 24px; - line-height: 1.2em; - } - h3 { - color: @blue; - line-height: 1.4em; - margin: 30px 0 15px 0; - font-size: 1em; - text-shadow: 0px 0px 0px @lightest; - span { color: @medium } - } - #example { - p { - font-size: 18px; - color: @blue; - font-weight: bold; - text-shadow: 0px 1px 1px @lightest; - } - pre { - margin: 0; - text-shadow: 0 -1px 1px @darkest; - margin-top: 20px; - background-color: desaturate(@darkest, 8%); - border: 0; - width: 450px; - color: lighten(@lightest, 2%); - background-repeat: repeat; - padding: 15px; - border: 1px dashed @lightest; - line-height: 15px; - .box-shadow(0, 0px, 15px, 0.5); - .code; - .border-radius(2px); - code .attribute { color: hsl(40, 50%, 70%) } - code .variable { color: hsl(120, 10%, 50%) } - code .element { color: hsl(170, 20%, 50%) } - - code .string, .regexp { color: hsl(75, 50%, 65%) } - code .class { color: hsl(40, 40%, 60%); font-weight: normal } - code .id { color: hsl(50, 40%, 60%); font-weight: normal } - code .comment { color: rgba(255, 255, 255, 0.2) } - code .number, .color { color: hsl(10, 40%, 50%) } - code .class, code .mixin, .special { color: hsl(190, 20%, 50%) } - #time { color: #aaa } - } - float: right; - font-size: 12px; - margin: 0; - margin-top: 15px; - padding: 0; - width: 500px; - } -} - - -.page { - .content { - width: 870px; - padding: 45px; - } - margin: 0 auto; - font-family: 'Georgia', serif; - font-size: 18px; - line-height: 26px; - padding: 0 60px; - code { - font-size: 16px; - } - pre { - border-width: 1px; - border-style: dashed; - padding: 15px; - margin: 15px 0; - } - h1 { - text-align: left; - font-size: 40px; - margin-top: 15px; - margin-bottom: 35px; - } - p + h1 { margin-top: 60px } - h2, h3 { - margin: 30px 0 15px 0; - } - p + h2, pre + h2, code + h2 { - border-top: 6px solid rgba(255, 255, 255, 0.1); - padding-top: 30px; - } - h3 { - margin: 15px 0; - } -} - - -#docs { - @bg: lighten(@light-blue, 5%); - border-top: 2px solid lighten(@bg, 5%); - color: @blue; - background-color: @light-blue; - .box-shadow(0, -2px, 5px, 0.2); - - h1 { - font-family: 'Droid Serif', 'Georgia', serif; - padding-top: 30px; - padding-left: 45px; - font-size: 44px; - text-align: left; - margin: 30px 0 !important; - text-shadow: 0px 1px 1px @lightest; - font-weight: bold; - } - .content { - clear: both; - border-color: transparent; - background-color: lighten(@light-blue, 25%); - .box-shadow(0, 5px, 5px, 0.4); - } - pre { - @background: lighten(@bg, 30%); - color: lighten(@blue, 10%); - background-color: @background; - border-color: lighten(@light-blue, 25%); - border-width: 2px; - code .attribute { color: hsl(40, 50%, 30%) } - code .variable { color: hsl(120, 10%, 30%) } - code .element { color: hsl(170, 20%, 30%) } - - code .string, .regexp { color: hsl(75, 50%, 35%) } - code .class { color: hsl(40, 40%, 30%); font-weight: normal } - code .id { color: hsl(50, 40%, 30%); font-weight: normal } - code .comment { color: rgba(0, 0, 0, 0.4) } - code .number, .color { color: hsl(10, 40%, 30%) } - code .class, code .mixin, .special { color: hsl(190, 20%, 30%) } - } - pre code { font-size: 15px } - p + h2, pre + h2, code + h2 { border-top-color: rgba(0, 0, 0, 0.1) } -} - -td { - padding-right: 30px; -} -#synopsis { - .box-shadow(0, 5px, 5px, 0.2); -} -#synopsis, #about { - h2 { - font-size: 30px; - padding: 10px 0; - } - h1 + h2 { - margin-top: 15px; - } - h3 { font-size: 22px } - - .code-example { - border-spacing: 0; - border-width: 1px; - border-style: dashed; - padding: 0; - pre { border: 0; margin: 0 } - td { - border: 0; - margin: 0; - background-color: desaturate(darken(@darkest, 5%), 20%); - vertical-align: top; - padding: 0; - } - tr { padding: 0 } - } - .css-output { - td { - border-left: 0; - } - } - .less-example { - //border-right: 1px dotted rgba(255, 255, 255, 0.5) !important; - } - .css-output, .less-example { - width: 390px; - } - pre { - padding: 20px; - line-height: 20px; - font-size: 14px; - } -} -#about, #synopsis, #guide { - a { - text-decoration: none; - color: @light-yellow; - border-bottom: 1px dashed rgba(255, 255, 255, 0.2); - &:hover { - text-decoration: none; - border-bottom: 1px dashed @light-yellow; - } - } - @bg: desaturate(darken(@darkest, 5%), 20%); - text-shadow: 0 -1px 1px lighten(@bg, 5%); - color: @highlight; - background-color: @bg; - .content { - background-color: desaturate(@darkest, 20%); - clear: both; - .box-shadow(0, 5px, 5px, 0.4); - } - h1, h2, h3 { - color: @dark-yellow; - } - pre { - code .attribute { color: hsl(40, 50%, 70%) } - code .variable { color: hsl(120, 10%, 50%) } - code .element { color: hsl(170, 20%, 50%) } - - code .string, .regexp { color: hsl(75, 50%, 65%) } - code .class { color: hsl(40, 40%, 60%); font-weight: normal } - code .id { color: hsl(50, 40%, 60%); font-weight: normal } - code .comment { color: rgba(255, 255, 255, 0.2) } - code .number, .color { color: hsl(10, 40%, 50%) } - code .class, code .mixin, .special { color: hsl(190, 20%, 50%) } - background-color: @bg; - border-color: darken(@light-yellow, 5%); - } - code { - color: darken(@dark-yellow, 5%); - .string, .regexp { color: desaturate(@light-blue, 15%) } - .keyword { color: hsl(40, 40%, 60%); font-weight: normal } - .comment { color: rgba(255, 255, 255, 0.2) } - .number { color: lighten(@blue, 10%) } - .class, .special { color: hsl(190, 20%, 50%) } - } -} -#guide { - background-color: @darkest; - .content { - background-color: transparent; - } - -} - -#about { - background-color: @darkest !important; - .content { - background-color: desaturate(lighten(@darkest, 3%), 5%); - } -} -#synopsis { - background-color: desaturate(lighten(@darkest, 3%), 5%) !important; - .content { - background-color: desaturate(lighten(@darkest, 3%), 5%); - } - pre {} -} -#synopsis, #guide { - .content { - .box-shadow(0, 0px, 0px, 0.0); - } -} -#about footer { - margin-top: 30px; - padding-top: 30px; - border-top: 6px solid rgba(0, 0, 0, 0.1); - text-align: center; - font-size: 16px; - color: rgba(255, 255, 255, 0.35); - #copy { font-size: 12px } - text-shadow: -1px -1px 1px rgba(0, 0, 0, 0.02); -} -</textarea></form> - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - theme: "lesser-dark", - lineNumbers : true, - matchBrackets : true - }); - </script> - - <p><strong>MIME types defined:</strong> <code>text/x-less</code>, <code>text/css</code> (if not previously defined).</p> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/less/less.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/less/less.js deleted file mode 100644 index 70cd5c937b3fbc208c8aacbb6fd8d81b33795bf5..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/less/less.js +++ /dev/null @@ -1,266 +0,0 @@ -/* - LESS mode - http://www.lesscss.org/ - Ported to CodeMirror by Peter Kroon <plakroon@gmail.com> - Report bugs/issues here: https://github.com/marijnh/CodeMirror/issues GitHub: @peterkroon -*/ - -CodeMirror.defineMode("less", function(config) { - var indentUnit = config.indentUnit, type; - function ret(style, tp) {type = tp; return style;} - //html tags - var tags = "a abbr acronym address applet area article aside audio b base basefont bdi bdo big blockquote body br button canvas caption cite code col colgroup command datalist dd del details dfn dir div dl dt em embed fieldset figcaption figure font footer form frame frameset h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe img input ins keygen kbd label legend li link map mark menu meta meter nav noframes noscript object ol optgroup option output p param pre progress q rp rt ruby s samp script section select small source span strike strong style sub summary sup table tbody td textarea tfoot th thead time title tr track tt u ul var video wbr".split(' '); - - function inTagsArray(val){ - for(var i=0; i<tags.length; i++)if(val === tags[i])return true; - } - - var selectors = /(^\:root$|^\:nth\-child$|^\:nth\-last\-child$|^\:nth\-of\-type$|^\:nth\-last\-of\-type$|^\:first\-child$|^\:last\-child$|^\:first\-of\-type$|^\:last\-of\-type$|^\:only\-child$|^\:only\-of\-type$|^\:empty$|^\:link|^\:visited$|^\:active$|^\:hover$|^\:focus$|^\:target$|^\:lang$|^\:enabled^\:disabled$|^\:checked$|^\:first\-line$|^\:first\-letter$|^\:before$|^\:after$|^\:not$|^\:required$|^\:invalid$)/; - - function tokenBase(stream, state) { - var ch = stream.next(); - - if (ch == "@") {stream.eatWhile(/[\w\-]/); return ret("meta", stream.current());} - else if (ch == "/" && stream.eat("*")) { - state.tokenize = tokenCComment; - return tokenCComment(stream, state); - } - else if (ch == "<" && stream.eat("!")) { - state.tokenize = tokenSGMLComment; - return tokenSGMLComment(stream, state); - } - else if (ch == "=") ret(null, "compare"); - else if (ch == "|" && stream.eat("=")) return ret(null, "compare"); - else if (ch == "\"" || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - else if (ch == "/") { // e.g.: .png will not be parsed as a class - if(stream.eat("/")){ - state.tokenize = tokenSComment; - return tokenSComment(stream, state); - }else{ - if(type == "string" || type == "(")return ret("string", "string"); - if(state.stack[state.stack.length-1] != undefined)return ret(null, ch); - stream.eatWhile(/[\a-zA-Z0-9\-_.\s]/); - if( /\/|\)|#/.test(stream.peek() || (stream.eatSpace() && stream.peek() == ")")) || stream.eol() )return ret("string", "string"); // let url(/images/logo.png) without quotes return as string - } - } - else if (ch == "!") { - stream.match(/^\s*\w*/); - return ret("keyword", "important"); - } - else if (/\d/.test(ch)) { - stream.eatWhile(/[\w.%]/); - return ret("number", "unit"); - } - else if (/[,+<>*\/]/.test(ch)) { - if(stream.peek() == "=" || type == "a")return ret("string", "string"); - return ret(null, "select-op"); - } - else if (/[;{}:\[\]()~\|]/.test(ch)) { - if(ch == ":"){ - stream.eatWhile(/[a-z\\\-]/); - if( selectors.test(stream.current()) ){ - return ret("tag", "tag"); - }else if(stream.peek() == ":"){//::-webkit-search-decoration - stream.next(); - stream.eatWhile(/[a-z\\\-]/); - if(stream.current().match(/\:\:\-(o|ms|moz|webkit)\-/))return ret("string", "string"); - if( selectors.test(stream.current().substring(1)) )return ret("tag", "tag"); - return ret(null, ch); - }else{ - return ret(null, ch); - } - }else if(ch == "~"){ - if(type == "r")return ret("string", "string"); - }else{ - return ret(null, ch); - } - } - else if (ch == ".") { - if(type == "(" || type == "string")return ret("string", "string"); // allow url(../image.png) - stream.eatWhile(/[\a-zA-Z0-9\-_]/); - if(stream.peek() == " ")stream.eatSpace(); - if(stream.peek() == ")")return ret("number", "unit");//rgba(0,0,0,.25); - return ret("tag", "tag"); - } - else if (ch == "#") { - //we don't eat white-space, we want the hex color and or id only - stream.eatWhile(/[A-Za-z0-9]/); - //check if there is a proper hex color length e.g. #eee || #eeeEEE - if(stream.current().length == 4 || stream.current().length == 7){ - if(stream.current().match(/[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/,false) != null){//is there a valid hex color value present in the current stream - //when not a valid hex value, parse as id - if(stream.current().substring(1) != stream.current().match(/[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/,false))return ret("atom", "tag"); - //eat white-space - stream.eatSpace(); - //when hex value declaration doesn't end with [;,] but is does with a slash/cc comment treat it as an id, just like the other hex values that don't end with[;,] - if( /[\/<>.(){!$%^&*_\-\\?=+\|#'~`]/.test(stream.peek()) )return ret("atom", "tag"); - //#time { color: #aaa } - else if(stream.peek() == "}" )return ret("number", "unit"); - //we have a valid hex color value, parse as id whenever an element/class is defined after the hex(id) value e.g. #eee aaa || #eee .aaa - else if( /[a-zA-Z\\]/.test(stream.peek()) )return ret("atom", "tag"); - //when a hex value is on the end of a line, parse as id - else if(stream.eol())return ret("atom", "tag"); - //default - else return ret("number", "unit"); - }else{//when not a valid hexvalue in the current stream e.g. #footer - stream.eatWhile(/[\w\\\-]/); - return ret("atom", "tag"); - } - }else{//when not a valid hexvalue length - stream.eatWhile(/[\w\\\-]/); - return ret("atom", "tag"); - } - } - else if (ch == "&") { - stream.eatWhile(/[\w\-]/); - return ret(null, ch); - } - else { - stream.eatWhile(/[\w\\\-_%.{]/); - if(type == "string"){ - return ret("string", "string"); - }else if(stream.current().match(/(^http$|^https$)/) != null){ - stream.eatWhile(/[\w\\\-_%.{:\/]/); - return ret("string", "string"); - }else if(stream.peek() == "<" || stream.peek() == ">"){ - return ret("tag", "tag"); - }else if( /\(/.test(stream.peek()) ){ - return ret(null, ch); - }else if (stream.peek() == "/" && state.stack[state.stack.length-1] != undefined){ // url(dir/center/image.png) - return ret("string", "string"); - }else if( stream.current().match(/\-\d|\-.\d/) ){ // match e.g.: -5px -0.4 etc... only colorize the minus sign - //commment out these 2 comment if you want the minus sign to be parsed as null -500px - //stream.backUp(stream.current().length-1); - //return ret(null, ch); //console.log( stream.current() ); - return ret("number", "unit"); - }else if( inTagsArray(stream.current().toLowerCase()) ){ // match html tags - return ret("tag", "tag"); - }else if( /\/|[\s\)]/.test(stream.peek() || stream.eol() || (stream.eatSpace() && stream.peek() == "/")) && stream.current().indexOf(".") !== -1){ - if(stream.current().substring(stream.current().length-1,stream.current().length) == "{"){ - stream.backUp(1); - return ret("tag", "tag"); - }//end if - stream.eatSpace(); - if( /[{<>.a-zA-Z\/]/.test(stream.peek()) || stream.eol() )return ret("tag", "tag"); // e.g. button.icon-plus - return ret("string", "string"); // let url(/images/logo.png) without quotes return as string - }else if( stream.eol() || stream.peek() == "[" || stream.peek() == "#" || type == "tag" ){ - if(stream.current().substring(stream.current().length-1,stream.current().length) == "{")stream.backUp(1); - return ret("tag", "tag"); - }else if(type == "compare" || type == "a" || type == "("){ - return ret("string", "string"); - }else if(type == "|" || stream.current() == "-" || type == "["){ - return ret(null, ch); - }else if(stream.peek() == ":") { - stream.next(); - var t_v = stream.peek() == ":" ? true : false; - if(!t_v){ - var old_pos = stream.pos; - var sc = stream.current().length; - stream.eatWhile(/[a-z\\\-]/); - var new_pos = stream.pos; - if(stream.current().substring(sc-1).match(selectors) != null){ - stream.backUp(new_pos-(old_pos-1)); - return ret("tag", "tag"); - } else stream.backUp(new_pos-(old_pos-1)); - }else{ - stream.backUp(1); - } - if(t_v)return ret("tag", "tag"); else return ret("variable", "variable"); - }else{ - return ret("variable", "variable"); - } - } - } - - function tokenSComment(stream, state) { // SComment = Slash comment - stream.skipToEnd(); - state.tokenize = tokenBase; - return ret("comment", "comment"); - } - - function tokenCComment(stream, state) { - var maybeEnd = false, ch; - while ((ch = stream.next()) != null) { - if (maybeEnd && ch == "/") { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return ret("comment", "comment"); - } - - function tokenSGMLComment(stream, state) { - var dashes = 0, ch; - while ((ch = stream.next()) != null) { - if (dashes >= 2 && ch == ">") { - state.tokenize = tokenBase; - break; - } - dashes = (ch == "-") ? dashes + 1 : 0; - } - return ret("comment", "comment"); - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) - break; - escaped = !escaped && ch == "\\"; - } - if (!escaped) state.tokenize = tokenBase; - return ret("string", "string"); - }; - } - - return { - startState: function(base) { - return {tokenize: tokenBase, - baseIndent: base || 0, - stack: []}; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - - var context = state.stack[state.stack.length-1]; - if (type == "hash" && context == "rule") style = "atom"; - else if (style == "variable") { - if (context == "rule") style = null; //"tag" - else if (!context || context == "@media{") { - style = stream.current() == "when" ? "variable" : - /[\s,|\s\)|\s]/.test(stream.peek()) ? "tag" : type; - } - } - - if (context == "rule" && /^[\{\};]$/.test(type)) - state.stack.pop(); - if (type == "{") { - if (context == "@media") state.stack[state.stack.length-1] = "@media{"; - else state.stack.push("{"); - } - else if (type == "}") state.stack.pop(); - else if (type == "@media") state.stack.push("@media"); - else if (context == "{" && type != "comment") state.stack.push("rule"); - return style; - }, - - indent: function(state, textAfter) { - var n = state.stack.length; - if (/^\}/.test(textAfter)) - n -= state.stack[state.stack.length-1] == "rule" ? 2 : 1; - return state.baseIndent + n * indentUnit; - }, - - electricChars: "}" - }; -}); - -CodeMirror.defineMIME("text/x-less", "less"); -if (!CodeMirror.mimeModes.hasOwnProperty("text/css")) - CodeMirror.defineMIME("text/css", "less"); \ No newline at end of file diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/lua/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/lua/index.html deleted file mode 100644 index df83f9b47d1e85e6aa2eac19d7bfe7ae00f2bf69..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/lua/index.html +++ /dev/null @@ -1,74 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Lua mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/util/matchbrackets.js"></script> - <script src="../../lib/codemirror.js"></script> - <script src="lua.js"></script> - <link rel="stylesheet" href="../../theme/neat.css"> - <style>.CodeMirror {border: 1px solid black;}</style> - <link rel="stylesheet" href="../../doc/docs.css"> - </head> - <body> - <h1>CodeMirror: Lua mode</h1> - <form><textarea id="code" name="code"> ---[[ -example useless code to show lua syntax highlighting -this is multiline comment -]] - -function blahblahblah(x) - - local table = { - "asd" = 123, - "x" = 0.34, - } - if x ~= 3 then - print( x ) - elseif x == "string" - my_custom_function( 0x34 ) - else - unknown_function( "some string" ) - end - - --single line comment - -end - -function blablabla3() - - for k,v in ipairs( table ) do - --abcde.. - y=[=[ - x=[[ - x is a multi line string - ]] - but its definition is iside a highest level string! - ]=] - print(" \"\" ") - - s = math.sin( x ) - end - -end -</textarea></form> - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - tabMode: "indent", - matchBrackets: true, - theme: "neat" - }); - </script> - - <p>Loosely based on Franciszek - Wawrzak's <a href="http://codemirror.net/1/contrib/lua">CodeMirror - 1 mode</a>. One configuration parameter is - supported, <code>specials</code>, to which you can provide an - array of strings to have those identifiers highlighted with - the <code>lua-special</code> style.</p> - <p><strong>MIME types defined:</strong> <code>text/x-lua</code>.</p> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/lua/lua.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/lua/lua.js deleted file mode 100644 index 97fb2c6f96dfcf896131106b490524874bc6a507..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/lua/lua.js +++ /dev/null @@ -1,140 +0,0 @@ -// LUA mode. Ported to CodeMirror 2 from Franciszek Wawrzak's -// CodeMirror 1 mode. -// highlights keywords, strings, comments (no leveling supported! ("[==[")), tokens, basic indenting - -CodeMirror.defineMode("lua", function(config, parserConfig) { - var indentUnit = config.indentUnit; - - function prefixRE(words) { - return new RegExp("^(?:" + words.join("|") + ")", "i"); - } - function wordRE(words) { - return new RegExp("^(?:" + words.join("|") + ")$", "i"); - } - var specials = wordRE(parserConfig.specials || []); - - // long list of standard functions from lua manual - var builtins = wordRE([ - "_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load", - "loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require", - "select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall", - - "coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield", - - "debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable", - "debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable", - "debug.setupvalue","debug.traceback", - - "close","flush","lines","read","seek","setvbuf","write", - - "io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin", - "io.stdout","io.tmpfile","io.type","io.write", - - "math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg", - "math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max", - "math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh", - "math.sqrt","math.tan","math.tanh", - - "os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale", - "os.time","os.tmpname", - - "package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload", - "package.seeall", - - "string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub", - "string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper", - - "table.concat","table.insert","table.maxn","table.remove","table.sort" - ]); - var keywords = wordRE(["and","break","elseif","false","nil","not","or","return", - "true","function", "end", "if", "then", "else", "do", - "while", "repeat", "until", "for", "in", "local" ]); - - var indentTokens = wordRE(["function", "if","repeat","do", "\\(", "{"]); - var dedentTokens = wordRE(["end", "until", "\\)", "}"]); - var dedentPartial = prefixRE(["end", "until", "\\)", "}", "else", "elseif"]); - - function readBracket(stream) { - var level = 0; - while (stream.eat("=")) ++level; - stream.eat("["); - return level; - } - - function normal(stream, state) { - var ch = stream.next(); - if (ch == "-" && stream.eat("-")) { - if (stream.eat("[") && stream.eat("[")) - return (state.cur = bracketed(readBracket(stream), "comment"))(stream, state); - stream.skipToEnd(); - return "comment"; - } - if (ch == "\"" || ch == "'") - return (state.cur = string(ch))(stream, state); - if (ch == "[" && /[\[=]/.test(stream.peek())) - return (state.cur = bracketed(readBracket(stream), "string"))(stream, state); - if (/\d/.test(ch)) { - stream.eatWhile(/[\w.%]/); - return "number"; - } - if (/[\w_]/.test(ch)) { - stream.eatWhile(/[\w\\\-_.]/); - return "variable"; - } - return null; - } - - function bracketed(level, style) { - return function(stream, state) { - var curlev = null, ch; - while ((ch = stream.next()) != null) { - if (curlev == null) {if (ch == "]") curlev = 0;} - else if (ch == "=") ++curlev; - else if (ch == "]" && curlev == level) { state.cur = normal; break; } - else curlev = null; - } - return style; - }; - } - - function string(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) break; - escaped = !escaped && ch == "\\"; - } - if (!escaped) state.cur = normal; - return "string"; - }; - } - - return { - startState: function(basecol) { - return {basecol: basecol || 0, indentDepth: 0, cur: normal}; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - var style = state.cur(stream, state); - var word = stream.current(); - if (style == "variable") { - if (keywords.test(word)) style = "keyword"; - else if (builtins.test(word)) style = "builtin"; - else if (specials.test(word)) style = "variable-2"; - } - if ((style != "comment") && (style != "string")){ - if (indentTokens.test(word)) ++state.indentDepth; - else if (dedentTokens.test(word)) --state.indentDepth; - } - return style; - }, - - indent: function(state, textAfter) { - var closing = dedentPartial.test(textAfter); - return state.basecol + indentUnit * (state.indentDepth - (closing ? 1 : 0)); - } - }; -}); - -CodeMirror.defineMIME("text/x-lua", "lua"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/markdown/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/markdown/index.html deleted file mode 100644 index 5d7452f1e83525fd03d7a21827e2aab71880098f..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/markdown/index.html +++ /dev/null @@ -1,344 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Markdown mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="../../lib/util/continuelist.js"></script> - <script src="../xml/xml.js"></script> - <script src="markdown.js"></script> - <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> - <link rel="stylesheet" href="../../doc/docs.css"> - </head> - <body> - <h1>CodeMirror: Markdown mode</h1> - -<!-- source: http://daringfireball.net/projects/markdown/basics.text --> -<form><textarea id="code" name="code"> -Markdown: Basics -================ - -<ul id="ProjectSubmenu"> - <li><a href="/projects/markdown/" title="Markdown Project Page">Main</a></li> - <li><a class="selected" title="Markdown Basics">Basics</a></li> - <li><a href="/projects/markdown/syntax" title="Markdown Syntax Documentation">Syntax</a></li> - <li><a href="/projects/markdown/license" title="Pricing and License Information">License</a></li> - <li><a href="/projects/markdown/dingus" title="Online Markdown Web Form">Dingus</a></li> -</ul> - - -Getting the Gist of Markdown's Formatting Syntax ------------------------------------------------- - -This page offers a brief overview of what it's like to use Markdown. -The [syntax page] [s] provides complete, detailed documentation for -every feature, but Markdown should be very easy to pick up simply by -looking at a few examples of it in action. The examples on this page -are written in a before/after style, showing example syntax and the -HTML output produced by Markdown. - -It's also helpful to simply try Markdown out; the [Dingus] [d] is a -web application that allows you type your own Markdown-formatted text -and translate it to XHTML. - -**Note:** This document is itself written using Markdown; you -can [see the source for it by adding '.text' to the URL] [src]. - - [s]: /projects/markdown/syntax "Markdown Syntax" - [d]: /projects/markdown/dingus "Markdown Dingus" - [src]: /projects/markdown/basics.text - - -## Paragraphs, Headers, Blockquotes ## - -A paragraph is simply one or more consecutive lines of text, separated -by one or more blank lines. (A blank line is any line that looks like -a blank line -- a line containing nothing but spaces or tabs is -considered blank.) Normal paragraphs should not be indented with -spaces or tabs. - -Markdown offers two styles of headers: *Setext* and *atx*. -Setext-style headers for `<h1>` and `<h2>` are created by -"underlining" with equal signs (`=`) and hyphens (`-`), respectively. -To create an atx-style header, you put 1-6 hash marks (`#`) at the -beginning of the line -- the number of hashes equals the resulting -HTML header level. - -Blockquotes are indicated using email-style '`>`' angle brackets. - -Markdown: - - A First Level Header - ==================== - - A Second Level Header - --------------------- - - Now is the time for all good men to come to - the aid of their country. This is just a - regular paragraph. - - The quick brown fox jumped over the lazy - dog's back. - - ### Header 3 - - > This is a blockquote. - > - > This is the second paragraph in the blockquote. - > - > ## This is an H2 in a blockquote - - -Output: - - <h1>A First Level Header</h1> - - <h2>A Second Level Header</h2> - - <p>Now is the time for all good men to come to - the aid of their country. This is just a - regular paragraph.</p> - - <p>The quick brown fox jumped over the lazy - dog's back.</p> - - <h3>Header 3</h3> - - <blockquote> - <p>This is a blockquote.</p> - - <p>This is the second paragraph in the blockquote.</p> - - <h2>This is an H2 in a blockquote</h2> - </blockquote> - - - -### Phrase Emphasis ### - -Markdown uses asterisks and underscores to indicate spans of emphasis. - -Markdown: - - Some of these words *are emphasized*. - Some of these words _are emphasized also_. - - Use two asterisks for **strong emphasis**. - Or, if you prefer, __use two underscores instead__. - -Output: - - <p>Some of these words <em>are emphasized</em>. - Some of these words <em>are emphasized also</em>.</p> - - <p>Use two asterisks for <strong>strong emphasis</strong>. - Or, if you prefer, <strong>use two underscores instead</strong>.</p> - - - -## Lists ## - -Unordered (bulleted) lists use asterisks, pluses, and hyphens (`*`, -`+`, and `-`) as list markers. These three markers are -interchangable; this: - - * Candy. - * Gum. - * Booze. - -this: - - + Candy. - + Gum. - + Booze. - -and this: - - - Candy. - - Gum. - - Booze. - -all produce the same output: - - <ul> - <li>Candy.</li> - <li>Gum.</li> - <li>Booze.</li> - </ul> - -Ordered (numbered) lists use regular numbers, followed by periods, as -list markers: - - 1. Red - 2. Green - 3. Blue - -Output: - - <ol> - <li>Red</li> - <li>Green</li> - <li>Blue</li> - </ol> - -If you put blank lines between items, you'll get `<p>` tags for the -list item text. You can create multi-paragraph list items by indenting -the paragraphs by 4 spaces or 1 tab: - - * A list item. - - With multiple paragraphs. - - * Another item in the list. - -Output: - - <ul> - <li><p>A list item.</p> - <p>With multiple paragraphs.</p></li> - <li><p>Another item in the list.</p></li> - </ul> - - - -### Links ### - -Markdown supports two styles for creating links: *inline* and -*reference*. With both styles, you use square brackets to delimit the -text you want to turn into a link. - -Inline-style links use parentheses immediately after the link text. -For example: - - This is an [example link](http://example.com/). - -Output: - - <p>This is an <a href="http://example.com/"> - example link</a>.</p> - -Optionally, you may include a title attribute in the parentheses: - - This is an [example link](http://example.com/ "With a Title"). - -Output: - - <p>This is an <a href="http://example.com/" title="With a Title"> - example link</a>.</p> - -Reference-style links allow you to refer to your links by names, which -you define elsewhere in your document: - - I get 10 times more traffic from [Google][1] than from - [Yahoo][2] or [MSN][3]. - - [1]: http://google.com/ "Google" - [2]: http://search.yahoo.com/ "Yahoo Search" - [3]: http://search.msn.com/ "MSN Search" - -Output: - - <p>I get 10 times more traffic from <a href="http://google.com/" - title="Google">Google</a> than from <a href="http://search.yahoo.com/" - title="Yahoo Search">Yahoo</a> or <a href="http://search.msn.com/" - title="MSN Search">MSN</a>.</p> - -The title attribute is optional. Link names may contain letters, -numbers and spaces, but are *not* case sensitive: - - I start my morning with a cup of coffee and - [The New York Times][NY Times]. - - [ny times]: http://www.nytimes.com/ - -Output: - - <p>I start my morning with a cup of coffee and - <a href="http://www.nytimes.com/">The New York Times</a>.</p> - - -### Images ### - -Image syntax is very much like link syntax. - -Inline (titles are optional): - -  - -Reference-style: - - ![alt text][id] - - [id]: /path/to/img.jpg "Title" - -Both of the above examples produce the same output: - - <img src="/path/to/img.jpg" alt="alt text" title="Title" /> - - - -### Code ### - -In a regular paragraph, you can create code span by wrapping text in -backtick quotes. Any ampersands (`&`) and angle brackets (`<` or -`>`) will automatically be translated into HTML entities. This makes -it easy to use Markdown to write about HTML example code: - - I strongly recommend against using any `<blink>` tags. - - I wish SmartyPants used named entities like `&mdash;` - instead of decimal-encoded entites like `&#8212;`. - -Output: - - <p>I strongly recommend against using any - <code>&lt;blink&gt;</code> tags.</p> - - <p>I wish SmartyPants used named entities like - <code>&amp;mdash;</code> instead of decimal-encoded - entites like <code>&amp;#8212;</code>.</p> - - -To specify an entire block of pre-formatted code, indent every line of -the block by 4 spaces or 1 tab. Just like with code spans, `&`, `<`, -and `>` characters will be escaped automatically. - -Markdown: - - If you want your page to validate under XHTML 1.0 Strict, - you've got to put paragraph tags in your blockquotes: - - <blockquote> - <p>For example.</p> - </blockquote> - -Output: - - <p>If you want your page to validate under XHTML 1.0 Strict, - you've got to put paragraph tags in your blockquotes:</p> - - <pre><code>&lt;blockquote&gt; - &lt;p&gt;For example.&lt;/p&gt; - &lt;/blockquote&gt; - </code></pre> -</textarea></form> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - mode: 'markdown', - lineNumbers: true, - theme: "default", - extraKeys: {"Enter": "newlineAndIndentContinueMarkdownList"} - }); - </script> - - <p>Optionally depends on the XML mode for properly highlighted inline XML blocks.</p> - - <p><strong>MIME types defined:</strong> <code>text/x-markdown</code>.</p> - - <p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#markdown_*">normal</a>, <a href="../../test/index.html#verbose,markdown_*">verbose</a>.</p> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/markdown/markdown.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/markdown/markdown.js deleted file mode 100644 index 34125c9c22b49cc35451a7ed87e0e633e994bfd7..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/markdown/markdown.js +++ /dev/null @@ -1,474 +0,0 @@ -CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { - - var htmlFound = CodeMirror.mimeModes.hasOwnProperty("text/html"); - var htmlMode = CodeMirror.getMode(cmCfg, htmlFound ? "text/html" : "text/plain"); - var aliases = { - html: "htmlmixed", - js: "javascript", - json: "application/json", - c: "text/x-csrc", - "c++": "text/x-c++src", - java: "text/x-java", - csharp: "text/x-csharp", - "c#": "text/x-csharp" - }; - - var getMode = (function () { - var i, modes = {}, mimes = {}, mime; - - var list = []; - for (var m in CodeMirror.modes) - if (CodeMirror.modes.propertyIsEnumerable(m)) list.push(m); - for (i = 0; i < list.length; i++) { - modes[list[i]] = list[i]; - } - var mimesList = []; - for (var m in CodeMirror.mimeModes) - if (CodeMirror.mimeModes.propertyIsEnumerable(m)) - mimesList.push({mime: m, mode: CodeMirror.mimeModes[m]}); - for (i = 0; i < mimesList.length; i++) { - mime = mimesList[i].mime; - mimes[mime] = mimesList[i].mime; - } - - for (var a in aliases) { - if (aliases[a] in modes || aliases[a] in mimes) - modes[a] = aliases[a]; - } - - return function (lang) { - return modes[lang] ? CodeMirror.getMode(cmCfg, modes[lang]) : null; - }; - }()); - - // Should underscores in words open/close em/strong? - if (modeCfg.underscoresBreakWords === undefined) - modeCfg.underscoresBreakWords = true; - - // Turn on fenced code blocks? ("```" to start/end) - if (modeCfg.fencedCodeBlocks === undefined) modeCfg.fencedCodeBlocks = false; - - var codeDepth = 0; - var prevLineHasContent = false - , thisLineHasContent = false; - - var header = 'header' - , code = 'comment' - , quote = 'quote' - , list = 'string' - , hr = 'hr' - , image = 'tag' - , linkinline = 'link' - , linkemail = 'link' - , linktext = 'link' - , linkhref = 'string' - , em = 'em' - , strong = 'strong' - , emstrong = 'emstrong'; - - var hrRE = /^([*\-=_])(?:\s*\1){2,}\s*$/ - , ulRE = /^[*\-+]\s+/ - , olRE = /^[0-9]+\.\s+/ - , headerRE = /^(?:\={1,}|-{1,})$/ - , textRE = /^[^!\[\]*_\\<>` "'(]+/; - - function switchInline(stream, state, f) { - state.f = state.inline = f; - return f(stream, state); - } - - function switchBlock(stream, state, f) { - state.f = state.block = f; - return f(stream, state); - } - - - // Blocks - - function blankLine(state) { - // Reset linkTitle state - state.linkTitle = false; - // Reset EM state - state.em = false; - // Reset STRONG state - state.strong = false; - // Reset state.quote - state.quote = false; - if (!htmlFound && state.f == htmlBlock) { - state.f = inlineNormal; - state.block = blockNormal; - } - return null; - } - - function blockNormal(stream, state) { - - if (state.list !== false && state.indentationDiff >= 0) { // Continued list - if (state.indentationDiff < 4) { // Only adjust indentation if *not* a code block - state.indentation -= state.indentationDiff; - } - state.list = null; - } else { // No longer a list - state.list = false; - } - - if (state.indentationDiff >= 4) { - state.indentation -= 4; - stream.skipToEnd(); - return code; - } else if (stream.eatSpace()) { - return null; - } else if (stream.peek() === '#' || (prevLineHasContent && stream.match(headerRE)) ) { - state.header = true; - } else if (stream.eat('>')) { - state.indentation++; - state.quote = true; - } else if (stream.peek() === '[') { - return switchInline(stream, state, footnoteLink); - } else if (stream.match(hrRE, true)) { - return hr; - } else if (stream.match(ulRE, true) || stream.match(olRE, true)) { - state.indentation += 4; - state.list = true; - } else if (modeCfg.fencedCodeBlocks && stream.match(/^```([\w+#]*)/, true)) { - // try switching mode - state.localMode = getMode(RegExp.$1); - if (state.localMode) state.localState = state.localMode.startState(); - switchBlock(stream, state, local); - return code; - } - - return switchInline(stream, state, state.inline); - } - - function htmlBlock(stream, state) { - var style = htmlMode.token(stream, state.htmlState); - if (htmlFound && style === 'tag' && state.htmlState.type !== 'openTag' && !state.htmlState.context) { - state.f = inlineNormal; - state.block = blockNormal; - } - if (state.md_inside && stream.current().indexOf(">")!=-1) { - state.f = inlineNormal; - state.block = blockNormal; - state.htmlState.context = undefined; - } - return style; - } - - function local(stream, state) { - if (stream.sol() && stream.match(/^```/, true)) { - state.localMode = state.localState = null; - state.f = inlineNormal; - state.block = blockNormal; - return code; - } else if (state.localMode) { - return state.localMode.token(stream, state.localState); - } else { - stream.skipToEnd(); - return code; - } - } - - // Inline - function getType(state) { - var styles = []; - - if (state.strong) { styles.push(state.em ? emstrong : strong); } - else if (state.em) { styles.push(em); } - - if (state.linkText) { styles.push(linktext); } - - if (state.code) { styles.push(code); } - - if (state.header) { styles.push(header); } - if (state.quote) { styles.push(quote); } - if (state.list !== false) { styles.push(list); } - - return styles.length ? styles.join(' ') : null; - } - - function handleText(stream, state) { - if (stream.match(textRE, true)) { - return getType(state); - } - return undefined; - } - - function inlineNormal(stream, state) { - var style = state.text(stream, state); - if (typeof style !== 'undefined') - return style; - - if (state.list) { // List marker (*, +, -, 1., etc) - state.list = null; - return list; - } - - var ch = stream.next(); - - if (ch === '\\') { - stream.next(); - return getType(state); - } - - // Matches link titles present on next line - if (state.linkTitle) { - state.linkTitle = false; - var matchCh = ch; - if (ch === '(') { - matchCh = ')'; - } - matchCh = (matchCh+'').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1"); - var regex = '^\\s*(?:[^' + matchCh + '\\\\]+|\\\\\\\\|\\\\.)' + matchCh; - if (stream.match(new RegExp(regex), true)) { - return linkhref; - } - } - - // If this block is changed, it may need to be updated in GFM mode - if (ch === '`') { - var t = getType(state); - var before = stream.pos; - stream.eatWhile('`'); - var difference = 1 + stream.pos - before; - if (!state.code) { - codeDepth = difference; - state.code = true; - return getType(state); - } else { - if (difference === codeDepth) { // Must be exact - state.code = false; - return t; - } - return getType(state); - } - } else if (state.code) { - return getType(state); - } - - if (ch === '!' && stream.match(/\[.*\] ?(?:\(|\[)/, false)) { - stream.match(/\[.*\]/); - state.inline = state.f = linkHref; - return image; - } - - if (ch === '[' && stream.match(/.*\](\(| ?\[)/, false)) { - state.linkText = true; - return getType(state); - } - - if (ch === ']' && state.linkText) { - var type = getType(state); - state.linkText = false; - state.inline = state.f = linkHref; - return type; - } - - if (ch === '<' && stream.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/, true)) { - return switchInline(stream, state, inlineElement(linkinline, '>')); - } - - if (ch === '<' && stream.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/, true)) { - return switchInline(stream, state, inlineElement(linkemail, '>')); - } - - if (ch === '<' && stream.match(/^\w/, false)) { - if (stream.string.indexOf(">")!=-1) { - var atts = stream.string.substring(1,stream.string.indexOf(">")); - if (/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(atts)) { - state.md_inside = true; - } - } - stream.backUp(1); - return switchBlock(stream, state, htmlBlock); - } - - if (ch === '<' && stream.match(/^\/\w*?>/)) { - state.md_inside = false; - return "tag"; - } - - var ignoreUnderscore = false; - if (!modeCfg.underscoresBreakWords) { - if (ch === '_' && stream.peek() !== '_' && stream.match(/(\w)/, false)) { - var prevPos = stream.pos - 2; - if (prevPos >= 0) { - var prevCh = stream.string.charAt(prevPos); - if (prevCh !== '_' && prevCh.match(/(\w)/, false)) { - ignoreUnderscore = true; - } - } - } - } - var t = getType(state); - if (ch === '*' || (ch === '_' && !ignoreUnderscore)) { - if (state.strong === ch && stream.eat(ch)) { // Remove STRONG - state.strong = false; - return t; - } else if (!state.strong && stream.eat(ch)) { // Add STRONG - state.strong = ch; - return getType(state); - } else if (state.em === ch) { // Remove EM - state.em = false; - return t; - } else if (!state.em) { // Add EM - state.em = ch; - return getType(state); - } - } else if (ch === ' ') { - if (stream.eat('*') || stream.eat('_')) { // Probably surrounded by spaces - if (stream.peek() === ' ') { // Surrounded by spaces, ignore - return getType(state); - } else { // Not surrounded by spaces, back up pointer - stream.backUp(1); - } - } - } - - return getType(state); - } - - function linkHref(stream, state) { - // Check if space, and return NULL if so (to avoid marking the space) - if(stream.eatSpace()){ - return null; - } - var ch = stream.next(); - if (ch === '(' || ch === '[') { - return switchInline(stream, state, inlineElement(linkhref, ch === '(' ? ')' : ']')); - } - return 'error'; - } - - function footnoteLink(stream, state) { - if (stream.match(/^[^\]]*\]:/, true)) { - state.f = footnoteUrl; - return linktext; - } - return switchInline(stream, state, inlineNormal); - } - - function footnoteUrl(stream, state) { - // Check if space, and return NULL if so (to avoid marking the space) - if(stream.eatSpace()){ - return null; - } - // Match URL - stream.match(/^[^\s]+/, true); - // Check for link title - if (stream.peek() === undefined) { // End of line, set flag to check next line - state.linkTitle = true; - } else { // More content on line, check if link title - stream.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/, true); - } - state.f = state.inline = inlineNormal; - return linkhref; - } - - var savedInlineRE = []; - function inlineRE(endChar) { - if (!savedInlineRE[endChar]) { - // Escape endChar for RegExp (taken from http://stackoverflow.com/a/494122/526741) - endChar = (endChar+'').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1"); - // Match any non-endChar, escaped character, as well as the closing - // endChar. - savedInlineRE[endChar] = new RegExp('^(?:[^\\\\]|\\\\.)*?(' + endChar + ')'); - } - return savedInlineRE[endChar]; - } - - function inlineElement(type, endChar, next) { - next = next || inlineNormal; - return function(stream, state) { - stream.match(inlineRE(endChar)); - state.inline = state.f = next; - return type; - }; - } - - return { - startState: function() { - prevLineHasContent = false; - thisLineHasContent = false; - return { - f: blockNormal, - - block: blockNormal, - htmlState: CodeMirror.startState(htmlMode), - indentation: 0, - - inline: inlineNormal, - text: handleText, - - linkText: false, - linkTitle: false, - em: false, - strong: false, - header: false, - list: false, - quote: false - }; - }, - - copyState: function(s) { - return { - f: s.f, - - block: s.block, - htmlState: CodeMirror.copyState(htmlMode, s.htmlState), - indentation: s.indentation, - - localMode: s.localMode, - localState: s.localMode ? CodeMirror.copyState(s.localMode, s.localState) : null, - - inline: s.inline, - text: s.text, - linkTitle: s.linkTitle, - em: s.em, - strong: s.strong, - header: s.header, - list: s.list, - quote: s.quote, - md_inside: s.md_inside - }; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (stream.match(/^\s*$/, true)) { - prevLineHasContent = false; - return blankLine(state); - } else { - if(thisLineHasContent){ - prevLineHasContent = true; - thisLineHasContent = false; - } - thisLineHasContent = true; - } - - // Reset state.header - state.header = false; - - // Reset state.code - state.code = false; - - state.f = state.block; - var indentation = stream.match(/^\s*/, true)[0].replace(/\t/g, ' ').length; - var difference = Math.floor((indentation - state.indentation) / 4) * 4; - if (difference > 4) difference = 4; - indentation = state.indentation + difference; - state.indentationDiff = indentation - state.indentation; - state.indentation = indentation; - if (indentation > 0) { return null; } - } - return state.f(stream, state); - }, - - blankLine: blankLine, - - getType: getType - }; - -}, "xml"); - -CodeMirror.defineMIME("text/x-markdown", "markdown"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/markdown/test.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/markdown/test.js deleted file mode 100644 index 7572db510b6a4ba4d0a5968aee769a8dd4e382ea..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/markdown/test.js +++ /dev/null @@ -1,1266 +0,0 @@ -// Initiate ModeTest and set defaults -var MT = ModeTest; -MT.modeName = 'markdown'; -MT.modeOptions = {}; - -MT.testMode( - 'plainText', - 'foo', - [ - null, 'foo' - ] -); - -// Code blocks using 4 spaces (regardless of CodeMirror.tabSize value) -MT.testMode( - 'codeBlocksUsing4Spaces', - ' foo', - [ - null, ' ', - 'comment', 'foo' - ] -); -// Code blocks using 4 spaces with internal indentation -MT.testMode( - 'codeBlocksUsing4SpacesIndentation', - ' bar\n hello\n world\n foo\nbar', - [ - null, ' ', - 'comment', 'bar', - null, ' ', - 'comment', 'hello', - null, ' ', - 'comment', 'world', - null, ' ', - 'comment', 'foo', - null, 'bar' - ] -); -// Code blocks using 4 spaces with internal indentation -MT.testMode( - 'codeBlocksUsing4SpacesIndentation', - ' foo\n bar\n hello\n world', - [ - null, ' foo', - null, ' ', - 'comment', 'bar', - null, ' ', - 'comment', 'hello', - null, ' ', - 'comment', 'world' - ] -); - -// Code blocks using 1 tab (regardless of CodeMirror.indentWithTabs value) -MT.testMode( - 'codeBlocksUsing1Tab', - '\tfoo', - [ - null, '\t', - 'comment', 'foo' - ] -); - -// Inline code using backticks -MT.testMode( - 'inlineCodeUsingBackticks', - 'foo `bar`', - [ - null, 'foo ', - 'comment', '`bar`' - ] -); - -// Block code using single backtick (shouldn't work) -MT.testMode( - 'blockCodeSingleBacktick', - '`\nfoo\n`', - [ - 'comment', '`', - null, 'foo', - 'comment', '`' - ] -); - -// Unclosed backticks -// Instead of simply marking as CODE, it would be nice to have an -// incomplete flag for CODE, that is styled slightly different. -MT.testMode( - 'unclosedBackticks', - 'foo `bar', - [ - null, 'foo ', - 'comment', '`bar' - ] -); - -// Per documentation: "To include a literal backtick character within a -// code span, you can use multiple backticks as the opening and closing -// delimiters" -MT.testMode( - 'doubleBackticks', - '``foo ` bar``', - [ - 'comment', '``foo ` bar``' - ] -); - -// Tests based on Dingus -// http://daringfireball.net/projects/markdown/dingus -// -// Multiple backticks within an inline code block -MT.testMode( - 'consecutiveBackticks', - '`foo```bar`', - [ - 'comment', '`foo```bar`' - ] -); -// Multiple backticks within an inline code block with a second code block -MT.testMode( - 'consecutiveBackticks', - '`foo```bar` hello `world`', - [ - 'comment', '`foo```bar`', - null, ' hello ', - 'comment', '`world`' - ] -); -// Unclosed with several different groups of backticks -MT.testMode( - 'unclosedBackticks', - '``foo ``` bar` hello', - [ - 'comment', '``foo ``` bar` hello' - ] -); -// Closed with several different groups of backticks -MT.testMode( - 'closedBackticks', - '``foo ``` bar` hello`` world', - [ - 'comment', '``foo ``` bar` hello``', - null, ' world' - ] -); - -// atx headers -// http://daringfireball.net/projects/markdown/syntax#header -// -// H1 -MT.testMode( - 'atxH1', - '# foo', - [ - 'header', '# foo' - ] -); -// H2 -MT.testMode( - 'atxH2', - '## foo', - [ - 'header', '## foo' - ] -); -// H3 -MT.testMode( - 'atxH3', - '### foo', - [ - 'header', '### foo' - ] -); -// H4 -MT.testMode( - 'atxH4', - '#### foo', - [ - 'header', '#### foo' - ] -); -// H5 -MT.testMode( - 'atxH5', - '##### foo', - [ - 'header', '##### foo' - ] -); -// H6 -MT.testMode( - 'atxH6', - '###### foo', - [ - 'header', '###### foo' - ] -); -// H6 - 7x '#' should still be H6, per Dingus -// http://daringfireball.net/projects/markdown/dingus -MT.testMode( - 'atxH6NotH7', - '####### foo', - [ - 'header', '####### foo' - ] -); - -// Setext headers - H1, H2 -// Per documentation, "Any number of underlining =’s or -’s will work." -// http://daringfireball.net/projects/markdown/syntax#header -// Ideally, the text would be marked as `header` as well, but this is -// not really feasible at the moment. So, instead, we're testing against -// what works today, to avoid any regressions. -// -// Check if single underlining = works -MT.testMode( - 'setextH1', - 'foo\n=', - [ - null, 'foo', - 'header', '=' - ] -); -// Check if 3+ ='s work -MT.testMode( - 'setextH1', - 'foo\n===', - [ - null, 'foo', - 'header', '===' - ] -); -// Check if single underlining - works -MT.testMode( - 'setextH2', - 'foo\n-', - [ - null, 'foo', - 'header', '-' - ] -); -// Check if 3+ -'s work -MT.testMode( - 'setextH2', - 'foo\n---', - [ - null, 'foo', - 'header', '---' - ] -); - -// Single-line blockquote with trailing space -MT.testMode( - 'blockquoteSpace', - '> foo', - [ - 'quote', '> foo' - ] -); - -// Single-line blockquote -MT.testMode( - 'blockquoteNoSpace', - '>foo', - [ - 'quote', '>foo' - ] -); - -// Single-line blockquote followed by normal paragraph -MT.testMode( - 'blockquoteThenParagraph', - '>foo\n\nbar', - [ - 'quote', '>foo', - null, 'bar' - ] -); - -// Multi-line blockquote (lazy mode) -MT.testMode( - 'multiBlockquoteLazy', - '>foo\nbar', - [ - 'quote', '>foo', - 'quote', 'bar' - ] -); - -// Multi-line blockquote followed by normal paragraph (lazy mode) -MT.testMode( - 'multiBlockquoteLazyThenParagraph', - '>foo\nbar\n\nhello', - [ - 'quote', '>foo', - 'quote', 'bar', - null, 'hello' - ] -); - -// Multi-line blockquote (non-lazy mode) -MT.testMode( - 'multiBlockquote', - '>foo\n>bar', - [ - 'quote', '>foo', - 'quote', '>bar' - ] -); - -// Multi-line blockquote followed by normal paragraph (non-lazy mode) -MT.testMode( - 'multiBlockquoteThenParagraph', - '>foo\n>bar\n\nhello', - [ - 'quote', '>foo', - 'quote', '>bar', - null, 'hello' - ] -); - -// Check list types -MT.testMode( - 'listAsterisk', - '* foo\n* bar', - [ - 'string', '* foo', - 'string', '* bar' - ] -); -MT.testMode( - 'listPlus', - '+ foo\n+ bar', - [ - 'string', '+ foo', - 'string', '+ bar' - ] -); -MT.testMode( - 'listDash', - '- foo\n- bar', - [ - 'string', '- foo', - 'string', '- bar' - ] -); -MT.testMode( - 'listNumber', - '1. foo\n2. bar', - [ - 'string', '1. foo', - 'string', '2. bar' - ] -); - -// Formatting in lists (*) -MT.testMode( - 'listAsteriskFormatting', - '* *foo* bar\n\n* **foo** bar\n\n* ***foo*** bar\n\n* `foo` bar', - [ - 'string', '* ', - 'string em', '*foo*', - 'string', ' bar', - 'string', '* ', - 'string strong', '**foo**', - 'string', ' bar', - 'string', '* ', - 'string strong', '**', - 'string emstrong', '*foo**', - 'string em', '*', - 'string', ' bar', - 'string', '* ', - 'string comment', '`foo`', - 'string', ' bar' - ] -); -// Formatting in lists (+) -MT.testMode( - 'listPlusFormatting', - '+ *foo* bar\n\n+ **foo** bar\n\n+ ***foo*** bar\n\n+ `foo` bar', - [ - 'string', '+ ', - 'string em', '*foo*', - 'string', ' bar', - 'string', '+ ', - 'string strong', '**foo**', - 'string', ' bar', - 'string', '+ ', - 'string strong', '**', - 'string emstrong', '*foo**', - 'string em', '*', - 'string', ' bar', - 'string', '+ ', - 'string comment', '`foo`', - 'string', ' bar' - ] -); -// Formatting in lists (-) -MT.testMode( - 'listDashFormatting', - '- *foo* bar\n\n- **foo** bar\n\n- ***foo*** bar\n\n- `foo` bar', - [ - 'string', '- ', - 'string em', '*foo*', - 'string', ' bar', - 'string', '- ', - 'string strong', '**foo**', - 'string', ' bar', - 'string', '- ', - 'string strong', '**', - 'string emstrong', '*foo**', - 'string em', '*', - 'string', ' bar', - 'string', '- ', - 'string comment', '`foo`', - 'string', ' bar' - ] -); -// Formatting in lists (1.) -MT.testMode( - 'listNumberFormatting', - '1. *foo* bar\n\n2. **foo** bar\n\n3. ***foo*** bar\n\n4. `foo` bar', - [ - 'string', '1. ', - 'string em', '*foo*', - 'string', ' bar', - 'string', '2. ', - 'string strong', '**foo**', - 'string', ' bar', - 'string', '3. ', - 'string strong', '**', - 'string emstrong', '*foo**', - 'string em', '*', - 'string', ' bar', - 'string', '4. ', - 'string comment', '`foo`', - 'string', ' bar' - ] -); - -// Paragraph lists -MT.testMode( - 'listParagraph', - '* foo\n\n* bar', - [ - 'string', '* foo', - 'string', '* bar' - ] -); - -// Multi-paragraph lists -// -// 4 spaces -MT.testMode( - 'listMultiParagraph', - '* foo\n\n* bar\n\n hello', - [ - 'string', '* foo', - 'string', '* bar', - null, ' ', - 'string', 'hello' - ] -); -// 4 spaces, extra blank lines (should still be list, per Dingus) -MT.testMode( - 'listMultiParagraphExtra', - '* foo\n\n* bar\n\n\n hello', - [ - 'string', '* foo', - 'string', '* bar', - null, ' ', - 'string', 'hello' - ] -); -// 4 spaces, plus 1 space (should still be list, per Dingus) -MT.testMode( - 'listMultiParagraphExtraSpace', - '* foo\n\n* bar\n\n hello\n\n world', - [ - 'string', '* foo', - 'string', '* bar', - null, ' ', - 'string', 'hello', - null, ' ', - 'string', 'world' - ] -); -// 1 tab -MT.testMode( - 'listTab', - '* foo\n\n* bar\n\n\thello', - [ - 'string', '* foo', - 'string', '* bar', - null, '\t', - 'string', 'hello' - ] -); -// No indent -MT.testMode( - 'listNoIndent', - '* foo\n\n* bar\n\nhello', - [ - 'string', '* foo', - 'string', '* bar', - null, 'hello' - ] -); -// Blockquote -MT.testMode( - 'blockquote', - '* foo\n\n* bar\n\n > hello', - [ - 'string', '* foo', - 'string', '* bar', - null, ' ', - 'string quote', '> hello' - ] -); -// Code block -MT.testMode( - 'blockquoteCode', - '* foo\n\n* bar\n\n > hello\n\n world', - [ - 'string', '* foo', - 'string', '* bar', - null, ' ', - 'comment', '> hello', - null, ' ', - 'string', 'world' - ] -); -// Code block followed by text -MT.testMode( - 'blockquoteCodeText', - '* foo\n\n bar\n\n hello\n\n world', - [ - 'string', '* foo', - null, ' ', - 'string', 'bar', - null, ' ', - 'comment', 'hello', - null, ' ', - 'string', 'world' - ] -); - -// Nested list -// -// * -MT.testMode( - 'listAsteriskNested', - '* foo\n\n * bar', - [ - 'string', '* foo', - null, ' ', - 'string', '* bar' - ] -); -// + -MT.testMode( - 'listPlusNested', - '+ foo\n\n + bar', - [ - 'string', '+ foo', - null, ' ', - 'string', '+ bar' - ] -); -// - -MT.testMode( - 'listDashNested', - '- foo\n\n - bar', - [ - 'string', '- foo', - null, ' ', - 'string', '- bar' - ] -); -// 1. -MT.testMode( - 'listNumberNested', - '1. foo\n\n 2. bar', - [ - 'string', '1. foo', - null, ' ', - 'string', '2. bar' - ] -); -// Mixed -MT.testMode( - 'listMixed', - '* foo\n\n + bar\n\n - hello\n\n 1. world', - [ - 'string', '* foo', - null, ' ', - 'string', '+ bar', - null, ' ', - 'string', '- hello', - null, ' ', - 'string', '1. world' - ] -); -// Blockquote -MT.testMode( - 'listBlockquote', - '* foo\n\n + bar\n\n > hello', - [ - 'string', '* foo', - null, ' ', - 'string', '+ bar', - null, ' ', - 'quote string', '> hello' - ] -); -// Code -MT.testMode( - 'listCode', - '* foo\n\n + bar\n\n hello', - [ - 'string', '* foo', - null, ' ', - 'string', '+ bar', - null, ' ', - 'comment', 'hello' - ] -); -// Code with internal indentation -MT.testMode( - 'listCodeIndentation', - '* foo\n\n bar\n hello\n world\n foo\n bar', - [ - 'string', '* foo', - null, ' ', - 'comment', 'bar', - null, ' ', - 'comment', 'hello', - null, ' ', - 'comment', 'world', - null, ' ', - 'comment', 'foo', - null, ' ', - 'string', 'bar' - ] -); -// Code followed by text -MT.testMode( - 'listCodeText', - '* foo\n\n bar\n\nhello', - [ - 'string', '* foo', - null, ' ', - 'comment', 'bar', - null, 'hello' - ] -); - -// Following tests directly from official Markdown documentation -// http://daringfireball.net/projects/markdown/syntax#hr -MT.testMode( - 'hrSpace', - '* * *', - [ - 'hr', '* * *' - ] -); - -MT.testMode( - 'hr', - '***', - [ - 'hr', '***' - ] -); - -MT.testMode( - 'hrLong', - '*****', - [ - 'hr', '*****' - ] -); - -MT.testMode( - 'hrSpaceDash', - '- - -', - [ - 'hr', '- - -' - ] -); - -MT.testMode( - 'hrDashLong', - '---------------------------------------', - [ - 'hr', '---------------------------------------' - ] -); - -// Inline link with title -MT.testMode( - 'linkTitle', - '[foo](http://example.com/ "bar") hello', - [ - 'link', '[foo]', - 'string', '(http://example.com/ "bar")', - null, ' hello' - ] -); - -// Inline link without title -MT.testMode( - 'linkNoTitle', - '[foo](http://example.com/) bar', - [ - 'link', '[foo]', - 'string', '(http://example.com/)', - null, ' bar' - ] -); - -// Inline link with Em -MT.testMode( - 'linkEm', - '[*foo*](http://example.com/) bar', - [ - 'link', '[', - 'link em', '*foo*', - 'link', ']', - 'string', '(http://example.com/)', - null, ' bar' - ] -); - -// Inline link with Strong -MT.testMode( - 'linkStrong', - '[**foo**](http://example.com/) bar', - [ - 'link', '[', - 'link strong', '**foo**', - 'link', ']', - 'string', '(http://example.com/)', - null, ' bar' - ] -); - -// Inline link with EmStrong -MT.testMode( - 'linkEmStrong', - '[***foo***](http://example.com/) bar', - [ - 'link', '[', - 'link strong', '**', - 'link emstrong', '*foo**', - 'link em', '*', - 'link', ']', - 'string', '(http://example.com/)', - null, ' bar' - ] -); - -// Image with title -MT.testMode( - 'imageTitle', - ' hello', - [ - 'tag', '![foo]', - 'string', '(http://example.com/ "bar")', - null, ' hello' - ] -); - -// Image without title -MT.testMode( - 'imageNoTitle', - ' bar', - [ - 'tag', '![foo]', - 'string', '(http://example.com/)', - null, ' bar' - ] -); - -// Image with asterisks -MT.testMode( - 'imageAsterisks', - ' bar', - [ - 'tag', '![*foo*]', - 'string', '(http://example.com/)', - null, ' bar' - ] -); - -// Not a link. Should be normal text due to square brackets being used -// regularly in text, especially in quoted material, and no space is allowed -// between square brackets and parentheses (per Dingus). -MT.testMode( - 'notALink', - '[foo] (bar)', - [ - null, '[foo] (bar)' - ] -); - -// Reference-style links -MT.testMode( - 'linkReference', - '[foo][bar] hello', - [ - 'link', '[foo]', - 'string', '[bar]', - null, ' hello' - ] -); -// Reference-style links with Em -MT.testMode( - 'linkReferenceEm', - '[*foo*][bar] hello', - [ - 'link', '[', - 'link em', '*foo*', - 'link', ']', - 'string', '[bar]', - null, ' hello' - ] -); -// Reference-style links with Strong -MT.testMode( - 'linkReferenceStrong', - '[**foo**][bar] hello', - [ - 'link', '[', - 'link strong', '**foo**', - 'link', ']', - 'string', '[bar]', - null, ' hello' - ] -); -// Reference-style links with EmStrong -MT.testMode( - 'linkReferenceEmStrong', - '[***foo***][bar] hello', - [ - 'link', '[', - 'link strong', '**', - 'link emstrong', '*foo**', - 'link em', '*', - 'link', ']', - 'string', '[bar]', - null, ' hello' - ] -); - -// Reference-style links with optional space separator (per docuentation) -// "You can optionally use a space to separate the sets of brackets" -MT.testMode( - 'linkReferenceSpace', - '[foo] [bar] hello', - [ - 'link', '[foo]', - null, ' ', - 'string', '[bar]', - null, ' hello' - ] -); -// Should only allow a single space ("...use *a* space...") -MT.testMode( - 'linkReferenceDoubleSpace', - '[foo] [bar] hello', - [ - null, '[foo] [bar] hello' - ] -); - -// Reference-style links with implicit link name -MT.testMode( - 'linkImplicit', - '[foo][] hello', - [ - 'link', '[foo]', - 'string', '[]', - null, ' hello' - ] -); - -// @todo It would be nice if, at some point, the document was actually -// checked to see if the referenced link exists - -// Link label, for reference-style links (taken from documentation) -// -// No title -MT.testMode( - 'labelNoTitle', - '[foo]: http://example.com/', - [ - 'link', '[foo]:', - null, ' ', - 'string', 'http://example.com/' - ] -); -// Space in ID and title -MT.testMode( - 'labelSpaceTitle', - '[foo bar]: http://example.com/ "hello"', - [ - 'link', '[foo bar]:', - null, ' ', - 'string', 'http://example.com/ "hello"' - ] -); -// Double title -MT.testMode( - 'labelDoubleTitle', - '[foo bar]: http://example.com/ "hello" "world"', - [ - 'link', '[foo bar]:', - null, ' ', - 'string', 'http://example.com/ "hello"', - null, ' "world"' - ] -); -// Double quotes around title -MT.testMode( - 'labelTitleDoubleQuotes', - '[foo]: http://example.com/ "bar"', - [ - 'link', '[foo]:', - null, ' ', - 'string', 'http://example.com/ "bar"' - ] -); -// Single quotes around title -MT.testMode( - 'labelTitleSingleQuotes', - '[foo]: http://example.com/ \'bar\'', - [ - 'link', '[foo]:', - null, ' ', - 'string', 'http://example.com/ \'bar\'' - ] -); -// Parentheses around title -MT.testMode( - 'labelTitleParenthese', - '[foo]: http://example.com/ (bar)', - [ - 'link', '[foo]:', - null, ' ', - 'string', 'http://example.com/ (bar)' - ] -); -// Invalid title -MT.testMode( - 'labelTitleInvalid', - '[foo]: http://example.com/ bar', - [ - 'link', '[foo]:', - null, ' ', - 'string', 'http://example.com/', - null, ' bar' - ] -); -// Angle brackets around URL -MT.testMode( - 'labelLinkAngleBrackets', - '[foo]: <http://example.com/> "bar"', - [ - 'link', '[foo]:', - null, ' ', - 'string', '<http://example.com/> "bar"' - ] -); -// Title on next line per documentation (double quotes) -MT.testMode( - 'labelTitleNextDoubleQuotes', - '[foo]: http://example.com/\n"bar" hello', - [ - 'link', '[foo]:', - null, ' ', - 'string', 'http://example.com/', - 'string', '"bar"', - null, ' hello' - ] -); -// Title on next line per documentation (single quotes) -MT.testMode( - 'labelTitleNextSingleQuotes', - '[foo]: http://example.com/\n\'bar\' hello', - [ - 'link', '[foo]:', - null, ' ', - 'string', 'http://example.com/', - 'string', '\'bar\'', - null, ' hello' - ] -); -// Title on next line per documentation (parentheses) -MT.testMode( - 'labelTitleNextParenthese', - '[foo]: http://example.com/\n(bar) hello', - [ - 'link', '[foo]:', - null, ' ', - 'string', 'http://example.com/', - 'string', '(bar)', - null, ' hello' - ] -); -// Title on next line per documentation (mixed) -MT.testMode( - 'labelTitleNextMixed', - '[foo]: http://example.com/\n(bar" hello', - [ - 'link', '[foo]:', - null, ' ', - 'string', 'http://example.com/', - null, '(bar" hello' - ] -); - -// Automatic links -MT.testMode( - 'linkWeb', - '<http://example.com/> foo', - [ - 'link', '<http://example.com/>', - null, ' foo' - ] -); - -// Automatic email links -MT.testMode( - 'linkEmail', - '<user@example.com> foo', - [ - 'link', '<user@example.com>', - null, ' foo' - ] -); - -// Single asterisk -MT.testMode( - 'emAsterisk', - '*foo* bar', - [ - 'em', '*foo*', - null, ' bar' - ] -); - -// Single underscore -MT.testMode( - 'emUnderscore', - '_foo_ bar', - [ - 'em', '_foo_', - null, ' bar' - ] -); - -// Emphasis characters within a word -MT.testMode( - 'emInWordAsterisk', - 'foo*bar*hello', - [ - null, 'foo', - 'em', '*bar*', - null, 'hello' - ] -); -MT.testMode( - 'emInWordUnderscore', - 'foo_bar_hello', - [ - null, 'foo', - 'em', '_bar_', - null, 'hello' - ] -); -// Per documentation: "...surround an * or _ with spaces, it’ll be -// treated as a literal asterisk or underscore." -// -// Inside EM -MT.testMode( - 'emEscapedBySpaceIn', - 'foo _bar _ hello_ world', - [ - null, 'foo ', - 'em', '_bar _ hello_', - null, ' world' - ] -); -// Outside EM -MT.testMode( - 'emEscapedBySpaceOut', - 'foo _ bar_hello_world', - [ - null, 'foo _ bar', - 'em', '_hello_', - null, 'world' - ] -); - -// Unclosed emphasis characters -// Instead of simply marking as EM / STRONG, it would be nice to have an -// incomplete flag for EM and STRONG, that is styled slightly different. -MT.testMode( - 'emIncompleteAsterisk', - 'foo *bar', - [ - null, 'foo ', - 'em', '*bar' - ] -); -MT.testMode( - 'emIncompleteUnderscore', - 'foo _bar', - [ - null, 'foo ', - 'em', '_bar' - ] -); - -// Double asterisk -MT.testMode( - 'strongAsterisk', - '**foo** bar', - [ - 'strong', '**foo**', - null, ' bar' - ] -); - -// Double underscore -MT.testMode( - 'strongUnderscore', - '__foo__ bar', - [ - 'strong', '__foo__', - null, ' bar' - ] -); - -// Triple asterisk -MT.testMode( - 'emStrongAsterisk', - '*foo**bar*hello** world', - [ - 'em', '*foo', - 'emstrong', '**bar*', - 'strong', 'hello**', - null, ' world' - ] -); - -// Triple underscore -MT.testMode( - 'emStrongUnderscore', - '_foo__bar_hello__ world', - [ - 'em', '_foo', - 'emstrong', '__bar_', - 'strong', 'hello__', - null, ' world' - ] -); - -// Triple mixed -// "...same character must be used to open and close an emphasis span."" -MT.testMode( - 'emStrongMixed', - '_foo**bar*hello__ world', - [ - 'em', '_foo', - 'emstrong', '**bar*hello__ world' - ] -); - -MT.testMode( - 'emStrongMixed', - '*foo__bar_hello** world', - [ - 'em', '*foo', - 'emstrong', '__bar_hello** world' - ] -); - -// These characters should be escaped: -// \ backslash -// ` backtick -// * asterisk -// _ underscore -// {} curly braces -// [] square brackets -// () parentheses -// # hash mark -// + plus sign -// - minus sign (hyphen) -// . dot -// ! exclamation mark -// -// Backtick (code) -MT.testMode( - 'escapeBacktick', - 'foo \\`bar\\`', - [ - null, 'foo \\`bar\\`' - ] -); -MT.testMode( - 'doubleEscapeBacktick', - 'foo \\\\`bar\\\\`', - [ - null, 'foo \\\\', - 'comment', '`bar\\\\`' - ] -); -// Asterisk (em) -MT.testMode( - 'escapeAsterisk', - 'foo \\*bar\\*', - [ - null, 'foo \\*bar\\*' - ] -); -MT.testMode( - 'doubleEscapeAsterisk', - 'foo \\\\*bar\\\\*', - [ - null, 'foo \\\\', - 'em', '*bar\\\\*' - ] -); -// Underscore (em) -MT.testMode( - 'escapeUnderscore', - 'foo \\_bar\\_', - [ - null, 'foo \\_bar\\_' - ] -); -MT.testMode( - 'doubleEscapeUnderscore', - 'foo \\\\_bar\\\\_', - [ - null, 'foo \\\\', - 'em', '_bar\\\\_' - ] -); -// Hash mark (headers) -MT.testMode( - 'escapeHash', - '\\# foo', - [ - null, '\\# foo' - ] -); -MT.testMode( - 'doubleEscapeHash', - '\\\\# foo', - [ - null, '\\\\# foo' - ] -); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/mysql/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/mysql/index.html deleted file mode 100644 index 0403a9699ea8487c66c6113e6baacf0407c2c49f..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/mysql/index.html +++ /dev/null @@ -1,41 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: MySQL mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="mysql.js"></script> - <style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> - <link rel="stylesheet" href="../../doc/docs.css"> - </head> - <body> - <h1>CodeMirror: MySQL mode</h1> - <form><textarea id="code" name="code"> --- Comment for the code --- MySQL Mode for CodeMirror2 by MySQLTools http://github.com/partydroid/MySQL-Tools -SELECT UNIQUE `var1` as `variable`, - MAX(`var5`) as `max`, - MIN(`var5`) as `min`, - STDEV(`var5`) as `dev` -FROM `table` - -LEFT JOIN `table2` ON `var2` = `variable` - -ORDER BY `var3` DESC -GROUP BY `groupvar` - -LIMIT 0,30; - -</textarea></form> - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - mode: "text/x-mysql", - tabMode: "indent" - }); - </script> - - <p><strong>MIME types defined:</strong> <code>text/x-mysql</code>.</p> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/mysql/mysql.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/mysql/mysql.js deleted file mode 100644 index 69d3f9952bd49ec1f7cf7d9ba35a592d41d73725..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/mysql/mysql.js +++ /dev/null @@ -1,203 +0,0 @@ -/* - * MySQL Mode for CodeMirror 2 by MySQL-Tools - * @author James Thorne (partydroid) - * @link http://github.com/partydroid/MySQL-Tools - * @link http://mysqltools.org - * @version 02/Jan/2012 -*/ -CodeMirror.defineMode("mysql", function(config) { - var indentUnit = config.indentUnit; - var curPunc; - - function wordRegexp(words) { - return new RegExp("^(?:" + words.join("|") + ")$", "i"); - } - var ops = wordRegexp(["str", "lang", "langmatches", "datatype", "bound", "sameterm", "isiri", "isuri", - "isblank", "isliteral", "union", "a"]); - var keywords = wordRegexp([ - ('ACCESSIBLE'),('ALTER'),('AS'),('BEFORE'),('BINARY'),('BY'),('CASE'),('CHARACTER'),('COLUMN'),('CONTINUE'),('CROSS'),('CURRENT_TIMESTAMP'),('DATABASE'),('DAY_MICROSECOND'),('DEC'),('DEFAULT'), - ('DESC'),('DISTINCT'),('DOUBLE'),('EACH'),('ENCLOSED'),('EXIT'),('FETCH'),('FLOAT8'),('FOREIGN'),('GRANT'),('HIGH_PRIORITY'),('HOUR_SECOND'),('IN'),('INNER'),('INSERT'),('INT2'),('INT8'), - ('INTO'),('JOIN'),('KILL'),('LEFT'),('LINEAR'),('LOCALTIME'),('LONG'),('LOOP'),('MATCH'),('MEDIUMTEXT'),('MINUTE_SECOND'),('NATURAL'),('NULL'),('OPTIMIZE'),('OR'),('OUTER'),('PRIMARY'), - ('RANGE'),('READ_WRITE'),('REGEXP'),('REPEAT'),('RESTRICT'),('RIGHT'),('SCHEMAS'),('SENSITIVE'),('SHOW'),('SPECIFIC'),('SQLSTATE'),('SQL_CALC_FOUND_ROWS'),('STARTING'),('TERMINATED'), - ('TINYINT'),('TRAILING'),('UNDO'),('UNLOCK'),('USAGE'),('UTC_DATE'),('VALUES'),('VARCHARACTER'),('WHERE'),('WRITE'),('ZEROFILL'),('ALL'),('AND'),('ASENSITIVE'),('BIGINT'),('BOTH'),('CASCADE'), - ('CHAR'),('COLLATE'),('CONSTRAINT'),('CREATE'),('CURRENT_TIME'),('CURSOR'),('DAY_HOUR'),('DAY_SECOND'),('DECLARE'),('DELETE'),('DETERMINISTIC'),('DIV'),('DUAL'),('ELSEIF'),('EXISTS'),('FALSE'), - ('FLOAT4'),('FORCE'),('FULLTEXT'),('HAVING'),('HOUR_MINUTE'),('IGNORE'),('INFILE'),('INSENSITIVE'),('INT1'),('INT4'),('INTERVAL'),('ITERATE'),('KEYS'),('LEAVE'),('LIMIT'),('LOAD'),('LOCK'), - ('LONGTEXT'),('MASTER_SSL_VERIFY_SERVER_CERT'),('MEDIUMINT'),('MINUTE_MICROSECOND'),('MODIFIES'),('NO_WRITE_TO_BINLOG'),('ON'),('OPTIONALLY'),('OUT'),('PRECISION'),('PURGE'),('READS'), - ('REFERENCES'),('RENAME'),('REQUIRE'),('REVOKE'),('SCHEMA'),('SELECT'),('SET'),('SPATIAL'),('SQLEXCEPTION'),('SQL_BIG_RESULT'),('SSL'),('TABLE'),('TINYBLOB'),('TO'),('TRUE'),('UNIQUE'), - ('UPDATE'),('USING'),('UTC_TIMESTAMP'),('VARCHAR'),('WHEN'),('WITH'),('YEAR_MONTH'),('ADD'),('ANALYZE'),('ASC'),('BETWEEN'),('BLOB'),('CALL'),('CHANGE'),('CHECK'),('CONDITION'),('CONVERT'), - ('CURRENT_DATE'),('CURRENT_USER'),('DATABASES'),('DAY_MINUTE'),('DECIMAL'),('DELAYED'),('DESCRIBE'),('DISTINCTROW'),('DROP'),('ELSE'),('ESCAPED'),('EXPLAIN'),('FLOAT'),('FOR'),('FROM'), - ('GROUP'),('HOUR_MICROSECOND'),('IF'),('INDEX'),('INOUT'),('INT'),('INT3'),('INTEGER'),('IS'),('KEY'),('LEADING'),('LIKE'),('LINES'),('LOCALTIMESTAMP'),('LONGBLOB'),('LOW_PRIORITY'), - ('MEDIUMBLOB'),('MIDDLEINT'),('MOD'),('NOT'),('NUMERIC'),('OPTION'),('ORDER'),('OUTFILE'),('PROCEDURE'),('READ'),('REAL'),('RELEASE'),('REPLACE'),('RETURN'),('RLIKE'),('SECOND_MICROSECOND'), - ('SEPARATOR'),('SMALLINT'),('SQL'),('SQLWARNING'),('SQL_SMALL_RESULT'),('STRAIGHT_JOIN'),('THEN'),('TINYTEXT'),('TRIGGER'),('UNION'),('UNSIGNED'),('USE'),('UTC_TIME'),('VARBINARY'),('VARYING'), - ('WHILE'),('XOR'),('FULL'),('COLUMNS'),('MIN'),('MAX'),('STDEV'),('COUNT') - ]); - var operatorChars = /[*+\-<>=&|]/; - - function tokenBase(stream, state) { - var ch = stream.next(); - curPunc = null; - if (ch == "$" || ch == "?") { - stream.match(/^[\w\d]*/); - return "variable-2"; - } - else if (ch == "<" && !stream.match(/^[\s\u00a0=]/, false)) { - stream.match(/^[^\s\u00a0>]*>?/); - return "atom"; - } - else if (ch == "\"" || ch == "'") { - state.tokenize = tokenLiteral(ch); - return state.tokenize(stream, state); - } - else if (ch == "`") { - state.tokenize = tokenOpLiteral(ch); - return state.tokenize(stream, state); - } - else if (/[{}\(\),\.;\[\]]/.test(ch)) { - curPunc = ch; - return null; - } - else if (ch == "-" && stream.eat("-")) { - stream.skipToEnd(); - return "comment"; - } - else if (ch == "/" && stream.eat("*")) { - state.tokenize = tokenComment; - return state.tokenize(stream, state); - } - else if (operatorChars.test(ch)) { - stream.eatWhile(operatorChars); - return null; - } - else if (ch == ":") { - stream.eatWhile(/[\w\d\._\-]/); - return "atom"; - } - else { - stream.eatWhile(/[_\w\d]/); - if (stream.eat(":")) { - stream.eatWhile(/[\w\d_\-]/); - return "atom"; - } - var word = stream.current(); - if (ops.test(word)) - return null; - else if (keywords.test(word)) - return "keyword"; - else - return "variable"; - } - } - - function tokenLiteral(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) { - state.tokenize = tokenBase; - break; - } - escaped = !escaped && ch == "\\"; - } - return "string"; - }; - } - - function tokenOpLiteral(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) { - state.tokenize = tokenBase; - break; - } - escaped = !escaped && ch == "\\"; - } - return "variable-2"; - }; - } - - function tokenComment(stream, state) { - for (;;) { - if (stream.skipTo("*")) { - stream.next(); - if (stream.eat("/")) { - state.tokenize = tokenBase; - break; - } - } else { - stream.skipToEnd(); - break; - } - } - return "comment"; - } - - - function pushContext(state, type, col) { - state.context = {prev: state.context, indent: state.indent, col: col, type: type}; - } - function popContext(state) { - state.indent = state.context.indent; - state.context = state.context.prev; - } - - return { - startState: function() { - return {tokenize: tokenBase, - context: null, - indent: 0, - col: 0}; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (state.context && state.context.align == null) state.context.align = false; - state.indent = stream.indentation(); - } - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - - if (style != "comment" && state.context && state.context.align == null && state.context.type != "pattern") { - state.context.align = true; - } - - if (curPunc == "(") pushContext(state, ")", stream.column()); - else if (curPunc == "[") pushContext(state, "]", stream.column()); - else if (curPunc == "{") pushContext(state, "}", stream.column()); - else if (/[\]\}\)]/.test(curPunc)) { - while (state.context && state.context.type == "pattern") popContext(state); - if (state.context && curPunc == state.context.type) popContext(state); - } - else if (curPunc == "." && state.context && state.context.type == "pattern") popContext(state); - else if (/atom|string|variable/.test(style) && state.context) { - if (/[\}\]]/.test(state.context.type)) - pushContext(state, "pattern", stream.column()); - else if (state.context.type == "pattern" && !state.context.align) { - state.context.align = true; - state.context.col = stream.column(); - } - } - - return style; - }, - - indent: function(state, textAfter) { - var firstChar = textAfter && textAfter.charAt(0); - var context = state.context; - if (/[\]\}]/.test(firstChar)) - while (context && context.type == "pattern") context = context.prev; - - var closing = context && firstChar == context.type; - if (!context) - return 0; - else if (context.type == "pattern") - return context.col; - else if (context.align) - return context.col + (closing ? 0 : 1); - else - return context.indent + (closing ? 0 : indentUnit); - } - }; -}); - -CodeMirror.defineMIME("text/x-mysql", "mysql"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/ntriples/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/ntriples/index.html deleted file mode 100644 index 052a53d86a40b7de923f6507c38edc2db190c7b4..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/ntriples/index.html +++ /dev/null @@ -1,33 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: NTriples mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="ntriples.js"></script> - <link rel="stylesheet" href="../../doc/docs.css"> - <style type="text/css"> - .CodeMirror { - border: 1px solid #eee; - } - </style> - </head> - <body> - <h1>CodeMirror: NTriples mode</h1> -<form> -<textarea id="ntriples" name="ntriples"> -<http://Sub1> <http://pred1> <http://obj> . -<http://Sub2> <http://pred2#an2> "literal 1" . -<http://Sub3#an3> <http://pred3> _:bnode3 . -_:bnode4 <http://pred4> "literal 2"@lang . -_:bnode5 <http://pred5> "literal 3"^^<http://type> . -</textarea> -</form> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("ntriples"), {}); - </script> - <p><strong>MIME types defined:</strong> <code>text/n-triples</code>.</p> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/ntriples/ntriples.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/ntriples/ntriples.js deleted file mode 100644 index ced8645169e1954b059aead216c6d0f06b55fa5f..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/ntriples/ntriples.js +++ /dev/null @@ -1,170 +0,0 @@ -/********************************************************** -* This script provides syntax highlighting support for -* the Ntriples format. -* Ntriples format specification: -* http://www.w3.org/TR/rdf-testcases/#ntriples -***********************************************************/ - -/* - The following expression defines the defined ASF grammar transitions. - - pre_subject -> - { - ( writing_subject_uri | writing_bnode_uri ) - -> pre_predicate - -> writing_predicate_uri - -> pre_object - -> writing_object_uri | writing_object_bnode | - ( - writing_object_literal - -> writing_literal_lang | writing_literal_type - ) - -> post_object - -> BEGIN - } otherwise { - -> ERROR - } -*/ -CodeMirror.defineMode("ntriples", function() { - - var Location = { - PRE_SUBJECT : 0, - WRITING_SUB_URI : 1, - WRITING_BNODE_URI : 2, - PRE_PRED : 3, - WRITING_PRED_URI : 4, - PRE_OBJ : 5, - WRITING_OBJ_URI : 6, - WRITING_OBJ_BNODE : 7, - WRITING_OBJ_LITERAL : 8, - WRITING_LIT_LANG : 9, - WRITING_LIT_TYPE : 10, - POST_OBJ : 11, - ERROR : 12 - }; - function transitState(currState, c) { - var currLocation = currState.location; - var ret; - - // Opening. - if (currLocation == Location.PRE_SUBJECT && c == '<') ret = Location.WRITING_SUB_URI; - else if(currLocation == Location.PRE_SUBJECT && c == '_') ret = Location.WRITING_BNODE_URI; - else if(currLocation == Location.PRE_PRED && c == '<') ret = Location.WRITING_PRED_URI; - else if(currLocation == Location.PRE_OBJ && c == '<') ret = Location.WRITING_OBJ_URI; - else if(currLocation == Location.PRE_OBJ && c == '_') ret = Location.WRITING_OBJ_BNODE; - else if(currLocation == Location.PRE_OBJ && c == '"') ret = Location.WRITING_OBJ_LITERAL; - - // Closing. - else if(currLocation == Location.WRITING_SUB_URI && c == '>') ret = Location.PRE_PRED; - else if(currLocation == Location.WRITING_BNODE_URI && c == ' ') ret = Location.PRE_PRED; - else if(currLocation == Location.WRITING_PRED_URI && c == '>') ret = Location.PRE_OBJ; - else if(currLocation == Location.WRITING_OBJ_URI && c == '>') ret = Location.POST_OBJ; - else if(currLocation == Location.WRITING_OBJ_BNODE && c == ' ') ret = Location.POST_OBJ; - else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '"') ret = Location.POST_OBJ; - else if(currLocation == Location.WRITING_LIT_LANG && c == ' ') ret = Location.POST_OBJ; - else if(currLocation == Location.WRITING_LIT_TYPE && c == '>') ret = Location.POST_OBJ; - - // Closing typed and language literal. - else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '@') ret = Location.WRITING_LIT_LANG; - else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '^') ret = Location.WRITING_LIT_TYPE; - - // Spaces. - else if( c == ' ' && - ( - currLocation == Location.PRE_SUBJECT || - currLocation == Location.PRE_PRED || - currLocation == Location.PRE_OBJ || - currLocation == Location.POST_OBJ - ) - ) ret = currLocation; - - // Reset. - else if(currLocation == Location.POST_OBJ && c == '.') ret = Location.PRE_SUBJECT; - - // Error - else ret = Location.ERROR; - - currState.location=ret; - } - - return { - startState: function() { - return { - location : Location.PRE_SUBJECT, - uris : [], - anchors : [], - bnodes : [], - langs : [], - types : [] - }; - }, - token: function(stream, state) { - var ch = stream.next(); - if(ch == '<') { - transitState(state, ch); - var parsedURI = ''; - stream.eatWhile( function(c) { if( c != '#' && c != '>' ) { parsedURI += c; return true; } return false;} ); - state.uris.push(parsedURI); - if( stream.match('#', false) ) return 'variable'; - stream.next(); - transitState(state, '>'); - return 'variable'; - } - if(ch == '#') { - var parsedAnchor = ''; - stream.eatWhile(function(c) { if(c != '>' && c != ' ') { parsedAnchor+= c; return true; } return false;}); - state.anchors.push(parsedAnchor); - return 'variable-2'; - } - if(ch == '>') { - transitState(state, '>'); - return 'variable'; - } - if(ch == '_') { - transitState(state, ch); - var parsedBNode = ''; - stream.eatWhile(function(c) { if( c != ' ' ) { parsedBNode += c; return true; } return false;}); - state.bnodes.push(parsedBNode); - stream.next(); - transitState(state, ' '); - return 'builtin'; - } - if(ch == '"') { - transitState(state, ch); - stream.eatWhile( function(c) { return c != '"'; } ); - stream.next(); - if( stream.peek() != '@' && stream.peek() != '^' ) { - transitState(state, '"'); - } - return 'string'; - } - if( ch == '@' ) { - transitState(state, '@'); - var parsedLang = ''; - stream.eatWhile(function(c) { if( c != ' ' ) { parsedLang += c; return true; } return false;}); - state.langs.push(parsedLang); - stream.next(); - transitState(state, ' '); - return 'string-2'; - } - if( ch == '^' ) { - stream.next(); - transitState(state, '^'); - var parsedType = ''; - stream.eatWhile(function(c) { if( c != '>' ) { parsedType += c; return true; } return false;} ); - state.types.push(parsedType); - stream.next(); - transitState(state, '>'); - return 'variable'; - } - if( ch == ' ' ) { - transitState(state, ch); - } - if( ch == '.' ) { - transitState(state, ch); - } - } - }; -}); - -CodeMirror.defineMIME("text/n-triples", "ntriples"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/ocaml/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/ocaml/index.html deleted file mode 100644 index 962fa29eb1efb5375c201514dbb4f368ab640bcd..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/ocaml/index.html +++ /dev/null @@ -1,131 +0,0 @@ -<!doctype html> -<meta charset=utf-8> -<title>CodeMirror: OCaml mode</title> - -<link rel=stylesheet href=../../lib/codemirror.css> -<link rel=stylesheet href=../../doc/docs.css> - -<style type=text/css> - .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;} -</style> - -<script src=../../lib/codemirror.js></script> -<script src=../../lib/util/matchbrackets.js></script> -<script src=ocaml.js></script> - -<h1>CodeMirror: OCaml mode</h1> - -<textarea id=code> -(* Summing a list of integers *) -let rec sum xs = - match xs with - | [] -> 0 - | x :: xs' -> x + sum xs' - -(* Quicksort *) -let rec qsort = function - | [] -> [] - | pivot :: rest -> - let is_less x = x < pivot in - let left, right = List.partition is_less rest in - qsort left @ [pivot] @ qsort right - -(* Fibonacci Sequence *) -let rec fib_aux n a b = - match n with - | 0 -> a - | _ -> fib_aux (n - 1) (a + b) a -let fib n = fib_aux n 0 1 - -(* Birthday paradox *) -let year_size = 365. - -let rec birthday_paradox prob people = - let prob' = (year_size -. float people) /. year_size *. prob in - if prob' < 0.5 then - Printf.printf "answer = %d\n" (people+1) - else - birthday_paradox prob' (people+1) ;; - -birthday_paradox 1.0 1 - -(* Church numerals *) -let zero f x = x -let succ n f x = f (n f x) -let one = succ zero -let two = succ (succ zero) -let add n1 n2 f x = n1 f (n2 f x) -let to_string n = n (fun k -> "S" ^ k) "0" -let _ = to_string (add (succ two) two) - -(* Elementary functions *) -let square x = x * x;; -let rec fact x = - if x <= 1 then 1 else x * fact (x - 1);; - -(* Automatic memory management *) -let l = 1 :: 2 :: 3 :: [];; -[1; 2; 3];; -5 :: l;; - -(* Polymorphism: sorting lists *) -let rec sort = function - | [] -> [] - | x :: l -> insert x (sort l) - -and insert elem = function - | [] -> [elem] - | x :: l -> - if elem < x then elem :: x :: l else x :: insert elem l;; - -(* Imperative features *) -let add_polynom p1 p2 = - let n1 = Array.length p1 - and n2 = Array.length p2 in - let result = Array.create (max n1 n2) 0 in - for i = 0 to n1 - 1 do result.(i) <- p1.(i) done; - for i = 0 to n2 - 1 do result.(i) <- result.(i) + p2.(i) done; - result;; -add_polynom [| 1; 2 |] [| 1; 2; 3 |];; - -(* We may redefine fact using a reference cell and a for loop *) -let fact n = - let result = ref 1 in - for i = 2 to n do - result := i * !result - done; - !result;; -fact 5;; - -(* Triangle (graphics) *) -let () = - ignore( Glut.init Sys.argv ); - Glut.initDisplayMode ~double_buffer:true (); - ignore (Glut.createWindow ~title:"OpenGL Demo"); - let angle t = 10. *. t *. t in - let render () = - GlClear.clear [ `color ]; - GlMat.load_identity (); - GlMat.rotate ~angle: (angle (Sys.time ())) ~z:1. (); - GlDraw.begins `triangles; - List.iter GlDraw.vertex2 [-1., -1.; 0., 1.; 1., -1.]; - GlDraw.ends (); - Glut.swapBuffers () in - GlMat.mode `modelview; - Glut.displayFunc ~cb:render; - Glut.idleFunc ~cb:(Some Glut.postRedisplay); - Glut.mainLoop () - -(* A Hundred Lines of Caml - http://caml.inria.fr/about/taste.en.html *) -(* OCaml page on Wikipedia - http://en.wikipedia.org/wiki/OCaml *) -</textarea> - -<script> - var editor = CodeMirror.fromTextArea(document.getElementById('code'), { - mode: 'ocaml', - lineNumbers: true, - matchBrackets: true - }); -</script> - -<p><strong>MIME types defined:</strong> <code>text/x-ocaml</code>.</p> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/ocaml/ocaml.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/ocaml/ocaml.js deleted file mode 100644 index 2ce3fb8f0c1f7d627dbfb40db7984786afecc733..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/ocaml/ocaml.js +++ /dev/null @@ -1,113 +0,0 @@ -CodeMirror.defineMode('ocaml', function() { - - var words = { - 'true': 'atom', - 'false': 'atom', - 'let': 'keyword', - 'rec': 'keyword', - 'in': 'keyword', - 'of': 'keyword', - 'and': 'keyword', - 'succ': 'keyword', - 'if': 'keyword', - 'then': 'keyword', - 'else': 'keyword', - 'for': 'keyword', - 'to': 'keyword', - 'while': 'keyword', - 'do': 'keyword', - 'done': 'keyword', - 'fun': 'keyword', - 'function': 'keyword', - 'val': 'keyword', - 'type': 'keyword', - 'mutable': 'keyword', - 'match': 'keyword', - 'with': 'keyword', - 'try': 'keyword', - 'raise': 'keyword', - 'begin': 'keyword', - 'end': 'keyword', - 'open': 'builtin', - 'trace': 'builtin', - 'ignore': 'builtin', - 'exit': 'builtin', - 'print_string': 'builtin', - 'print_endline': 'builtin' - }; - - function tokenBase(stream, state) { - var ch = stream.next(); - - if (ch === '"') { - state.tokenize = tokenString; - return state.tokenize(stream, state); - } - if (ch === '(') { - if (stream.eat('*')) { - state.commentLevel++; - state.tokenize = tokenComment; - return state.tokenize(stream, state); - } - } - if (ch === '~') { - stream.eatWhile(/\w/); - return 'variable-2'; - } - if (ch === '`') { - stream.eatWhile(/\w/); - return 'quote'; - } - if (/\d/.test(ch)) { - stream.eatWhile(/[\d]/); - if (stream.eat('.')) { - stream.eatWhile(/[\d]/); - } - return 'number'; - } - if ( /[+\-*&%=<>!?|]/.test(ch)) { - return 'operator'; - } - stream.eatWhile(/\w/); - var cur = stream.current(); - return words[cur] || 'variable'; - } - - function tokenString(stream, state) { - var next, end = false, escaped = false; - while ((next = stream.next()) != null) { - if (next === '"' && !escaped) { - end = true; - break; - } - escaped = !escaped && next === '\\'; - } - if (end && !escaped) { - state.tokenize = tokenBase; - } - return 'string'; - }; - - function tokenComment(stream, state) { - var prev, next; - while(state.commentLevel > 0 && (next = stream.next()) != null) { - if (prev === '(' && next === '*') state.commentLevel++; - if (prev === '*' && next === ')') state.commentLevel--; - prev = next; - } - if (state.commentLevel <= 0) { - state.tokenize = tokenBase; - } - return 'comment'; - } - - return { - startState: function() {return {tokenize: tokenBase, commentLevel: 0};}, - token: function(stream, state) { - if (stream.eatSpace()) return null; - return state.tokenize(stream, state); - } - }; -}); - -CodeMirror.defineMIME('text/x-ocaml', 'ocaml'); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/pascal/LICENSE b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/pascal/LICENSE deleted file mode 100644 index 8e3747e74808d9c135b4afff23ce215d074d9973..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/pascal/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (c) 2011 souceLair <support@sourcelair.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/pascal/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/pascal/index.html deleted file mode 100644 index b3016afb10cbd2bb30b33509e096335cf219e010..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/pascal/index.html +++ /dev/null @@ -1,48 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Pascal mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="pascal.js"></script> - <link rel="stylesheet" href="../../doc/docs.css"> - <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> - </head> - <body> - <h1>CodeMirror: Pascal mode</h1> - -<div><textarea id="code" name="code"> -(* Example Pascal code *) - -while a <> b do writeln('Waiting'); - -if a > b then - writeln('Condition met') -else - writeln('Condition not met'); - -for i := 1 to 10 do - writeln('Iteration: ', i:1); - -repeat - a := a + 1 -until a = 10; - -case i of - 0: write('zero'); - 1: write('one'); - 2: write('two') -end; -</textarea></div> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - mode: "text/x-pascal" - }); - </script> - - <p><strong>MIME types defined:</strong> <code>text/x-pascal</code>.</p> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/pascal/pascal.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/pascal/pascal.js deleted file mode 100644 index 09d9b0617b1b254cb15a9be7da16e7c61bf0b946..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/pascal/pascal.js +++ /dev/null @@ -1,94 +0,0 @@ -CodeMirror.defineMode("pascal", function() { - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - var keywords = words("and array begin case const div do downto else end file for forward integer " + - "boolean char function goto if in label mod nil not of or packed procedure " + - "program record repeat set string then to type until var while with"); - var atoms = {"null": true}; - - var isOperatorChar = /[+\-*&%=<>!?|\/]/; - - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == "#" && state.startOfLine) { - stream.skipToEnd(); - return "meta"; - } - if (ch == '"' || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - if (ch == "(" && stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } - if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - return null; - } - if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return "number"; - } - if (ch == "/") { - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - } - if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "operator"; - } - stream.eatWhile(/[\w\$_]/); - var cur = stream.current(); - if (keywords.propertyIsEnumerable(cur)) return "keyword"; - if (atoms.propertyIsEnumerable(cur)) return "atom"; - return "variable"; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && next == "\\"; - } - if (end || !escaped) state.tokenize = null; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == ")" && maybeEnd) { - state.tokenize = null; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - // Interface - - return { - startState: function() { - return {tokenize: null}; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style == "comment" || style == "meta") return style; - return style; - }, - - electricChars: "{}" - }; -}); - -CodeMirror.defineMIME("text/x-pascal", "pascal"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/perl/LICENSE b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/perl/LICENSE deleted file mode 100644 index 96f4115af8a96e1fb2ab78d5ac0d9490f16c7469..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/perl/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2011 by Sabaca <mail@sabaca.com> under the MIT license. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/perl/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/perl/index.html deleted file mode 100644 index 13c7af64d3c79c51f7737915e7e44c844b3d26be..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/perl/index.html +++ /dev/null @@ -1,62 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Perl mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="perl.js"></script> - <link rel="stylesheet" href="../../doc/docs.css"> - <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> - </head> - <body> - <h1>CodeMirror: Perl mode</h1> - -<div><textarea id="code" name="code"> -#!/usr/bin/perl - -use Something qw(func1 func2); - -# strings -my $s1 = qq'single line'; -our $s2 = q(multi- - line); - -=item Something - Example. -=cut - -my $html=<<'HTML' -<html> -<title>hi!</title> -</html> -HTML - -print "first,".join(',', 'second', qq~third~); - -if($s1 =~ m[(?<!\s)(l.ne)\z]o) { - $h->{$1}=$$.' predefined variables'; - $s2 =~ s/\-line//ox; - $s1 =~ s[ - line ] - [ - block - ]ox; -} - -1; # numbers and comments - -__END__ -something... - -</textarea></div> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true - }); - </script> - - <p><strong>MIME types defined:</strong> <code>text/x-perl</code>.</p> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/perl/perl.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/perl/perl.js deleted file mode 100644 index 52361c6107a42f0e674e207a41e45c97a8f738c4..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/perl/perl.js +++ /dev/null @@ -1,816 +0,0 @@ -// CodeMirror2 mode/perl/perl.js (text/x-perl) beta 0.10 (2011-11-08) -// This is a part of CodeMirror from https://github.com/sabaca/CodeMirror_mode_perl (mail@sabaca.com) -CodeMirror.defineMode("perl",function(){ - // http://perldoc.perl.org - var PERL={ // null - magic touch - // 1 - keyword - // 2 - def - // 3 - atom - // 4 - operator - // 5 - variable-2 (predefined) - // [x,y] - x=1,2,3; y=must be defined if x{...} - // PERL operators - '->' : 4, - '++' : 4, - '--' : 4, - '**' : 4, - // ! ~ \ and unary + and - - '=~' : 4, - '!~' : 4, - '*' : 4, - '/' : 4, - '%' : 4, - 'x' : 4, - '+' : 4, - '-' : 4, - '.' : 4, - '<<' : 4, - '>>' : 4, - // named unary operators - '<' : 4, - '>' : 4, - '<=' : 4, - '>=' : 4, - 'lt' : 4, - 'gt' : 4, - 'le' : 4, - 'ge' : 4, - '==' : 4, - '!=' : 4, - '<=>' : 4, - 'eq' : 4, - 'ne' : 4, - 'cmp' : 4, - '~~' : 4, - '&' : 4, - '|' : 4, - '^' : 4, - '&&' : 4, - '||' : 4, - '//' : 4, - '..' : 4, - '...' : 4, - '?' : 4, - ':' : 4, - '=' : 4, - '+=' : 4, - '-=' : 4, - '*=' : 4, // etc. ??? - ',' : 4, - '=>' : 4, - '::' : 4, - // list operators (rightward) - 'not' : 4, - 'and' : 4, - 'or' : 4, - 'xor' : 4, - // PERL predefined variables (I know, what this is a paranoid idea, but may be needed for people, who learn PERL, and for me as well, ...and may be for you?;) - 'BEGIN' : [5,1], - 'END' : [5,1], - 'PRINT' : [5,1], - 'PRINTF' : [5,1], - 'GETC' : [5,1], - 'READ' : [5,1], - 'READLINE' : [5,1], - 'DESTROY' : [5,1], - 'TIE' : [5,1], - 'TIEHANDLE' : [5,1], - 'UNTIE' : [5,1], - 'STDIN' : 5, - 'STDIN_TOP' : 5, - 'STDOUT' : 5, - 'STDOUT_TOP' : 5, - 'STDERR' : 5, - 'STDERR_TOP' : 5, - '$ARG' : 5, - '$_' : 5, - '@ARG' : 5, - '@_' : 5, - '$LIST_SEPARATOR' : 5, - '$"' : 5, - '$PROCESS_ID' : 5, - '$PID' : 5, - '$$' : 5, - '$REAL_GROUP_ID' : 5, - '$GID' : 5, - '$(' : 5, - '$EFFECTIVE_GROUP_ID' : 5, - '$EGID' : 5, - '$)' : 5, - '$PROGRAM_NAME' : 5, - '$0' : 5, - '$SUBSCRIPT_SEPARATOR' : 5, - '$SUBSEP' : 5, - '$;' : 5, - '$REAL_USER_ID' : 5, - '$UID' : 5, - '$<' : 5, - '$EFFECTIVE_USER_ID' : 5, - '$EUID' : 5, - '$>' : 5, - '$a' : 5, - '$b' : 5, - '$COMPILING' : 5, - '$^C' : 5, - '$DEBUGGING' : 5, - '$^D' : 5, - '${^ENCODING}' : 5, - '$ENV' : 5, - '%ENV' : 5, - '$SYSTEM_FD_MAX' : 5, - '$^F' : 5, - '@F' : 5, - '${^GLOBAL_PHASE}' : 5, - '$^H' : 5, - '%^H' : 5, - '@INC' : 5, - '%INC' : 5, - '$INPLACE_EDIT' : 5, - '$^I' : 5, - '$^M' : 5, - '$OSNAME' : 5, - '$^O' : 5, - '${^OPEN}' : 5, - '$PERLDB' : 5, - '$^P' : 5, - '$SIG' : 5, - '%SIG' : 5, - '$BASETIME' : 5, - '$^T' : 5, - '${^TAINT}' : 5, - '${^UNICODE}' : 5, - '${^UTF8CACHE}' : 5, - '${^UTF8LOCALE}' : 5, - '$PERL_VERSION' : 5, - '$^V' : 5, - '${^WIN32_SLOPPY_STAT}' : 5, - '$EXECUTABLE_NAME' : 5, - '$^X' : 5, - '$1' : 5, // - regexp $1, $2... - '$MATCH' : 5, - '$&' : 5, - '${^MATCH}' : 5, - '$PREMATCH' : 5, - '$`' : 5, - '${^PREMATCH}' : 5, - '$POSTMATCH' : 5, - "$'" : 5, - '${^POSTMATCH}' : 5, - '$LAST_PAREN_MATCH' : 5, - '$+' : 5, - '$LAST_SUBMATCH_RESULT' : 5, - '$^N' : 5, - '@LAST_MATCH_END' : 5, - '@+' : 5, - '%LAST_PAREN_MATCH' : 5, - '%+' : 5, - '@LAST_MATCH_START' : 5, - '@-' : 5, - '%LAST_MATCH_START' : 5, - '%-' : 5, - '$LAST_REGEXP_CODE_RESULT' : 5, - '$^R' : 5, - '${^RE_DEBUG_FLAGS}' : 5, - '${^RE_TRIE_MAXBUF}' : 5, - '$ARGV' : 5, - '@ARGV' : 5, - 'ARGV' : 5, - 'ARGVOUT' : 5, - '$OUTPUT_FIELD_SEPARATOR' : 5, - '$OFS' : 5, - '$,' : 5, - '$INPUT_LINE_NUMBER' : 5, - '$NR' : 5, - '$.' : 5, - '$INPUT_RECORD_SEPARATOR' : 5, - '$RS' : 5, - '$/' : 5, - '$OUTPUT_RECORD_SEPARATOR' : 5, - '$ORS' : 5, - '$\\' : 5, - '$OUTPUT_AUTOFLUSH' : 5, - '$|' : 5, - '$ACCUMULATOR' : 5, - '$^A' : 5, - '$FORMAT_FORMFEED' : 5, - '$^L' : 5, - '$FORMAT_PAGE_NUMBER' : 5, - '$%' : 5, - '$FORMAT_LINES_LEFT' : 5, - '$-' : 5, - '$FORMAT_LINE_BREAK_CHARACTERS' : 5, - '$:' : 5, - '$FORMAT_LINES_PER_PAGE' : 5, - '$=' : 5, - '$FORMAT_TOP_NAME' : 5, - '$^' : 5, - '$FORMAT_NAME' : 5, - '$~' : 5, - '${^CHILD_ERROR_NATIVE}' : 5, - '$EXTENDED_OS_ERROR' : 5, - '$^E' : 5, - '$EXCEPTIONS_BEING_CAUGHT' : 5, - '$^S' : 5, - '$WARNING' : 5, - '$^W' : 5, - '${^WARNING_BITS}' : 5, - '$OS_ERROR' : 5, - '$ERRNO' : 5, - '$!' : 5, - '%OS_ERROR' : 5, - '%ERRNO' : 5, - '%!' : 5, - '$CHILD_ERROR' : 5, - '$?' : 5, - '$EVAL_ERROR' : 5, - '$@' : 5, - '$OFMT' : 5, - '$#' : 5, - '$*' : 5, - '$ARRAY_BASE' : 5, - '$[' : 5, - '$OLD_PERL_VERSION' : 5, - '$]' : 5, - // PERL blocks - 'if' :[1,1], - elsif :[1,1], - 'else' :[1,1], - 'while' :[1,1], - unless :[1,1], - 'for' :[1,1], - foreach :[1,1], - // PERL functions - 'abs' :1, // - absolute value function - accept :1, // - accept an incoming socket connect - alarm :1, // - schedule a SIGALRM - 'atan2' :1, // - arctangent of Y/X in the range -PI to PI - bind :1, // - binds an address to a socket - binmode :1, // - prepare binary files for I/O - bless :1, // - create an object - bootstrap :1, // - 'break' :1, // - break out of a "given" block - caller :1, // - get context of the current subroutine call - chdir :1, // - change your current working directory - chmod :1, // - changes the permissions on a list of files - chomp :1, // - remove a trailing record separator from a string - chop :1, // - remove the last character from a string - chown :1, // - change the owership on a list of files - chr :1, // - get character this number represents - chroot :1, // - make directory new root for path lookups - close :1, // - close file (or pipe or socket) handle - closedir :1, // - close directory handle - connect :1, // - connect to a remote socket - 'continue' :[1,1], // - optional trailing block in a while or foreach - 'cos' :1, // - cosine function - crypt :1, // - one-way passwd-style encryption - dbmclose :1, // - breaks binding on a tied dbm file - dbmopen :1, // - create binding on a tied dbm file - 'default' :1, // - defined :1, // - test whether a value, variable, or function is defined - 'delete' :1, // - deletes a value from a hash - die :1, // - raise an exception or bail out - 'do' :1, // - turn a BLOCK into a TERM - dump :1, // - create an immediate core dump - each :1, // - retrieve the next key/value pair from a hash - endgrent :1, // - be done using group file - endhostent :1, // - be done using hosts file - endnetent :1, // - be done using networks file - endprotoent :1, // - be done using protocols file - endpwent :1, // - be done using passwd file - endservent :1, // - be done using services file - eof :1, // - test a filehandle for its end - 'eval' :1, // - catch exceptions or compile and run code - 'exec' :1, // - abandon this program to run another - exists :1, // - test whether a hash key is present - exit :1, // - terminate this program - 'exp' :1, // - raise I to a power - fcntl :1, // - file control system call - fileno :1, // - return file descriptor from filehandle - flock :1, // - lock an entire file with an advisory lock - fork :1, // - create a new process just like this one - format :1, // - declare a picture format with use by the write() function - formline :1, // - internal function used for formats - getc :1, // - get the next character from the filehandle - getgrent :1, // - get next group record - getgrgid :1, // - get group record given group user ID - getgrnam :1, // - get group record given group name - gethostbyaddr :1, // - get host record given its address - gethostbyname :1, // - get host record given name - gethostent :1, // - get next hosts record - getlogin :1, // - return who logged in at this tty - getnetbyaddr :1, // - get network record given its address - getnetbyname :1, // - get networks record given name - getnetent :1, // - get next networks record - getpeername :1, // - find the other end of a socket connection - getpgrp :1, // - get process group - getppid :1, // - get parent process ID - getpriority :1, // - get current nice value - getprotobyname :1, // - get protocol record given name - getprotobynumber :1, // - get protocol record numeric protocol - getprotoent :1, // - get next protocols record - getpwent :1, // - get next passwd record - getpwnam :1, // - get passwd record given user login name - getpwuid :1, // - get passwd record given user ID - getservbyname :1, // - get services record given its name - getservbyport :1, // - get services record given numeric port - getservent :1, // - get next services record - getsockname :1, // - retrieve the sockaddr for a given socket - getsockopt :1, // - get socket options on a given socket - given :1, // - glob :1, // - expand filenames using wildcards - gmtime :1, // - convert UNIX time into record or string using Greenwich time - 'goto' :1, // - create spaghetti code - grep :1, // - locate elements in a list test true against a given criterion - hex :1, // - convert a string to a hexadecimal number - 'import' :1, // - patch a module's namespace into your own - index :1, // - find a substring within a string - 'int' :1, // - get the integer portion of a number - ioctl :1, // - system-dependent device control system call - 'join' :1, // - join a list into a string using a separator - keys :1, // - retrieve list of indices from a hash - kill :1, // - send a signal to a process or process group - last :1, // - exit a block prematurely - lc :1, // - return lower-case version of a string - lcfirst :1, // - return a string with just the next letter in lower case - length :1, // - return the number of bytes in a string - 'link' :1, // - create a hard link in the filesytem - listen :1, // - register your socket as a server - local : 2, // - create a temporary value for a global variable (dynamic scoping) - localtime :1, // - convert UNIX time into record or string using local time - lock :1, // - get a thread lock on a variable, subroutine, or method - 'log' :1, // - retrieve the natural logarithm for a number - lstat :1, // - stat a symbolic link - m :null, // - match a string with a regular expression pattern - map :1, // - apply a change to a list to get back a new list with the changes - mkdir :1, // - create a directory - msgctl :1, // - SysV IPC message control operations - msgget :1, // - get SysV IPC message queue - msgrcv :1, // - receive a SysV IPC message from a message queue - msgsnd :1, // - send a SysV IPC message to a message queue - my : 2, // - declare and assign a local variable (lexical scoping) - 'new' :1, // - next :1, // - iterate a block prematurely - no :1, // - unimport some module symbols or semantics at compile time - oct :1, // - convert a string to an octal number - open :1, // - open a file, pipe, or descriptor - opendir :1, // - open a directory - ord :1, // - find a character's numeric representation - our : 2, // - declare and assign a package variable (lexical scoping) - pack :1, // - convert a list into a binary representation - 'package' :1, // - declare a separate global namespace - pipe :1, // - open a pair of connected filehandles - pop :1, // - remove the last element from an array and return it - pos :1, // - find or set the offset for the last/next m//g search - print :1, // - output a list to a filehandle - printf :1, // - output a formatted list to a filehandle - prototype :1, // - get the prototype (if any) of a subroutine - push :1, // - append one or more elements to an array - q :null, // - singly quote a string - qq :null, // - doubly quote a string - qr :null, // - Compile pattern - quotemeta :null, // - quote regular expression magic characters - qw :null, // - quote a list of words - qx :null, // - backquote quote a string - rand :1, // - retrieve the next pseudorandom number - read :1, // - fixed-length buffered input from a filehandle - readdir :1, // - get a directory from a directory handle - readline :1, // - fetch a record from a file - readlink :1, // - determine where a symbolic link is pointing - readpipe :1, // - execute a system command and collect standard output - recv :1, // - receive a message over a Socket - redo :1, // - start this loop iteration over again - ref :1, // - find out the type of thing being referenced - rename :1, // - change a filename - require :1, // - load in external functions from a library at runtime - reset :1, // - clear all variables of a given name - 'return' :1, // - get out of a function early - reverse :1, // - flip a string or a list - rewinddir :1, // - reset directory handle - rindex :1, // - right-to-left substring search - rmdir :1, // - remove a directory - s :null, // - replace a pattern with a string - say :1, // - print with newline - scalar :1, // - force a scalar context - seek :1, // - reposition file pointer for random-access I/O - seekdir :1, // - reposition directory pointer - select :1, // - reset default output or do I/O multiplexing - semctl :1, // - SysV semaphore control operations - semget :1, // - get set of SysV semaphores - semop :1, // - SysV semaphore operations - send :1, // - send a message over a socket - setgrent :1, // - prepare group file for use - sethostent :1, // - prepare hosts file for use - setnetent :1, // - prepare networks file for use - setpgrp :1, // - set the process group of a process - setpriority :1, // - set a process's nice value - setprotoent :1, // - prepare protocols file for use - setpwent :1, // - prepare passwd file for use - setservent :1, // - prepare services file for use - setsockopt :1, // - set some socket options - shift :1, // - remove the first element of an array, and return it - shmctl :1, // - SysV shared memory operations - shmget :1, // - get SysV shared memory segment identifier - shmread :1, // - read SysV shared memory - shmwrite :1, // - write SysV shared memory - shutdown :1, // - close down just half of a socket connection - 'sin' :1, // - return the sine of a number - sleep :1, // - block for some number of seconds - socket :1, // - create a socket - socketpair :1, // - create a pair of sockets - 'sort' :1, // - sort a list of values - splice :1, // - add or remove elements anywhere in an array - 'split' :1, // - split up a string using a regexp delimiter - sprintf :1, // - formatted print into a string - 'sqrt' :1, // - square root function - srand :1, // - seed the random number generator - stat :1, // - get a file's status information - state :1, // - declare and assign a state variable (persistent lexical scoping) - study :1, // - optimize input data for repeated searches - 'sub' :1, // - declare a subroutine, possibly anonymously - 'substr' :1, // - get or alter a portion of a stirng - symlink :1, // - create a symbolic link to a file - syscall :1, // - execute an arbitrary system call - sysopen :1, // - open a file, pipe, or descriptor - sysread :1, // - fixed-length unbuffered input from a filehandle - sysseek :1, // - position I/O pointer on handle used with sysread and syswrite - system :1, // - run a separate program - syswrite :1, // - fixed-length unbuffered output to a filehandle - tell :1, // - get current seekpointer on a filehandle - telldir :1, // - get current seekpointer on a directory handle - tie :1, // - bind a variable to an object class - tied :1, // - get a reference to the object underlying a tied variable - time :1, // - return number of seconds since 1970 - times :1, // - return elapsed time for self and child processes - tr :null, // - transliterate a string - truncate :1, // - shorten a file - uc :1, // - return upper-case version of a string - ucfirst :1, // - return a string with just the next letter in upper case - umask :1, // - set file creation mode mask - undef :1, // - remove a variable or function definition - unlink :1, // - remove one link to a file - unpack :1, // - convert binary structure into normal perl variables - unshift :1, // - prepend more elements to the beginning of a list - untie :1, // - break a tie binding to a variable - use :1, // - load in a module at compile time - utime :1, // - set a file's last access and modify times - values :1, // - return a list of the values in a hash - vec :1, // - test or set particular bits in a string - wait :1, // - wait for any child process to die - waitpid :1, // - wait for a particular child process to die - wantarray :1, // - get void vs scalar vs list context of current subroutine call - warn :1, // - print debugging info - when :1, // - write :1, // - print a picture record - y :null}; // - transliterate a string - - var RXstyle="string-2"; - var RXmodifiers=/[goseximacplud]/; // NOTE: "m", "s", "y" and "tr" need to correct real modifiers for each regexp type - - function tokenChain(stream,state,chain,style,tail){ // NOTE: chain.length > 2 is not working now (it's for s[...][...]geos;) - state.chain=null; // 12 3tail - state.style=null; - state.tail=null; - state.tokenize=function(stream,state){ - var e=false,c,i=0; - while(c=stream.next()){ - if(c===chain[i]&&!e){ - if(chain[++i]!==undefined){ - state.chain=chain[i]; - state.style=style; - state.tail=tail;} - else if(tail) - stream.eatWhile(tail); - state.tokenize=tokenPerl; - return style;} - e=!e&&c=="\\";} - return style;}; - return state.tokenize(stream,state);} - - function tokenSOMETHING(stream,state,string){ - state.tokenize=function(stream,state){ - if(stream.string==string) - state.tokenize=tokenPerl; - stream.skipToEnd(); - return "string";}; - return state.tokenize(stream,state);} - - function tokenPerl(stream,state){ - if(stream.eatSpace()) - return null; - if(state.chain) - return tokenChain(stream,state,state.chain,state.style,state.tail); - if(stream.match(/^\-?[\d\.]/,false)) - if(stream.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/)) - return 'number'; - if(stream.match(/^<<(?=\w)/)){ // NOTE: <<SOMETHING\n...\nSOMETHING\n - stream.eatWhile(/\w/); - return tokenSOMETHING(stream,state,stream.current().substr(2));} - if(stream.sol()&&stream.match(/^\=item(?!\w)/)){// NOTE: \n=item...\n=cut\n - return tokenSOMETHING(stream,state,'=cut');} - var ch=stream.next(); - if(ch=='"'||ch=="'"){ // NOTE: ' or " or <<'SOMETHING'\n...\nSOMETHING\n or <<"SOMETHING"\n...\nSOMETHING\n - if(stream.prefix(3)=="<<"+ch){ - var p=stream.pos; - stream.eatWhile(/\w/); - var n=stream.current().substr(1); - if(n&&stream.eat(ch)) - return tokenSOMETHING(stream,state,n); - stream.pos=p;} - return tokenChain(stream,state,[ch],"string");} - if(ch=="q"){ - var c=stream.look(-2); - if(!(c&&/\w/.test(c))){ - c=stream.look(0); - if(c=="x"){ - c=stream.look(1); - if(c=="("){ - stream.eatSuffix(2); - return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);} - if(c=="["){ - stream.eatSuffix(2); - return tokenChain(stream,state,["]"],RXstyle,RXmodifiers);} - if(c=="{"){ - stream.eatSuffix(2); - return tokenChain(stream,state,["}"],RXstyle,RXmodifiers);} - if(c=="<"){ - stream.eatSuffix(2); - return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);} - if(/[\^'"!~\/]/.test(c)){ - stream.eatSuffix(1); - return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers);}} - else if(c=="q"){ - c=stream.look(1); - if(c=="("){ - stream.eatSuffix(2); - return tokenChain(stream,state,[")"],"string");} - if(c=="["){ - stream.eatSuffix(2); - return tokenChain(stream,state,["]"],"string");} - if(c=="{"){ - stream.eatSuffix(2); - return tokenChain(stream,state,["}"],"string");} - if(c=="<"){ - stream.eatSuffix(2); - return tokenChain(stream,state,[">"],"string");} - if(/[\^'"!~\/]/.test(c)){ - stream.eatSuffix(1); - return tokenChain(stream,state,[stream.eat(c)],"string");}} - else if(c=="w"){ - c=stream.look(1); - if(c=="("){ - stream.eatSuffix(2); - return tokenChain(stream,state,[")"],"bracket");} - if(c=="["){ - stream.eatSuffix(2); - return tokenChain(stream,state,["]"],"bracket");} - if(c=="{"){ - stream.eatSuffix(2); - return tokenChain(stream,state,["}"],"bracket");} - if(c=="<"){ - stream.eatSuffix(2); - return tokenChain(stream,state,[">"],"bracket");} - if(/[\^'"!~\/]/.test(c)){ - stream.eatSuffix(1); - return tokenChain(stream,state,[stream.eat(c)],"bracket");}} - else if(c=="r"){ - c=stream.look(1); - if(c=="("){ - stream.eatSuffix(2); - return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);} - if(c=="["){ - stream.eatSuffix(2); - return tokenChain(stream,state,["]"],RXstyle,RXmodifiers);} - if(c=="{"){ - stream.eatSuffix(2); - return tokenChain(stream,state,["}"],RXstyle,RXmodifiers);} - if(c=="<"){ - stream.eatSuffix(2); - return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);} - if(/[\^'"!~\/]/.test(c)){ - stream.eatSuffix(1); - return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers);}} - else if(/[\^'"!~\/(\[{<]/.test(c)){ - if(c=="("){ - stream.eatSuffix(1); - return tokenChain(stream,state,[")"],"string");} - if(c=="["){ - stream.eatSuffix(1); - return tokenChain(stream,state,["]"],"string");} - if(c=="{"){ - stream.eatSuffix(1); - return tokenChain(stream,state,["}"],"string");} - if(c=="<"){ - stream.eatSuffix(1); - return tokenChain(stream,state,[">"],"string");} - if(/[\^'"!~\/]/.test(c)){ - return tokenChain(stream,state,[stream.eat(c)],"string");}}}} - if(ch=="m"){ - var c=stream.look(-2); - if(!(c&&/\w/.test(c))){ - c=stream.eat(/[(\[{<\^'"!~\/]/); - if(c){ - if(/[\^'"!~\/]/.test(c)){ - return tokenChain(stream,state,[c],RXstyle,RXmodifiers);} - if(c=="("){ - return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);} - if(c=="["){ - return tokenChain(stream,state,["]"],RXstyle,RXmodifiers);} - if(c=="{"){ - return tokenChain(stream,state,["}"],RXstyle,RXmodifiers);} - if(c=="<"){ - return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);}}}} - if(ch=="s"){ - var c=/[\/>\]})\w]/.test(stream.look(-2)); - if(!c){ - c=stream.eat(/[(\[{<\^'"!~\/]/); - if(c){ - if(c=="[") - return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers); - if(c=="{") - return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers); - if(c=="<") - return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers); - if(c=="(") - return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers); - return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}} - if(ch=="y"){ - var c=/[\/>\]})\w]/.test(stream.look(-2)); - if(!c){ - c=stream.eat(/[(\[{<\^'"!~\/]/); - if(c){ - if(c=="[") - return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers); - if(c=="{") - return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers); - if(c=="<") - return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers); - if(c=="(") - return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers); - return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}} - if(ch=="t"){ - var c=/[\/>\]})\w]/.test(stream.look(-2)); - if(!c){ - c=stream.eat("r");if(c){ - c=stream.eat(/[(\[{<\^'"!~\/]/); - if(c){ - if(c=="[") - return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers); - if(c=="{") - return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers); - if(c=="<") - return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers); - if(c=="(") - return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers); - return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}}} - if(ch=="`"){ - return tokenChain(stream,state,[ch],"variable-2");} - if(ch=="/"){ - if(!/~\s*$/.test(stream.prefix())) - return "operator"; - else - return tokenChain(stream,state,[ch],RXstyle,RXmodifiers);} - if(ch=="$"){ - var p=stream.pos; - if(stream.eatWhile(/\d/)||stream.eat("{")&&stream.eatWhile(/\d/)&&stream.eat("}")) - return "variable-2"; - else - stream.pos=p;} - if(/[$@%]/.test(ch)){ - var p=stream.pos; - if(stream.eat("^")&&stream.eat(/[A-Z]/)||!/[@$%&]/.test(stream.look(-2))&&stream.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){ - var c=stream.current(); - if(PERL[c]) - return "variable-2";} - stream.pos=p;} - if(/[$@%&]/.test(ch)){ - if(stream.eatWhile(/[\w$\[\]]/)||stream.eat("{")&&stream.eatWhile(/[\w$\[\]]/)&&stream.eat("}")){ - var c=stream.current(); - if(PERL[c]) - return "variable-2"; - else - return "variable";}} - if(ch=="#"){ - if(stream.look(-2)!="$"){ - stream.skipToEnd(); - return "comment";}} - if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(ch)){ - var p=stream.pos; - stream.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/); - if(PERL[stream.current()]) - return "operator"; - else - stream.pos=p;} - if(ch=="_"){ - if(stream.pos==1){ - if(stream.suffix(6)=="_END__"){ - return tokenChain(stream,state,['\0'],"comment");} - else if(stream.suffix(7)=="_DATA__"){ - return tokenChain(stream,state,['\0'],"variable-2");} - else if(stream.suffix(7)=="_C__"){ - return tokenChain(stream,state,['\0'],"string");}}} - if(/\w/.test(ch)){ - var p=stream.pos; - if(stream.look(-2)=="{"&&(stream.look(0)=="}"||stream.eatWhile(/\w/)&&stream.look(0)=="}")) - return "string"; - else - stream.pos=p;} - if(/[A-Z]/.test(ch)){ - var l=stream.look(-2); - var p=stream.pos; - stream.eatWhile(/[A-Z_]/); - if(/[\da-z]/.test(stream.look(0))){ - stream.pos=p;} - else{ - var c=PERL[stream.current()]; - if(!c) - return "meta"; - if(c[1]) - c=c[0]; - if(l!=":"){ - if(c==1) - return "keyword"; - else if(c==2) - return "def"; - else if(c==3) - return "atom"; - else if(c==4) - return "operator"; - else if(c==5) - return "variable-2"; - else - return "meta";} - else - return "meta";}} - if(/[a-zA-Z_]/.test(ch)){ - var l=stream.look(-2); - stream.eatWhile(/\w/); - var c=PERL[stream.current()]; - if(!c) - return "meta"; - if(c[1]) - c=c[0]; - if(l!=":"){ - if(c==1) - return "keyword"; - else if(c==2) - return "def"; - else if(c==3) - return "atom"; - else if(c==4) - return "operator"; - else if(c==5) - return "variable-2"; - else - return "meta";} - else - return "meta";} - return null;} - - return{ - startState:function(){ - return{ - tokenize:tokenPerl, - chain:null, - style:null, - tail:null};}, - token:function(stream,state){ - return (state.tokenize||tokenPerl)(stream,state);}, - electricChars:"{}"};}); - -CodeMirror.defineMIME("text/x-perl", "perl"); - -// it's like "peek", but need for look-ahead or look-behind if index < 0 -CodeMirror.StringStream.prototype.look=function(c){ - return this.string.charAt(this.pos+(c||0));}; - -// return a part of prefix of current stream from current position -CodeMirror.StringStream.prototype.prefix=function(c){ - if(c){ - var x=this.pos-c; - return this.string.substr((x>=0?x:0),c);} - else{ - return this.string.substr(0,this.pos-1);}}; - -// return a part of suffix of current stream from current position -CodeMirror.StringStream.prototype.suffix=function(c){ - var y=this.string.length; - var x=y-this.pos+1; - return this.string.substr(this.pos,(c&&c<y?c:x));}; - -// return a part of suffix of current stream from current position and change current position -CodeMirror.StringStream.prototype.nsuffix=function(c){ - var p=this.pos; - var l=c||(this.string.length-this.pos+1); - this.pos+=l; - return this.string.substr(p,l);}; - -// eating and vomiting a part of stream from current position -CodeMirror.StringStream.prototype.eatSuffix=function(c){ - var x=this.pos+c; - var y; - if(x<=0) - this.pos=0; - else if(x>=(y=this.string.length-1)) - this.pos=y; - else - this.pos=x;}; diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/php/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/php/index.html deleted file mode 100644 index 4b21c1900a3aa1f2a95cdb2ffc57bc247930524d..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/php/index.html +++ /dev/null @@ -1,51 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: PHP mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="../../lib/util/matchbrackets.js"></script> - <script src="../htmlmixed/htmlmixed.js"></script> - <script src="../xml/xml.js"></script> - <script src="../javascript/javascript.js"></script> - <script src="../css/css.js"></script> - <script src="../clike/clike.js"></script> - <script src="php.js"></script> - <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> - <link rel="stylesheet" href="../../doc/docs.css"> - </head> - <body> - <h1>CodeMirror: PHP mode</h1> - -<form><textarea id="code" name="code"> -<?php -function hello($who) { - return "Hello " . $who; -} -?> -<p>The program says <?= hello("World") ?>.</p> -<script> - alert("And here is some JS code"); // also colored -</script> -</textarea></form> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - matchBrackets: true, - mode: "application/x-httpd-php", - indentUnit: 4, - indentWithTabs: true, - enterMode: "keep", - tabMode: "shift" - }); - </script> - - <p>Simple HTML/PHP mode based on - the <a href="../clike/">C-like</a> mode. Depends on XML, - JavaScript, CSS, HTMLMixed, and C-like modes.</p> - - <p><strong>MIME types defined:</strong> <code>application/x-httpd-php</code> (HTML with PHP code), <code>text/x-php</code> (plain, non-wrapped PHP code).</p> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/php/php.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/php/php.js deleted file mode 100644 index ea32fda72a50763e87cb2a0e8ddbb99b63d1ee20..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/php/php.js +++ /dev/null @@ -1,129 +0,0 @@ -(function() { - function keywords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - function heredoc(delim) { - return function(stream, state) { - if (stream.match(delim)) state.tokenize = null; - else stream.skipToEnd(); - return "string"; - }; - } - var phpConfig = { - name: "clike", - keywords: keywords("abstract and array as break case catch class clone const continue declare default " + - "do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final " + - "for foreach function global goto if implements interface instanceof namespace " + - "new or private protected public static switch throw trait try use var while xor " + - "die echo empty exit eval include include_once isset list require require_once return " + - "print unset __halt_compiler self static parent"), - blockKeywords: keywords("catch do else elseif for foreach if switch try while"), - atoms: keywords("true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__"), - builtin: keywords("func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport echo print global static exit array empty eval isset unset die include require include_once require_once"), - multiLineStrings: true, - hooks: { - "$": function(stream) { - stream.eatWhile(/[\w\$_]/); - return "variable-2"; - }, - "<": function(stream, state) { - if (stream.match(/<</)) { - stream.eatWhile(/[\w\.]/); - state.tokenize = heredoc(stream.current().slice(3)); - return state.tokenize(stream, state); - } - return false; - }, - "#": function(stream) { - while (!stream.eol() && !stream.match("?>", false)) stream.next(); - return "comment"; - }, - "/": function(stream) { - if (stream.eat("/")) { - while (!stream.eol() && !stream.match("?>", false)) stream.next(); - return "comment"; - } - return false; - } - } - }; - - CodeMirror.defineMode("php", function(config, parserConfig) { - var htmlMode = CodeMirror.getMode(config, "text/html"); - var phpMode = CodeMirror.getMode(config, phpConfig); - - function dispatch(stream, state) { - var isPHP = state.curMode == phpMode; - if (stream.sol() && state.pending != '"') state.pending = null; - if (!isPHP) { - if (stream.match(/^<\?\w*/)) { - state.curMode = phpMode; - state.curState = state.php; - return "meta"; - } - if (state.pending == '"') { - while (!stream.eol() && stream.next() != '"') {} - var style = "string"; - } else if (state.pending && stream.pos < state.pending.end) { - stream.pos = state.pending.end; - var style = state.pending.style; - } else { - var style = htmlMode.token(stream, state.curState); - } - state.pending = null; - var cur = stream.current(), openPHP = cur.search(/<\?/); - if (openPHP != -1) { - if (style == "string" && /\"$/.test(cur) && !/\?>/.test(cur)) state.pending = '"'; - else state.pending = {end: stream.pos, style: style}; - stream.backUp(cur.length - openPHP); - } - return style; - } else if (isPHP && state.php.tokenize == null && stream.match("?>")) { - state.curMode = htmlMode; - state.curState = state.html; - return "meta"; - } else { - return phpMode.token(stream, state.curState); - } - } - - return { - startState: function() { - var html = CodeMirror.startState(htmlMode), php = CodeMirror.startState(phpMode); - return {html: html, - php: php, - curMode: parserConfig.startOpen ? phpMode : htmlMode, - curState: parserConfig.startOpen ? php : html, - pending: null}; - }, - - copyState: function(state) { - var html = state.html, htmlNew = CodeMirror.copyState(htmlMode, html), - php = state.php, phpNew = CodeMirror.copyState(phpMode, php), cur; - if (state.curMode == htmlMode) cur = htmlNew; - else cur = phpNew; - return {html: htmlNew, php: phpNew, curMode: state.curMode, curState: cur, - pending: state.pending}; - }, - - token: dispatch, - - indent: function(state, textAfter) { - if ((state.curMode != phpMode && /^\s*<\//.test(textAfter)) || - (state.curMode == phpMode && /^\?>/.test(textAfter))) - return htmlMode.indent(state.html, textAfter); - return state.curMode.indent(state.curState, textAfter); - }, - - electricChars: "/{}:", - - innerMode: function(state) { return {state: state.curState, mode: state.curMode}; } - }; - }, "htmlmixed"); - - CodeMirror.defineMIME("application/x-httpd-php", "php"); - CodeMirror.defineMIME("application/x-httpd-php-open", {name: "php", startOpen: true}); - CodeMirror.defineMIME("text/x-php", phpConfig); -})(); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/pig/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/pig/index.html deleted file mode 100644 index 1b0c60267f830c3bd924dc32a6f70452645b442e..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/pig/index.html +++ /dev/null @@ -1,42 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Pig Latin mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="pig.js"></script> - <link rel="stylesheet" href="../../doc/docs.css"> - <style>.CodeMirror {border: 2px inset #dee;}</style> - </head> - <body> - <h1>CodeMirror: Pig Latin mode</h1> - -<form><textarea id="code" name="code"> --- Apache Pig (Pig Latin Language) Demo -/* -This is a multiline comment. -*/ -a = LOAD "\path\to\input" USING PigStorage('\t') AS (x:long, y:chararray, z:bytearray); -b = GROUP a BY (x,y,3+4); -c = FOREACH b GENERATE flatten(group) as (x,y), SUM(group.$2) as z; -STORE c INTO "\path\to\output"; - --- -</textarea></form> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - indentUnit: 4, - mode: "text/x-pig" - }); - </script> - - <p> - Simple mode that handles Pig Latin language. - </p> - - <p><strong>MIME type defined:</strong> <code>text/x-pig</code> - (PIG code) -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/pig/pig.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/pig/pig.js deleted file mode 100644 index f8818a9b66b88bc294d1f34e8d4e109f88183d01..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/pig/pig.js +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Pig Latin Mode for CodeMirror 2 - * @author Prasanth Jayachandran - * @link https://github.com/prasanthj/pig-codemirror-2 - * This implementation is adapted from PL/SQL mode in CodeMirror 2. -*/ -CodeMirror.defineMode("pig", function(_config, parserConfig) { - var keywords = parserConfig.keywords, - builtins = parserConfig.builtins, - types = parserConfig.types, - multiLineStrings = parserConfig.multiLineStrings; - - var isOperatorChar = /[*+\-%<>=&?:\/!|]/; - - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - - var type; - function ret(tp, style) { - type = tp; - return style; - } - - function tokenComment(stream, state) { - var isEnd = false; - var ch; - while(ch = stream.next()) { - if(ch == "/" && isEnd) { - state.tokenize = tokenBase; - break; - } - isEnd = (ch == "*"); - } - return ret("comment", "comment"); - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while((next = stream.next()) != null) { - if (next == quote && !escaped) { - end = true; break; - } - escaped = !escaped && next == "\\"; - } - if (end || !(escaped || multiLineStrings)) - state.tokenize = tokenBase; - return ret("string", "error"); - }; - } - - function tokenBase(stream, state) { - var ch = stream.next(); - - // is a start of string? - if (ch == '"' || ch == "'") - return chain(stream, state, tokenString(ch)); - // is it one of the special chars - else if(/[\[\]{}\(\),;\.]/.test(ch)) - return ret(ch); - // is it a number? - else if(/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return ret("number", "number"); - } - // multi line comment or operator - else if (ch == "/") { - if (stream.eat("*")) { - return chain(stream, state, tokenComment); - } - else { - stream.eatWhile(isOperatorChar); - return ret("operator", "operator"); - } - } - // single line comment or operator - else if (ch=="-") { - if(stream.eat("-")){ - stream.skipToEnd(); - return ret("comment", "comment"); - } - else { - stream.eatWhile(isOperatorChar); - return ret("operator", "operator"); - } - } - // is it an operator - else if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return ret("operator", "operator"); - } - else { - // get the while word - stream.eatWhile(/[\w\$_]/); - // is it one of the listed keywords? - if (keywords && keywords.propertyIsEnumerable(stream.current().toUpperCase())) { - if (stream.eat(")") || stream.eat(".")) { - //keywords can be used as variables like flatten(group), group.$0 etc.. - } - else { - return ("keyword", "keyword"); - } - } - // is it one of the builtin functions? - if (builtins && builtins.propertyIsEnumerable(stream.current().toUpperCase())) - { - return ("keyword", "variable-2"); - } - // is it one of the listed types? - if (types && types.propertyIsEnumerable(stream.current().toUpperCase())) - return ("keyword", "variable-3"); - // default is a 'variable' - return ret("variable", "pig-word"); - } - } - - // Interface - return { - startState: function() { - return { - tokenize: tokenBase, - startOfLine: true - }; - }, - - token: function(stream, state) { - if(stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - return style; - } - }; -}); - -(function() { - function keywords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - // builtin funcs taken from trunk revision 1303237 - var pBuiltins = "ABS ACOS ARITY ASIN ATAN AVG BAGSIZE BINSTORAGE BLOOM BUILDBLOOM CBRT CEIL " - + "CONCAT COR COS COSH COUNT COUNT_STAR COV CONSTANTSIZE CUBEDIMENSIONS DIFF DISTINCT DOUBLEABS " - + "DOUBLEAVG DOUBLEBASE DOUBLEMAX DOUBLEMIN DOUBLEROUND DOUBLESUM EXP FLOOR FLOATABS FLOATAVG " - + "FLOATMAX FLOATMIN FLOATROUND FLOATSUM GENERICINVOKER INDEXOF INTABS INTAVG INTMAX INTMIN " - + "INTSUM INVOKEFORDOUBLE INVOKEFORFLOAT INVOKEFORINT INVOKEFORLONG INVOKEFORSTRING INVOKER " - + "ISEMPTY JSONLOADER JSONMETADATA JSONSTORAGE LAST_INDEX_OF LCFIRST LOG LOG10 LOWER LONGABS " - + "LONGAVG LONGMAX LONGMIN LONGSUM MAX MIN MAPSIZE MONITOREDUDF NONDETERMINISTIC OUTPUTSCHEMA " - + "PIGSTORAGE PIGSTREAMING RANDOM REGEX_EXTRACT REGEX_EXTRACT_ALL REPLACE ROUND SIN SINH SIZE " - + "SQRT STRSPLIT SUBSTRING SUM STRINGCONCAT STRINGMAX STRINGMIN STRINGSIZE TAN TANH TOBAG " - + "TOKENIZE TOMAP TOP TOTUPLE TRIM TEXTLOADER TUPLESIZE UCFIRST UPPER UTF8STORAGECONVERTER "; - - // taken from QueryLexer.g - var pKeywords = "VOID IMPORT RETURNS DEFINE LOAD FILTER FOREACH ORDER CUBE DISTINCT COGROUP " - + "JOIN CROSS UNION SPLIT INTO IF OTHERWISE ALL AS BY USING INNER OUTER ONSCHEMA PARALLEL " - + "PARTITION GROUP AND OR NOT GENERATE FLATTEN ASC DESC IS STREAM THROUGH STORE MAPREDUCE " - + "SHIP CACHE INPUT OUTPUT STDERROR STDIN STDOUT LIMIT SAMPLE LEFT RIGHT FULL EQ GT LT GTE LTE " - + "NEQ MATCHES TRUE FALSE "; - - // data types - var pTypes = "BOOLEAN INT LONG FLOAT DOUBLE CHARARRAY BYTEARRAY BAG TUPLE MAP "; - - CodeMirror.defineMIME("text/x-pig", { - name: "pig", - builtins: keywords(pBuiltins), - keywords: keywords(pKeywords), - types: keywords(pTypes) - }); -}()); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/plsql/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/plsql/index.html deleted file mode 100644 index 9206e42403ff65d038cfe8d74c9a2c314b6d7c84..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/plsql/index.html +++ /dev/null @@ -1,62 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Oracle PL/SQL mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="plsql.js"></script> - <link rel="stylesheet" href="../../doc/docs.css"> - <style>.CodeMirror {border: 2px inset #dee;}</style> - </head> - <body> - <h1>CodeMirror: Oracle PL/SQL mode</h1> - -<form><textarea id="code" name="code"> --- Oracle PL/SQL Code Demo -/* - based on c-like mode, adapted to PL/SQL by Peter Raganitsch ( http://www.oracle-and-apex.com/ ) - April 2011 -*/ -DECLARE - vIdx NUMBER; - vString VARCHAR2(100); - cText CONSTANT VARCHAR2(100) := 'That''s it! Have fun with CodeMirror 2'; -BEGIN - vIdx := 0; - -- - FOR rDATA IN - ( SELECT * - FROM EMP - ORDER BY EMPNO - ) - LOOP - vIdx := vIdx + 1; - vString := rDATA.EMPNO || ' - ' || rDATA.ENAME; - -- - UPDATE EMP - SET SAL = SAL * 101/100 - WHERE EMPNO = rDATA.EMPNO - ; - END LOOP; - -- - SYS.DBMS_OUTPUT.Put_Line (cText); -END; --- -</textarea></form> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - indentUnit: 4, - mode: "text/x-plsql" - }); - </script> - - <p> - Simple mode that handles Oracle PL/SQL language (and Oracle SQL, of course). - </p> - - <p><strong>MIME type defined:</strong> <code>text/x-plsql</code> - (PLSQL code) -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/plsql/plsql.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/plsql/plsql.js deleted file mode 100644 index df119baee195b6bba14529dcf2491761e51547cc..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/plsql/plsql.js +++ /dev/null @@ -1,216 +0,0 @@ -CodeMirror.defineMode("plsql", function(_config, parserConfig) { - var keywords = parserConfig.keywords, - functions = parserConfig.functions, - types = parserConfig.types, - sqlplus = parserConfig.sqlplus, - multiLineStrings = parserConfig.multiLineStrings; - var isOperatorChar = /[+\-*&%=<>!?:\/|]/; - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - - var type; - function ret(tp, style) { - type = tp; - return style; - } - - function tokenBase(stream, state) { - var ch = stream.next(); - // start of string? - if (ch == '"' || ch == "'") - return chain(stream, state, tokenString(ch)); - // is it one of the special signs []{}().,;? Seperator? - else if (/[\[\]{}\(\),;\.]/.test(ch)) - return ret(ch); - // start of a number value? - else if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return ret("number", "number"); - } - // multi line comment or simple operator? - else if (ch == "/") { - if (stream.eat("*")) { - return chain(stream, state, tokenComment); - } - else { - stream.eatWhile(isOperatorChar); - return ret("operator", "operator"); - } - } - // single line comment or simple operator? - else if (ch == "-") { - if (stream.eat("-")) { - stream.skipToEnd(); - return ret("comment", "comment"); - } - else { - stream.eatWhile(isOperatorChar); - return ret("operator", "operator"); - } - } - // pl/sql variable? - else if (ch == "@" || ch == "$") { - stream.eatWhile(/[\w\d\$_]/); - return ret("word", "variable"); - } - // is it a operator? - else if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return ret("operator", "operator"); - } - else { - // get the whole word - stream.eatWhile(/[\w\$_]/); - // is it one of the listed keywords? - if (keywords && keywords.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "keyword"); - // is it one of the listed functions? - if (functions && functions.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "builtin"); - // is it one of the listed types? - if (types && types.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "variable-2"); - // is it one of the listed sqlplus keywords? - if (sqlplus && sqlplus.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "variable-3"); - // default: just a "variable" - return ret("word", "variable"); - } - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && next == "\\"; - } - if (end || !(escaped || multiLineStrings)) - state.tokenize = tokenBase; - return ret("string", "plsql-string"); - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return ret("comment", "plsql-comment"); - } - - // Interface - - return { - startState: function() { - return { - tokenize: tokenBase, - startOfLine: true - }; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - return style; - } - }; -}); - -(function() { - function keywords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - var cKeywords = "abort accept access add all alter and any array arraylen as asc assert assign at attributes audit " + - "authorization avg " + - "base_table begin between binary_integer body boolean by " + - "case cast char char_base check close cluster clusters colauth column comment commit compress connect " + - "connected constant constraint crash create current currval cursor " + - "data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete " + - "desc digits dispose distinct do drop " + - "else elsif enable end entry escape exception exception_init exchange exclusive exists exit external " + - "fast fetch file for force form from function " + - "generic goto grant group " + - "having " + - "identified if immediate in increment index indexes indicator initial initrans insert interface intersect " + - "into is " + - "key " + - "level library like limited local lock log logging long loop " + - "master maxextents maxtrans member minextents minus mislabel mode modify multiset " + - "new next no noaudit nocompress nologging noparallel not nowait number_base " + - "object of off offline on online only open option or order out " + - "package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior " + - "private privileges procedure public " + - "raise range raw read rebuild record ref references refresh release rename replace resource restrict return " + - "returning reverse revoke rollback row rowid rowlabel rownum rows run " + - "savepoint schema segment select separate session set share snapshot some space split sql start statement " + - "storage subtype successful synonym " + - "tabauth table tables tablespace task terminate then to trigger truncate type " + - "union unique unlimited unrecoverable unusable update use using " + - "validate value values variable view views " + - "when whenever where while with work"; - - var cFunctions = "abs acos add_months ascii asin atan atan2 average " + - "bfilename " + - "ceil chartorowid chr concat convert cos cosh count " + - "decode deref dual dump dup_val_on_index " + - "empty error exp " + - "false floor found " + - "glb greatest " + - "hextoraw " + - "initcap instr instrb isopen " + - "last_day least lenght lenghtb ln lower lpad ltrim lub " + - "make_ref max min mod months_between " + - "new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower " + - "nls_sort nls_upper nlssort no_data_found notfound null nvl " + - "others " + - "power " + - "rawtohex reftohex round rowcount rowidtochar rpad rtrim " + - "sign sin sinh soundex sqlcode sqlerrm sqrt stddev substr substrb sum sysdate " + - "tan tanh to_char to_date to_label to_multi_byte to_number to_single_byte translate true trunc " + - "uid upper user userenv " + - "variance vsize"; - - var cTypes = "bfile blob " + - "character clob " + - "dec " + - "float " + - "int integer " + - "mlslabel " + - "natural naturaln nchar nclob number numeric nvarchar2 " + - "real rowtype " + - "signtype smallint string " + - "varchar varchar2"; - - var cSqlplus = "appinfo arraysize autocommit autoprint autorecovery autotrace " + - "blockterminator break btitle " + - "cmdsep colsep compatibility compute concat copycommit copytypecheck " + - "define describe " + - "echo editfile embedded escape exec execute " + - "feedback flagger flush " + - "heading headsep " + - "instance " + - "linesize lno loboffset logsource long longchunksize " + - "markup " + - "native newpage numformat numwidth " + - "pagesize pause pno " + - "recsep recsepchar release repfooter repheader " + - "serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber " + - "sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix " + - "tab term termout time timing trimout trimspool ttitle " + - "underline " + - "verify version " + - "wrap"; - - CodeMirror.defineMIME("text/x-plsql", { - name: "plsql", - keywords: keywords(cKeywords), - functions: keywords(cFunctions), - types: keywords(cTypes), - sqlplus: keywords(cSqlplus) - }); -}()); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/properties/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/properties/index.html deleted file mode 100644 index e21e02abd28d5e5d813f73c9fb1ad1da0b5ce350..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/properties/index.html +++ /dev/null @@ -1,41 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Properties files mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="properties.js"></script> - <style>.CodeMirror {border-top: 1px solid #ddd; border-bottom: 1px solid #ddd;}</style> - <link rel="stylesheet" href="../../doc/docs.css"> - </head> - <body> - <h1>CodeMirror: Properties files mode</h1> - <form><textarea id="code" name="code"> -# This is a properties file -a.key = A value -another.key = http://example.com -! Exclamation mark as comment -but.not=Within ! A value # indeed - # Spaces at the beginning of a line - spaces.before.key=value -backslash=Used for multi\ - line entries,\ - that's convenient. -# Unicode sequences -unicode.key=This is \u0020 Unicode -no.multiline=here -# Colons -colons : can be used too -# Spaces -spaces\ in\ keys=Not very common... -</textarea></form> - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), {}); - </script> - - <p><strong>MIME types defined:</strong> <code>text/x-properties</code>, - <code>text/x-ini</code>.</p> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/properties/properties.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/properties/properties.js deleted file mode 100644 index d3a13c765dca5afbd2b8a69ebef4017033bdd68b..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/properties/properties.js +++ /dev/null @@ -1,63 +0,0 @@ -CodeMirror.defineMode("properties", function() { - return { - token: function(stream, state) { - var sol = stream.sol() || state.afterSection; - var eol = stream.eol(); - - state.afterSection = false; - - if (sol) { - if (state.nextMultiline) { - state.inMultiline = true; - state.nextMultiline = false; - } else { - state.position = "def"; - } - } - - if (eol && ! state.nextMultiline) { - state.inMultiline = false; - state.position = "def"; - } - - if (sol) { - while(stream.eatSpace()); - } - - var ch = stream.next(); - - if (sol && (ch === "#" || ch === "!" || ch === ";")) { - state.position = "comment"; - stream.skipToEnd(); - return "comment"; - } else if (sol && ch === "[") { - state.afterSection = true; - stream.skipTo("]"); stream.eat("]"); - return "header"; - } else if (ch === "=" || ch === ":") { - state.position = "quote"; - return null; - } else if (ch === "\\" && state.position === "quote") { - if (stream.next() !== "u") { // u = Unicode sequence \u1234 - // Multiline value - state.nextMultiline = true; - } - } - - return state.position; - }, - - startState: function() { - return { - position : "def", // Current position, "def", "quote" or "comment" - nextMultiline : false, // Is the next line multiline value - inMultiline : false, // Is the current line a multiline value - afterSection : false // Did we just open a section - }; - } - - }; -}); - -CodeMirror.defineMIME("text/x-properties", "properties"); -CodeMirror.defineMIME("text/x-ini", "properties"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/python/LICENSE.txt b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/python/LICENSE.txt deleted file mode 100644 index 918866b42a7709e69143605918c4adc30863bbdd..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/python/LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License - -Copyright (c) 2010 Timothy Farrell - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/python/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/python/index.html deleted file mode 100644 index 7a26d278dbb16e8f3acd25cbdeeedce39d614064..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/python/index.html +++ /dev/null @@ -1,124 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Python mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="../../lib/util/matchbrackets.js"></script> - <script src="python.js"></script> - <link rel="stylesheet" href="../../doc/docs.css"> - <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> - </head> - <body> - <h1>CodeMirror: Python mode</h1> - - <div><textarea id="code" name="code"> -# Literals -1234 -0.0e101 -.123 -0b01010011100 -0o01234567 -0x0987654321abcdef -7 -2147483647 -3L -79228162514264337593543950336L -0x100000000L -79228162514264337593543950336 -0xdeadbeef -3.14j -10.j -10j -.001j -1e100j -3.14e-10j - - -# String Literals -'For\'' -"God\"" -"""so loved -the world""" -'''that he gave -his only begotten\' ''' -'that whosoever believeth \ -in him' -'' - -# Identifiers -__a__ -a.b -a.b.c - -# Operators -+ - * / % & | ^ ~ < > -== != <= >= <> << >> // ** -and or not in is - -# Delimiters -() [] {} , : ` = ; @ . # Note that @ and . require the proper context. -+= -= *= /= %= &= |= ^= -//= >>= <<= **= - -# Keywords -as assert break class continue def del elif else except -finally for from global if import lambda pass raise -return try while with yield - -# Python 2 Keywords (otherwise Identifiers) -exec print - -# Python 3 Keywords (otherwise Identifiers) -nonlocal - -# Types -bool classmethod complex dict enumerate float frozenset int list object -property reversed set slice staticmethod str super tuple type - -# Python 2 Types (otherwise Identifiers) -basestring buffer file long unicode xrange - -# Python 3 Types (otherwise Identifiers) -bytearray bytes filter map memoryview open range zip - -# Some Example code -import os -from package import ParentClass - -@nonsenseDecorator -def doesNothing(): - pass - -class ExampleClass(ParentClass): - @staticmethod - def example(inputStr): - a = list(inputStr) - a.reverse() - return ''.join(a) - - def __init__(self, mixin = 'Hello'): - self.mixin = mixin - -</textarea></div> - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - mode: {name: "python", - version: 2, - singleLineStringErrors: false}, - lineNumbers: true, - indentUnit: 4, - tabMode: "shift", - matchBrackets: true - }); - </script> - <h2>Configuration Options:</h2> - <ul> - <li>version - 2/3 - The version of Python to recognize. Default is 2.</li> - <li>singleLineStringErrors - true/false - If you have a single-line string that is not terminated at the end of the line, this will show subsequent lines as errors if true, otherwise it will consider the newline as the end of the string. Default is false.</li> - </ul> - - <p><strong>MIME types defined:</strong> <code>text/x-python</code>.</p> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/python/python.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/python/python.js deleted file mode 100644 index a12e326dc805251749e84a2161b41891241a3693..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/python/python.js +++ /dev/null @@ -1,340 +0,0 @@ -CodeMirror.defineMode("python", function(conf, parserConf) { - var ERRORCLASS = 'error'; - - function wordRegexp(words) { - return new RegExp("^((" + words.join(")|(") + "))\\b"); - } - - var singleOperators = new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"); - var singleDelimiters = new RegExp('^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]'); - var doubleOperators = new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"); - var doubleDelimiters = new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"); - var tripleDelimiters = new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"); - var identifiers = new RegExp("^[_A-Za-z][_A-Za-z0-9]*"); - - var wordOperators = wordRegexp(['and', 'or', 'not', 'is', 'in']); - var commonkeywords = ['as', 'assert', 'break', 'class', 'continue', - 'def', 'del', 'elif', 'else', 'except', 'finally', - 'for', 'from', 'global', 'if', 'import', - 'lambda', 'pass', 'raise', 'return', - 'try', 'while', 'with', 'yield']; - var commonBuiltins = ['abs', 'all', 'any', 'bin', 'bool', 'bytearray', 'callable', 'chr', - 'classmethod', 'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod', - 'enumerate', 'eval', 'filter', 'float', 'format', 'frozenset', - 'getattr', 'globals', 'hasattr', 'hash', 'help', 'hex', 'id', - 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', - 'list', 'locals', 'map', 'max', 'memoryview', 'min', 'next', - 'object', 'oct', 'open', 'ord', 'pow', 'property', 'range', - 'repr', 'reversed', 'round', 'set', 'setattr', 'slice', - 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', - 'type', 'vars', 'zip', '__import__', 'NotImplemented', - 'Ellipsis', '__debug__']; - var py2 = {'builtins': ['apply', 'basestring', 'buffer', 'cmp', 'coerce', 'execfile', - 'file', 'intern', 'long', 'raw_input', 'reduce', 'reload', - 'unichr', 'unicode', 'xrange', 'False', 'True', 'None'], - 'keywords': ['exec', 'print']}; - var py3 = {'builtins': ['ascii', 'bytes', 'exec', 'print'], - 'keywords': ['nonlocal', 'False', 'True', 'None']}; - - if (!!parserConf.version && parseInt(parserConf.version, 10) === 3) { - commonkeywords = commonkeywords.concat(py3.keywords); - commonBuiltins = commonBuiltins.concat(py3.builtins); - var stringPrefixes = new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))", "i"); - } else { - commonkeywords = commonkeywords.concat(py2.keywords); - commonBuiltins = commonBuiltins.concat(py2.builtins); - var stringPrefixes = new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))", "i"); - } - var keywords = wordRegexp(commonkeywords); - var builtins = wordRegexp(commonBuiltins); - - var indentInfo = null; - - // tokenizers - function tokenBase(stream, state) { - // Handle scope changes - if (stream.sol()) { - var scopeOffset = state.scopes[0].offset; - if (stream.eatSpace()) { - var lineOffset = stream.indentation(); - if (lineOffset > scopeOffset) { - indentInfo = 'indent'; - } else if (lineOffset < scopeOffset) { - indentInfo = 'dedent'; - } - return null; - } else { - if (scopeOffset > 0) { - dedent(stream, state); - } - } - } - if (stream.eatSpace()) { - return null; - } - - var ch = stream.peek(); - - // Handle Comments - if (ch === '#') { - stream.skipToEnd(); - return 'comment'; - } - - // Handle Number Literals - if (stream.match(/^[0-9\.]/, false)) { - var floatLiteral = false; - // Floats - if (stream.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)) { floatLiteral = true; } - if (stream.match(/^\d+\.\d*/)) { floatLiteral = true; } - if (stream.match(/^\.\d+/)) { floatLiteral = true; } - if (floatLiteral) { - // Float literals may be "imaginary" - stream.eat(/J/i); - return 'number'; - } - // Integers - var intLiteral = false; - // Hex - if (stream.match(/^0x[0-9a-f]+/i)) { intLiteral = true; } - // Binary - if (stream.match(/^0b[01]+/i)) { intLiteral = true; } - // Octal - if (stream.match(/^0o[0-7]+/i)) { intLiteral = true; } - // Decimal - if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) { - // Decimal literals may be "imaginary" - stream.eat(/J/i); - // TODO - Can you have imaginary longs? - intLiteral = true; - } - // Zero by itself with no other piece of number. - if (stream.match(/^0(?![\dx])/i)) { intLiteral = true; } - if (intLiteral) { - // Integer literals may be "long" - stream.eat(/L/i); - return 'number'; - } - } - - // Handle Strings - if (stream.match(stringPrefixes)) { - state.tokenize = tokenStringFactory(stream.current()); - return state.tokenize(stream, state); - } - - // Handle operators and Delimiters - if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) { - return null; - } - if (stream.match(doubleOperators) - || stream.match(singleOperators) - || stream.match(wordOperators)) { - return 'operator'; - } - if (stream.match(singleDelimiters)) { - return null; - } - - if (stream.match(keywords)) { - return 'keyword'; - } - - if (stream.match(builtins)) { - return 'builtin'; - } - - if (stream.match(identifiers)) { - return 'variable'; - } - - // Handle non-detected items - stream.next(); - return ERRORCLASS; - } - - function tokenStringFactory(delimiter) { - while ('rub'.indexOf(delimiter.charAt(0).toLowerCase()) >= 0) { - delimiter = delimiter.substr(1); - } - var singleline = delimiter.length == 1; - var OUTCLASS = 'string'; - - function tokenString(stream, state) { - while (!stream.eol()) { - stream.eatWhile(/[^'"\\]/); - if (stream.eat('\\')) { - stream.next(); - if (singleline && stream.eol()) { - return OUTCLASS; - } - } else if (stream.match(delimiter)) { - state.tokenize = tokenBase; - return OUTCLASS; - } else { - stream.eat(/['"]/); - } - } - if (singleline) { - if (parserConf.singleLineStringErrors) { - return ERRORCLASS; - } else { - state.tokenize = tokenBase; - } - } - return OUTCLASS; - } - tokenString.isString = true; - return tokenString; - } - - function indent(stream, state, type) { - type = type || 'py'; - var indentUnit = 0; - if (type === 'py') { - if (state.scopes[0].type !== 'py') { - state.scopes[0].offset = stream.indentation(); - return; - } - for (var i = 0; i < state.scopes.length; ++i) { - if (state.scopes[i].type === 'py') { - indentUnit = state.scopes[i].offset + conf.indentUnit; - break; - } - } - } else { - indentUnit = stream.column() + stream.current().length; - } - state.scopes.unshift({ - offset: indentUnit, - type: type - }); - } - - function dedent(stream, state, type) { - type = type || 'py'; - if (state.scopes.length == 1) return; - if (state.scopes[0].type === 'py') { - var _indent = stream.indentation(); - var _indent_index = -1; - for (var i = 0; i < state.scopes.length; ++i) { - if (_indent === state.scopes[i].offset) { - _indent_index = i; - break; - } - } - if (_indent_index === -1) { - return true; - } - while (state.scopes[0].offset !== _indent) { - state.scopes.shift(); - } - return false; - } else { - if (type === 'py') { - state.scopes[0].offset = stream.indentation(); - return false; - } else { - if (state.scopes[0].type != type) { - return true; - } - state.scopes.shift(); - return false; - } - } - } - - function tokenLexer(stream, state) { - indentInfo = null; - var style = state.tokenize(stream, state); - var current = stream.current(); - - // Handle '.' connected identifiers - if (current === '.') { - style = stream.match(identifiers, false) ? null : ERRORCLASS; - if (style === null && state.lastToken === 'meta') { - // Apply 'meta' style to '.' connected identifiers when - // appropriate. - style = 'meta'; - } - return style; - } - - // Handle decorators - if (current === '@') { - return stream.match(identifiers, false) ? 'meta' : ERRORCLASS; - } - - if ((style === 'variable' || style === 'builtin') - && state.lastToken === 'meta') { - style = 'meta'; - } - - // Handle scope changes. - if (current === 'pass' || current === 'return') { - state.dedent += 1; - } - if (current === 'lambda') state.lambda = true; - if ((current === ':' && !state.lambda && state.scopes[0].type == 'py') - || indentInfo === 'indent') { - indent(stream, state); - } - var delimiter_index = '[({'.indexOf(current); - if (delimiter_index !== -1) { - indent(stream, state, '])}'.slice(delimiter_index, delimiter_index+1)); - } - if (indentInfo === 'dedent') { - if (dedent(stream, state)) { - return ERRORCLASS; - } - } - delimiter_index = '])}'.indexOf(current); - if (delimiter_index !== -1) { - if (dedent(stream, state, current)) { - return ERRORCLASS; - } - } - if (state.dedent > 0 && stream.eol() && state.scopes[0].type == 'py') { - if (state.scopes.length > 1) state.scopes.shift(); - state.dedent -= 1; - } - - return style; - } - - var external = { - startState: function(basecolumn) { - return { - tokenize: tokenBase, - scopes: [{offset:basecolumn || 0, type:'py'}], - lastToken: null, - lambda: false, - dedent: 0 - }; - }, - - token: function(stream, state) { - var style = tokenLexer(stream, state); - - state.lastToken = style; - - if (stream.eol() && stream.lambda) { - state.lambda = false; - } - - return style; - }, - - indent: function(state) { - if (state.tokenize != tokenBase) { - return state.tokenize.isString ? CodeMirror.Pass : 0; - } - - return state.scopes[0].offset; - } - - }; - return external; -}); - -CodeMirror.defineMIME("text/x-python", "python"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/r/LICENSE b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/r/LICENSE deleted file mode 100644 index 2510ae16cf7288da165dfe6a29717eb24a3a58cc..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/r/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2011, Ubalo, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Ubalo, Inc nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL UBALO, INC BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/r/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/r/index.html deleted file mode 100644 index 12819553e9c25eb7f2136d60a5eeb20c8871b43c..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/r/index.html +++ /dev/null @@ -1,74 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: R mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="r.js"></script> - <style> - .CodeMirror { border-top: 1px solid silver; border-bottom: 1px solid silver; } - .cm-s-default span.cm-semi { color: blue; font-weight: bold; } - .cm-s-default span.cm-dollar { color: orange; font-weight: bold; } - .cm-s-default span.cm-arrow { color: brown; } - .cm-s-default span.cm-arg-is { color: brown; } - </style> - <link rel="stylesheet" href="../../doc/docs.css"> - </head> - <body> - <h1>CodeMirror: R mode</h1> - <form><textarea id="code" name="code"> -# Code from http://www.mayin.org/ajayshah/KB/R/ - -# FIRST LEARN ABOUT LISTS -- -X = list(height=5.4, weight=54) -print("Use default printing --") -print(X) -print("Accessing individual elements --") -cat("Your height is ", X$height, " and your weight is ", X$weight, "\n") - -# FUNCTIONS -- -square <- function(x) { - return(x*x) -} -cat("The square of 3 is ", square(3), "\n") - - # default value of the arg is set to 5. -cube <- function(x=5) { - return(x*x*x); -} -cat("Calling cube with 2 : ", cube(2), "\n") # will give 2^3 -cat("Calling cube : ", cube(), "\n") # will default to 5^3. - -# LEARN ABOUT FUNCTIONS THAT RETURN MULTIPLE OBJECTS -- -powers <- function(x) { - parcel = list(x2=x*x, x3=x*x*x, x4=x*x*x*x); - return(parcel); -} - -X = powers(3); -print("Showing powers of 3 --"); print(X); - -# WRITING THIS COMPACTLY (4 lines instead of 7) - -powerful <- function(x) { - return(list(x2=x*x, x3=x*x*x, x4=x*x*x*x)); -} -print("Showing powers of 3 --"); print(powerful(3)); - -# In R, the last expression in a function is, by default, what is -# returned. So you could equally just say: -powerful <- function(x) {list(x2=x*x, x3=x*x*x, x4=x*x*x*x)} -</textarea></form> - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), {}); - </script> - - <p><strong>MIME types defined:</strong> <code>text/x-rsrc</code>.</p> - - <p>Development of the CodeMirror R mode was kindly sponsored - by <a href="http://ubalo.com/">Ubalo</a>, who hold - the <a href="LICENSE">license</a>.</p> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/r/r.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/r/r.js deleted file mode 100644 index 6410efbb22723c98a48efafe4519d958f73508d4..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/r/r.js +++ /dev/null @@ -1,141 +0,0 @@ -CodeMirror.defineMode("r", function(config) { - function wordObj(str) { - var words = str.split(" "), res = {}; - for (var i = 0; i < words.length; ++i) res[words[i]] = true; - return res; - } - var atoms = wordObj("NULL NA Inf NaN NA_integer_ NA_real_ NA_complex_ NA_character_"); - var builtins = wordObj("list quote bquote eval return call parse deparse"); - var keywords = wordObj("if else repeat while function for in next break"); - var blockkeywords = wordObj("if else repeat while function for"); - var opChars = /[+\-*\/^<>=!&|~$:]/; - var curPunc; - - function tokenBase(stream, state) { - curPunc = null; - var ch = stream.next(); - if (ch == "#") { - stream.skipToEnd(); - return "comment"; - } else if (ch == "0" && stream.eat("x")) { - stream.eatWhile(/[\da-f]/i); - return "number"; - } else if (ch == "." && stream.eat(/\d/)) { - stream.match(/\d*(?:e[+\-]?\d+)?/); - return "number"; - } else if (/\d/.test(ch)) { - stream.match(/\d*(?:\.\d+)?(?:e[+\-]\d+)?L?/); - return "number"; - } else if (ch == "'" || ch == '"') { - state.tokenize = tokenString(ch); - return "string"; - } else if (ch == "." && stream.match(/.[.\d]+/)) { - return "keyword"; - } else if (/[\w\.]/.test(ch) && ch != "_") { - stream.eatWhile(/[\w\.]/); - var word = stream.current(); - if (atoms.propertyIsEnumerable(word)) return "atom"; - if (keywords.propertyIsEnumerable(word)) { - if (blockkeywords.propertyIsEnumerable(word)) curPunc = "block"; - return "keyword"; - } - if (builtins.propertyIsEnumerable(word)) return "builtin"; - return "variable"; - } else if (ch == "%") { - if (stream.skipTo("%")) stream.next(); - return "variable-2"; - } else if (ch == "<" && stream.eat("-")) { - return "arrow"; - } else if (ch == "=" && state.ctx.argList) { - return "arg-is"; - } else if (opChars.test(ch)) { - if (ch == "$") return "dollar"; - stream.eatWhile(opChars); - return "operator"; - } else if (/[\(\){}\[\];]/.test(ch)) { - curPunc = ch; - if (ch == ";") return "semi"; - return null; - } else { - return null; - } - } - - function tokenString(quote) { - return function(stream, state) { - if (stream.eat("\\")) { - var ch = stream.next(); - if (ch == "x") stream.match(/^[a-f0-9]{2}/i); - else if ((ch == "u" || ch == "U") && stream.eat("{") && stream.skipTo("}")) stream.next(); - else if (ch == "u") stream.match(/^[a-f0-9]{4}/i); - else if (ch == "U") stream.match(/^[a-f0-9]{8}/i); - else if (/[0-7]/.test(ch)) stream.match(/^[0-7]{1,2}/); - return "string-2"; - } else { - var next; - while ((next = stream.next()) != null) { - if (next == quote) { state.tokenize = tokenBase; break; } - if (next == "\\") { stream.backUp(1); break; } - } - return "string"; - } - }; - } - - function push(state, type, stream) { - state.ctx = {type: type, - indent: state.indent, - align: null, - column: stream.column(), - prev: state.ctx}; - } - function pop(state) { - state.indent = state.ctx.indent; - state.ctx = state.ctx.prev; - } - - return { - startState: function() { - return {tokenize: tokenBase, - ctx: {type: "top", - indent: -config.indentUnit, - align: false}, - indent: 0, - afterIdent: false}; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (state.ctx.align == null) state.ctx.align = false; - state.indent = stream.indentation(); - } - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - if (style != "comment" && state.ctx.align == null) state.ctx.align = true; - - var ctype = state.ctx.type; - if ((curPunc == ";" || curPunc == "{" || curPunc == "}") && ctype == "block") pop(state); - if (curPunc == "{") push(state, "}", stream); - else if (curPunc == "(") { - push(state, ")", stream); - if (state.afterIdent) state.ctx.argList = true; - } - else if (curPunc == "[") push(state, "]", stream); - else if (curPunc == "block") push(state, "block", stream); - else if (curPunc == ctype) pop(state); - state.afterIdent = style == "variable" || style == "keyword"; - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), ctx = state.ctx, - closing = firstChar == ctx.type; - if (ctx.type == "block") return ctx.indent + (firstChar == "{" ? 0 : config.indentUnit); - else if (ctx.align) return ctx.column + (closing ? 0 : 1); - else return ctx.indent + (closing ? 0 : config.indentUnit); - } - }; -}); - -CodeMirror.defineMIME("text/x-rsrc", "r"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/rpm/changes/changes.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/rpm/changes/changes.js deleted file mode 100644 index 14a08d9700849eb74c727fb4e2bff8ee78befa73..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/rpm/changes/changes.js +++ /dev/null @@ -1,19 +0,0 @@ -CodeMirror.defineMode("changes", function() { - var headerSeperator = /^-+$/; - var headerLine = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /; - var simpleEmail = /^[\w+.-]+@[\w.-]+/; - - return { - token: function(stream) { - if (stream.sol()) { - if (stream.match(headerSeperator)) { return 'tag'; } - if (stream.match(headerLine)) { return 'tag'; } - } - if (stream.match(simpleEmail)) { return 'string'; } - stream.next(); - return null; - } - }; -}); - -CodeMirror.defineMIME("text/x-rpm-changes", "changes"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/rpm/changes/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/rpm/changes/index.html deleted file mode 100644 index e0e2d8778bd0e8e128ac8348b60a4b77d49fb97d..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/rpm/changes/index.html +++ /dev/null @@ -1,53 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: RPM changes mode</title> - <link rel="stylesheet" href="../../../lib/codemirror.css"> - <script src="../../../lib/codemirror.js"></script> - <script src="changes.js"></script> - <link rel="stylesheet" href="../../../doc/docs.css"> - <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> - </head> - <body> - <h1>CodeMirror: RPM changes mode</h1> - - <div><textarea id="code" name="code"> -------------------------------------------------------------------- -Tue Oct 18 13:58:40 UTC 2011 - misterx@example.com - -- Update to r60.3 -- Fixes bug in the reflect package - * disallow Interface method on Value obtained via unexported name - -------------------------------------------------------------------- -Thu Oct 6 08:14:24 UTC 2011 - misterx@example.com - -- Update to r60.2 -- Fixes memory leak in certain map types - -------------------------------------------------------------------- -Wed Oct 5 14:34:10 UTC 2011 - misterx@example.com - -- Tweaks for gdb debugging -- go.spec changes: - - move %go_arch definition to %prep section - - pass correct location of go specific gdb pretty printer and - functions to cpp as HOST_EXTRA_CFLAGS macro - - install go gdb functions & printer -- gdb-printer.patch - - patch linker (src/cmd/ld/dwarf.c) to emit correct location of go - gdb functions and pretty printer -</textarea></div> - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - mode: {name: "changes"}, - lineNumbers: true, - indentUnit: 4, - tabMode: "shift" - }); - </script> - - <p><strong>MIME types defined:</strong> <code>text/x-rpm-changes</code>.</p> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/rpm/spec/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/rpm/spec/index.html deleted file mode 100644 index 8be98b63ec3c9b5f7d1167e2462053376839bb60..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/rpm/spec/index.html +++ /dev/null @@ -1,99 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: RPM spec mode</title> - <link rel="stylesheet" href="../../../lib/codemirror.css"> - <script src="../../../lib/codemirror.js"></script> - <script src="spec.js"></script> - <link rel="stylesheet" href="spec.css"> - <link rel="stylesheet" href="../../../doc/docs.css"> - <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> - </head> - <body> - <h1>CodeMirror: RPM spec mode</h1> - - <div><textarea id="code" name="code"> -# -# spec file for package minidlna -# -# Copyright (c) 2011, Sascha Peilicke <saschpe@gmx.de> -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - - -Name: libupnp6 -Version: 1.6.13 -Release: 0 -Summary: Portable Universal Plug and Play (UPnP) SDK -Group: System/Libraries -License: BSD-3-Clause -Url: http://sourceforge.net/projects/pupnp/ -Source0: http://downloads.sourceforge.net/pupnp/libupnp-%{version}.tar.bz2 -BuildRoot: %{_tmppath}/%{name}-%{version}-build - -%description -The portable Universal Plug and Play (UPnP) SDK provides support for building -UPnP-compliant control points, devices, and bridges on several operating -systems. - -%package -n libupnp-devel -Summary: Portable Universal Plug and Play (UPnP) SDK -Group: Development/Libraries/C and C++ -Provides: pkgconfig(libupnp) -Requires: %{name} = %{version} - -%description -n libupnp-devel -The portable Universal Plug and Play (UPnP) SDK provides support for building -UPnP-compliant control points, devices, and bridges on several operating -systems. - -%prep -%setup -n libupnp-%{version} - -%build -%configure --disable-static -make %{?_smp_mflags} - -%install -%makeinstall -find %{buildroot} -type f -name '*.la' -exec rm -f {} ';' - -%post -p /sbin/ldconfig - -%postun -p /sbin/ldconfig - -%files -%defattr(-,root,root,-) -%doc ChangeLog NEWS README TODO -%{_libdir}/libixml.so.* -%{_libdir}/libthreadutil.so.* -%{_libdir}/libupnp.so.* - -%files -n libupnp-devel -%defattr(-,root,root,-) -%{_libdir}/pkgconfig/libupnp.pc -%{_libdir}/libixml.so -%{_libdir}/libthreadutil.so -%{_libdir}/libupnp.so -%{_includedir}/upnp/ - -%changelog</textarea></div> - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - mode: {name: "spec"}, - lineNumbers: true, - indentUnit: 4 - }); - </script> - - <p><strong>MIME types defined:</strong> <code>text/x-rpm-spec</code>.</p> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/rpm/spec/spec.css b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/rpm/spec/spec.css deleted file mode 100644 index d0a5d430cacf07486842e77e55fdc429d70c6f70..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/rpm/spec/spec.css +++ /dev/null @@ -1,5 +0,0 @@ -.cm-s-default span.cm-preamble {color: #b26818; font-weight: bold;} -.cm-s-default span.cm-macro {color: #b218b2;} -.cm-s-default span.cm-section {color: green; font-weight: bold;} -.cm-s-default span.cm-script {color: red;} -.cm-s-default span.cm-issue {color: yellow;} diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/rpm/spec/spec.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/rpm/spec/spec.js deleted file mode 100644 index 9f339c21b1ae75d5988d48182f967ac90acef79b..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/rpm/spec/spec.js +++ /dev/null @@ -1,66 +0,0 @@ -// Quick and dirty spec file highlighting - -CodeMirror.defineMode("spec", function() { - var arch = /^(i386|i586|i686|x86_64|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/; - - var preamble = /^(Name|Version|Release|License|Summary|Url|Group|Source|BuildArch|BuildRequires|BuildRoot|AutoReqProv|Provides|Requires(\(\w+\))?|Obsoletes|Conflicts|Recommends|Source\d*|Patch\d*|ExclusiveArch|NoSource|Supplements):/; - var section = /^%(debug_package|package|description|prep|build|install|files|clean|changelog|preun|postun|pre|post|triggerin|triggerun|pretrans|posttrans|verifyscript|check|triggerpostun|triggerprein|trigger)/; - var control_flow_complex = /^%(ifnarch|ifarch|if)/; // rpm control flow macros - var control_flow_simple = /^%(else|endif)/; // rpm control flow macros - var operators = /^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/; // operators in control flow macros - - return { - startState: function () { - return { - controlFlow: false, - macroParameters: false, - section: false - }; - }, - token: function (stream, state) { - var ch = stream.peek(); - if (ch == "#") { stream.skipToEnd(); return "comment"; } - - if (stream.sol()) { - if (stream.match(preamble)) { return "preamble"; } - if (stream.match(section)) { return "section"; } - } - - if (stream.match(/^\$\w+/)) { return "def"; } // Variables like '$RPM_BUILD_ROOT' - if (stream.match(/^\$\{\w+\}/)) { return "def"; } // Variables like '${RPM_BUILD_ROOT}' - - if (stream.match(control_flow_simple)) { return "keyword"; } - if (stream.match(control_flow_complex)) { - state.controlFlow = true; - return "keyword"; - } - if (state.controlFlow) { - if (stream.match(operators)) { return "operator"; } - if (stream.match(/^(\d+)/)) { return "number"; } - if (stream.eol()) { state.controlFlow = false; } - } - - if (stream.match(arch)) { return "number"; } - - // Macros like '%make_install' or '%attr(0775,root,root)' - if (stream.match(/^%[\w]+/)) { - if (stream.match(/^\(/)) { state.macroParameters = true; } - return "macro"; - } - if (state.macroParameters) { - if (stream.match(/^\d+/)) { return "number";} - if (stream.match(/^\)/)) { - state.macroParameters = false; - return "macro"; - } - } - if (stream.match(/^%\{\??[\w \-]+\}/)) { return "macro"; } // Macros like '%{defined fedora}' - - //TODO: Include bash script sub-parser (CodeMirror supports that) - stream.next(); - return null; - } - }; -}); - -CodeMirror.defineMIME("text/x-rpm-spec", "spec"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/rst/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/rst/index.html deleted file mode 100644 index 6e477201f4fa7336df64bf93788de55cf301fc85..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/rst/index.html +++ /dev/null @@ -1,526 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: reStructuredText mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="rst.js"></script> - <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> - <link rel="stylesheet" href="../../doc/docs.css"> - </head> - <body> - <h1>CodeMirror: reStructuredText mode</h1> - -<form><textarea id="code" name="code"> -.. This is an excerpt from Sphinx documentation: http://sphinx.pocoo.org/_sources/rest.txt - -.. highlightlang:: rest - -.. _rst-primer: - -reStructuredText Primer -======================= - -This section is a brief introduction to reStructuredText (reST) concepts and -syntax, intended to provide authors with enough information to author documents -productively. Since reST was designed to be a simple, unobtrusive markup -language, this will not take too long. - -.. seealso:: - - The authoritative `reStructuredText User Documentation - <http://docutils.sourceforge.net/rst.html>`_. The "ref" links in this - document link to the description of the individual constructs in the reST - reference. - - -Paragraphs ----------- - -The paragraph (:duref:`ref <paragraphs>`) is the most basic block in a reST -document. Paragraphs are simply chunks of text separated by one or more blank -lines. As in Python, indentation is significant in reST, so all lines of the -same paragraph must be left-aligned to the same level of indentation. - - -.. _inlinemarkup: - -Inline markup -------------- - -The standard reST inline markup is quite simple: use - -* one asterisk: ``*text*`` for emphasis (italics), -* two asterisks: ``**text**`` for strong emphasis (boldface), and -* backquotes: ````text```` for code samples. - -If asterisks or backquotes appear in running text and could be confused with -inline markup delimiters, they have to be escaped with a backslash. - -Be aware of some restrictions of this markup: - -* it may not be nested, -* content may not start or end with whitespace: ``* text*`` is wrong, -* it must be separated from surrounding text by non-word characters. Use a - backslash escaped space to work around that: ``thisis\ *one*\ word``. - -These restrictions may be lifted in future versions of the docutils. - -reST also allows for custom "interpreted text roles"', which signify that the -enclosed text should be interpreted in a specific way. Sphinx uses this to -provide semantic markup and cross-referencing of identifiers, as described in -the appropriate section. The general syntax is ``:rolename:`content```. - -Standard reST provides the following roles: - -* :durole:`emphasis` -- alternate spelling for ``*emphasis*`` -* :durole:`strong` -- alternate spelling for ``**strong**`` -* :durole:`literal` -- alternate spelling for ````literal```` -* :durole:`subscript` -- subscript text -* :durole:`superscript` -- superscript text -* :durole:`title-reference` -- for titles of books, periodicals, and other - materials - -See :ref:`inline-markup` for roles added by Sphinx. - - -Lists and Quote-like blocks ---------------------------- - -List markup (:duref:`ref <bullet-lists>`) is natural: just place an asterisk at -the start of a paragraph and indent properly. The same goes for numbered lists; -they can also be autonumbered using a ``#`` sign:: - - * This is a bulleted list. - * It has two items, the second - item uses two lines. - - 1. This is a numbered list. - 2. It has two items too. - - #. This is a numbered list. - #. It has two items too. - - -Nested lists are possible, but be aware that they must be separated from the -parent list items by blank lines:: - - * this is - * a list - - * with a nested list - * and some subitems - - * and here the parent list continues - -Definition lists (:duref:`ref <definition-lists>`) are created as follows:: - - term (up to a line of text) - Definition of the term, which must be indented - - and can even consist of multiple paragraphs - - next term - Description. - -Note that the term cannot have more than one line of text. - -Quoted paragraphs (:duref:`ref <block-quotes>`) are created by just indenting -them more than the surrounding paragraphs. - -Line blocks (:duref:`ref <line-blocks>`) are a way of preserving line breaks:: - - | These lines are - | broken exactly like in - | the source file. - -There are also several more special blocks available: - -* field lists (:duref:`ref <field-lists>`) -* option lists (:duref:`ref <option-lists>`) -* quoted literal blocks (:duref:`ref <quoted-literal-blocks>`) -* doctest blocks (:duref:`ref <doctest-blocks>`) - - -Source Code ------------ - -Literal code blocks (:duref:`ref <literal-blocks>`) are introduced by ending a -paragraph with the special marker ``::``. The literal block must be indented -(and, like all paragraphs, separated from the surrounding ones by blank lines):: - - This is a normal text paragraph. The next paragraph is a code sample:: - - It is not processed in any way, except - that the indentation is removed. - - It can span multiple lines. - - This is a normal text paragraph again. - -The handling of the ``::`` marker is smart: - -* If it occurs as a paragraph of its own, that paragraph is completely left - out of the document. -* If it is preceded by whitespace, the marker is removed. -* If it is preceded by non-whitespace, the marker is replaced by a single - colon. - -That way, the second sentence in the above example's first paragraph would be -rendered as "The next paragraph is a code sample:". - - -.. _rst-tables: - -Tables ------- - -Two forms of tables are supported. For *grid tables* (:duref:`ref -<grid-tables>`), you have to "paint" the cell grid yourself. They look like -this:: - - +------------------------+------------+----------+----------+ - | Header row, column 1 | Header 2 | Header 3 | Header 4 | - | (header rows optional) | | | | - +========================+============+==========+==========+ - | body row 1, column 1 | column 2 | column 3 | column 4 | - +------------------------+------------+----------+----------+ - | body row 2 | ... | ... | | - +------------------------+------------+----------+----------+ - -*Simple tables* (:duref:`ref <simple-tables>`) are easier to write, but -limited: they must contain more than one row, and the first column cannot -contain multiple lines. They look like this:: - - ===== ===== ======= - A B A and B - ===== ===== ======= - False False False - True False False - False True False - True True True - ===== ===== ======= - - -Hyperlinks ----------- - -External links -^^^^^^^^^^^^^^ - -Use ```Link text <http://example.com/>`_`` for inline web links. If the link -text should be the web address, you don't need special markup at all, the parser -finds links and mail addresses in ordinary text. - -You can also separate the link and the target definition (:duref:`ref -<hyperlink-targets>`), like this:: - - This is a paragraph that contains `a link`_. - - .. _a link: http://example.com/ - - -Internal links -^^^^^^^^^^^^^^ - -Internal linking is done via a special reST role provided by Sphinx, see the -section on specific markup, :ref:`ref-role`. - - -Sections --------- - -Section headers (:duref:`ref <sections>`) are created by underlining (and -optionally overlining) the section title with a punctuation character, at least -as long as the text:: - - ================= - This is a heading - ================= - -Normally, there are no heading levels assigned to certain characters as the -structure is determined from the succession of headings. However, for the -Python documentation, this convention is used which you may follow: - -* ``#`` with overline, for parts -* ``*`` with overline, for chapters -* ``=``, for sections -* ``-``, for subsections -* ``^``, for subsubsections -* ``"``, for paragraphs - -Of course, you are free to use your own marker characters (see the reST -documentation), and use a deeper nesting level, but keep in mind that most -target formats (HTML, LaTeX) have a limited supported nesting depth. - - -Explicit Markup ---------------- - -"Explicit markup" (:duref:`ref <explicit-markup-blocks>`) is used in reST for -most constructs that need special handling, such as footnotes, -specially-highlighted paragraphs, comments, and generic directives. - -An explicit markup block begins with a line starting with ``..`` followed by -whitespace and is terminated by the next paragraph at the same level of -indentation. (There needs to be a blank line between explicit markup and normal -paragraphs. This may all sound a bit complicated, but it is intuitive enough -when you write it.) - - -.. _directives: - -Directives ----------- - -A directive (:duref:`ref <directives>`) is a generic block of explicit markup. -Besides roles, it is one of the extension mechanisms of reST, and Sphinx makes -heavy use of it. - -Docutils supports the following directives: - -* Admonitions: :dudir:`attention`, :dudir:`caution`, :dudir:`danger`, - :dudir:`error`, :dudir:`hint`, :dudir:`important`, :dudir:`note`, - :dudir:`tip`, :dudir:`warning` and the generic :dudir:`admonition`. - (Most themes style only "note" and "warning" specially.) - -* Images: - - - :dudir:`image` (see also Images_ below) - - :dudir:`figure` (an image with caption and optional legend) - -* Additional body elements: - - - :dudir:`contents` (a local, i.e. for the current file only, table of - contents) - - :dudir:`container` (a container with a custom class, useful to generate an - outer ``<div>`` in HTML) - - :dudir:`rubric` (a heading without relation to the document sectioning) - - :dudir:`topic`, :dudir:`sidebar` (special highlighted body elements) - - :dudir:`parsed-literal` (literal block that supports inline markup) - - :dudir:`epigraph` (a block quote with optional attribution line) - - :dudir:`highlights`, :dudir:`pull-quote` (block quotes with their own - class attribute) - - :dudir:`compound` (a compound paragraph) - -* Special tables: - - - :dudir:`table` (a table with title) - - :dudir:`csv-table` (a table generated from comma-separated values) - - :dudir:`list-table` (a table generated from a list of lists) - -* Special directives: - - - :dudir:`raw` (include raw target-format markup) - - :dudir:`include` (include reStructuredText from another file) - -- in Sphinx, when given an absolute include file path, this directive takes - it as relative to the source directory - - :dudir:`class` (assign a class attribute to the next element) [1]_ - -* HTML specifics: - - - :dudir:`meta` (generation of HTML ``<meta>`` tags) - - :dudir:`title` (override document title) - -* Influencing markup: - - - :dudir:`default-role` (set a new default role) - - :dudir:`role` (create a new role) - - Since these are only per-file, better use Sphinx' facilities for setting the - :confval:`default_role`. - -Do *not* use the directives :dudir:`sectnum`, :dudir:`header` and -:dudir:`footer`. - -Directives added by Sphinx are described in :ref:`sphinxmarkup`. - -Basically, a directive consists of a name, arguments, options and content. (Keep -this terminology in mind, it is used in the next chapter describing custom -directives.) Looking at this example, :: - - .. function:: foo(x) - foo(y, z) - :module: some.module.name - - Return a line of text input from the user. - -``function`` is the directive name. It is given two arguments here, the -remainder of the first line and the second line, as well as one option -``module`` (as you can see, options are given in the lines immediately following -the arguments and indicated by the colons). Options must be indented to the -same level as the directive content. - -The directive content follows after a blank line and is indented relative to the -directive start. - - -Images ------- - -reST supports an image directive (:dudir:`ref <image>`), used like so:: - - .. image:: gnu.png - (options) - -When used within Sphinx, the file name given (here ``gnu.png``) must either be -relative to the source file, or absolute which means that they are relative to -the top source directory. For example, the file ``sketch/spam.rst`` could refer -to the image ``images/spam.png`` as ``../images/spam.png`` or -``/images/spam.png``. - -Sphinx will automatically copy image files over to a subdirectory of the output -directory on building (e.g. the ``_static`` directory for HTML output.) - -Interpretation of image size options (``width`` and ``height``) is as follows: -if the size has no unit or the unit is pixels, the given size will only be -respected for output channels that support pixels (i.e. not in LaTeX output). -Other units (like ``pt`` for points) will be used for HTML and LaTeX output. - -Sphinx extends the standard docutils behavior by allowing an asterisk for the -extension:: - - .. image:: gnu.* - -Sphinx then searches for all images matching the provided pattern and determines -their type. Each builder then chooses the best image out of these candidates. -For instance, if the file name ``gnu.*`` was given and two files :file:`gnu.pdf` -and :file:`gnu.png` existed in the source tree, the LaTeX builder would choose -the former, while the HTML builder would prefer the latter. - -.. versionchanged:: 0.4 - Added the support for file names ending in an asterisk. - -.. versionchanged:: 0.6 - Image paths can now be absolute. - - -Footnotes ---------- - -For footnotes (:duref:`ref <footnotes>`), use ``[#name]_`` to mark the footnote -location, and add the footnote body at the bottom of the document after a -"Footnotes" rubric heading, like so:: - - Lorem ipsum [#f1]_ dolor sit amet ... [#f2]_ - - .. rubric:: Footnotes - - .. [#f1] Text of the first footnote. - .. [#f2] Text of the second footnote. - -You can also explicitly number the footnotes (``[1]_``) or use auto-numbered -footnotes without names (``[#]_``). - - -Citations ---------- - -Standard reST citations (:duref:`ref <citations>`) are supported, with the -additional feature that they are "global", i.e. all citations can be referenced -from all files. Use them like so:: - - Lorem ipsum [Ref]_ dolor sit amet. - - .. [Ref] Book or article reference, URL or whatever. - -Citation usage is similar to footnote usage, but with a label that is not -numeric or begins with ``#``. - - -Substitutions -------------- - -reST supports "substitutions" (:duref:`ref <substitution-definitions>`), which -are pieces of text and/or markup referred to in the text by ``|name|``. They -are defined like footnotes with explicit markup blocks, like this:: - - .. |name| replace:: replacement *text* - -or this:: - - .. |caution| image:: warning.png - :alt: Warning! - -See the :duref:`reST reference for substitutions <substitution-definitions>` -for details. - -If you want to use some substitutions for all documents, put them into -:confval:`rst_prolog` or put them into a separate file and include it into all -documents you want to use them in, using the :rst:dir:`include` directive. (Be -sure to give the include file a file name extension differing from that of other -source files, to avoid Sphinx finding it as a standalone document.) - -Sphinx defines some default substitutions, see :ref:`default-substitutions`. - - -Comments --------- - -Every explicit markup block which isn't a valid markup construct (like the -footnotes above) is regarded as a comment (:duref:`ref <comments>`). For -example:: - - .. This is a comment. - -You can indent text after a comment start to form multiline comments:: - - .. - This whole indented block - is a comment. - - Still in the comment. - - -Source encoding ---------------- - -Since the easiest way to include special characters like em dashes or copyright -signs in reST is to directly write them as Unicode characters, one has to -specify an encoding. Sphinx assumes source files to be encoded in UTF-8 by -default; you can change this with the :confval:`source_encoding` config value. - - -Gotchas -------- - -There are some problems one commonly runs into while authoring reST documents: - -* **Separation of inline markup:** As said above, inline markup spans must be - separated from the surrounding text by non-word characters, you have to use a - backslash-escaped space to get around that. See `the reference - <http://docutils.sf.net/docs/ref/rst/restructuredtext.html#inline-markup>`_ - for the details. - -* **No nested inline markup:** Something like ``*see :func:`foo`*`` is not - possible. - - -.. rubric:: Footnotes - -.. [1] When the default domain contains a :rst:dir:`class` directive, this directive - will be shadowed. Therefore, Sphinx re-exports it as :rst:dir:`rst-class`. -</textarea></form> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - }); - </script> - <p>The reStructuredText mode supports one configuration parameter:</p> - <dl> - <dt><code>verbatim (string)</code></dt> - <dd>A name or MIME type of a mode that will be used for highlighting - verbatim blocks. By default, reStructuredText mode uses uniform color - for whole block of verbatim text if no mode is given.</dd> - </dl> - <p>If <code>python</code> mode is available, - it will be used for highlighting blocks containing Python/IPython terminal - sessions (blocks starting with <code>>>></code> (for Python) or - <code>In [num]:</code> (for IPython). - - <p><strong>MIME types defined:</strong> <code>text/x-rst</code>.</p> - </body> -</html> - diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/rst/rst.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/rst/rst.js deleted file mode 100644 index 56d8502e7d52f533c65c37fad39bce10e8a4f43b..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/rst/rst.js +++ /dev/null @@ -1,314 +0,0 @@ -CodeMirror.defineMode('rst', function(config, options) { - function setState(state, fn, ctx) { - state.fn = fn; - setCtx(state, ctx); - } - - function setCtx(state, ctx) { - state.ctx = ctx || {}; - } - - function setNormal(state, ch) { - if (ch && (typeof ch !== 'string')) { - var str = ch.current(); - ch = str[str.length-1]; - } - - setState(state, normal, {back: ch}); - } - - function hasMode(mode) { - return mode && CodeMirror.modes.hasOwnProperty(mode); - } - - function getMode(mode) { - if (hasMode(mode)) { - return CodeMirror.getMode(config, mode); - } else { - return null; - } - } - - var verbatimMode = getMode(options.verbatim); - var pythonMode = getMode('python'); - - var reSection = /^[!"#$%&'()*+,-./:;<=>?@[\\\]^_`{|}~]/; - var reDirective = /^\s*\w([-:.\w]*\w)?::(\s|$)/; - var reHyperlink = /^\s*_[\w-]+:(\s|$)/; - var reFootnote = /^\s*\[(\d+|#)\](\s|$)/; - var reCitation = /^\s*\[[A-Za-z][\w-]*\](\s|$)/; - var reFootnoteRef = /^\[(\d+|#)\]_/; - var reCitationRef = /^\[[A-Za-z][\w-]*\]_/; - var reDirectiveMarker = /^\.\.(\s|$)/; - var reVerbatimMarker = /^::\s*$/; - var rePreInline = /^[-\s"([{</:]/; - var rePostInline = /^[-\s`'")\]}>/:.,;!?\\_]/; - var reExamples = /^\s+(>>>|In \[\d+\]:)\s/; - - function normal(stream, state) { - var ch, sol, i; - - if (stream.eat(/\\/)) { - ch = stream.next(); - setNormal(state, ch); - return null; - } - - sol = stream.sol(); - - if (sol && (ch = stream.eat(reSection))) { - for (i = 0; stream.eat(ch); i++); - - if (i >= 3 && stream.match(/^\s*$/)) { - setNormal(state, null); - return 'header'; - } else { - stream.backUp(i + 1); - } - } - - if (sol && stream.match(reDirectiveMarker)) { - if (!stream.eol()) { - setState(state, directive); - } - return 'meta'; - } - - if (stream.match(reVerbatimMarker)) { - if (!verbatimMode) { - setState(state, verbatim); - } else { - var mode = verbatimMode; - - setState(state, verbatim, { - mode: mode, - local: mode.startState() - }); - } - return 'meta'; - } - - if (sol && stream.match(reExamples, false)) { - if (!pythonMode) { - setState(state, verbatim); - return 'meta'; - } else { - var mode = pythonMode; - - setState(state, verbatim, { - mode: mode, - local: mode.startState() - }); - - return null; - } - } - - function testBackward(re) { - return sol || !state.ctx.back || re.test(state.ctx.back); - } - - function testForward(re) { - return stream.eol() || stream.match(re, false); - } - - function testInline(re) { - return stream.match(re) && testBackward(/\W/) && testForward(/\W/); - } - - if (testInline(reFootnoteRef)) { - setNormal(state, stream); - return 'footnote'; - } - - if (testInline(reCitationRef)) { - setNormal(state, stream); - return 'citation'; - } - - ch = stream.next(); - - if (testBackward(rePreInline)) { - if ((ch === ':' || ch === '|') && stream.eat(/\S/)) { - var token; - - if (ch === ':') { - token = 'builtin'; - } else { - token = 'atom'; - } - - setState(state, inline, { - ch: ch, - wide: false, - prev: null, - token: token - }); - - return token; - } - - if (ch === '*' || ch === '`') { - var orig = ch, - wide = false; - - ch = stream.next(); - - if (ch == orig) { - wide = true; - ch = stream.next(); - } - - if (ch && !/\s/.test(ch)) { - var token; - - if (orig === '*') { - token = wide ? 'strong' : 'em'; - } else { - token = wide ? 'string' : 'string-2'; - } - - setState(state, inline, { - ch: orig, // inline() has to know what to search for - wide: wide, // are we looking for `ch` or `chch` - prev: null, // terminator must not be preceeded with whitespace - token: token // I don't want to recompute this all the time - }); - - return token; - } - } - } - - setNormal(state, ch); - return null; - } - - function inline(stream, state) { - var ch = stream.next(), - token = state.ctx.token; - - function finish(ch) { - state.ctx.prev = ch; - return token; - } - - if (ch != state.ctx.ch) { - return finish(ch); - } - - if (/\s/.test(state.ctx.prev)) { - return finish(ch); - } - - if (state.ctx.wide) { - ch = stream.next(); - - if (ch != state.ctx.ch) { - return finish(ch); - } - } - - if (!stream.eol() && !rePostInline.test(stream.peek())) { - if (state.ctx.wide) { - stream.backUp(1); - } - - return finish(ch); - } - - setState(state, normal); - setNormal(state, ch); - - return token; - } - - function directive(stream, state) { - var token = null; - - if (stream.match(reDirective)) { - token = 'attribute'; - } else if (stream.match(reHyperlink)) { - token = 'link'; - } else if (stream.match(reFootnote)) { - token = 'quote'; - } else if (stream.match(reCitation)) { - token = 'quote'; - } else { - stream.eatSpace(); - - if (stream.eol()) { - setNormal(state, stream); - return null; - } else { - stream.skipToEnd(); - setState(state, comment); - return 'comment'; - } - } - - // FIXME this is unreachable - setState(state, body, {start: true}); - return token; - } - - function body(stream, state) { - var token = 'body'; - - if (!state.ctx.start || stream.sol()) { - return block(stream, state, token); - } - - stream.skipToEnd(); - setCtx(state); - - return token; - } - - function comment(stream, state) { - return block(stream, state, 'comment'); - } - - function verbatim(stream, state) { - if (!verbatimMode) { - return block(stream, state, 'meta'); - } else { - if (stream.sol()) { - if (!stream.eatSpace()) { - setNormal(state, stream); - } - - return null; - } - - return verbatimMode.token(stream, state.ctx.local); - } - } - - function block(stream, state, token) { - if (stream.eol() || stream.eatSpace()) { - stream.skipToEnd(); - return token; - } else { - setNormal(state, stream); - return null; - } - } - - return { - startState: function() { - return {fn: normal, ctx: {}}; - }, - - copyState: function(state) { - return {fn: state.fn, ctx: state.ctx}; - }, - - token: function(stream, state) { - var token = state.fn(stream, state); - return token; - } - }; -}, "python"); - -CodeMirror.defineMIME("text/x-rst", "rst"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/ruby/LICENSE b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/ruby/LICENSE deleted file mode 100644 index ac09fc4035781366af9b7693ceaf19cf30deee27..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/ruby/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2011, Ubalo, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Ubalo, Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL UBALO, INC BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/ruby/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/ruby/index.html deleted file mode 100644 index f226289d7d9b8d08a62ea262a2415083c41513a1..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/ruby/index.html +++ /dev/null @@ -1,173 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Ruby mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="../../lib/util/matchbrackets.js"></script> - <script src="ruby.js"></script> - <style> - .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;} - .cm-s-default span.cm-arrow { color: red; } - </style> - <link rel="stylesheet" href="../../doc/docs.css"> - </head> - <body> - <h1>CodeMirror: Ruby mode</h1> - <form><textarea id="code" name="code"> -# Code from http://sandbox.mc.edu/~bennet/ruby/code/poly_rb.html -# -# This program evaluates polynomials. It first asks for the coefficients -# of a polynomial, which must be entered on one line, highest-order first. -# It then requests values of x and will compute the value of the poly for -# each x. It will repeatly ask for x values, unless you the user enters -# a blank line. It that case, it will ask for another polynomial. If the -# user types quit for either input, the program immediately exits. -# - -# -# Function to evaluate a polynomial at x. The polynomial is given -# as a list of coefficients, from the greatest to the least. -def polyval(x, coef) - sum = 0 - coef = coef.clone # Don't want to destroy the original - while true - sum += coef.shift # Add and remove the next coef - break if coef.empty? # If no more, done entirely. - sum *= x # This happens the right number of times. - end - return sum -end - -# -# Function to read a line containing a list of integers and return -# them as an array of integers. If the string conversion fails, it -# throws TypeError. If the input line is the word 'quit', then it -# converts it to an end-of-file exception -def readints(prompt) - # Read a line - print prompt - line = readline.chomp - raise EOFError.new if line == 'quit' # You can also use a real EOF. - - # Go through each item on the line, converting each one and adding it - # to retval. - retval = [ ] - for str in line.split(/\s+/) - if str =~ /^\-?\d+$/ - retval.push(str.to_i) - else - raise TypeError.new - end - end - - return retval -end - -# -# Take a coeff and an exponent and return the string representation, ignoring -# the sign of the coefficient. -def term_to_str(coef, exp) - ret = "" - - # Show coeff, unless it's 1 or at the right - coef = coef.abs - ret = coef.to_s unless coef == 1 && exp > 0 - ret += "x" if exp > 0 # x if exponent not 0 - ret += "^" + exp.to_s if exp > 1 # ^exponent, if > 1. - - return ret -end - -# -# Create a string of the polynomial in sort-of-readable form. -def polystr(p) - # Get the exponent of first coefficient, plus 1. - exp = p.length - - # Assign exponents to each term, making pairs of coeff and exponent, - # Then get rid of the zero terms. - p = (p.map { |c| exp -= 1; [ c, exp ] }).select { |p| p[0] != 0 } - - # If there's nothing left, it's a zero - return "0" if p.empty? - - # *** Now p is a non-empty list of [ coef, exponent ] pairs. *** - - # Convert the first term, preceded by a "-" if it's negative. - result = (if p[0][0] < 0 then "-" else "" end) + term_to_str(*p[0]) - - # Convert the rest of the terms, in each case adding the appropriate - # + or - separating them. - for term in p[1...p.length] - # Add the separator then the rep. of the term. - result += (if term[0] < 0 then " - " else " + " end) + - term_to_str(*term) - end - - return result -end - -# -# Run until some kind of endfile. -begin - # Repeat until an exception or quit gets us out. - while true - # Read a poly until it works. An EOF will except out of the - # program. - print "\n" - begin - poly = readints("Enter a polynomial coefficients: ") - rescue TypeError - print "Try again.\n" - retry - end - break if poly.empty? - - # Read and evaluate x values until the user types a blank line. - # Again, an EOF will except out of the pgm. - while true - # Request an integer. - print "Enter x value or blank line: " - x = readline.chomp - break if x == '' - raise EOFError.new if x == 'quit' - - # If it looks bad, let's try again. - if x !~ /^\-?\d+$/ - print "That doesn't look like an integer. Please try again.\n" - next - end - - # Convert to an integer and print the result. - x = x.to_i - print "p(x) = ", polystr(poly), "\n" - print "p(", x, ") = ", polyval(x, poly), "\n" - end - end -rescue EOFError - print "\n=== EOF ===\n" -rescue Interrupt, SignalException - print "\n=== Interrupted ===\n" -else - print "--- Bye ---\n" -end -</textarea></form> - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - mode: "text/x-ruby", - tabMode: "indent", - matchBrackets: true, - indentUnit: 4 - }); - </script> - - <p><strong>MIME types defined:</strong> <code>text/x-ruby</code>.</p> - - <p>Development of the CodeMirror Ruby mode was kindly sponsored - by <a href="http://ubalo.com/">Ubalo</a>, who hold - the <a href="LICENSE">license</a>.</p> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/ruby/ruby.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/ruby/ruby.js deleted file mode 100644 index d106a542db5d7846a3087978a6d84c5db1d84808..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/ruby/ruby.js +++ /dev/null @@ -1,195 +0,0 @@ -CodeMirror.defineMode("ruby", function(config) { - function wordObj(words) { - var o = {}; - for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true; - return o; - } - var keywords = wordObj([ - "alias", "and", "BEGIN", "begin", "break", "case", "class", "def", "defined?", "do", "else", - "elsif", "END", "end", "ensure", "false", "for", "if", "in", "module", "next", "not", "or", - "redo", "rescue", "retry", "return", "self", "super", "then", "true", "undef", "unless", - "until", "when", "while", "yield", "nil", "raise", "throw", "catch", "fail", "loop", "callcc", - "caller", "lambda", "proc", "public", "protected", "private", "require", "load", - "require_relative", "extend", "autoload" - ]); - var indentWords = wordObj(["def", "class", "case", "for", "while", "do", "module", "then", - "catch", "loop", "proc", "begin"]); - var dedentWords = wordObj(["end", "until"]); - var matching = {"[": "]", "{": "}", "(": ")"}; - var curPunc; - - function chain(newtok, stream, state) { - state.tokenize.push(newtok); - return newtok(stream, state); - } - - function tokenBase(stream, state) { - curPunc = null; - if (stream.sol() && stream.match("=begin") && stream.eol()) { - state.tokenize.push(readBlockComment); - return "comment"; - } - if (stream.eatSpace()) return null; - var ch = stream.next(), m; - if (ch == "`" || ch == "'" || ch == '"' || - (ch == "/" && !stream.eol() && stream.peek() != " ")) { - return chain(readQuoted(ch, "string", ch == '"' || ch == "`"), stream, state); - } else if (ch == "%") { - var style, embed = false; - if (stream.eat("s")) style = "atom"; - else if (stream.eat(/[WQ]/)) { style = "string"; embed = true; } - else if (stream.eat(/[wxqr]/)) style = "string"; - var delim = stream.eat(/[^\w\s]/); - if (!delim) return "operator"; - if (matching.propertyIsEnumerable(delim)) delim = matching[delim]; - return chain(readQuoted(delim, style, embed, true), stream, state); - } else if (ch == "#") { - stream.skipToEnd(); - return "comment"; - } else if (ch == "<" && (m = stream.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/))) { - return chain(readHereDoc(m[1]), stream, state); - } else if (ch == "0") { - if (stream.eat("x")) stream.eatWhile(/[\da-fA-F]/); - else if (stream.eat("b")) stream.eatWhile(/[01]/); - else stream.eatWhile(/[0-7]/); - return "number"; - } else if (/\d/.test(ch)) { - stream.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/); - return "number"; - } else if (ch == "?") { - while (stream.match(/^\\[CM]-/)) {} - if (stream.eat("\\")) stream.eatWhile(/\w/); - else stream.next(); - return "string"; - } else if (ch == ":") { - if (stream.eat("'")) return chain(readQuoted("'", "atom", false), stream, state); - if (stream.eat('"')) return chain(readQuoted('"', "atom", true), stream, state); - stream.eatWhile(/[\w\?]/); - return "atom"; - } else if (ch == "@") { - stream.eat("@"); - stream.eatWhile(/[\w\?]/); - return "variable-2"; - } else if (ch == "$") { - stream.next(); - stream.eatWhile(/[\w\?]/); - return "variable-3"; - } else if (/\w/.test(ch)) { - stream.eatWhile(/[\w\?]/); - if (stream.eat(":")) return "atom"; - return "ident"; - } else if (ch == "|" && (state.varList || state.lastTok == "{" || state.lastTok == "do")) { - curPunc = "|"; - return null; - } else if (/[\(\)\[\]{}\\;]/.test(ch)) { - curPunc = ch; - return null; - } else if (ch == "-" && stream.eat(">")) { - return "arrow"; - } else if (/[=+\-\/*:\.^%<>~|]/.test(ch)) { - stream.eatWhile(/[=+\-\/*:\.^%<>~|]/); - return "operator"; - } else { - return null; - } - } - - function tokenBaseUntilBrace() { - var depth = 1; - return function(stream, state) { - if (stream.peek() == "}") { - depth--; - if (depth == 0) { - state.tokenize.pop(); - return state.tokenize[state.tokenize.length-1](stream, state); - } - } else if (stream.peek() == "{") { - depth++; - } - return tokenBase(stream, state); - }; - } - function readQuoted(quote, style, embed, unescaped) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && (unescaped || !escaped)) { - state.tokenize.pop(); - break; - } - if (embed && ch == "#" && !escaped && stream.eat("{")) { - state.tokenize.push(tokenBaseUntilBrace(arguments.callee)); - break; - } - escaped = !escaped && ch == "\\"; - } - return style; - }; - } - function readHereDoc(phrase) { - return function(stream, state) { - if (stream.match(phrase)) state.tokenize.pop(); - else stream.skipToEnd(); - return "string"; - }; - } - function readBlockComment(stream, state) { - if (stream.sol() && stream.match("=end") && stream.eol()) - state.tokenize.pop(); - stream.skipToEnd(); - return "comment"; - } - - return { - startState: function() { - return {tokenize: [tokenBase], - indented: 0, - context: {type: "top", indented: -config.indentUnit}, - continuedLine: false, - lastTok: null, - varList: false}; - }, - - token: function(stream, state) { - if (stream.sol()) state.indented = stream.indentation(); - var style = state.tokenize[state.tokenize.length-1](stream, state), kwtype; - if (style == "ident") { - var word = stream.current(); - style = keywords.propertyIsEnumerable(stream.current()) ? "keyword" - : /^[A-Z]/.test(word) ? "tag" - : (state.lastTok == "def" || state.lastTok == "class" || state.varList) ? "def" - : "variable"; - if (indentWords.propertyIsEnumerable(word)) kwtype = "indent"; - else if (dedentWords.propertyIsEnumerable(word)) kwtype = "dedent"; - else if ((word == "if" || word == "unless") && stream.column() == stream.indentation()) - kwtype = "indent"; - } - if (curPunc || (style && style != "comment")) state.lastTok = word || curPunc || style; - if (curPunc == "|") state.varList = !state.varList; - - if (kwtype == "indent" || /[\(\[\{]/.test(curPunc)) - state.context = {prev: state.context, type: curPunc || style, indented: state.indented}; - else if ((kwtype == "dedent" || /[\)\]\}]/.test(curPunc)) && state.context.prev) - state.context = state.context.prev; - - if (stream.eol()) - state.continuedLine = (curPunc == "\\" || style == "operator"); - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize[state.tokenize.length-1] != tokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0); - var ct = state.context; - var closing = ct.type == matching[firstChar] || - ct.type == "keyword" && /^(?:end|until|else|elsif|when|rescue)\b/.test(textAfter); - return ct.indented + (closing ? 0 : config.indentUnit) + - (state.continuedLine ? config.indentUnit : 0); - }, - electricChars: "}de" // enD and rescuE - - }; -}); - -CodeMirror.defineMIME("text/x-ruby", "ruby"); - diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/rust/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/rust/index.html deleted file mode 100644 index a6d47fe84db98e7804c6d36370c4124dab41d9c7..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/rust/index.html +++ /dev/null @@ -1,48 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Rust mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="rust.js"></script> - <link rel="stylesheet" href="../../doc/docs.css"> - <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> - </head> - <body> - <h1>CodeMirror: Rust mode</h1> - -<div><textarea id="code" name="code"> -// Demo code. - -type foo<T> = int; -enum bar { - some(int, foo<float>), - none -} - -fn check_crate(x: int) { - let v = 10; - alt foo { - 1 to 3 { - print_foo(); - if x { - blah() + 10; - } - } - (x, y) { "bye" } - _ { "hi" } - } -} -</textarea></div> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - tabMode: "indent" - }); - </script> - - <p><strong>MIME types defined:</strong> <code>text/x-rustsrc</code>.</p> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/rust/rust.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/rust/rust.js deleted file mode 100644 index ea3005c360da3c9369ec2fffca70b6db3d40fd00..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/rust/rust.js +++ /dev/null @@ -1,432 +0,0 @@ -CodeMirror.defineMode("rust", function() { - var indentUnit = 4, altIndentUnit = 2; - var valKeywords = { - "if": "if-style", "while": "if-style", "else": "else-style", - "do": "else-style", "ret": "else-style", "fail": "else-style", - "break": "atom", "cont": "atom", "const": "let", "resource": "fn", - "let": "let", "fn": "fn", "for": "for", "alt": "alt", "iface": "iface", - "impl": "impl", "type": "type", "enum": "enum", "mod": "mod", - "as": "op", "true": "atom", "false": "atom", "assert": "op", "check": "op", - "claim": "op", "native": "ignore", "unsafe": "ignore", "import": "else-style", - "export": "else-style", "copy": "op", "log": "op", "log_err": "op", - "use": "op", "bind": "op", "self": "atom" - }; - var typeKeywords = function() { - var keywords = {"fn": "fn", "block": "fn", "obj": "obj"}; - var atoms = "bool uint int i8 i16 i32 i64 u8 u16 u32 u64 float f32 f64 str char".split(" "); - for (var i = 0, e = atoms.length; i < e; ++i) keywords[atoms[i]] = "atom"; - return keywords; - }(); - var operatorChar = /[+\-*&%=<>!?|\.@]/; - - // Tokenizer - - // Used as scratch variable to communicate multiple values without - // consing up tons of objects. - var tcat, content; - function r(tc, style) { - tcat = tc; - return style; - } - - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"') { - state.tokenize = tokenString; - return state.tokenize(stream, state); - } - if (ch == "'") { - tcat = "atom"; - if (stream.eat("\\")) { - if (stream.skipTo("'")) { stream.next(); return "string"; } - else { return "error"; } - } else { - stream.next(); - return stream.eat("'") ? "string" : "error"; - } - } - if (ch == "/") { - if (stream.eat("/")) { stream.skipToEnd(); return "comment"; } - if (stream.eat("*")) { - state.tokenize = tokenComment(1); - return state.tokenize(stream, state); - } - } - if (ch == "#") { - if (stream.eat("[")) { tcat = "open-attr"; return null; } - stream.eatWhile(/\w/); - return r("macro", "meta"); - } - if (ch == ":" && stream.match(":<")) { - return r("op", null); - } - if (ch.match(/\d/) || (ch == "." && stream.eat(/\d/))) { - var flp = false; - if (!stream.match(/^x[\da-f]+/i) && !stream.match(/^b[01]+/)) { - stream.eatWhile(/\d/); - if (stream.eat(".")) { flp = true; stream.eatWhile(/\d/); } - if (stream.match(/^e[+\-]?\d+/i)) { flp = true; } - } - if (flp) stream.match(/^f(?:32|64)/); - else stream.match(/^[ui](?:8|16|32|64)/); - return r("atom", "number"); - } - if (ch.match(/[()\[\]{}:;,]/)) return r(ch, null); - if (ch == "-" && stream.eat(">")) return r("->", null); - if (ch.match(operatorChar)) { - stream.eatWhile(operatorChar); - return r("op", null); - } - stream.eatWhile(/\w/); - content = stream.current(); - if (stream.match(/^::\w/)) { - stream.backUp(1); - return r("prefix", "variable-2"); - } - if (state.keywords.propertyIsEnumerable(content)) - return r(state.keywords[content], content.match(/true|false/) ? "atom" : "keyword"); - return r("name", "variable"); - } - - function tokenString(stream, state) { - var ch, escaped = false; - while (ch = stream.next()) { - if (ch == '"' && !escaped) { - state.tokenize = tokenBase; - return r("atom", "string"); - } - escaped = !escaped && ch == "\\"; - } - // Hack to not confuse the parser when a string is split in - // pieces. - return r("op", "string"); - } - - function tokenComment(depth) { - return function(stream, state) { - var lastCh = null, ch; - while (ch = stream.next()) { - if (ch == "/" && lastCh == "*") { - if (depth == 1) { - state.tokenize = tokenBase; - break; - } else { - state.tokenize = tokenComment(depth - 1); - return state.tokenize(stream, state); - } - } - if (ch == "*" && lastCh == "/") { - state.tokenize = tokenComment(depth + 1); - return state.tokenize(stream, state); - } - lastCh = ch; - } - return "comment"; - }; - } - - // Parser - - var cx = {state: null, stream: null, marked: null, cc: null}; - function pass() { - for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); - } - function cont() { - pass.apply(null, arguments); - return true; - } - - function pushlex(type, info) { - var result = function() { - var state = cx.state; - state.lexical = {indented: state.indented, column: cx.stream.column(), - type: type, prev: state.lexical, info: info}; - }; - result.lex = true; - return result; - } - function poplex() { - var state = cx.state; - if (state.lexical.prev) { - if (state.lexical.type == ")") - state.indented = state.lexical.indented; - state.lexical = state.lexical.prev; - } - } - function typecx() { cx.state.keywords = typeKeywords; } - function valcx() { cx.state.keywords = valKeywords; } - poplex.lex = typecx.lex = valcx.lex = true; - - function commasep(comb, end) { - function more(type) { - if (type == ",") return cont(comb, more); - if (type == end) return cont(); - return cont(more); - } - return function(type) { - if (type == end) return cont(); - return pass(comb, more); - }; - } - - function stat_of(comb, tag) { - return cont(pushlex("stat", tag), comb, poplex, block); - } - function block(type) { - if (type == "}") return cont(); - if (type == "let") return stat_of(letdef1, "let"); - if (type == "fn") return stat_of(fndef); - if (type == "type") return cont(pushlex("stat"), tydef, endstatement, poplex, block); - if (type == "enum") return stat_of(enumdef); - if (type == "mod") return stat_of(mod); - if (type == "iface") return stat_of(iface); - if (type == "impl") return stat_of(impl); - if (type == "open-attr") return cont(pushlex("]"), commasep(expression, "]"), poplex); - if (type == "ignore" || type.match(/[\]\);,]/)) return cont(block); - return pass(pushlex("stat"), expression, poplex, endstatement, block); - } - function endstatement(type) { - if (type == ";") return cont(); - return pass(); - } - function expression(type) { - if (type == "atom" || type == "name") return cont(maybeop); - if (type == "{") return cont(pushlex("}"), exprbrace, poplex); - if (type.match(/[\[\(]/)) return matchBrackets(type, expression); - if (type.match(/[\]\)\};,]/)) return pass(); - if (type == "if-style") return cont(expression, expression); - if (type == "else-style" || type == "op") return cont(expression); - if (type == "for") return cont(pattern, maybetype, inop, expression, expression); - if (type == "alt") return cont(expression, altbody); - if (type == "fn") return cont(fndef); - if (type == "macro") return cont(macro); - return cont(); - } - function maybeop(type) { - if (content == ".") return cont(maybeprop); - if (content == "::<"){return cont(typarams, maybeop);} - if (type == "op" || content == ":") return cont(expression); - if (type == "(" || type == "[") return matchBrackets(type, expression); - return pass(); - } - function maybeprop() { - if (content.match(/^\w+$/)) {cx.marked = "variable"; return cont(maybeop);} - return pass(expression); - } - function exprbrace(type) { - if (type == "op") { - if (content == "|") return cont(blockvars, poplex, pushlex("}", "block"), block); - if (content == "||") return cont(poplex, pushlex("}", "block"), block); - } - if (content == "mutable" || (content.match(/^\w+$/) && cx.stream.peek() == ":" - && !cx.stream.match("::", false))) - return pass(record_of(expression)); - return pass(block); - } - function record_of(comb) { - function ro(type) { - if (content == "mutable" || content == "with") {cx.marked = "keyword"; return cont(ro);} - if (content.match(/^\w*$/)) {cx.marked = "variable"; return cont(ro);} - if (type == ":") return cont(comb, ro); - if (type == "}") return cont(); - return cont(ro); - } - return ro; - } - function blockvars(type) { - if (type == "name") {cx.marked = "def"; return cont(blockvars);} - if (type == "op" && content == "|") return cont(); - return cont(blockvars); - } - - function letdef1(type) { - if (type.match(/[\]\)\};]/)) return cont(); - if (content == "=") return cont(expression, letdef2); - if (type == ",") return cont(letdef1); - return pass(pattern, maybetype, letdef1); - } - function letdef2(type) { - if (type.match(/[\]\)\};,]/)) return pass(letdef1); - else return pass(expression, letdef2); - } - function maybetype(type) { - if (type == ":") return cont(typecx, rtype, valcx); - return pass(); - } - function inop(type) { - if (type == "name" && content == "in") {cx.marked = "keyword"; return cont();} - return pass(); - } - function fndef(type) { - if (content == "@" || content == "~") {cx.marked = "keyword"; return cont(fndef);} - if (type == "name") {cx.marked = "def"; return cont(fndef);} - if (content == "<") return cont(typarams, fndef); - if (type == "{") return pass(expression); - if (type == "(") return cont(pushlex(")"), commasep(argdef, ")"), poplex, fndef); - if (type == "->") return cont(typecx, rtype, valcx, fndef); - if (type == ";") return cont(); - return cont(fndef); - } - function tydef(type) { - if (type == "name") {cx.marked = "def"; return cont(tydef);} - if (content == "<") return cont(typarams, tydef); - if (content == "=") return cont(typecx, rtype, valcx); - return cont(tydef); - } - function enumdef(type) { - if (type == "name") {cx.marked = "def"; return cont(enumdef);} - if (content == "<") return cont(typarams, enumdef); - if (content == "=") return cont(typecx, rtype, valcx, endstatement); - if (type == "{") return cont(pushlex("}"), typecx, enumblock, valcx, poplex); - return cont(enumdef); - } - function enumblock(type) { - if (type == "}") return cont(); - if (type == "(") return cont(pushlex(")"), commasep(rtype, ")"), poplex, enumblock); - if (content.match(/^\w+$/)) cx.marked = "def"; - return cont(enumblock); - } - function mod(type) { - if (type == "name") {cx.marked = "def"; return cont(mod);} - if (type == "{") return cont(pushlex("}"), block, poplex); - return pass(); - } - function iface(type) { - if (type == "name") {cx.marked = "def"; return cont(iface);} - if (content == "<") return cont(typarams, iface); - if (type == "{") return cont(pushlex("}"), block, poplex); - return pass(); - } - function impl(type) { - if (content == "<") return cont(typarams, impl); - if (content == "of" || content == "for") {cx.marked = "keyword"; return cont(rtype, impl);} - if (type == "name") {cx.marked = "def"; return cont(impl);} - if (type == "{") return cont(pushlex("}"), block, poplex); - return pass(); - } - function typarams() { - if (content == ">") return cont(); - if (content == ",") return cont(typarams); - if (content == ":") return cont(rtype, typarams); - return pass(rtype, typarams); - } - function argdef(type) { - if (type == "name") {cx.marked = "def"; return cont(argdef);} - if (type == ":") return cont(typecx, rtype, valcx); - return pass(); - } - function rtype(type) { - if (type == "name") {cx.marked = "variable-3"; return cont(rtypemaybeparam); } - if (content == "mutable") {cx.marked = "keyword"; return cont(rtype);} - if (type == "atom") return cont(rtypemaybeparam); - if (type == "op" || type == "obj") return cont(rtype); - if (type == "fn") return cont(fntype); - if (type == "{") return cont(pushlex("{"), record_of(rtype), poplex); - return matchBrackets(type, rtype); - } - function rtypemaybeparam() { - if (content == "<") return cont(typarams); - return pass(); - } - function fntype(type) { - if (type == "(") return cont(pushlex("("), commasep(rtype, ")"), poplex, fntype); - if (type == "->") return cont(rtype); - return pass(); - } - function pattern(type) { - if (type == "name") {cx.marked = "def"; return cont(patternmaybeop);} - if (type == "atom") return cont(patternmaybeop); - if (type == "op") return cont(pattern); - if (type.match(/[\]\)\};,]/)) return pass(); - return matchBrackets(type, pattern); - } - function patternmaybeop(type) { - if (type == "op" && content == ".") return cont(); - if (content == "to") {cx.marked = "keyword"; return cont(pattern);} - else return pass(); - } - function altbody(type) { - if (type == "{") return cont(pushlex("}", "alt"), altblock1, poplex); - return pass(); - } - function altblock1(type) { - if (type == "}") return cont(); - if (type == "|") return cont(altblock1); - if (content == "when") {cx.marked = "keyword"; return cont(expression, altblock2);} - if (type.match(/[\]\);,]/)) return cont(altblock1); - return pass(pattern, altblock2); - } - function altblock2(type) { - if (type == "{") return cont(pushlex("}", "alt"), block, poplex, altblock1); - else return pass(altblock1); - } - - function macro(type) { - if (type.match(/[\[\(\{]/)) return matchBrackets(type, expression); - return pass(); - } - function matchBrackets(type, comb) { - if (type == "[") return cont(pushlex("]"), commasep(comb, "]"), poplex); - if (type == "(") return cont(pushlex(")"), commasep(comb, ")"), poplex); - if (type == "{") return cont(pushlex("}"), commasep(comb, "}"), poplex); - return cont(); - } - - function parse(state, stream, style) { - var cc = state.cc; - // Communicate our context to the combinators. - // (Less wasteful than consing up a hundred closures on every call.) - cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; - - while (true) { - var combinator = cc.length ? cc.pop() : block; - if (combinator(tcat)) { - while(cc.length && cc[cc.length - 1].lex) - cc.pop()(); - return cx.marked || style; - } - } - } - - return { - startState: function() { - return { - tokenize: tokenBase, - cc: [], - lexical: {indented: -indentUnit, column: 0, type: "top", align: false}, - keywords: valKeywords, - indented: 0 - }; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = false; - state.indented = stream.indentation(); - } - if (stream.eatSpace()) return null; - tcat = content = null; - var style = state.tokenize(stream, state); - if (style == "comment") return style; - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = true; - if (tcat == "prefix") return style; - if (!content) content = stream.current(); - return parse(state, stream, style); - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, - type = lexical.type, closing = firstChar == type; - if (type == "stat") return lexical.indented + indentUnit; - if (lexical.align) return lexical.column + (closing ? 0 : 1); - return lexical.indented + (closing ? 0 : (lexical.info == "alt" ? altIndentUnit : indentUnit)); - }, - - electricChars: "{}" - }; -}); - -CodeMirror.defineMIME("text/x-rustsrc", "rust"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/scheme/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/scheme/index.html deleted file mode 100644 index 5936a0241f9124d43e9ab5bcd3f4e44d9a1d1450..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/scheme/index.html +++ /dev/null @@ -1,65 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Scheme mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="scheme.js"></script> - <style>.CodeMirror {background: #f8f8f8;}</style> - <link rel="stylesheet" href="../../doc/docs.css"> - </head> - <body> - <h1>CodeMirror: Scheme mode</h1> - <form><textarea id="code" name="code"> -; See if the input starts with a given symbol. -(define (match-symbol input pattern) - (cond ((null? (remain input)) #f) - ((eqv? (car (remain input)) pattern) (r-cdr input)) - (else #f))) - -; Allow the input to start with one of a list of patterns. -(define (match-or input pattern) - (cond ((null? pattern) #f) - ((match-pattern input (car pattern))) - (else (match-or input (cdr pattern))))) - -; Allow a sequence of patterns. -(define (match-seq input pattern) - (if (null? pattern) - input - (let ((match (match-pattern input (car pattern)))) - (if match (match-seq match (cdr pattern)) #f)))) - -; Match with the pattern but no problem if it does not match. -(define (match-opt input pattern) - (let ((match (match-pattern input (car pattern)))) - (if match match input))) - -; Match anything (other than '()), until pattern is found. The rather -; clumsy form of requiring an ending pattern is needed to decide where -; the end of the match is. If none is given, this will match the rest -; of the sentence. -(define (match-any input pattern) - (cond ((null? (remain input)) #f) - ((null? pattern) (f-cons (remain input) (clear-remain input))) - (else - (let ((accum-any (collector))) - (define (match-pattern-any input pattern) - (cond ((null? (remain input)) #f) - (else (accum-any (car (remain input))) - (cond ((match-pattern (r-cdr input) pattern)) - (else (match-pattern-any (r-cdr input) pattern)))))) - (let ((retval (match-pattern-any input (car pattern)))) - (if retval - (f-cons (accum-any) retval) - #f)))))) -</textarea></form> - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), {}); - </script> - - <p><strong>MIME types defined:</strong> <code>text/x-scheme</code>.</p> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/scheme/scheme.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/scheme/scheme.js deleted file mode 100644 index 2ed0a24cd85fa3453da843d3dc32fce127b2d8c3..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/scheme/scheme.js +++ /dev/null @@ -1,230 +0,0 @@ -/** - * Author: Koh Zi Han, based on implementation by Koh Zi Chun - */ -CodeMirror.defineMode("scheme", function () { - var BUILTIN = "builtin", COMMENT = "comment", STRING = "string", - ATOM = "atom", NUMBER = "number", BRACKET = "bracket"; - var INDENT_WORD_SKIP = 2; - - function makeKeywords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var keywords = makeKeywords("λ case-lambda call/cc class define-class exit-handler field import inherit init-field interface let*-values let-values let/ec mixin opt-lambda override protect provide public rename require require-for-syntax syntax syntax-case syntax-error unit/sig unless when with-syntax and begin call-with-current-continuation call-with-input-file call-with-output-file case cond define define-syntax delay do dynamic-wind else for-each if lambda let let* let-syntax letrec letrec-syntax map or syntax-rules abs acos angle append apply asin assoc assq assv atan boolean? caar cadr call-with-input-file call-with-output-file call-with-values car cdddar cddddr cdr ceiling char->integer char-alphabetic? char-ci<=? char-ci<? char-ci=? char-ci>=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char<? char=? char>=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci<? string-ci=? string-ci>=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string<? string=? string>=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"); - var indentKeys = makeKeywords("define let letrec let* lambda"); - - function stateStack(indent, type, prev) { // represents a state stack object - this.indent = indent; - this.type = type; - this.prev = prev; - } - - function pushStack(state, indent, type) { - state.indentStack = new stateStack(indent, type, state.indentStack); - } - - function popStack(state) { - state.indentStack = state.indentStack.prev; - } - - var binaryMatcher = new RegExp(/^(?:[-+]i|[-+][01]+#*(?:\/[01]+#*)?i|[-+]?[01]+#*(?:\/[01]+#*)?@[-+]?[01]+#*(?:\/[01]+#*)?|[-+]?[01]+#*(?:\/[01]+#*)?[-+](?:[01]+#*(?:\/[01]+#*)?)?i|[-+]?[01]+#*(?:\/[01]+#*)?)(?=[()\s;"]|$)/i); - var octalMatcher = new RegExp(/^(?:[-+]i|[-+][0-7]+#*(?:\/[0-7]+#*)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?@[-+]?[0-7]+#*(?:\/[0-7]+#*)?|[-+]?[0-7]+#*(?:\/[0-7]+#*)?[-+](?:[0-7]+#*(?:\/[0-7]+#*)?)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?)(?=[()\s;"]|$)/i); - var hexMatcher = new RegExp(/^(?:[-+]i|[-+][\da-f]+#*(?:\/[\da-f]+#*)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?@[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?[-+](?:[\da-f]+#*(?:\/[\da-f]+#*)?)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?)(?=[()\s;"]|$)/i); - var decimalMatcher = new RegExp(/^(?:[-+]i|[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)i|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)@[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)?i|(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*))(?=[()\s;"]|$)/i); - - function isBinaryNumber (stream) { - return stream.match(binaryMatcher); - } - - function isOctalNumber (stream) { - return stream.match(octalMatcher); - } - - function isDecimalNumber (stream, backup) { - if (backup === true) { - stream.backUp(1); - } - return stream.match(decimalMatcher); - } - - function isHexNumber (stream) { - return stream.match(hexMatcher); - } - - return { - startState: function () { - return { - indentStack: null, - indentation: 0, - mode: false, - sExprComment: false - }; - }, - - token: function (stream, state) { - if (state.indentStack == null && stream.sol()) { - // update indentation, but only if indentStack is empty - state.indentation = stream.indentation(); - } - - // skip spaces - if (stream.eatSpace()) { - return null; - } - var returnType = null; - - switch(state.mode){ - case "string": // multi-line string parsing mode - var next, escaped = false; - while ((next = stream.next()) != null) { - if (next == "\"" && !escaped) { - - state.mode = false; - break; - } - escaped = !escaped && next == "\\"; - } - returnType = STRING; // continue on in scheme-string mode - break; - case "comment": // comment parsing mode - var next, maybeEnd = false; - while ((next = stream.next()) != null) { - if (next == "#" && maybeEnd) { - - state.mode = false; - break; - } - maybeEnd = (next == "|"); - } - returnType = COMMENT; - break; - case "s-expr-comment": // s-expr commenting mode - state.mode = false; - if(stream.peek() == "(" || stream.peek() == "["){ - // actually start scheme s-expr commenting mode - state.sExprComment = 0; - }else{ - // if not we just comment the entire of the next token - stream.eatWhile(/[^/s]/); // eat non spaces - returnType = COMMENT; - break; - } - default: // default parsing mode - var ch = stream.next(); - - if (ch == "\"") { - state.mode = "string"; - returnType = STRING; - - } else if (ch == "'") { - returnType = ATOM; - } else if (ch == '#') { - if (stream.eat("|")) { // Multi-line comment - state.mode = "comment"; // toggle to comment mode - returnType = COMMENT; - } else if (stream.eat(/[tf]/i)) { // #t/#f (atom) - returnType = ATOM; - } else if (stream.eat(';')) { // S-Expr comment - state.mode = "s-expr-comment"; - returnType = COMMENT; - } else { - var numTest = null, hasExactness = false, hasRadix = true; - if (stream.eat(/[ei]/i)) { - hasExactness = true; - } else { - stream.backUp(1); // must be radix specifier - } - if (stream.match(/^#b/i)) { - numTest = isBinaryNumber; - } else if (stream.match(/^#o/i)) { - numTest = isOctalNumber; - } else if (stream.match(/^#x/i)) { - numTest = isHexNumber; - } else if (stream.match(/^#d/i)) { - numTest = isDecimalNumber; - } else if (stream.match(/^[-+0-9.]/, false)) { - hasRadix = false; - numTest = isDecimalNumber; - // re-consume the intial # if all matches failed - } else if (!hasExactness) { - stream.eat('#'); - } - if (numTest != null) { - if (hasRadix && !hasExactness) { - // consume optional exactness after radix - stream.match(/^#[ei]/i); - } - if (numTest(stream)) - returnType = NUMBER; - } - } - } else if (/^[-+0-9.]/.test(ch) && isDecimalNumber(stream, true)) { // match non-prefixed number, must be decimal - returnType = NUMBER; - } else if (ch == ";") { // comment - stream.skipToEnd(); // rest of the line is a comment - returnType = COMMENT; - } else if (ch == "(" || ch == "[") { - var keyWord = ''; var indentTemp = stream.column(), letter; - /** - Either - (indent-word .. - (non-indent-word .. - (;something else, bracket, etc. - */ - - while ((letter = stream.eat(/[^\s\(\[\;\)\]]/)) != null) { - keyWord += letter; - } - - if (keyWord.length > 0 && indentKeys.propertyIsEnumerable(keyWord)) { // indent-word - - pushStack(state, indentTemp + INDENT_WORD_SKIP, ch); - } else { // non-indent word - // we continue eating the spaces - stream.eatSpace(); - if (stream.eol() || stream.peek() == ";") { - // nothing significant after - // we restart indentation 1 space after - pushStack(state, indentTemp + 1, ch); - } else { - pushStack(state, indentTemp + stream.current().length, ch); // else we match - } - } - stream.backUp(stream.current().length - 1); // undo all the eating - - if(typeof state.sExprComment == "number") state.sExprComment++; - - returnType = BRACKET; - } else if (ch == ")" || ch == "]") { - returnType = BRACKET; - if (state.indentStack != null && state.indentStack.type == (ch == ")" ? "(" : "[")) { - popStack(state); - - if(typeof state.sExprComment == "number"){ - if(--state.sExprComment == 0){ - returnType = COMMENT; // final closing bracket - state.sExprComment = false; // turn off s-expr commenting mode - } - } - } - } else { - stream.eatWhile(/[\w\$_\-!$%&*+\.\/:<=>?@\^~]/); - - if (keywords && keywords.propertyIsEnumerable(stream.current())) { - returnType = BUILTIN; - } else returnType = "variable"; - } - } - return (typeof state.sExprComment == "number") ? COMMENT : returnType; - }, - - indent: function (state) { - if (state.indentStack == null) return state.indentation; - return state.indentStack.indent; - } - }; -}); - -CodeMirror.defineMIME("text/x-scheme", "scheme"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/shell/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/shell/index.html deleted file mode 100644 index 0827053ceebbf7f80af9c74e8a39c4dd79d18e50..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/shell/index.html +++ /dev/null @@ -1,51 +0,0 @@ -<!doctype html> -<meta charset=utf-8> -<title>CodeMirror: Shell mode</title> - -<link rel=stylesheet href=../../lib/codemirror.css> -<link rel=stylesheet href=../../doc/docs.css> - -<style type=text/css> - .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;} -</style> - -<script src=../../lib/codemirror.js></script> -<script src="../../lib/util/matchbrackets.js"></script> -<script src=shell.js></script> - -<h1>CodeMirror: Shell mode</h1> - -<textarea id=code> -#!/bin/bash - -# clone the repository -git clone http://github.com/garden/tree - -# generate HTTPS credentials -cd tree -openssl genrsa -aes256 -out https.key 1024 -openssl req -new -nodes -key https.key -out https.csr -openssl x509 -req -days 365 -in https.csr -signkey https.key -out https.crt -cp https.key{,.orig} -openssl rsa -in https.key.orig -out https.key - -# start the server in HTTPS mode -cd web -sudo node ../server.js 443 'yes' >> ../node.log & - -# here is how to stop the server -for pid in `ps aux | grep 'node ../server.js' | awk '{print $2}'` ; do - sudo kill -9 $pid 2> /dev/null -done - -exit 0</textarea> - -<script> - var editor = CodeMirror.fromTextArea(document.getElementById('code'), { - mode: 'shell', - lineNumbers: true, - matchBrackets: true - }); -</script> - -<p><strong>MIME types defined:</strong> <code>text/x-sh</code>.</p> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/shell/shell.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/shell/shell.js deleted file mode 100644 index 9ce139b411f482aa6ea23c909c17e87e6f8ba7ea..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/shell/shell.js +++ /dev/null @@ -1,118 +0,0 @@ -CodeMirror.defineMode('shell', function() { - - var words = {}; - function define(style, string) { - var split = string.split(' '); - for(var i = 0; i < split.length; i++) { - words[split[i]] = style; - } - }; - - // Atoms - define('atom', 'true false'); - - // Keywords - define('keyword', 'if then do else elif while until for in esac fi fin ' + - 'fil done exit set unset export function'); - - // Commands - define('builtin', 'ab awk bash beep cat cc cd chown chmod chroot clear cp ' + - 'curl cut diff echo find gawk gcc get git grep kill killall ln ls make ' + - 'mkdir openssl mv nc node npm ping ps restart rm rmdir sed service sh ' + - 'shopt shred source sort sleep ssh start stop su sudo tee telnet top ' + - 'touch vi vim wall wc wget who write yes zsh'); - - function tokenBase(stream, state) { - - var sol = stream.sol(); - var ch = stream.next(); - - if (ch === '\'' || ch === '"' || ch === '`') { - state.tokens.unshift(tokenString(ch)); - return tokenize(stream, state); - } - if (ch === '#') { - if (sol && stream.eat('!')) { - stream.skipToEnd(); - return 'meta'; // 'comment'? - } - stream.skipToEnd(); - return 'comment'; - } - if (ch === '$') { - state.tokens.unshift(tokenDollar); - return tokenize(stream, state); - } - if (ch === '+' || ch === '=') { - return 'operator'; - } - if (ch === '-') { - stream.eat('-'); - stream.eatWhile(/\w/); - return 'attribute'; - } - if (/\d/.test(ch)) { - stream.eatWhile(/\d/); - if(!/\w/.test(stream.peek())) { - return 'number'; - } - } - stream.eatWhile(/\w/); - var cur = stream.current(); - if (stream.peek() === '=' && /\w+/.test(cur)) return 'def'; - return words.hasOwnProperty(cur) ? words[cur] : null; - } - - function tokenString(quote) { - return function(stream, state) { - var next, end = false, escaped = false; - while ((next = stream.next()) != null) { - if (next === quote && !escaped) { - end = true; - break; - } - if (next === '$' && !escaped && quote !== '\'') { - escaped = true; - stream.backUp(1); - state.tokens.unshift(tokenDollar); - break; - } - escaped = !escaped && next === '\\'; - } - if (end || !escaped) { - state.tokens.shift(); - } - return (quote === '`' || quote === ')' ? 'quote' : 'string'); - }; - }; - - var tokenDollar = function(stream, state) { - if (state.tokens.length > 1) stream.eat('$'); - var ch = stream.next(), hungry = /\w/; - if (ch === '{') hungry = /[^}]/; - if (ch === '(') { - state.tokens[0] = tokenString(')'); - return tokenize(stream, state); - } - if (!/\d/.test(ch)) { - stream.eatWhile(hungry); - stream.eat('}'); - } - state.tokens.shift(); - return 'def'; - }; - - function tokenize(stream, state) { - return (state.tokens[0] || tokenBase) (stream, state); - }; - - return { - startState: function() {return {tokens:[]};}, - token: function(stream, state) { - if (stream.eatSpace()) return null; - return tokenize(stream, state); - } - }; -}); - -CodeMirror.defineMIME('text/x-sh', 'shell'); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/sieve/LICENSE b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/sieve/LICENSE deleted file mode 100644 index 24e4c94c098cc90130be055c6770ab89ba2feed7..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/sieve/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (C) 2012 Thomas Schmid <schmid-thomas@gmx.net> - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -Please note that some subdirectories of the CodeMirror distribution -include their own LICENSE files, and are released under different -licences. diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/sieve/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/sieve/index.html deleted file mode 100644 index 8b549815ce37dc7ca702315b6010c198bdf6a24f..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/sieve/index.html +++ /dev/null @@ -1,81 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Sieve (RFC5228) mode</title> - <link rel="stylesheet" href="../../doc/docs.css"> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="sieve.js"></script> - <style>.CodeMirror {background: #f8f8f8;}</style> - </head> - <body> - <h1>CodeMirror: Sieve (RFC5228) mode</h1> - <form><textarea id="code" name="code"> -# -# Example Sieve Filter -# Declare any optional features or extension used by the script -# - -require ["fileinto", "reject"]; - -# -# Reject any large messages (note that the four leading dots get -# "stuffed" to three) -# -if size :over 1M -{ - reject text: -Please do not send me large attachments. -Put your file on a server and send me the URL. -Thank you. -.... Fred -. -; - stop; -} - -# -# Handle messages from known mailing lists -# Move messages from IETF filter discussion list to filter folder -# -if header :is "Sender" "owner-ietf-mta-filters@imc.org" -{ - fileinto "filter"; # move to "filter" folder -} -# -# Keep all messages to or from people in my company -# -elsif address :domain :is ["From", "To"] "example.com" -{ - keep; # keep in "In" folder -} - -# -# Try and catch unsolicited email. If a message is not to me, -# or it contains a subject known to be spam, file it away. -# -elsif anyof (not address :all :contains - ["To", "Cc", "Bcc"] "me@example.com", - header :matches "subject" - ["*make*money*fast*", "*university*dipl*mas*"]) -{ - # If message header does not contain my address, - # it's from a list. - fileinto "spam"; # move to "spam" folder -} -else -{ - # Move all other (non-company) mail to "personal" - # folder. - fileinto "personal"; -} -</textarea></form> - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), {}); - </script> - - <p><strong>MIME types defined:</strong> <code>application/sieve</code>.</p> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/sieve/sieve.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/sieve/sieve.js deleted file mode 100644 index 291c9c8c259122d7a4aaa7eaa4bc175a416334e9..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/sieve/sieve.js +++ /dev/null @@ -1,156 +0,0 @@ -/* - * See LICENSE in this directory for the license under which this code - * is released. - */ - -CodeMirror.defineMode("sieve", function(config) { - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var keywords = words("if elsif else stop require"); - var atoms = words("true false not"); - var indentUnit = config.indentUnit; - - function tokenBase(stream, state) { - - var ch = stream.next(); - if (ch == "/" && stream.eat("*")) { - state.tokenize = tokenCComment; - return tokenCComment(stream, state); - } - - if (ch === '#') { - stream.skipToEnd(); - return "comment"; - } - - if (ch == "\"") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - - if (ch === "{") - { - state._indent++; - return null; - } - - if (ch === "}") - { - state._indent--; - return null; - } - - if (/[{}\(\),;]/.test(ch)) - return null; - - // 1*DIGIT "K" / "M" / "G" - if (/\d/.test(ch)) { - stream.eatWhile(/[\d]/); - stream.eat(/[KkMmGg]/); - return "number"; - } - - // ":" (ALPHA / "_") *(ALPHA / DIGIT / "_") - if (ch == ":") { - stream.eatWhile(/[a-zA-Z_]/); - stream.eatWhile(/[a-zA-Z0-9_]/); - - return "operator"; - } - - stream.eatWhile(/[\w\$_]/); - var cur = stream.current(); - - // "text:" *(SP / HTAB) (hash-comment / CRLF) - // *(multiline-literal / multiline-dotstart) - // "." CRLF - if ((cur == "text") && stream.eat(":")) - { - state.tokenize = tokenMultiLineString; - return "string"; - } - - if (keywords.propertyIsEnumerable(cur)) - return "keyword"; - - if (atoms.propertyIsEnumerable(cur)) - return "atom"; - } - - function tokenMultiLineString(stream, state) - { - state._multiLineString = true; - // the first line is special it may contain a comment - if (!stream.sol()) { - stream.eatSpace(); - - if (stream.peek() == "#") { - stream.skipToEnd(); - return "comment"; - } - - stream.skipToEnd(); - return "string"; - } - - if ((stream.next() == ".") && (stream.eol())) - { - state._multiLineString = false; - state.tokenize = tokenBase; - } - - return "string"; - } - - function tokenCComment(stream, state) { - var maybeEnd = false, ch; - while ((ch = stream.next()) != null) { - if (maybeEnd && ch == "/") { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) - break; - escaped = !escaped && ch == "\\"; - } - if (!escaped) state.tokenize = tokenBase; - return "string"; - }; - } - - return { - startState: function(base) { - return {tokenize: tokenBase, - baseIndent: base || 0, - _indent: 0}; - }, - - token: function(stream, state) { - if (stream.eatSpace()) - return null; - - return (state.tokenize || tokenBase)(stream, state);; - }, - - indent: function(state, _textAfter) { - return state.baseIndent + state._indent * indentUnit; - }, - - electricChars: "}" - }; -}); - -CodeMirror.defineMIME("application/sieve", "sieve"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/smalltalk/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/smalltalk/index.html deleted file mode 100644 index 690b560fd7f6d032689d0420431c4dbdda2bbdc8..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/smalltalk/index.html +++ /dev/null @@ -1,57 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Smalltalk mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="../../lib/util/matchbrackets.js"></script> - <script src="smalltalk.js"></script> - <link rel="stylesheet" href="../../doc/docs.css"> - <style> - .CodeMirror {border: 2px solid #dee; border-right-width: 10px;} - .CodeMirror-gutter {border: none; background: #dee;} - .CodeMirror-gutter pre {color: white; font-weight: bold;} - </style> - </head> - <body> - <h1>CodeMirror: Smalltalk mode</h1> - -<form><textarea id="code" name="code"> -" - This is a test of the Smalltalk code -" -Seaside.WAComponent subclass: #MyCounter [ - | count | - MyCounter class >> canBeRoot [ ^true ] - - initialize [ - super initialize. - count := 0. - ] - states [ ^{ self } ] - renderContentOn: html [ - html heading: count. - html anchor callback: [ count := count + 1 ]; with: '++'. - html space. - html anchor callback: [ count := count - 1 ]; with: '--'. - ] -] - -MyCounter registerAsApplication: 'mycounter' -</textarea></form> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - matchBrackets: true, - mode: "text/x-stsrc", - indentUnit: 4 - }); - </script> - - <p>Simple Smalltalk mode.</p> - - <p><strong>MIME types defined:</strong> <code>text/x-stsrc</code>.</p> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/smalltalk/smalltalk.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/smalltalk/smalltalk.js deleted file mode 100644 index 33ea11eae70ec08c8d6bae2252e712a568535410..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/smalltalk/smalltalk.js +++ /dev/null @@ -1,139 +0,0 @@ -CodeMirror.defineMode('smalltalk', function(config) { - - var specialChars = /[+\-/\\*~<>=@%|&?!.:;^]/; - var keywords = /true|false|nil|self|super|thisContext/; - - var Context = function(tokenizer, parent) { - this.next = tokenizer; - this.parent = parent; - }; - - var Token = function(name, context, eos) { - this.name = name; - this.context = context; - this.eos = eos; - }; - - var State = function() { - this.context = new Context(next, null); - this.expectVariable = true; - this.indentation = 0; - this.userIndentationDelta = 0; - }; - - State.prototype.userIndent = function(indentation) { - this.userIndentationDelta = indentation > 0 ? (indentation / config.indentUnit - this.indentation) : 0; - }; - - var next = function(stream, context, state) { - var token = new Token(null, context, false); - var aChar = stream.next(); - - if (aChar === '"') { - token = nextComment(stream, new Context(nextComment, context)); - - } else if (aChar === '\'') { - token = nextString(stream, new Context(nextString, context)); - - } else if (aChar === '#') { - stream.eatWhile(/[^ .]/); - token.name = 'string-2'; - - } else if (aChar === '$') { - stream.eatWhile(/[^ ]/); - token.name = 'string-2'; - - } else if (aChar === '|' && state.expectVariable) { - token.context = new Context(nextTemporaries, context); - - } else if (/[\[\]{}()]/.test(aChar)) { - token.name = 'bracket'; - token.eos = /[\[{(]/.test(aChar); - - if (aChar === '[') { - state.indentation++; - } else if (aChar === ']') { - state.indentation = Math.max(0, state.indentation - 1); - } - - } else if (specialChars.test(aChar)) { - stream.eatWhile(specialChars); - token.name = 'operator'; - token.eos = aChar !== ';'; // ; cascaded message expression - - } else if (/\d/.test(aChar)) { - stream.eatWhile(/[\w\d]/); - token.name = 'number'; - - } else if (/[\w_]/.test(aChar)) { - stream.eatWhile(/[\w\d_]/); - token.name = state.expectVariable ? (keywords.test(stream.current()) ? 'keyword' : 'variable') : null; - - } else { - token.eos = state.expectVariable; - } - - return token; - }; - - var nextComment = function(stream, context) { - stream.eatWhile(/[^"]/); - return new Token('comment', stream.eat('"') ? context.parent : context, true); - }; - - var nextString = function(stream, context) { - stream.eatWhile(/[^']/); - return new Token('string', stream.eat('\'') ? context.parent : context, false); - }; - - var nextTemporaries = function(stream, context) { - var token = new Token(null, context, false); - var aChar = stream.next(); - - if (aChar === '|') { - token.context = context.parent; - token.eos = true; - - } else { - stream.eatWhile(/[^|]/); - token.name = 'variable'; - } - - return token; - }; - - return { - startState: function() { - return new State; - }, - - token: function(stream, state) { - state.userIndent(stream.indentation()); - - if (stream.eatSpace()) { - return null; - } - - var token = state.context.next(stream, state.context, state); - state.context = token.context; - state.expectVariable = token.eos; - - state.lastToken = token; - return token.name; - }, - - blankLine: function(state) { - state.userIndent(0); - }, - - indent: function(state, textAfter) { - var i = state.context.next === next && textAfter && textAfter.charAt(0) === ']' ? -1 : state.userIndentationDelta; - return (state.indentation + i) * config.indentUnit; - }, - - electricChars: ']' - }; - -}); - -CodeMirror.defineMIME('text/x-stsrc', {name: 'smalltalk'}); \ No newline at end of file diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/smarty/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/smarty/index.html deleted file mode 100644 index 6b7debedc4be652867116f46998f0bd25098f096..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/smarty/index.html +++ /dev/null @@ -1,83 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Smarty mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="smarty.js"></script> - <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> - <link rel="stylesheet" href="../../doc/docs.css"> - </head> - <body> - <h1>CodeMirror: Smarty mode</h1> - - <form><textarea id="code" name="code"> -{extends file="parent.tpl"} -{include file="template.tpl"} - -{* some example Smarty content *} -{if isset($name) && $name == 'Blog'} - This is a {$var}. - {$integer = 451}, {$array[] = "a"}, {$stringvar = "string"} - {assign var='bob' value=$var.prop} -{elseif $name == $foo} - {function name=menu level=0} - {foreach $data as $entry} - {if is_array($entry)} - - {$entry@key} - {menu data=$entry level=$level+1} - {else} - {$entry} - {/if} - {/foreach} - {/function} -{/if}</textarea></form> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - mode: "smarty" - }); - </script> - - <br /> - - <form><textarea id="code2" name="code2"> -{--extends file="parent.tpl"--} -{--include file="template.tpl"--} - -{--* some example Smarty content *--} -{--if isset($name) && $name == 'Blog'--} - This is a {--$var--}. - {--$integer = 451--}, {--$array[] = "a"--}, {--$stringvar = "string"--} - {--assign var='bob' value=$var.prop--} -{--elseif $name == $foo--} - {--function name=menu level=0--} - {--foreach $data as $entry--} - {--if is_array($entry)--} - - {--$entry@key--} - {--menu data=$entry level=$level+1--} - {--else--} - {--$entry--} - {--/if--} - {--/foreach--} - {--/function--} -{--/if--}</textarea></form> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code2"), { - lineNumbers: true, - mode: { - name: "smarty", - leftDelimiter: "{--", - rightDelimiter: "--}" - } - }); - </script> - - <p>A plain text/Smarty mode which allows for custom delimiter tags (defaults to <b>{</b> and <b>}</b>).</p> - - <p><strong>MIME types defined:</strong> <code>text/x-smarty</code></p> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/smarty/smarty.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/smarty/smarty.js deleted file mode 100644 index 9ee1e4851c468821cd075b5a2a65c4a85c390632..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/smarty/smarty.js +++ /dev/null @@ -1,148 +0,0 @@ -CodeMirror.defineMode("smarty", function(config) { - var keyFuncs = ["debug", "extends", "function", "include", "literal"]; - var last; - var regs = { - operatorChars: /[+\-*&%=<>!?]/, - validIdentifier: /[a-zA-Z0-9\_]/, - stringChar: /[\'\"]/ - }; - var leftDelim = (typeof config.mode.leftDelimiter != 'undefined') ? config.mode.leftDelimiter : "{"; - var rightDelim = (typeof config.mode.rightDelimiter != 'undefined') ? config.mode.rightDelimiter : "}"; - function ret(style, lst) { last = lst; return style; } - - - function tokenizer(stream, state) { - function chain(parser) { - state.tokenize = parser; - return parser(stream, state); - } - - if (stream.match(leftDelim, true)) { - if (stream.eat("*")) { - return chain(inBlock("comment", "*" + rightDelim)); - } - else { - state.tokenize = inSmarty; - return "tag"; - } - } - else { - // I'd like to do an eatWhile() here, but I can't get it to eat only up to the rightDelim string/char - stream.next(); - return null; - } - } - - function inSmarty(stream, state) { - if (stream.match(rightDelim, true)) { - state.tokenize = tokenizer; - return ret("tag", null); - } - - var ch = stream.next(); - if (ch == "$") { - stream.eatWhile(regs.validIdentifier); - return ret("variable-2", "variable"); - } - else if (ch == ".") { - return ret("operator", "property"); - } - else if (regs.stringChar.test(ch)) { - state.tokenize = inAttribute(ch); - return ret("string", "string"); - } - else if (regs.operatorChars.test(ch)) { - stream.eatWhile(regs.operatorChars); - return ret("operator", "operator"); - } - else if (ch == "[" || ch == "]") { - return ret("bracket", "bracket"); - } - else if (/\d/.test(ch)) { - stream.eatWhile(/\d/); - return ret("number", "number"); - } - else { - if (state.last == "variable") { - if (ch == "@") { - stream.eatWhile(regs.validIdentifier); - return ret("property", "property"); - } - else if (ch == "|") { - stream.eatWhile(regs.validIdentifier); - return ret("qualifier", "modifier"); - } - } - else if (state.last == "whitespace") { - stream.eatWhile(regs.validIdentifier); - return ret("attribute", "modifier"); - } - else if (state.last == "property") { - stream.eatWhile(regs.validIdentifier); - return ret("property", null); - } - else if (/\s/.test(ch)) { - last = "whitespace"; - return null; - } - - var str = ""; - if (ch != "/") { - str += ch; - } - var c = ""; - while ((c = stream.eat(regs.validIdentifier))) { - str += c; - } - var i, j; - for (i=0, j=keyFuncs.length; i<j; i++) { - if (keyFuncs[i] == str) { - return ret("keyword", "keyword"); - } - } - if (/\s/.test(ch)) { - return null; - } - return ret("tag", "tag"); - } - } - - function inAttribute(quote) { - return function(stream, state) { - while (!stream.eol()) { - if (stream.next() == quote) { - state.tokenize = inSmarty; - break; - } - } - return "string"; - }; - } - - function inBlock(style, terminator) { - return function(stream, state) { - while (!stream.eol()) { - if (stream.match(terminator)) { - state.tokenize = tokenizer; - break; - } - stream.next(); - } - return style; - }; - } - - return { - startState: function() { - return { tokenize: tokenizer, mode: "smarty", last: null }; - }, - token: function(stream, state) { - var style = state.tokenize(stream, state); - state.last = last; - return style; - }, - electricChars: "" - }; -}); - -CodeMirror.defineMIME("text/x-smarty", "smarty"); \ No newline at end of file diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/sparql/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/sparql/index.html deleted file mode 100644 index a99febd5305b4d33249eed9d2661ba2f647fac14..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/sparql/index.html +++ /dev/null @@ -1,42 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: SPARQL mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="../../lib/util/matchbrackets.js"></script> - <script src="sparql.js"></script> - <style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> - <link rel="stylesheet" href="../../doc/docs.css"> - </head> - <body> - <h1>CodeMirror: SPARQL mode</h1> - <form><textarea id="code" name="code"> -PREFIX a: <http://www.w3.org/2000/10/annotation-ns#> -PREFIX dc: <http://purl.org/dc/elements/1.1/> -PREFIX foaf: <http://xmlns.com/foaf/0.1/> - -# Comment! - -SELECT ?given ?family -WHERE { - ?annot a:annotates <http://www.w3.org/TR/rdf-sparql-query/> . - ?annot dc:creator ?c . - OPTIONAL {?c foaf:given ?given ; - foaf:family ?family } . - FILTER isBlank(?c) -} -</textarea></form> - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - mode: "application/x-sparql-query", - tabMode: "indent", - matchBrackets: true - }); - </script> - - <p><strong>MIME types defined:</strong> <code>application/x-sparql-query</code>.</p> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/sparql/sparql.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/sparql/sparql.js deleted file mode 100644 index 0b367b2a801787eedabce41e9052c4ac75fa6c14..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/sparql/sparql.js +++ /dev/null @@ -1,143 +0,0 @@ -CodeMirror.defineMode("sparql", function(config) { - var indentUnit = config.indentUnit; - var curPunc; - - function wordRegexp(words) { - return new RegExp("^(?:" + words.join("|") + ")$", "i"); - } - var ops = wordRegexp(["str", "lang", "langmatches", "datatype", "bound", "sameterm", "isiri", "isuri", - "isblank", "isliteral", "union", "a"]); - var keywords = wordRegexp(["base", "prefix", "select", "distinct", "reduced", "construct", "describe", - "ask", "from", "named", "where", "order", "limit", "offset", "filter", "optional", - "graph", "by", "asc", "desc"]); - var operatorChars = /[*+\-<>=&|]/; - - function tokenBase(stream, state) { - var ch = stream.next(); - curPunc = null; - if (ch == "$" || ch == "?") { - stream.match(/^[\w\d]*/); - return "variable-2"; - } - else if (ch == "<" && !stream.match(/^[\s\u00a0=]/, false)) { - stream.match(/^[^\s\u00a0>]*>?/); - return "atom"; - } - else if (ch == "\"" || ch == "'") { - state.tokenize = tokenLiteral(ch); - return state.tokenize(stream, state); - } - else if (/[{}\(\),\.;\[\]]/.test(ch)) { - curPunc = ch; - return null; - } - else if (ch == "#") { - stream.skipToEnd(); - return "comment"; - } - else if (operatorChars.test(ch)) { - stream.eatWhile(operatorChars); - return null; - } - else if (ch == ":") { - stream.eatWhile(/[\w\d\._\-]/); - return "atom"; - } - else { - stream.eatWhile(/[_\w\d]/); - if (stream.eat(":")) { - stream.eatWhile(/[\w\d_\-]/); - return "atom"; - } - var word = stream.current(); - if (ops.test(word)) - return null; - else if (keywords.test(word)) - return "keyword"; - else - return "variable"; - } - } - - function tokenLiteral(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) { - state.tokenize = tokenBase; - break; - } - escaped = !escaped && ch == "\\"; - } - return "string"; - }; - } - - function pushContext(state, type, col) { - state.context = {prev: state.context, indent: state.indent, col: col, type: type}; - } - function popContext(state) { - state.indent = state.context.indent; - state.context = state.context.prev; - } - - return { - startState: function() { - return {tokenize: tokenBase, - context: null, - indent: 0, - col: 0}; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (state.context && state.context.align == null) state.context.align = false; - state.indent = stream.indentation(); - } - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - - if (style != "comment" && state.context && state.context.align == null && state.context.type != "pattern") { - state.context.align = true; - } - - if (curPunc == "(") pushContext(state, ")", stream.column()); - else if (curPunc == "[") pushContext(state, "]", stream.column()); - else if (curPunc == "{") pushContext(state, "}", stream.column()); - else if (/[\]\}\)]/.test(curPunc)) { - while (state.context && state.context.type == "pattern") popContext(state); - if (state.context && curPunc == state.context.type) popContext(state); - } - else if (curPunc == "." && state.context && state.context.type == "pattern") popContext(state); - else if (/atom|string|variable/.test(style) && state.context) { - if (/[\}\]]/.test(state.context.type)) - pushContext(state, "pattern", stream.column()); - else if (state.context.type == "pattern" && !state.context.align) { - state.context.align = true; - state.context.col = stream.column(); - } - } - - return style; - }, - - indent: function(state, textAfter) { - var firstChar = textAfter && textAfter.charAt(0); - var context = state.context; - if (/[\]\}]/.test(firstChar)) - while (context && context.type == "pattern") context = context.prev; - - var closing = context && firstChar == context.type; - if (!context) - return 0; - else if (context.type == "pattern") - return context.col; - else if (context.align) - return context.col + (closing ? 0 : 1); - else - return context.indent + (closing ? 0 : indentUnit); - } - }; -}); - -CodeMirror.defineMIME("application/x-sparql-query", "sparql"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/stex/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/stex/index.html deleted file mode 100644 index 2dafe698160dfd7015cb9c68a286228b8f91d8f8..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/stex/index.html +++ /dev/null @@ -1,98 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: sTeX mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="stex.js"></script> - <style>.CodeMirror {background: #f8f8f8;}</style> - <link rel="stylesheet" href="../../doc/docs.css"> - </head> - <body> - <h1>CodeMirror: sTeX mode</h1> - <form><textarea id="code" name="code"> -\begin{module}[id=bbt-size] -\importmodule[balanced-binary-trees]{balanced-binary-trees} -\importmodule[\KWARCslides{dmath/en/cardinality}]{cardinality} - -\begin{frame} - \frametitle{Size Lemma for Balanced Trees} - \begin{itemize} - \item - \begin{assertion}[id=size-lemma,type=lemma] - Let $G=\tup{V,E}$ be a \termref[cd=binary-trees]{balanced binary tree} - of \termref[cd=graph-depth,name=vertex-depth]{depth}$n>i$, then the set - $\defeq{\livar{V}i}{\setst{\inset{v}{V}}{\gdepth{v} = i}}$ of - \termref[cd=graphs-intro,name=node]{nodes} at - \termref[cd=graph-depth,name=vertex-depth]{depth} $i$ has - \termref[cd=cardinality,name=cardinality]{cardinality} $\power2i$. - \end{assertion} - \item - \begin{sproof}[id=size-lemma-pf,proofend=,for=size-lemma]{via induction over the depth $i$.} - \begin{spfcases}{We have to consider two cases} - \begin{spfcase}{$i=0$} - \begin{spfstep}[display=flow] - then $\livar{V}i=\set{\livar{v}r}$, where $\livar{v}r$ is the root, so - $\eq{\card{\livar{V}0},\card{\set{\livar{v}r}},1,\power20}$. - \end{spfstep} - \end{spfcase} - \begin{spfcase}{$i>0$} - \begin{spfstep}[display=flow] - then $\livar{V}{i-1}$ contains $\power2{i-1}$ vertexes - \begin{justification}[method=byIH](IH)\end{justification} - \end{spfstep} - \begin{spfstep} - By the \begin{justification}[method=byDef]definition of a binary - tree\end{justification}, each $\inset{v}{\livar{V}{i-1}}$ is a leaf or has - two children that are at depth $i$. - \end{spfstep} - \begin{spfstep} - As $G$ is \termref[cd=balanced-binary-trees,name=balanced-binary-tree]{balanced} and $\gdepth{G}=n>i$, $\livar{V}{i-1}$ cannot contain - leaves. - \end{spfstep} - \begin{spfstep}[type=conclusion] - Thus $\eq{\card{\livar{V}i},{\atimes[cdot]{2,\card{\livar{V}{i-1}}}},{\atimes[cdot]{2,\power2{i-1}}},\power2i}$. - \end{spfstep} - \end{spfcase} - \end{spfcases} - \end{sproof} - \item - \begin{assertion}[id=fbbt,type=corollary] - A fully balanced tree of depth $d$ has $\power2{d+1}-1$ nodes. - \end{assertion} - \item - \begin{sproof}[for=fbbt,id=fbbt-pf]{} - \begin{spfstep} - Let $\defeq{G}{\tup{V,E}}$ be a fully balanced tree - \end{spfstep} - \begin{spfstep} - Then $\card{V}=\Sumfromto{i}1d{\power2i}= \power2{d+1}-1$. - \end{spfstep} - \end{sproof} - \end{itemize} - \end{frame} -\begin{note} - \begin{omtext}[type=conclusion,for=binary-tree] - This shows that balanced binary trees grow in breadth very quickly, a consequence of - this is that they are very shallow (and this compute very fast), which is the essence of - the next result. - \end{omtext} -\end{note} -\end{module} - -%%% Local Variables: -%%% mode: LaTeX -%%% TeX-master: "all" -%%% End: \end{document} -</textarea></form> - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), {}); - </script> - - <p><strong>MIME types defined:</strong> <code>text/x-stex</code>.</p> - - <p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#stex_*">normal</a>, <a href="../../test/index.html#verbose,stex_*">verbose</a>.</p> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/stex/stex.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/stex/stex.js deleted file mode 100644 index 42ed82c6690f93471b3e403f84fedd021f5191dc..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/stex/stex.js +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Author: Constantin Jucovschi (c.jucovschi@jacobs-university.de) - * Licence: MIT - */ - -CodeMirror.defineMode("stex", function() -{ - function pushCommand(state, command) { - state.cmdState.push(command); - } - - function peekCommand(state) { - if (state.cmdState.length>0) - return state.cmdState[state.cmdState.length-1]; - else - return null; - } - - function popCommand(state) { - if (state.cmdState.length>0) { - var plug = state.cmdState.pop(); - plug.closeBracket(); - } - } - - function applyMostPowerful(state) { - var context = state.cmdState; - for (var i = context.length - 1; i >= 0; i--) { - var plug = context[i]; - if (plug.name=="DEFAULT") - continue; - return plug.styleIdentifier(); - } - return null; - } - - function addPluginPattern(pluginName, cmdStyle, brackets, styles) { - return function () { - this.name=pluginName; - this.bracketNo = 0; - this.style=cmdStyle; - this.styles = styles; - this.brackets = brackets; - - this.styleIdentifier = function() { - if (this.bracketNo<=this.styles.length) - return this.styles[this.bracketNo-1]; - else - return null; - }; - this.openBracket = function() { - this.bracketNo++; - return "bracket"; - }; - this.closeBracket = function() {}; - }; - } - - var plugins = new Array(); - - plugins["importmodule"] = addPluginPattern("importmodule", "tag", "{[", ["string", "builtin"]); - plugins["documentclass"] = addPluginPattern("documentclass", "tag", "{[", ["", "atom"]); - plugins["usepackage"] = addPluginPattern("documentclass", "tag", "[", ["atom"]); - plugins["begin"] = addPluginPattern("documentclass", "tag", "[", ["atom"]); - plugins["end"] = addPluginPattern("documentclass", "tag", "[", ["atom"]); - - plugins["DEFAULT"] = function () { - this.name="DEFAULT"; - this.style="tag"; - - this.styleIdentifier = this.openBracket = this.closeBracket = function() {}; - }; - - function setState(state, f) { - state.f = f; - } - - function normal(source, state) { - if (source.match(/^\\[a-zA-Z@]+/)) { - var cmdName = source.current(); - cmdName = cmdName.substr(1, cmdName.length-1); - var plug; - if (plugins.hasOwnProperty(cmdName)) { - plug = plugins[cmdName]; - } else { - plug = plugins["DEFAULT"]; - } - plug = new plug(); - pushCommand(state, plug); - setState(state, beginParams); - return plug.style; - } - - // escape characters - if (source.match(/^\\[$&%#{}_]/)) { - return "tag"; - } - - // white space control characters - if (source.match(/^\\[,;!\/]/)) { - return "tag"; - } - - var ch = source.next(); - if (ch == "%") { - // special case: % at end of its own line; stay in same state - if (!source.eol()) { - setState(state, inCComment); - } - return "comment"; - } - else if (ch=='}' || ch==']') { - plug = peekCommand(state); - if (plug) { - plug.closeBracket(ch); - setState(state, beginParams); - } else - return "error"; - return "bracket"; - } else if (ch=='{' || ch=='[') { - plug = plugins["DEFAULT"]; - plug = new plug(); - pushCommand(state, plug); - return "bracket"; - } - else if (/\d/.test(ch)) { - source.eatWhile(/[\w.%]/); - return "atom"; - } - else { - source.eatWhile(/[\w-_]/); - return applyMostPowerful(state); - } - } - - function inCComment(source, state) { - source.skipToEnd(); - setState(state, normal); - return "comment"; - } - - function beginParams(source, state) { - var ch = source.peek(); - if (ch == '{' || ch == '[') { - var lastPlug = peekCommand(state); - lastPlug.openBracket(ch); - source.eat(ch); - setState(state, normal); - return "bracket"; - } - if (/[ \t\r]/.test(ch)) { - source.eat(ch); - return null; - } - setState(state, normal); - lastPlug = peekCommand(state); - if (lastPlug) { - popCommand(state); - } - return normal(source, state); - } - - return { - startState: function() { return { f:normal, cmdState:[] }; }, - copyState: function(s) { return { f: s.f, cmdState: s.cmdState.slice(0, s.cmdState.length) }; }, - - token: function(stream, state) { - var t = state.f(stream, state); - return t; - } - }; -}); - -CodeMirror.defineMIME("text/x-stex", "stex"); -CodeMirror.defineMIME("text/x-latex", "stex"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/stex/test.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/stex/test.js deleted file mode 100644 index c5a34f3d8d05efcd66d9621ce8c47c8871c46dd2..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/stex/test.js +++ /dev/null @@ -1,343 +0,0 @@ -var MT = ModeTest; -MT.modeName = 'stex'; -MT.modeOptions = {}; - -MT.testMode( - 'word', - 'foo', - [ - null, 'foo' - ] -); - -MT.testMode( - 'twoWords', - 'foo bar', - [ - null, 'foo bar' - ] -); - -MT.testMode( - 'beginEndDocument', - '\\begin{document}\n\\end{document}', - [ - 'tag', '\\begin', - 'bracket', '{', - 'atom', 'document', - 'bracket', '}', - 'tag', '\\end', - 'bracket', '{', - 'atom', 'document', - 'bracket', '}' - ] -); - -MT.testMode( - 'beginEndEquation', - '\\begin{equation}\n E=mc^2\n\\end{equation}', - [ - 'tag', '\\begin', - 'bracket', '{', - 'atom', 'equation', - 'bracket', '}', - null, ' E=mc^2', - 'tag', '\\end', - 'bracket', '{', - 'atom', 'equation', - 'bracket', '}' - ] -); - -MT.testMode( - 'beginModule', - '\\begin{module}[]', - [ - 'tag', '\\begin', - 'bracket', '{', - 'atom', 'module', - 'bracket', '}[]' - ] -); - -MT.testMode( - 'beginModuleId', - '\\begin{module}[id=bbt-size]', - [ - 'tag', '\\begin', - 'bracket', '{', - 'atom', 'module', - 'bracket', '}[', - null, 'id=bbt-size', - 'bracket', ']' - ] -); - -MT.testMode( - 'importModule', - '\\importmodule[b-b-t]{b-b-t}', - [ - 'tag', '\\importmodule', - 'bracket', '[', - 'string', 'b-b-t', - 'bracket', ']{', - 'builtin', 'b-b-t', - 'bracket', '}' - ] -); - -MT.testMode( - 'importModulePath', - '\\importmodule[\\KWARCslides{dmath/en/cardinality}]{card}', - [ - 'tag', '\\importmodule', - 'bracket', '[', - 'tag', '\\KWARCslides', - 'bracket', '{', - 'string', 'dmath/en/cardinality', - 'bracket', '}]{', - 'builtin', 'card', - 'bracket', '}' - ] -); - -MT.testMode( - 'psForPDF', - '\\PSforPDF[1]{#1}', // could treat #1 specially - [ - 'tag', '\\PSforPDF', - 'bracket', '[', - 'atom', '1', - 'bracket', ']{', - null, '#1', - 'bracket', '}' - ] -); - -MT.testMode( - 'comment', - '% foo', - [ - 'comment', '% foo' - ] -); - -MT.testMode( - 'tagComment', - '\\item% bar', - [ - 'tag', '\\item', - 'comment', '% bar' - ] -); - -MT.testMode( - 'commentTag', - ' % \\item', - [ - null, ' ', - 'comment', '% \\item' - ] -); - -MT.testMode( - 'commentLineBreak', - '%\nfoo', - [ - 'comment', '%', - null, 'foo' - ] -); - -MT.testMode( - 'tagErrorCurly', - '\\begin}{', - [ - 'tag', '\\begin', - 'error', '}', - 'bracket', '{' - ] -); - -MT.testMode( - 'tagErrorSquare', - '\\item]{', - [ - 'tag', '\\item', - 'error', ']', - 'bracket', '{' - ] -); - -MT.testMode( - 'commentCurly', - '% }', - [ - 'comment', '% }' - ] -); - -MT.testMode( - 'tagHash', - 'the \\# key', - [ - null, 'the ', - 'tag', '\\#', - null, ' key' - ] -); - -MT.testMode( - 'tagNumber', - 'a \\$5 stetson', - [ - null, 'a ', - 'tag', '\\$', - 'atom', 5, - null, ' stetson' - ] -); - -MT.testMode( - 'tagPercent', - '100\\% beef', - [ - 'atom', '100', - 'tag', '\\%', - null, ' beef' - ] -); - -MT.testMode( - 'tagAmpersand', - 'L \\& N', - [ - null, 'L ', - 'tag', '\\&', - null, ' N' - ] -); - -MT.testMode( - 'tagUnderscore', - 'foo\\_bar', - [ - null, 'foo', - 'tag', '\\_', - null, 'bar' - ] -); - -MT.testMode( - 'tagBracketOpen', - '\\emph{\\{}', - [ - 'tag', '\\emph', - 'bracket', '{', - 'tag', '\\{', - 'bracket', '}' - ] -); - -MT.testMode( - 'tagBracketClose', - '\\emph{\\}}', - [ - 'tag', '\\emph', - 'bracket', '{', - 'tag', '\\}', - 'bracket', '}' - ] -); - -MT.testMode( - 'tagLetterNumber', - 'section \\S1', - [ - null, 'section ', - 'tag', '\\S', - 'atom', '1' - ] -); - -MT.testMode( - 'textTagNumber', - 'para \\P2', - [ - null, 'para ', - 'tag', '\\P', - 'atom', '2' - ] -); - -MT.testMode( - 'thinspace', - 'x\\,y', // thinspace - [ - null, 'x', - 'tag', '\\,', - null, 'y' - ] -); - -MT.testMode( - 'thickspace', - 'x\\;y', // thickspace - [ - null, 'x', - 'tag', '\\;', - null, 'y' - ] -); - -MT.testMode( - 'negativeThinspace', - 'x\\!y', // negative thinspace - [ - null, 'x', - 'tag', '\\!', - null, 'y' - ] -); - -MT.testMode( - 'periodNotSentence', - 'J.\\ L.\\ is', // period not ending a sentence - [ - null, 'J.\\ L.\\ is' - ] -); // maybe could be better - -MT.testMode( - 'periodSentence', - 'X\\@. The', // period ending a sentence - [ - null, 'X', - 'tag', '\\@', - null, '. The' - ] -); - -MT.testMode( - 'italicCorrection', - '{\\em If\\/} I', // italic correction - [ - 'bracket', '{', - 'tag', '\\em', - null, ' If', - 'tag', '\\/', - 'bracket', '}', - null, ' I' - ] -); - -MT.testMode( - 'tagBracket', - '\\newcommand{\\pop}', - [ - 'tag', '\\newcommand', - 'bracket', '{', - 'tag', '\\pop', - 'bracket', '}' - ] -); \ No newline at end of file diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/tiddlywiki/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/tiddlywiki/index.html deleted file mode 100644 index 89ae85892b211af3e9ad27542106a22440cf4ecb..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/tiddlywiki/index.html +++ /dev/null @@ -1,142 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: TiddlyWiki mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="../../lib/util/matchbrackets.js"></script> - <script src="tiddlywiki.js"></script> - <link rel="stylesheet" href="tiddlywiki.css"> - <link rel="stylesheet" href="../../doc/docs.css"> - <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> - </head> - <body> - <h1>CodeMirror: TiddlyWiki mode</h1> - -<div><textarea id="code" name="code"> -!TiddlyWiki Formatting -* Rendered versions can be found at: http://www.tiddlywiki.com/#Reference - -|!Option | !Syntax | -|bold font | ''bold'' | -|italic type | //italic// | -|underlined text | __underlined__ | -|strikethrough text | --strikethrough-- | -|superscript text | super^^script^^ | -|subscript text | sub~~script~~ | -|highlighted text | @@highlighted@@ | -|preformatted text | {{{preformatted}}} | - -!Block Elements -<<< -!Heading 1 - -!!Heading 2 - -!!!Heading 3 - -!!!!Heading 4 - -!!!!!Heading 5 -<<< - -!!Lists -<<< -* unordered list, level 1 -** unordered list, level 2 -*** unordered list, level 3 - -# ordered list, level 1 -## ordered list, level 2 -### unordered list, level 3 - -; definition list, term -: definition list, description -<<< - -!!Blockquotes -<<< -> blockquote, level 1 ->> blockquote, level 2 ->>> blockquote, level 3 - -> blockquote -<<< - -!!Preformatted Text -<<< -{{{ -preformatted (e.g. code) -}}} -<<< - -!!Code Sections -<<< -{{{ -Text style code -}}} - -//{{{ -JS styled code. TiddlyWiki mixed mode should support highlighter switching in the future. -//}}} - -<!--{{{--> -XML styled code. TiddlyWiki mixed mode should support highlighter switching in the future. -<!--}}}--> -<<< - -!!Tables -<<< -|CssClass|k -|!heading column 1|!heading column 2| -|row 1, column 1|row 1, column 2| -|row 2, column 1|row 2, column 2| -|>|COLSPAN| -|ROWSPAN| ... | -|~| ... | -|CssProperty:value;...| ... | -|caption|c - -''Annotation:'' -* The {{{>}}} marker creates a "colspan", causing the current cell to merge with the one to the right. -* The {{{~}}} marker creates a "rowspan", causing the current cell to merge with the one above. -<<< -!!Images /% TODO %/ -cf. [[TiddlyWiki.com|http://www.tiddlywiki.com/#EmbeddedImages]] - -!Hyperlinks -* [[WikiWords|WikiWord]] are automatically transformed to hyperlinks to the respective tiddler -** the automatic transformation can be suppressed by preceding the respective WikiWord with a tilde ({{{~}}}): {{{~WikiWord}}} -* [[PrettyLinks]] are enclosed in square brackets and contain the desired tiddler name: {{{[[tiddler name]]}}} -** optionally, a custom title or description can be added, separated by a pipe character ({{{|}}}): {{{[[title|target]]}}}<br>'''N.B.:''' In this case, the target can also be any website (i.e. URL). - -!Custom Styling -* {{{@@CssProperty:value;CssProperty:value;...@@}}}<br>''N.B.:'' CSS color definitions should use lowercase letters to prevent the inadvertent creation of WikiWords. -* <html><code>{{customCssClass{...}}}</code></html> -* raw HTML can be inserted by enclosing the respective code in HTML tags: {{{<html> ... </html>}}} - -!Special Markers -* {{{<br>}}} forces a manual line break -* {{{----}}} creates a horizontal ruler -* [[HTML entities|http://www.tiddlywiki.com/#HtmlEntities]] -* [[HTML entities local|HtmlEntities]] -* {{{<<macroName>>}}} calls the respective [[macro|Macros]] -* To hide text within a tiddler so that it is not displayed, it can be wrapped in {{{/%}}} and {{{%/}}}.<br/>This can be a useful trick for hiding drafts or annotating complex markup. -* To prevent wiki markup from taking effect for a particular section, that section can be enclosed in three double quotes: e.g. {{{"""WikiWord"""}}}. -</textarea></div> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - mode: 'tiddlywiki', - lineNumbers: true, - enterMode: 'keep', - matchBrackets: true - }); - </script> - - <p>TiddlyWiki mode supports a single configuration.</p> - - <p><strong>MIME types defined:</strong> <code>text/x-tiddlywiki</code>.</p> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/tiddlywiki/tiddlywiki.css b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/tiddlywiki/tiddlywiki.css deleted file mode 100644 index 9a69b639f8a71389a99dacb03bd03e4bb2a57ded..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/tiddlywiki/tiddlywiki.css +++ /dev/null @@ -1,14 +0,0 @@ -span.cm-underlined { - text-decoration: underline; -} -span.cm-strikethrough { - text-decoration: line-through; -} -span.cm-brace { - color: #170; - font-weight: bold; -} -span.cm-table { - color: blue; - font-weight: bold; -} diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/tiddlywiki/tiddlywiki.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/tiddlywiki/tiddlywiki.js deleted file mode 100644 index 0d506ee6088b6bcd06b551a378e0452b836467f1..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/tiddlywiki/tiddlywiki.js +++ /dev/null @@ -1,353 +0,0 @@ -/*** -|''Name''|tiddlywiki.js| -|''Description''|Enables TiddlyWikiy syntax highlighting using CodeMirror| -|''Author''|PMario| -|''Version''|0.1.7| -|''Status''|''stable''| -|''Source''|[[GitHub|https://github.com/pmario/CodeMirror2/blob/tw-syntax/mode/tiddlywiki]]| -|''Documentation''|http://codemirror.tiddlyspace.com/| -|''License''|[[MIT License|http://www.opensource.org/licenses/mit-license.php]]| -|''CoreVersion''|2.5.0| -|''Requires''|codemirror.js| -|''Keywords''|syntax highlighting color code mirror codemirror| -! Info -CoreVersion parameter is needed for TiddlyWiki only! -***/ -//{{{ -CodeMirror.defineMode("tiddlywiki", function () { - // Tokenizer - var textwords = {}; - - var keywords = function () { - function kw(type) { - return { type: type, style: "macro"}; - } - return { - "allTags": kw('allTags'), "closeAll": kw('closeAll'), "list": kw('list'), - "newJournal": kw('newJournal'), "newTiddler": kw('newTiddler'), - "permaview": kw('permaview'), "saveChanges": kw('saveChanges'), - "search": kw('search'), "slider": kw('slider'), "tabs": kw('tabs'), - "tag": kw('tag'), "tagging": kw('tagging'), "tags": kw('tags'), - "tiddler": kw('tiddler'), "timeline": kw('timeline'), - "today": kw('today'), "version": kw('version'), "option": kw('option'), - - "with": kw('with'), - "filter": kw('filter') - }; - }(); - - var isSpaceName = /[\w_\-]/i, - reHR = /^\-\-\-\-+$/, // <hr> - reWikiCommentStart = /^\/\*\*\*$/, // /*** - reWikiCommentStop = /^\*\*\*\/$/, // ***/ - reBlockQuote = /^<<<$/, - - reJsCodeStart = /^\/\/\{\{\{$/, // //{{{ js block start - reJsCodeStop = /^\/\/\}\}\}$/, // //}}} js stop - reXmlCodeStart = /^<!--\{\{\{-->$/, // xml block start - reXmlCodeStop = /^<!--\}\}\}-->$/, // xml stop - - reCodeBlockStart = /^\{\{\{$/, // {{{ TW text div block start - reCodeBlockStop = /^\}\}\}$/, // }}} TW text stop - - reUntilCodeStop = /.*?\}\}\}/; - - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - - // Used as scratch variables to communicate multiple values without - // consing up tons of objects. - var type, content; - - function ret(tp, style, cont) { - type = tp; - content = cont; - return style; - } - - function jsTokenBase(stream, state) { - var sol = stream.sol(), ch; - - state.block = false; // indicates the start of a code block. - - ch = stream.peek(); // don't eat, to make matching simpler - - // check start of blocks - if (sol && /[<\/\*{}\-]/.test(ch)) { - if (stream.match(reCodeBlockStart)) { - state.block = true; - return chain(stream, state, twTokenCode); - } - if (stream.match(reBlockQuote)) { - return ret('quote', 'quote'); - } - if (stream.match(reWikiCommentStart) || stream.match(reWikiCommentStop)) { - return ret('code', 'comment'); - } - if (stream.match(reJsCodeStart) || stream.match(reJsCodeStop) || stream.match(reXmlCodeStart) || stream.match(reXmlCodeStop)) { - return ret('code', 'comment'); - } - if (stream.match(reHR)) { - return ret('hr', 'hr'); - } - } // sol - ch = stream.next(); - - if (sol && /[\/\*!#;:>|]/.test(ch)) { - if (ch == "!") { // tw header - stream.skipToEnd(); - return ret("header", "header"); - } - if (ch == "*") { // tw list - stream.eatWhile('*'); - return ret("list", "comment"); - } - if (ch == "#") { // tw numbered list - stream.eatWhile('#'); - return ret("list", "comment"); - } - if (ch == ";") { // definition list, term - stream.eatWhile(';'); - return ret("list", "comment"); - } - if (ch == ":") { // definition list, description - stream.eatWhile(':'); - return ret("list", "comment"); - } - if (ch == ">") { // single line quote - stream.eatWhile(">"); - return ret("quote", "quote"); - } - if (ch == '|') { - return ret('table', 'header'); - } - } - - if (ch == '{' && stream.match(/\{\{/)) { - return chain(stream, state, twTokenCode); - } - - // rudimentary html:// file:// link matching. TW knows much more ... - if (/[hf]/i.test(ch)) { - if (/[ti]/i.test(stream.peek()) && stream.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i)) { - return ret("link", "link"); - } - } - // just a little string indicator, don't want to have the whole string covered - if (ch == '"') { - return ret('string', 'string'); - } - if (ch == '~') { // _no_ CamelCase indicator should be bold - return ret('text', 'brace'); - } - if (/[\[\]]/.test(ch)) { // check for [[..]] - if (stream.peek() == ch) { - stream.next(); - return ret('brace', 'brace'); - } - } - if (ch == "@") { // check for space link. TODO fix @@...@@ highlighting - stream.eatWhile(isSpaceName); - return ret("link", "link"); - } - if (/\d/.test(ch)) { // numbers - stream.eatWhile(/\d/); - return ret("number", "number"); - } - if (ch == "/") { // tw invisible comment - if (stream.eat("%")) { - return chain(stream, state, twTokenComment); - } - else if (stream.eat("/")) { // - return chain(stream, state, twTokenEm); - } - } - if (ch == "_") { // tw underline - if (stream.eat("_")) { - return chain(stream, state, twTokenUnderline); - } - } - // strikethrough and mdash handling - if (ch == "-") { - if (stream.eat("-")) { - // if strikethrough looks ugly, change CSS. - if (stream.peek() != ' ') - return chain(stream, state, twTokenStrike); - // mdash - if (stream.peek() == ' ') - return ret('text', 'brace'); - } - } - if (ch == "'") { // tw bold - if (stream.eat("'")) { - return chain(stream, state, twTokenStrong); - } - } - if (ch == "<") { // tw macro - if (stream.eat("<")) { - return chain(stream, state, twTokenMacro); - } - } - else { - return ret(ch); - } - - // core macro handling - stream.eatWhile(/[\w\$_]/); - var word = stream.current(), - known = textwords.propertyIsEnumerable(word) && textwords[word]; - - return known ? ret(known.type, known.style, word) : ret("text", null, word); - - } // jsTokenBase() - - // tw invisible comment - function twTokenComment(stream, state) { - var maybeEnd = false, - ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = jsTokenBase; - break; - } - maybeEnd = (ch == "%"); - } - return ret("comment", "comment"); - } - - // tw strong / bold - function twTokenStrong(stream, state) { - var maybeEnd = false, - ch; - while (ch = stream.next()) { - if (ch == "'" && maybeEnd) { - state.tokenize = jsTokenBase; - break; - } - maybeEnd = (ch == "'"); - } - return ret("text", "strong"); - } - - // tw code - function twTokenCode(stream, state) { - var ch, sb = state.block; - - if (sb && stream.current()) { - return ret("code", "comment"); - } - - if (!sb && stream.match(reUntilCodeStop)) { - state.tokenize = jsTokenBase; - return ret("code", "comment"); - } - - if (sb && stream.sol() && stream.match(reCodeBlockStop)) { - state.tokenize = jsTokenBase; - return ret("code", "comment"); - } - - ch = stream.next(); - return (sb) ? ret("code", "comment") : ret("code", "comment"); - } - - // tw em / italic - function twTokenEm(stream, state) { - var maybeEnd = false, - ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = jsTokenBase; - break; - } - maybeEnd = (ch == "/"); - } - return ret("text", "em"); - } - - // tw underlined text - function twTokenUnderline(stream, state) { - var maybeEnd = false, - ch; - while (ch = stream.next()) { - if (ch == "_" && maybeEnd) { - state.tokenize = jsTokenBase; - break; - } - maybeEnd = (ch == "_"); - } - return ret("text", "underlined"); - } - - // tw strike through text looks ugly - // change CSS if needed - function twTokenStrike(stream, state) { - var maybeEnd = false, ch; - - while (ch = stream.next()) { - if (ch == "-" && maybeEnd) { - state.tokenize = jsTokenBase; - break; - } - maybeEnd = (ch == "-"); - } - return ret("text", "strikethrough"); - } - - // macro - function twTokenMacro(stream, state) { - var ch, word, known; - - if (stream.current() == '<<') { - return ret('brace', 'macro'); - } - - ch = stream.next(); - if (!ch) { - state.tokenize = jsTokenBase; - return ret(ch); - } - if (ch == ">") { - if (stream.peek() == '>') { - stream.next(); - state.tokenize = jsTokenBase; - return ret("brace", "macro"); - } - } - - stream.eatWhile(/[\w\$_]/); - word = stream.current(); - known = keywords.propertyIsEnumerable(word) && keywords[word]; - - if (known) { - return ret(known.type, known.style, word); - } - else { - return ret("macro", null, word); - } - } - - // Interface - return { - startState: function () { - return { - tokenize: jsTokenBase, - indented: 0, - level: 0 - }; - }, - - token: function (stream, state) { - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - return style; - }, - - electricChars: "" - }; -}); - -CodeMirror.defineMIME("text/x-tiddlywiki", "tiddlywiki"); -//}}} diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/tiki/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/tiki/index.html deleted file mode 100644 index 7b85a44a7e0b1edd81da263419e0bafdc7fe8707..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/tiki/index.html +++ /dev/null @@ -1,81 +0,0 @@ -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Tiki wiki mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="tiki.js"></script> - <link rel="stylesheet" href="tiki.css"> - <link rel="stylesheet" href="../../doc/docs.css"> - <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> - </head> - <body style="padding: 20px;"> - <h1>CodeMirror: Tiki wiki mode</h1> - -<div><textarea id="code" name="code"> -Headings -!Header 1 -!!Header 2 -!!!Header 3 -!!!!Header 4 -!!!!!Header 5 -!!!!!!Header 6 - -Styling --=titlebar=- -^^ Box on multi -lines -of content^^ -__bold__ -''italic'' -===underline=== -::center:: ---Line Through-- - -Operators -~np~No parse~/np~ - -Link -[link|desc|nocache] - -Wiki -((Wiki)) -((Wiki|desc)) -((Wiki|desc|timeout)) - -Table -||row1 col1|row1 col2|row1 col3 -row2 col1|row2 col2|row2 col3 -row3 col1|row3 col2|row3 col3|| - -Lists: -*bla -**bla-1 -++continue-bla-1 -***bla-2 -++continue-bla-1 -*bla -+continue-bla -#bla -** tra-la-la -+continue-bla -#bla - -Plugin (standard): -{PLUGIN(attr="my attr")} -Plugin Body -{PLUGIN} - -Plugin (inline): -{plugin attr="my attr"} -</textarea></div> - -<script type="text/javascript"> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - mode: 'tiki', - lineNumbers: true - }); -</script> - -</body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/tiki/tiki.css b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/tiki/tiki.css deleted file mode 100644 index e3c3c0fd2d2bfdec704f3fcc9c4ad0903a99284a..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/tiki/tiki.css +++ /dev/null @@ -1,26 +0,0 @@ -.cm-tw-syntaxerror { - color: #FFFFFF; - background-color: #990000; -} - -.cm-tw-deleted { - text-decoration: line-through; -} - -.cm-tw-header5 { - font-weight: bold; -} -.cm-tw-listitem:first-child { /*Added first child to fix duplicate padding when highlighting*/ - padding-left: 10px; -} - -.cm-tw-box { - border-top-width: 0px ! important; - border-style: solid; - border-width: 1px; - border-color: inherit; -} - -.cm-tw-underline { - text-decoration: underline; -} \ No newline at end of file diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/tiki/tiki.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/tiki/tiki.js deleted file mode 100644 index 81e87ab213c90d3fc37e1e1811aad33e9b5cecdc..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/tiki/tiki.js +++ /dev/null @@ -1,309 +0,0 @@ -CodeMirror.defineMode('tiki', function(config) { - function inBlock(style, terminator, returnTokenizer) { - return function(stream, state) { - while (!stream.eol()) { - if (stream.match(terminator)) { - state.tokenize = inText; - break; - } - stream.next(); - } - - if (returnTokenizer) state.tokenize = returnTokenizer; - - return style; - }; - } - - function inLine(style) { - return function(stream, state) { - while(!stream.eol()) { - stream.next(); - } - state.tokenize = inText; - return style; - }; - } - - function inText(stream, state) { - function chain(parser) { - state.tokenize = parser; - return parser(stream, state); - } - - var sol = stream.sol(); - var ch = stream.next(); - - //non start of line - switch (ch) { //switch is generally much faster than if, so it is used here - case "{": //plugin - stream.eat("/"); - stream.eatSpace(); - var tagName = ""; - var c; - while ((c = stream.eat(/[^\s\u00a0=\"\'\/?(}]/))) tagName += c; - state.tokenize = inPlugin; - return "tag"; - break; - case "_": //bold - if (stream.eat("_")) { - return chain(inBlock("strong", "__", inText)); - } - break; - case "'": //italics - if (stream.eat("'")) { - // Italic text - return chain(inBlock("em", "''", inText)); - } - break; - case "(":// Wiki Link - if (stream.eat("(")) { - return chain(inBlock("variable-2", "))", inText)); - } - break; - case "[":// Weblink - return chain(inBlock("variable-3", "]", inText)); - break; - case "|": //table - if (stream.eat("|")) { - return chain(inBlock("comment", "||")); - } - break; - case "-": - if (stream.eat("=")) {//titleBar - return chain(inBlock("header string", "=-", inText)); - } else if (stream.eat("-")) {//deleted - return chain(inBlock("error tw-deleted", "--", inText)); - } - break; - case "=": //underline - if (stream.match("==")) { - return chain(inBlock("tw-underline", "===", inText)); - } - break; - case ":": - if (stream.eat(":")) { - return chain(inBlock("comment", "::")); - } - break; - case "^": //box - return chain(inBlock("tw-box", "^")); - break; - case "~": //np - if (stream.match("np~")) { - return chain(inBlock("meta", "~/np~")); - } - break; - } - - //start of line types - if (sol) { - switch (ch) { - case "!": //header at start of line - if (stream.match('!!!!!')) { - return chain(inLine("header string")); - } else if (stream.match('!!!!')) { - return chain(inLine("header string")); - } else if (stream.match('!!!')) { - return chain(inLine("header string")); - } else if (stream.match('!!')) { - return chain(inLine("header string")); - } else { - return chain(inLine("header string")); - } - break; - case "*": //unordered list line item, or <li /> at start of line - case "#": //ordered list line item, or <li /> at start of line - case "+": //ordered list line item, or <li /> at start of line - return chain(inLine("tw-listitem bracket")); - break; - } - } - - //stream.eatWhile(/[&{]/); was eating up plugins, turned off to act less like html and more like tiki - return null; - } - - var indentUnit = config.indentUnit; - - // Return variables for tokenizers - var pluginName, type; - function inPlugin(stream, state) { - var ch = stream.next(); - var peek = stream.peek(); - - if (ch == "}") { - state.tokenize = inText; - //type = ch == ")" ? "endPlugin" : "selfclosePlugin"; inPlugin - return "tag"; - } else if (ch == "(" || ch == ")") { - return "bracket"; - } else if (ch == "=") { - type = "equals"; - - if (peek == ">") { - ch = stream.next(); - peek = stream.peek(); - } - - //here we detect values directly after equal character with no quotes - if (!/[\'\"]/.test(peek)) { - state.tokenize = inAttributeNoQuote(); - } - //end detect values - - return "operator"; - } else if (/[\'\"]/.test(ch)) { - state.tokenize = inAttribute(ch); - return state.tokenize(stream, state); - } else { - stream.eatWhile(/[^\s\u00a0=\"\'\/?]/); - return "keyword"; - } - } - - function inAttribute(quote) { - return function(stream, state) { - while (!stream.eol()) { - if (stream.next() == quote) { - state.tokenize = inPlugin; - break; - } - } - return "string"; - }; - } - - function inAttributeNoQuote() { - return function(stream, state) { - while (!stream.eol()) { - var ch = stream.next(); - var peek = stream.peek(); - if (ch == " " || ch == "," || /[ )}]/.test(peek)) { - state.tokenize = inPlugin; - break; - } - } - return "string"; - }; - } - - var curState, setStyle; - function pass() { - for (var i = arguments.length - 1; i >= 0; i--) curState.cc.push(arguments[i]); - } - - function cont() { - pass.apply(null, arguments); - return true; - } - - function pushContext(pluginName, startOfLine) { - var noIndent = curState.context && curState.context.noIndent; - curState.context = { - prev: curState.context, - pluginName: pluginName, - indent: curState.indented, - startOfLine: startOfLine, - noIndent: noIndent - }; - } - - function popContext() { - if (curState.context) curState.context = curState.context.prev; - } - - function element(type) { - if (type == "openPlugin") {curState.pluginName = pluginName; return cont(attributes, endplugin(curState.startOfLine));} - else if (type == "closePlugin") { - var err = false; - if (curState.context) { - err = curState.context.pluginName != pluginName; - popContext(); - } else { - err = true; - } - if (err) setStyle = "error"; - return cont(endcloseplugin(err)); - } - else if (type == "string") { - if (!curState.context || curState.context.name != "!cdata") pushContext("!cdata"); - if (curState.tokenize == inText) popContext(); - return cont(); - } - else return cont(); - } - - function endplugin(startOfLine) { - return function(type) { - if ( - type == "selfclosePlugin" || - type == "endPlugin" - ) - return cont(); - if (type == "endPlugin") {pushContext(curState.pluginName, startOfLine); return cont();} - return cont(); - }; - } - - function endcloseplugin(err) { - return function(type) { - if (err) setStyle = "error"; - if (type == "endPlugin") return cont(); - return pass(); - }; - } - - function attributes(type) { - if (type == "keyword") {setStyle = "attribute"; return cont(attributes);} - if (type == "equals") return cont(attvalue, attributes); - return pass(); - } - function attvalue(type) { - if (type == "keyword") {setStyle = "string"; return cont();} - if (type == "string") return cont(attvaluemaybe); - return pass(); - } - function attvaluemaybe(type) { - if (type == "string") return cont(attvaluemaybe); - else return pass(); - } - return { - startState: function() { - return {tokenize: inText, cc: [], indented: 0, startOfLine: true, pluginName: null, context: null}; - }, - token: function(stream, state) { - if (stream.sol()) { - state.startOfLine = true; - state.indented = stream.indentation(); - } - if (stream.eatSpace()) return null; - - setStyle = type = pluginName = null; - var style = state.tokenize(stream, state); - if ((style || type) && style != "comment") { - curState = state; - while (true) { - var comb = state.cc.pop() || element; - if (comb(type || style)) break; - } - } - state.startOfLine = false; - return setStyle || style; - }, - indent: function(state, textAfter) { - var context = state.context; - if (context && context.noIndent) return 0; - if (context && /^{\//.test(textAfter)) - context = context.prev; - while (context && !context.startOfLine) - context = context.prev; - if (context) return context.indent + indentUnit; - else return 0; - }, - electricChars: "/" - }; -}); - -//I figure, why not -CodeMirror.defineMIME("text/tiki", "tiki"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/turtle/turtle.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/turtle/turtle.html deleted file mode 100644 index ffe8fef22f78185c6788d9d7c3370e9fbda8655f..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/turtle/turtle.html +++ /dev/null @@ -1,38 +0,0 @@ -<!doctype html> -<html> - <head> - <title>CodeMirror: Turtle mode</title> - <link rel="stylesheet" href="codemirror.css"> - <script src="codemirror-compressed.js"></script> - <script src="turtle.js"></script> - <style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> - <link rel="stylesheet" href="oc/docs.css"> - </head> - <body> - <h1>CodeMirror: Turtle mode</h1> - <form><textarea id="code" name="code"> -@prefix foaf: <http://xmlns.com/foaf/0.1/> . -@prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> . -@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . - -<http://purl.org/net/bsletten> - rdf:type foaf:Person; - foaf:birthday "5-26"; - foaf:based_near [ - geo:lat "34.0736111" ; - geo:lon "-118.3994444" - ] - -</textarea></form> - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - mode: "text/turtle", - tabMode: "indent", - matchBrackets: true - }); - </script> - - <p><strong>MIME types defined:</strong> <code>text/turtle</code>.</p> - - </body> -</html> \ No newline at end of file diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/turtle/turtle.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/turtle/turtle.js deleted file mode 100644 index 954583aad43deb914c24ad105660083274a0affd..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/turtle/turtle.js +++ /dev/null @@ -1,138 +0,0 @@ -CodeMirror.defineMode("turtle", function(config) { - var indentUnit = config.indentUnit; - var curPunc; - - function wordRegexp(words) { - return new RegExp("^(?:" + words.join("|") + ")$", "i"); - } - var ops = wordRegexp([]); - var keywords = wordRegexp(["@prefix", "@base"]); - var operatorChars = /[*+\-<>=&|]/; - - function tokenBase(stream, state) { - var ch = stream.next(); - curPunc = null; - if (ch == "<" && !stream.match(/^[\s\u00a0=]/, false)) { - stream.match(/^[^\s\u00a0>]*>?/); - return "meta"; - } - else if (ch == "\"" || ch == "'") { - state.tokenize = tokenLiteral(ch); - return state.tokenize(stream, state); - } - else if (/[{}\(\),\.;\[\]]/.test(ch)) { - curPunc = ch; - return null; - } - else if (ch == "#") { - stream.skipToEnd(); - return "comment"; - } - else if (operatorChars.test(ch)) { - stream.eatWhile(operatorChars); - return null; - } - else if (ch == ":") { - stream.eatWhile(/[\w\d\._\-]/); - return "atom"; - } - else { - stream.eatWhile(/[_\w\d]/); - if(stream.peek() == ":") { -// if (stream.eat(":")) { - //stream.eatWhile(/[\w\d_\-]/); - // stream.backup(1); - return "quote"; - } - var word = stream.current(), type; - if (ops.test(word)) - return null; - else if (keywords.test(word)) - return "keyword"; - else - return "variable"; - } - } - - function tokenLiteral(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) { - state.tokenize = tokenBase; - break; - } - escaped = !escaped && ch == "\\"; - } - return "string"; - }; - } - - function pushContext(state, type, col) { - state.context = {prev: state.context, indent: state.indent, col: col, type: type}; - } - function popContext(state) { - state.indent = state.context.indent; - state.context = state.context.prev; - } - - return { - startState: function(base) { - return {tokenize: tokenBase, - context: null, - indent: 0, - col: 0}; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (state.context && state.context.align == null) state.context.align = false; - state.indent = stream.indentation(); - } - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - - if (style != "comment" && state.context && state.context.align == null && state.context.type != "pattern") { - state.context.align = true; - } - - if (curPunc == "(") pushContext(state, ")", stream.column()); - else if (curPunc == "[") pushContext(state, "]", stream.column()); - else if (curPunc == "{") pushContext(state, "}", stream.column()); - else if (/[\]\}\)]/.test(curPunc)) { - while (state.context && state.context.type == "pattern") popContext(state); - if (state.context && curPunc == state.context.type) popContext(state); - } - else if (curPunc == "." && state.context && state.context.type == "pattern") popContext(state); - else if (/atom|string|variable/.test(style) && state.context) { - if (/[\}\]]/.test(state.context.type)) - pushContext(state, "pattern", stream.column()); - else if (state.context.type == "pattern" && !state.context.align) { - state.context.align = true; - state.context.col = stream.column(); - } - } - - return style; - }, - - indent: function(state, textAfter) { - var firstChar = textAfter && textAfter.charAt(0); - var context = state.context; - if (/[\]\}]/.test(firstChar)) - while (context && context.type == "pattern") context = context.prev; - - var closing = context && firstChar == context.type; - if (!context) - return 0; - else if (context.type == "pattern") - return context.col; - else if (context.align) - return context.col + (closing ? 0 : 1); - else - return context.indent + (closing ? 0 : indentUnit); - } - }; -}); - -CodeMirror.defineMIME("text/turtle", "turtle"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/vb/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/vb/index.html deleted file mode 100644 index 1670c7d05b039d1fd44b6162fe6061c4977bfbf6..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/vb/index.html +++ /dev/null @@ -1,88 +0,0 @@ -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: VB.NET mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="vb.js"></script> - <link rel="stylesheet" href="../../doc/docs.css"> - <link href="http://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet" type="text/css"> - <style> - .CodeMirror {border: 1px solid #aaa; height:210px; height: auto;} - .CodeMirror-scroll { overflow-x: auto; overflow-y: hidden;} - .CodeMirror pre { font-family: Inconsolata; font-size: 14px} - </style> - <script type="text/javascript" src="../../lib/util/runmode.js"></script> - </head> - <body onload="init()"> - <h1>CodeMirror: VB.NET mode</h1> -<script type="text/javascript"> -function test(golden, text) { - var ok = true; - var i = 0; - function callback(token, style, lineNo, pos){ - //console.log(String(token) + " " + String(style) + " " + String(lineNo) + " " + String(pos)); - var result = [String(token), String(style)]; - if (golden[i][0] != result[0] || golden[i][1] != result[1]){ - return "Error, expected: " + String(golden[i]) + ", got: " + String(result); - ok = false; - } - i++; - } - CodeMirror.runMode(text, "text/x-vb",callback); - - if (ok) return "Tests OK"; -} -function testTypes() { - var golden = [['Integer','keyword'],[' ','null'],['Float','keyword']] - var text = "Integer Float"; - return test(golden,text); -} -function testIf(){ - var golden = [['If','keyword'],[' ','null'],['True','keyword'],[' ','null'],['End','keyword'],[' ','null'],['If','keyword']]; - var text = 'If True End If'; - return test(golden, text); -} -function testDecl(){ - var golden = [['Dim','keyword'],[' ','null'],['x','variable'],[' ','null'],['as','keyword'],[' ','null'],['Integer','keyword']]; - var text = 'Dim x as Integer'; - return test(golden, text); -} -function testAll(){ - var result = ""; - - result += testTypes() + "\n"; - result += testIf() + "\n"; - result += testDecl() + "\n"; - return result; - -} -function initText(editor) { - var content = 'Class rocket\nPrivate quality as Double\nPublic Sub launch() as String\nif quality > 0.8\nlaunch = "Successful"\nElse\nlaunch = "Failed"\nEnd If\nEnd sub\nEnd class\n'; - editor.setValue(content); - for (var i =0; i< editor.lineCount(); i++) editor.indentLine(i); -} -function init() { - editor = CodeMirror.fromTextArea(document.getElementById("solution"), { - lineNumbers: true, - mode: "text/x-vb", - readOnly: false, - tabMode: "shift" - }); - runTest(); -} -function runTest() { - document.getElementById('testresult').innerHTML = testAll(); - initText(editor); - -} -</script> - - - <div id="edit"> - <textarea style="width:95%;height:200px;padding:5px;" name="solution" id="solution" ></textarea> - </div> - <pre id="testresult"></pre> - <p>MIME type defined: <code>text/x-vb</code>.</p> - -</body></html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/vb/vb.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/vb/vb.js deleted file mode 100644 index f5d47d62f7a12f3fbce87faf9f94e16ae9fcfed9..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/vb/vb.js +++ /dev/null @@ -1,260 +0,0 @@ -CodeMirror.defineMode("vb", function(conf, parserConf) { - var ERRORCLASS = 'error'; - - function wordRegexp(words) { - return new RegExp("^((" + words.join(")|(") + "))\\b", "i"); - } - - var singleOperators = new RegExp("^[\\+\\-\\*/%&\\\\|\\^~<>!]"); - var singleDelimiters = new RegExp('^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]'); - var doubleOperators = new RegExp("^((==)|(<>)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"); - var doubleDelimiters = new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"); - var tripleDelimiters = new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"); - var identifiers = new RegExp("^[_A-Za-z][_A-Za-z0-9]*"); - - var openingKeywords = ['class','module', 'sub','enum','select','while','if','function', 'get','set','property', 'try']; - var middleKeywords = ['else','elseif','case', 'catch']; - var endKeywords = ['next','loop']; - - var wordOperators = wordRegexp(['and', 'or', 'not', 'xor', 'in']); - var commonkeywords = ['as', 'dim', 'break', 'continue','optional', 'then', 'until', - 'goto', 'byval','byref','new','handles','property', 'return', - 'const','private', 'protected', 'friend', 'public', 'shared', 'static', 'true','false']; - var commontypes = ['integer','string','double','decimal','boolean','short','char', 'float','single']; - - var keywords = wordRegexp(commonkeywords); - var types = wordRegexp(commontypes); - var stringPrefixes = '"'; - - var opening = wordRegexp(openingKeywords); - var middle = wordRegexp(middleKeywords); - var closing = wordRegexp(endKeywords); - var doubleClosing = wordRegexp(['end']); - var doOpening = wordRegexp(['do']); - - var indentInfo = null; - - - - - function indent(_stream, state) { - state.currentIndent++; - } - - function dedent(_stream, state) { - state.currentIndent--; - } - // tokenizers - function tokenBase(stream, state) { - if (stream.eatSpace()) { - return null; - } - - var ch = stream.peek(); - - // Handle Comments - if (ch === "'") { - stream.skipToEnd(); - return 'comment'; - } - - - // Handle Number Literals - if (stream.match(/^((&H)|(&O))?[0-9\.a-f]/i, false)) { - var floatLiteral = false; - // Floats - if (stream.match(/^\d*\.\d+F?/i)) { floatLiteral = true; } - else if (stream.match(/^\d+\.\d*F?/)) { floatLiteral = true; } - else if (stream.match(/^\.\d+F?/)) { floatLiteral = true; } - - if (floatLiteral) { - // Float literals may be "imaginary" - stream.eat(/J/i); - return 'number'; - } - // Integers - var intLiteral = false; - // Hex - if (stream.match(/^&H[0-9a-f]+/i)) { intLiteral = true; } - // Octal - else if (stream.match(/^&O[0-7]+/i)) { intLiteral = true; } - // Decimal - else if (stream.match(/^[1-9]\d*F?/)) { - // Decimal literals may be "imaginary" - stream.eat(/J/i); - // TODO - Can you have imaginary longs? - intLiteral = true; - } - // Zero by itself with no other piece of number. - else if (stream.match(/^0(?![\dx])/i)) { intLiteral = true; } - if (intLiteral) { - // Integer literals may be "long" - stream.eat(/L/i); - return 'number'; - } - } - - // Handle Strings - if (stream.match(stringPrefixes)) { - state.tokenize = tokenStringFactory(stream.current()); - return state.tokenize(stream, state); - } - - // Handle operators and Delimiters - if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) { - return null; - } - if (stream.match(doubleOperators) - || stream.match(singleOperators) - || stream.match(wordOperators)) { - return 'operator'; - } - if (stream.match(singleDelimiters)) { - return null; - } - if (stream.match(doOpening)) { - indent(stream,state); - state.doInCurrentLine = true; - return 'keyword'; - } - if (stream.match(opening)) { - if (! state.doInCurrentLine) - indent(stream,state); - else - state.doInCurrentLine = false; - return 'keyword'; - } - if (stream.match(middle)) { - return 'keyword'; - } - - if (stream.match(doubleClosing)) { - dedent(stream,state); - dedent(stream,state); - return 'keyword'; - } - if (stream.match(closing)) { - dedent(stream,state); - return 'keyword'; - } - - if (stream.match(types)) { - return 'keyword'; - } - - if (stream.match(keywords)) { - return 'keyword'; - } - - if (stream.match(identifiers)) { - return 'variable'; - } - - // Handle non-detected items - stream.next(); - return ERRORCLASS; - } - - function tokenStringFactory(delimiter) { - var singleline = delimiter.length == 1; - var OUTCLASS = 'string'; - - return function tokenString(stream, state) { - while (!stream.eol()) { - stream.eatWhile(/[^'"]/); - if (stream.match(delimiter)) { - state.tokenize = tokenBase; - return OUTCLASS; - } else { - stream.eat(/['"]/); - } - } - if (singleline) { - if (parserConf.singleLineStringErrors) { - return ERRORCLASS; - } else { - state.tokenize = tokenBase; - } - } - return OUTCLASS; - }; - } - - - function tokenLexer(stream, state) { - var style = state.tokenize(stream, state); - var current = stream.current(); - - // Handle '.' connected identifiers - if (current === '.') { - style = state.tokenize(stream, state); - current = stream.current(); - if (style === 'variable') { - return 'variable'; - } else { - return ERRORCLASS; - } - } - - - var delimiter_index = '[({'.indexOf(current); - if (delimiter_index !== -1) { - indent(stream, state ); - } - if (indentInfo === 'dedent') { - if (dedent(stream, state)) { - return ERRORCLASS; - } - } - delimiter_index = '])}'.indexOf(current); - if (delimiter_index !== -1) { - if (dedent(stream, state)) { - return ERRORCLASS; - } - } - - return style; - } - - var external = { - electricChars:"dDpPtTfFeE ", - startState: function() { - return { - tokenize: tokenBase, - lastToken: null, - currentIndent: 0, - nextLineIndent: 0, - doInCurrentLine: false - - - }; - }, - - token: function(stream, state) { - if (stream.sol()) { - state.currentIndent += state.nextLineIndent; - state.nextLineIndent = 0; - state.doInCurrentLine = 0; - } - var style = tokenLexer(stream, state); - - state.lastToken = {style:style, content: stream.current()}; - - - - return style; - }, - - indent: function(state, textAfter) { - var trueText = textAfter.replace(/^\s+|\s+$/g, '') ; - if (trueText.match(closing) || trueText.match(doubleClosing) || trueText.match(middle)) return conf.indentUnit*(state.currentIndent-1); - if(state.currentIndent < 0) return 0; - return state.currentIndent * conf.indentUnit; - } - - }; - return external; -}); - -CodeMirror.defineMIME("text/x-vb", "vb"); - diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/vbscript/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/vbscript/index.html deleted file mode 100644 index 8c86f9ef9424fd506b8ac2c598e6c4477ac2433f..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/vbscript/index.html +++ /dev/null @@ -1,42 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: VBScript mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="vbscript.js"></script> - <link rel="stylesheet" href="../../doc/docs.css"> - <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> - </head> - <body> - <h1>CodeMirror: VBScript mode</h1> - -<div><textarea id="code" name="code"> -' Pete Guhl -' 03-04-2012 -' -' Basic VBScript support for codemirror2 - -Const ForReading = 1, ForWriting = 2, ForAppending = 8 - -Call Sub020_PostBroadcastToUrbanAirship(strUserName, strPassword, intTransmitID, strResponse) - -If Not IsNull(strResponse) AND Len(strResponse) = 0 Then - boolTransmitOkYN = False -Else - ' WScript.Echo "Oh Happy Day! Oh Happy DAY!" - boolTransmitOkYN = True -End If -</textarea></div> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true - }); - </script> - - <p><strong>MIME types defined:</strong> <code>text/vbscript</code>.</p> - </body> -</html> - diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/vbscript/vbscript.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/vbscript/vbscript.js deleted file mode 100644 index 65d6c212767a64d4dc34df33d3185d56fc6ffc8b..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/vbscript/vbscript.js +++ /dev/null @@ -1,26 +0,0 @@ -CodeMirror.defineMode("vbscript", function() { - var regexVBScriptKeyword = /^(?:Call|Case|CDate|Clear|CInt|CLng|Const|CStr|Description|Dim|Do|Each|Else|ElseIf|End|Err|Error|Exit|False|For|Function|If|LCase|Loop|LTrim|Next|Nothing|Now|Number|On|Preserve|Quit|ReDim|Resume|RTrim|Select|Set|Sub|Then|To|Trim|True|UBound|UCase|Until|VbCr|VbCrLf|VbLf|VbTab)$/im; - - return { - token: function(stream) { - if (stream.eatSpace()) return null; - var ch = stream.next(); - if (ch == "'") { - stream.skipToEnd(); - return "comment"; - } - if (ch == '"') { - stream.skipTo('"'); - return "string"; - } - - if (/\w/.test(ch)) { - stream.eatWhile(/\w/); - if (regexVBScriptKeyword.test(stream.current())) return "keyword"; - } - return null; - } - }; -}); - -CodeMirror.defineMIME("text/vbscript", "vbscript"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/velocity/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/velocity/index.html deleted file mode 100644 index fb59cb590df7c0c11e38719611454fa2ef1cb963..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/velocity/index.html +++ /dev/null @@ -1,103 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Velocity mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="velocity.js"></script> - <link rel="stylesheet" href="../../theme/night.css"> - <style>.CodeMirror {border: 1px solid black;}</style> - <link rel="stylesheet" href="../../doc/docs.css"> - </head> - <body> - <h1>CodeMirror: Velocity mode</h1> - <form><textarea id="code" name="code"> -## Velocity Code Demo -#* - based on PL/SQL mode by Peter Raganitsch, adapted to Velocity by Steve O'Hara ( http://www.pivotal-solutions.co.uk ) - August 2011 -*# - -#* - This is a multiline comment. - This is the second line -*# - -#[[ hello steve - This has invalid syntax that would normally need "poor man's escaping" like: - - #define() - - ${blah -]]# - -#include( "disclaimer.txt" "opinion.txt" ) -#include( $foo $bar ) - -#parse( "lecorbusier.vm" ) -#parse( $foo ) - -#evaluate( 'string with VTL #if(true)will be displayed#end' ) - -#define( $hello ) Hello $who #end #set( $who = "World!") $hello ## displays Hello World! - -#foreach( $customer in $customerList ) - - $foreach.count $customer.Name - - #if( $foo == ${bar}) - it's true! - #break - #{else} - it's not! - #stop - #end - - #if ($foreach.parent.hasNext) - $velocityCount - #end -#end - -$someObject.getValues("this is a string split - across lines") - -#macro( tablerows $color $somelist ) - #foreach( $something in $somelist ) - <tr><td bgcolor=$color>$something</td></tr> - #end -#end - -#tablerows("red" ["dadsdf","dsa"]) - - Variable reference: #set( $monkey = $bill ) - String literal: #set( $monkey.Friend = 'monica' ) - Property reference: #set( $monkey.Blame = $whitehouse.Leak ) - Method reference: #set( $monkey.Plan = $spindoctor.weave($web) ) - Number literal: #set( $monkey.Number = 123 ) - Range operator: #set( $monkey.Numbers = [1..3] ) - Object list: #set( $monkey.Say = ["Not", $my, "fault"] ) - Object map: #set( $monkey.Map = {"banana" : "good", "roast beef" : "bad"}) - -The RHS can also be a simple arithmetic expression, such as: -Addition: #set( $value = $foo + 1 ) - Subtraction: #set( $value = $bar - 1 ) - Multiplication: #set( $value = $foo * $bar ) - Division: #set( $value = $foo / $bar ) - Remainder: #set( $value = $foo % $bar ) - -</textarea></form> - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - tabMode: "indent", - theme: "night", - lineNumbers: true, - indentUnit: 4, - mode: "text/velocity" - }); - </script> - - <p><strong>MIME types defined:</strong> <code>text/velocity</code>.</p> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/velocity/velocity.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/velocity/velocity.js deleted file mode 100644 index 43a97ba676585dd67a2bb1bcd08e8152db8afb93..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/velocity/velocity.js +++ /dev/null @@ -1,144 +0,0 @@ -CodeMirror.defineMode("velocity", function() { - function parseWords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var keywords = parseWords("#end #else #break #stop #[[ #]] " + - "#{end} #{else} #{break} #{stop}"); - var functions = parseWords("#if #elseif #foreach #set #include #parse #macro #define #evaluate " + - "#{if} #{elseif} #{foreach} #{set} #{include} #{parse} #{macro} #{define} #{evaluate}"); - var specials = parseWords("$foreach.count $foreach.hasNext $foreach.first $foreach.last $foreach.topmost $foreach.parent $velocityCount"); - var isOperatorChar = /[+\-*&%=<>!?:\/|]/; - - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - function tokenBase(stream, state) { - var beforeParams = state.beforeParams; - state.beforeParams = false; - var ch = stream.next(); - // start of string? - if ((ch == '"' || ch == "'") && state.inParams) - return chain(stream, state, tokenString(ch)); - // is it one of the special signs []{}().,;? Seperator? - else if (/[\[\]{}\(\),;\.]/.test(ch)) { - if (ch == "(" && beforeParams) state.inParams = true; - else if (ch == ")") state.inParams = false; - return null; - } - // start of a number value? - else if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return "number"; - } - // multi line comment? - else if (ch == "#" && stream.eat("*")) { - return chain(stream, state, tokenComment); - } - // unparsed content? - else if (ch == "#" && stream.match(/ *\[ *\[/)) { - return chain(stream, state, tokenUnparsed); - } - // single line comment? - else if (ch == "#" && stream.eat("#")) { - stream.skipToEnd(); - return "comment"; - } - // variable? - else if (ch == "$") { - stream.eatWhile(/[\w\d\$_\.{}]/); - // is it one of the specials? - if (specials && specials.propertyIsEnumerable(stream.current().toLowerCase())) { - return "keyword"; - } - else { - state.beforeParams = true; - return "builtin"; - } - } - // is it a operator? - else if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "operator"; - } - else { - // get the whole word - stream.eatWhile(/[\w\$_{}]/); - var word = stream.current().toLowerCase(); - // is it one of the listed keywords? - if (keywords && keywords.propertyIsEnumerable(word)) - return "keyword"; - // is it one of the listed functions? - if (functions && functions.propertyIsEnumerable(word) || - stream.current().match(/^#[a-z0-9_]+ *$/i) && stream.peek()=="(") { - state.beforeParams = true; - return "keyword"; - } - // default: just a "word" - return null; - } - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) { - end = true; - break; - } - escaped = !escaped && next == "\\"; - } - if (end) state.tokenize = tokenBase; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "#" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function tokenUnparsed(stream, state) { - var maybeEnd = 0, ch; - while (ch = stream.next()) { - if (ch == "#" && maybeEnd == 2) { - state.tokenize = tokenBase; - break; - } - if (ch == "]") - maybeEnd++; - else if (ch != " ") - maybeEnd = 0; - } - return "meta"; - } - // Interface - - return { - startState: function() { - return { - tokenize: tokenBase, - beforeParams: false, - inParams: false - }; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - return state.tokenize(stream, state); - } - }; -}); - -CodeMirror.defineMIME("text/velocity", "velocity"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/verilog/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/verilog/index.html deleted file mode 100644 index c1d14d682a1b61bccd60b836978986788cfa9cd3..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/verilog/index.html +++ /dev/null @@ -1,210 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Verilog mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="verilog.js"></script> - <link rel="stylesheet" href="../../doc/docs.css"> - <style>.CodeMirror {border: 2px inset #dee;}</style> - </head> - <body> - <h1>CodeMirror: Verilog mode</h1> - -<form><textarea id="code" name="code"> -/* Verilog demo code */ - -////////////////////////////////////////////////////////////////////// -//// //// -//// wb_master_model.v //// -//// //// -//// This file is part of the SPI IP core project //// -//// http://www.opencores.org/projects/spi/ //// -//// //// -//// Author(s): //// -//// - Simon Srot (simons@opencores.org) //// -//// //// -//// Based on: //// -//// - i2c/bench/verilog/wb_master_model.v //// -//// Copyright (C) 2001 Richard Herveille //// -//// //// -//// All additional information is avaliable in the Readme.txt //// -//// file. //// -//// //// -////////////////////////////////////////////////////////////////////// -//// //// -//// Copyright (C) 2002 Authors //// -//// //// -//// This source file may be used and distributed without //// -//// restriction provided that this copyright statement is not //// -//// removed from the file and that any derivative work contains //// -//// the original copyright notice and the associated disclaimer. //// -//// //// -//// This source file is free software; you can redistribute it //// -//// and/or modify it under the terms of the GNU Lesser General //// -//// Public License as published by the Free Software Foundation; //// -//// either version 2.1 of the License, or (at your option) any //// -//// later version. //// -//// //// -//// This source 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 Lesser General Public License for more //// -//// details. //// -//// //// -//// You should have received a copy of the GNU Lesser General //// -//// Public License along with this source; if not, download it //// -//// from http://www.opencores.org/lgpl.shtml //// -//// //// -////////////////////////////////////////////////////////////////////// - -`include "timescale.v" - -module wb_master_model(clk, rst, adr, din, dout, cyc, stb, we, sel, ack, err, rty); - - parameter dwidth = 32; - parameter awidth = 32; - - input clk, rst; - output [awidth -1:0] adr; - input [dwidth -1:0] din; - output [dwidth -1:0] dout; - output cyc, stb; - output we; - output [dwidth/8 -1:0] sel; - input ack, err, rty; - - // Internal signals - reg [awidth -1:0] adr; - reg [dwidth -1:0] dout; - reg cyc, stb; - reg we; - reg [dwidth/8 -1:0] sel; - - reg [dwidth -1:0] q; - - // Memory Logic - initial - begin - adr = {awidth{1'bx}}; - dout = {dwidth{1'bx}}; - cyc = 1'b0; - stb = 1'bx; - we = 1'hx; - sel = {dwidth/8{1'bx}}; - #1; - end - - // Wishbone write cycle - task wb_write; - input delay; - integer delay; - - input [awidth -1:0] a; - input [dwidth -1:0] d; - - begin - - // wait initial delay - repeat(delay) @(posedge clk); - - // assert wishbone signal - #1; - adr = a; - dout = d; - cyc = 1'b1; - stb = 1'b1; - we = 1'b1; - sel = {dwidth/8{1'b1}}; - @(posedge clk); - - // wait for acknowledge from slave - while(~ack) @(posedge clk); - - // negate wishbone signals - #1; - cyc = 1'b0; - stb = 1'bx; - adr = {awidth{1'bx}}; - dout = {dwidth{1'bx}}; - we = 1'hx; - sel = {dwidth/8{1'bx}}; - - end - endtask - - // Wishbone read cycle - task wb_read; - input delay; - integer delay; - - input [awidth -1:0] a; - output [dwidth -1:0] d; - - begin - - // wait initial delay - repeat(delay) @(posedge clk); - - // assert wishbone signals - #1; - adr = a; - dout = {dwidth{1'bx}}; - cyc = 1'b1; - stb = 1'b1; - we = 1'b0; - sel = {dwidth/8{1'b1}}; - @(posedge clk); - - // wait for acknowledge from slave - while(~ack) @(posedge clk); - - // negate wishbone signals - #1; - cyc = 1'b0; - stb = 1'bx; - adr = {awidth{1'bx}}; - dout = {dwidth{1'bx}}; - we = 1'hx; - sel = {dwidth/8{1'bx}}; - d = din; - - end - endtask - - // Wishbone compare cycle (read data from location and compare with expected data) - task wb_cmp; - input delay; - integer delay; - - input [awidth -1:0] a; - input [dwidth -1:0] d_exp; - - begin - wb_read (delay, a, q); - - if (d_exp !== q) begin - $display("\n--- ERROR: At address 0x%0x, got 0x%0x, expected 0x%0x at time %t", a, q, d_exp, $time); - $stop; - end - end - endtask - -endmodule -</textarea></form> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - mode: "text/x-verilog" - }); - </script> - - <p>Simple mode that tries to handle Verilog-like languages as well as it - can. Takes one configuration parameters: <code>keywords</code>, an - object whose property names are the keywords in the language.</p> - - <p><strong>MIME types defined:</strong> <code>text/x-verilog</code> (Verilog code).</p> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/verilog/verilog.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/verilog/verilog.js deleted file mode 100644 index 708de23f491ba57870ae4fee4d56b6730f9c43ad..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/verilog/verilog.js +++ /dev/null @@ -1,182 +0,0 @@ -CodeMirror.defineMode("verilog", function(config, parserConfig) { - var indentUnit = config.indentUnit, - keywords = parserConfig.keywords || {}, - blockKeywords = parserConfig.blockKeywords || {}, - atoms = parserConfig.atoms || {}, - hooks = parserConfig.hooks || {}, - multiLineStrings = parserConfig.multiLineStrings; - var isOperatorChar = /[&|~><!\)\(*#%@+\/=?\:;}{,\.\^\-\[\]]/; - - var curPunc; - - function tokenBase(stream, state) { - var ch = stream.next(); - if (hooks[ch]) { - var result = hooks[ch](stream, state); - if (result !== false) return result; - } - if (ch == '"') { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - curPunc = ch; - return null; - } - if (/[\d']/.test(ch)) { - stream.eatWhile(/[\w\.']/); - return "number"; - } - if (ch == "/") { - if (stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - } - if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "operator"; - } - stream.eatWhile(/[\w\$_]/); - var cur = stream.current(); - if (keywords.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "keyword"; - } - if (atoms.propertyIsEnumerable(cur)) return "atom"; - return "variable"; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && next == "\\"; - } - if (end || !(escaped || multiLineStrings)) - state.tokenize = tokenBase; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - function pushContext(state, col, type) { - return state.context = new Context(state.indented, col, type, null, state.context); - } - function popContext(state) { - var t = state.context.type; - if (t == ")" || t == "]" || t == "}") - state.indented = state.context.indented; - return state.context = state.context.prev; - } - - // Interface - - return { - startState: function(basecolumn) { - return { - tokenize: null, - context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), - indented: 0, - startOfLine: true - }; - }, - - token: function(stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - } - if (stream.eatSpace()) return null; - curPunc = null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style == "comment" || style == "meta") return style; - if (ctx.align == null) ctx.align = true; - - if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state); - else if (curPunc == "{") pushContext(state, stream.column(), "}"); - else if (curPunc == "[") pushContext(state, stream.column(), "]"); - else if (curPunc == "(") pushContext(state, stream.column(), ")"); - else if (curPunc == "}") { - while (ctx.type == "statement") ctx = popContext(state); - if (ctx.type == "}") ctx = popContext(state); - while (ctx.type == "statement") ctx = popContext(state); - } - else if (curPunc == ctx.type) popContext(state); - else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement")) - pushContext(state, stream.column(), "statement"); - state.startOfLine = false; - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase && state.tokenize != null) return 0; - var firstChar = textAfter && textAfter.charAt(0), ctx = state.context, closing = firstChar == ctx.type; - if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : indentUnit); - else if (ctx.align) return ctx.column + (closing ? 0 : 1); - else return ctx.indented + (closing ? 0 : indentUnit); - }, - - electricChars: "{}" - }; -}); - -(function() { - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var verilogKeywords = "always and assign automatic begin buf bufif0 bufif1 case casex casez cell cmos config " + - "deassign default defparam design disable edge else end endcase endconfig endfunction endgenerate endmodule " + - "endprimitive endspecify endtable endtask event for force forever fork function generate genvar highz0 " + - "highz1 if ifnone incdir include initial inout input instance integer join large liblist library localparam " + - "macromodule medium module nand negedge nmos nor noshowcancelled not notif0 notif1 or output parameter pmos " + - "posedge primitive pull0 pull1 pulldown pullup pulsestyle_onevent pulsestyle_ondetect rcmos real realtime " + - "reg release repeat rnmos rpmos rtran rtranif0 rtranif1 scalared showcancelled signed small specify specparam " + - "strong0 strong1 supply0 supply1 table task time tran tranif0 tranif1 tri tri0 tri1 triand trior trireg " + - "unsigned use vectored wait wand weak0 weak1 while wire wor xnor xor"; - - var verilogBlockKeywords = "begin bufif0 bufif1 case casex casez config else end endcase endconfig endfunction " + - "endgenerate endmodule endprimitive endspecify endtable endtask for forever function generate if ifnone " + - "macromodule module primitive repeat specify table task while"; - - function metaHook(stream) { - stream.eatWhile(/[\w\$_]/); - return "meta"; - } - - CodeMirror.defineMIME("text/x-verilog", { - name: "verilog", - keywords: words(verilogKeywords), - blockKeywords: words(verilogBlockKeywords), - atoms: words("null"), - hooks: {"`": metaHook, "$": metaHook} - }); -}()); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/xml/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/xml/index.html deleted file mode 100644 index 9628d954c002fc2edbc0b22007f0c6ab7c40b103..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/xml/index.html +++ /dev/null @@ -1,45 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: XML mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="xml.js"></script> - <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> - <link rel="stylesheet" href="../../doc/docs.css"> - </head> - <body> - <h1>CodeMirror: XML mode</h1> - <form><textarea id="code" name="code"> -<html style="color: green"> - <!-- this is a comment --> - <head> - <title>HTML Example</title> - </head> - <body> - The indentation tries to be <em>somewhat &quot;do what - I mean&quot;</em>... but might not match your style. - </body> -</html> -</textarea></form> - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - mode: {name: "xml", alignCDATA: true}, - lineNumbers: true - }); - </script> - <p>The XML mode supports two configuration parameters:</p> - <dl> - <dt><code>htmlMode (boolean)</code></dt> - <dd>This switches the mode to parse HTML instead of XML. This - means attributes do not have to be quoted, and some elements - (such as <code>br</code>) do not require a closing tag.</dd> - <dt><code>alignCDATA (boolean)</code></dt> - <dd>Setting this to true will force the opening tag of CDATA - blocks to not be indented.</dd> - </dl> - - <p><strong>MIME types defined:</strong> <code>application/xml</code>, <code>text/html</code>.</p> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/xml/xml.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/xml/xml.js deleted file mode 100644 index 7b11fd6746cef7e6b6d80300143a6973357dd4c3..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/xml/xml.js +++ /dev/null @@ -1,324 +0,0 @@ -CodeMirror.defineMode("xml", function(config, parserConfig) { - var indentUnit = config.indentUnit; - var Kludges = parserConfig.htmlMode ? { - autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true, - 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true, - 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true, - 'track': true, 'wbr': true}, - implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true, - 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true, - 'th': true, 'tr': true}, - contextGrabbers: { - 'dd': {'dd': true, 'dt': true}, - 'dt': {'dd': true, 'dt': true}, - 'li': {'li': true}, - 'option': {'option': true, 'optgroup': true}, - 'optgroup': {'optgroup': true}, - 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true, - 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true, - 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true, - 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true, - 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true}, - 'rp': {'rp': true, 'rt': true}, - 'rt': {'rp': true, 'rt': true}, - 'tbody': {'tbody': true, 'tfoot': true}, - 'td': {'td': true, 'th': true}, - 'tfoot': {'tbody': true}, - 'th': {'td': true, 'th': true}, - 'thead': {'tbody': true, 'tfoot': true}, - 'tr': {'tr': true} - }, - doNotIndent: {"pre": true}, - allowUnquoted: true, - allowMissing: true - } : { - autoSelfClosers: {}, - implicitlyClosed: {}, - contextGrabbers: {}, - doNotIndent: {}, - allowUnquoted: false, - allowMissing: false - }; - var alignCDATA = parserConfig.alignCDATA; - - // Return variables for tokenizers - var tagName, type; - - function inText(stream, state) { - function chain(parser) { - state.tokenize = parser; - return parser(stream, state); - } - - var ch = stream.next(); - if (ch == "<") { - if (stream.eat("!")) { - if (stream.eat("[")) { - if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>")); - else return null; - } - else if (stream.match("--")) return chain(inBlock("comment", "-->")); - else if (stream.match("DOCTYPE", true, true)) { - stream.eatWhile(/[\w\._\-]/); - return chain(doctype(1)); - } - else return null; - } - else if (stream.eat("?")) { - stream.eatWhile(/[\w\._\-]/); - state.tokenize = inBlock("meta", "?>"); - return "meta"; - } - else { - var isClose = stream.eat("/"); - tagName = ""; - var c; - while ((c = stream.eat(/[^\s\u00a0=<>\"\'\/?]/))) tagName += c; - if (!tagName) return "error"; - type = isClose ? "closeTag" : "openTag"; - state.tokenize = inTag; - return "tag"; - } - } - else if (ch == "&") { - var ok; - if (stream.eat("#")) { - if (stream.eat("x")) { - ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";"); - } else { - ok = stream.eatWhile(/[\d]/) && stream.eat(";"); - } - } else { - ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";"); - } - return ok ? "atom" : "error"; - } - else { - stream.eatWhile(/[^&<]/); - return null; - } - } - - function inTag(stream, state) { - var ch = stream.next(); - if (ch == ">" || (ch == "/" && stream.eat(">"))) { - state.tokenize = inText; - type = ch == ">" ? "endTag" : "selfcloseTag"; - return "tag"; - } - else if (ch == "=") { - type = "equals"; - return null; - } - else if (/[\'\"]/.test(ch)) { - state.tokenize = inAttribute(ch); - return state.tokenize(stream, state); - } - else { - stream.eatWhile(/[^\s\u00a0=<>\"\']/); - return "word"; - } - } - - function inAttribute(quote) { - return function(stream, state) { - while (!stream.eol()) { - if (stream.next() == quote) { - state.tokenize = inTag; - break; - } - } - return "string"; - }; - } - - function inBlock(style, terminator) { - return function(stream, state) { - while (!stream.eol()) { - if (stream.match(terminator)) { - state.tokenize = inText; - break; - } - stream.next(); - } - return style; - }; - } - function doctype(depth) { - return function(stream, state) { - var ch; - while ((ch = stream.next()) != null) { - if (ch == "<") { - state.tokenize = doctype(depth + 1); - return state.tokenize(stream, state); - } else if (ch == ">") { - if (depth == 1) { - state.tokenize = inText; - break; - } else { - state.tokenize = doctype(depth - 1); - return state.tokenize(stream, state); - } - } - } - return "meta"; - }; - } - - var curState, setStyle; - function pass() { - for (var i = arguments.length - 1; i >= 0; i--) curState.cc.push(arguments[i]); - } - function cont() { - pass.apply(null, arguments); - return true; - } - - function pushContext(tagName, startOfLine) { - var noIndent = Kludges.doNotIndent.hasOwnProperty(tagName) || (curState.context && curState.context.noIndent); - curState.context = { - prev: curState.context, - tagName: tagName, - indent: curState.indented, - startOfLine: startOfLine, - noIndent: noIndent - }; - } - function popContext() { - if (curState.context) curState.context = curState.context.prev; - } - - function element(type) { - if (type == "openTag") { - curState.tagName = tagName; - return cont(attributes, endtag(curState.startOfLine)); - } else if (type == "closeTag") { - var err = false; - if (curState.context) { - if (curState.context.tagName != tagName) { - if (Kludges.implicitlyClosed.hasOwnProperty(curState.context.tagName.toLowerCase())) { - popContext(); - } - err = !curState.context || curState.context.tagName != tagName; - } - } else { - err = true; - } - if (err) setStyle = "error"; - return cont(endclosetag(err)); - } - return cont(); - } - function endtag(startOfLine) { - return function(type) { - var tagName = curState.tagName; - curState.tagName = null; - if (type == "selfcloseTag" || - (type == "endTag" && Kludges.autoSelfClosers.hasOwnProperty(tagName.toLowerCase()))) { - maybePopContext(tagName.toLowerCase()); - return cont(); - } - if (type == "endTag") { - maybePopContext(tagName.toLowerCase()); - pushContext(tagName, startOfLine); - return cont(); - } - return cont(); - }; - } - function endclosetag(err) { - return function(type) { - if (err) setStyle = "error"; - if (type == "endTag") { popContext(); return cont(); } - setStyle = "error"; - return cont(arguments.callee); - }; - } - function maybePopContext(nextTagName) { - var parentTagName; - while (true) { - if (!curState.context) { - return; - } - parentTagName = curState.context.tagName.toLowerCase(); - if (!Kludges.contextGrabbers.hasOwnProperty(parentTagName) || - !Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) { - return; - } - popContext(); - } - } - - function attributes(type) { - if (type == "word") {setStyle = "attribute"; return cont(attribute, attributes);} - if (type == "endTag" || type == "selfcloseTag") return pass(); - setStyle = "error"; - return cont(attributes); - } - function attribute(type) { - if (type == "equals") return cont(attvalue, attributes); - if (!Kludges.allowMissing) setStyle = "error"; - else if (type == "word") setStyle = "attribute"; - return (type == "endTag" || type == "selfcloseTag") ? pass() : cont(); - } - function attvalue(type) { - if (type == "string") return cont(attvaluemaybe); - if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return cont();} - setStyle = "error"; - return (type == "endTag" || type == "selfCloseTag") ? pass() : cont(); - } - function attvaluemaybe(type) { - if (type == "string") return cont(attvaluemaybe); - else return pass(); - } - - return { - startState: function() { - return {tokenize: inText, cc: [], indented: 0, startOfLine: true, tagName: null, context: null}; - }, - - token: function(stream, state) { - if (stream.sol()) { - state.startOfLine = true; - state.indented = stream.indentation(); - } - if (stream.eatSpace()) return null; - - setStyle = type = tagName = null; - var style = state.tokenize(stream, state); - state.type = type; - if ((style || type) && style != "comment") { - curState = state; - while (true) { - var comb = state.cc.pop() || element; - if (comb(type || style)) break; - } - } - state.startOfLine = false; - return setStyle || style; - }, - - indent: function(state, textAfter, fullLine) { - var context = state.context; - if ((state.tokenize != inTag && state.tokenize != inText) || - context && context.noIndent) - return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0; - if (alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0; - if (context && /^<\//.test(textAfter)) - context = context.prev; - while (context && !context.startOfLine) - context = context.prev; - if (context) return context.indent + indentUnit; - else return 0; - }, - - electricChars: "/", - - configuration: parserConfig.htmlMode ? "html" : "xml" - }; -}); - -CodeMirror.defineMIME("text/xml", "xml"); -CodeMirror.defineMIME("application/xml", "xml"); -if (!CodeMirror.mimeModes.hasOwnProperty("text/html")) - CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true}); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/xquery/LICENSE b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/xquery/LICENSE deleted file mode 100644 index 2a2d47be53f7e15c31b683a4f166461339b87a7e..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/xquery/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (C) 2011 by MarkLogic Corporation -Author: Mike Brevoort <mike@brevoort.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/xquery/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/xquery/index.html deleted file mode 100644 index 27acb89786deac66a4ace494fd1b7f451fa0b3b5..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/xquery/index.html +++ /dev/null @@ -1,221 +0,0 @@ -<!doctype html> -<html> -<!-- -/* -Copyright (C) 2011 by MarkLogic Corporation -Author: Mike Brevoort <mike@brevoort.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ ---> - <head> - <meta charset="utf-8"> - <title>CodeMirror: XQuery mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="xquery.js"></script> - <link rel="stylesheet" href="../../doc/docs.css"> - <link rel="stylesheet" href="../../theme/xq-dark.css"> - <style type="text/css"> - .CodeMirror { - border-top: 1px solid black; border-bottom: 1px solid black; - height:400px; - } - </style> - </head> - <body> - <h1>CodeMirror: XQuery mode</h1> - -<div class="cm-s-default"> - <textarea id="code" name="code"> -xquery version "1.0-ml"; -(: this is - : a - "comment" :) -let $let := <x attr="value">"test"<func>function() $var {function()} {$var}</func></x> -let $joe:=1 -return element element { - attribute attribute { 1 }, - element test { 'a' }, - attribute foo { "bar" }, - fn:doc()[ foo/@bar eq $let ], - //x } - -(: a more 'evil' test :) -(: Modified Blakeley example (: with nested comment :) ... :) -declare private function local:declare() {()}; -declare private function local:private() {()}; -declare private function local:function() {()}; -declare private function local:local() {()}; -let $let := <let>let $let := "let"</let> -return element element { - attribute attribute { try { xdmp:version() } catch($e) { xdmp:log($e) } }, - attribute fn:doc { "bar" castable as xs:string }, - element text { text { "text" } }, - fn:doc()[ child::eq/(@bar | attribute::attribute) eq $let ], - //fn:doc -} - - - -xquery version "1.0-ml"; - -(: Copyright 2006-2010 Mark Logic Corporation. :) - -(: - : Licensed under the Apache License, Version 2.0 (the "License"); - : you may not use this file except in compliance with the License. - : You may obtain a copy of the License at - : - : http://www.apache.org/licenses/LICENSE-2.0 - : - : Unless required by applicable law or agreed to in writing, software - : distributed under the License is distributed on an "AS IS" BASIS, - : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - : See the License for the specific language governing permissions and - : limitations under the License. - :) - -module namespace json = "http://marklogic.com/json"; -declare default function namespace "http://www.w3.org/2005/xpath-functions"; - -(: Need to backslash escape any double quotes, backslashes, and newlines :) -declare function json:escape($s as xs:string) as xs:string { - let $s := replace($s, "\\", "\\\\") - let $s := replace($s, """", "\\""") - let $s := replace($s, codepoints-to-string((13, 10)), "\\n") - let $s := replace($s, codepoints-to-string(13), "\\n") - let $s := replace($s, codepoints-to-string(10), "\\n") - return $s -}; - -declare function json:atomize($x as element()) as xs:string { - if (count($x/node()) = 0) then 'null' - else if ($x/@type = "number") then - let $castable := $x castable as xs:float or - $x castable as xs:double or - $x castable as xs:decimal - return - if ($castable) then xs:string($x) - else error(concat("Not a number: ", xdmp:describe($x))) - else if ($x/@type = "boolean") then - let $castable := $x castable as xs:boolean - return - if ($castable) then xs:string(xs:boolean($x)) - else error(concat("Not a boolean: ", xdmp:describe($x))) - else concat('"', json:escape($x), '"') -}; - -(: Print the thing that comes after the colon :) -declare function json:print-value($x as element()) as xs:string { - if (count($x/*) = 0) then - json:atomize($x) - else if ($x/@quote = "true") then - concat('"', json:escape(xdmp:quote($x/node())), '"') - else - string-join(('{', - string-join(for $i in $x/* return json:print-name-value($i), ","), - '}'), "") -}; - -(: Print the name and value both :) -declare function json:print-name-value($x as element()) as xs:string? { - let $name := name($x) - let $first-in-array := - count($x/preceding-sibling::*[name(.) = $name]) = 0 and - (count($x/following-sibling::*[name(.) = $name]) > 0 or $x/@array = "true") - let $later-in-array := count($x/preceding-sibling::*[name(.) = $name]) > 0 - return - - if ($later-in-array) then - () (: I was handled previously :) - else if ($first-in-array) then - string-join(('"', json:escape($name), '":[', - string-join((for $i in ($x, $x/following-sibling::*[name(.) = $name]) return json:print-value($i)), ","), - ']'), "") - else - string-join(('"', json:escape($name), '":', json:print-value($x)), "") -}; - -(:~ - Transforms an XML element into a JSON string representation. See http://json.org. - <p/> - Sample usage: - <pre> - xquery version "1.0-ml"; - import module namespace json="http://marklogic.com/json" at "json.xqy"; - json:serialize(&lt;foo&gt;&lt;bar&gt;kid&lt;/bar&gt;&lt;/foo&gt;) - </pre> - Sample transformations: - <pre> - &lt;e/&gt; becomes {"e":null} - &lt;e&gt;text&lt;/e&gt; becomes {"e":"text"} - &lt;e&gt;quote " escaping&lt;/e&gt; becomes {"e":"quote \" escaping"} - &lt;e&gt;backslash \ escaping&lt;/e&gt; becomes {"e":"backslash \\ escaping"} - &lt;e&gt;&lt;a&gt;text1&lt;/a&gt;&lt;b&gt;text2&lt;/b&gt;&lt;/e&gt; becomes {"e":{"a":"text1","b":"text2"}} - &lt;e&gt;&lt;a&gt;text1&lt;/a&gt;&lt;a&gt;text2&lt;/a&gt;&lt;/e&gt; becomes {"e":{"a":["text1","text2"]}} - &lt;e&gt;&lt;a array="true"&gt;text1&lt;/a&gt;&lt;/e&gt; becomes {"e":{"a":["text1"]}} - &lt;e&gt;&lt;a type="boolean"&gt;false&lt;/a&gt;&lt;/e&gt; becomes {"e":{"a":false}} - &lt;e&gt;&lt;a type="number"&gt;123.5&lt;/a&gt;&lt;/e&gt; becomes {"e":{"a":123.5}} - &lt;e quote="true"&gt;&lt;div attrib="value"/&gt;&lt;/e&gt; becomes {"e":"&lt;div attrib=\"value\"/&gt;"} - </pre> - <p/> - Namespace URIs are ignored. Namespace prefixes are included in the JSON name. - <p/> - Attributes are ignored, except for the special attribute @array="true" that - indicates the JSON serialization should write the node, even if single, as an - array, and the attribute @type that can be set to "boolean" or "number" to - dictate the value should be written as that type (unquoted). There's also - an @quote attribute that when set to true writes the inner content as text - rather than as structured JSON, useful for sending some XHTML over the - wire. - <p/> - Text nodes within mixed content are ignored. - - @param $x Element node to convert - @return String holding JSON serialized representation of $x - - @author Jason Hunter - @version 1.0.1 - - Ported to xquery 1.0-ml; double escaped backslashes in json:escape -:) -declare function json:serialize($x as element()) as xs:string { - string-join(('{', json:print-name-value($x), '}'), "") -}; - </textarea> -</div> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - matchBrackets: true, - theme: "xq-dark" - }); - </script> - - <p><strong>MIME types defined:</strong> <code>application/xquery</code>.</p> - - <p>Development of the CodeMirror XQuery mode was sponsored by - <a href="http://marklogic.com">MarkLogic</a> and developed by - <a href="https://twitter.com/mbrevoort">Mike Brevoort</a>. - </p> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/xquery/test.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/xquery/test.js deleted file mode 100644 index 23ab3d1e3ef84df0e6f30553e23eb413a7407cd6..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/xquery/test.js +++ /dev/null @@ -1,77 +0,0 @@ -// Initiate ModeTest and set defaults -var MT = ModeTest; -MT.modeName = "xquery"; -MT.modeOptions = {}; - -MT.testMode("eviltest", - 'xquery version "1.0-ml";\ - (: this is\ - : a \ - "comment" :)\ - let $let := <x attr="value">"test"<func>function() $var {function()} {$var}</func></x>\ - let $joe:=1\ - return element element {\ - attribute attribute { 1 },\ - element test { 'a' }, \ - attribute foo { "bar" },\ - fn:doc()[ foo/@bar eq $let ],\ - //x } \ - \ - (: a more \'evil\' test :)\ - (: Modified Blakeley example (: with nested comment :) ... :)\ - declare private function local:declare() {()};\ - declare private function local:private() {()};\ - declare private function local:function() {()};\ - declare private function local:local() {()};\ - let $let := <let>let $let := "let"</let>\ - return element element {\ - attribute attribute { try { xdmp:version() } catch($e) { xdmp:log($e) } },\ - attribute fn:doc { "bar" castable as xs:string },\ - element text { text { "text" } },\ - fn:doc()[ child::eq/(@bar | attribute::attribute) eq $let ],\ - //fn:doc\ - }', ["keyword","xquery",null," ","keyword","version",null," ","variable",""1","keyword",".","atom","0","keyword","-","variable","ml"","def variable",";",null," ","comment","(: this is : a \"comment\" :)",null," ","keyword","let",null," ","variable","$let",null," ","keyword",":=",null," ","variable","<x",null," ","variable","attr","keyword","=","variable",""value">"test"<func>","def variable",";function","","()",null," ","variable","$var",null," ","","{","keyword","function","","()}",null," ","","{","variable","$var","","}","variable","<","keyword","/","variable","func><","keyword","/","variable","x>",null," ","keyword","let",null," ","variable","$joe","keyword",":=","atom","1",null," ","keyword","return",null," ","keyword","element",null," ","variable","element",null," ","","{",null," ","keyword","attribute",null," ","variable","attribute",null," ","","{",null," ","atom","1",null," ","","},",null," ","keyword","element",null," ","variable","test",null," ","","{",null," ","variable","'a'",null," ","","},",null," ","keyword","attribute",null," ","variable","foo",null," ","","{",null," ","variable",""bar"",null," ","","},",null," ","def variable","fn:doc","","()[",null," ","variable","foo","keyword","/","variable","@bar",null," ","keyword","eq",null," ","variable","$let",null," ","","],",null," ","keyword","//","variable","x",null," ","","}",null," ","comment","(: a more 'evil' test :)",null," ","comment","(: Modified Blakeley example (: with nested comment :) ... :)",null," ","keyword","declare",null," ","keyword","private",null," ","keyword","function",null," ","def variable","local:declare","","()",null," ","","{()}","variable",";",null," ","keyword","declare",null," ","keyword","private",null," ","keyword","function",null," ","def variable","local:private","","()",null," ","","{()}","variable",";",null," ","keyword","declare",null," ","keyword","private",null," ","keyword","function",null," ","def variable","local:function","","()",null," ","","{()}","variable",";",null," ","keyword","declare",null," ","keyword","private",null," ","keyword","function",null," ","def variable","local:local","","()",null," ","","{()}","variable",";",null," ","keyword","let",null," ","variable","$let",null," ","keyword",":=",null," ","variable","<let>let",null," ","variable","$let",null," ","keyword",":=",null," ","variable",""let"<","keyword","/let","variable",">",null," ","keyword","return",null," ","keyword","element",null," ","variable","element",null," ","","{",null," ","keyword","attribute",null," ","variable","attribute",null," ","","{",null," ","keyword","try",null," ","","{",null," ","def variable","xdmp:version","","()",null," ","","}",null," ","keyword","catch","","(","variable","$e","",")",null," ","","{",null," ","def variable","xdmp:log","","(","variable","$e","",")",null," ","","}",null," ","","},",null," ","keyword","attribute",null," ","variable","fn:doc",null," ","","{",null," ","variable",""bar"",null," ","variable","castable",null," ","keyword","as",null," ","atom","xs:string",null," ","","},",null," ","keyword","element",null," ","variable","text",null," ","","{",null," ","keyword","text",null," ","","{",null," ","variable",""text"",null," ","","}",null," ","","},",null," ","def variable","fn:doc","","()[",null," ","qualifier","child::","variable","eq","keyword","/","","(","variable","@bar",null," ","keyword","|",null," ","qualifier","attribute::","variable","attribute","",")",null," ","keyword","eq",null," ","variable","$let",null," ","","],",null," ","keyword","//","variable","fn:doc",null," ","","}"]); - -MT.testMode("testEmptySequenceKeyword", - '"foo" instance of empty-sequence()', - ["string","\"foo\"",null," ","keyword","instance",null," ","keyword","of",null," ","keyword","empty-sequence","","()"]); - - -MT.testMode("testMultiAttr", - '<p a1="foo" a2="bar">hello world</p>', - ["tag","<p ","attribute","a1","","=","string","\"foo\"",null," ","attribute","a2","","=","string","\"bar\"","tag",">","variable","hello",null," ","variable","world","tag","</p>"]); - -MT.testMode("test namespaced variable", - 'declare namespace e = "http://example.com/ANamespace";\ -declare variable $e:exampleComThisVarIsNotRecognized as element(*) external;', - ["keyword","declare",null," ","keyword","namespace",null," ","variable","e",null," ","keyword","=",null," ","string","\"http://example.com/ANamespace\"","variable",";declare",null," ","keyword","variable",null," ","variable","$e:exampleComThisVarIsNotRecognized",null," ","keyword","as",null," ","keyword","element","","(","keyword","*","",")",null," ","variable","external;"]); - -MT.testMode("test EQName variable", - 'declare variable $"http://www.example.com/ns/my":var := 12;\ -<out>{$"http://www.example.com/ns/my":var}</out>', - ["keyword","declare",null," ","keyword","variable",null," ","variable","$\"http://www.example.com/ns/my\":var",null," ","keyword",":=",null," ","atom","12","variable",";","tag","<out>","","{","variable","$\"http://www.example.com/ns/my\":var","","}","tag","</out>"]); - -MT.testMode("test EQName function", - 'declare function "http://www.example.com/ns/my":fn ($a as xs:integer) as xs:integer {\ - $a + 2\ -};\ -<out>{"http://www.example.com/ns/my":fn(12)}</out>', - ["keyword","declare",null," ","keyword","function",null," ","def variable","\"http://www.example.com/ns/my\":fn",null," ","","(","variable","$a",null," ","keyword","as",null," ","atom","xs:integer","",")",null," ","keyword","as",null," ","atom","xs:integer",null," ","","{",null," ","variable","$a",null," ","keyword","+",null," ","atom","2","","}","variable",";","tag","<out>","","{","def variable","\"http://www.example.com/ns/my\":fn","","(","atom","12","",")}","tag","</out>"]); - -MT.testMode("test EQName function with single quotes", - 'declare function \'http://www.example.com/ns/my\':fn ($a as xs:integer) as xs:integer {\ - $a + 2\ -};\ -<out>{\'http://www.example.com/ns/my\':fn(12)}</out>', - ["keyword","declare",null," ","keyword","function",null," ","def variable","'http://www.example.com/ns/my':fn",null," ","","(","variable","$a",null," ","keyword","as",null," ","atom","xs:integer","",")",null," ","keyword","as",null," ","atom","xs:integer",null," ","","{",null," ","variable","$a",null," ","keyword","+",null," ","atom","2","","}","variable",";","tag","<out>","","{","def variable","'http://www.example.com/ns/my':fn","","(","atom","12","",")}","tag","</out>"]); - -MT.testMode("testProcessingInstructions", - 'data(<?target content?>) instance of xs:string', - ["def variable","data","","(","comment meta","<?target content?>","",")",null," ","keyword","instance",null," ","keyword","of",null," ","atom","xs:string"]); - -MT.testMode("testQuoteEscapeDouble", - 'let $rootfolder := "c:\\builds\\winnt\\HEAD\\qa\\scripts\\"\ -let $keysfolder := concat($rootfolder, "keys\\")\ -return\ -$keysfolder', - ["keyword","let",null," ","variable","$rootfolder",null," ","keyword",":=",null," ","string","\"c:\\builds\\winnt\\HEAD\\qa\\scripts\\\"","keyword","let",null," ","variable","$keysfolder",null," ","keyword",":=",null," ","def variable","concat","","(","variable","$rootfolder","",",",null," ","string","\"keys\\\"","",")","variable","return$keysfolder"]); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/xquery/xquery.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/xquery/xquery.js deleted file mode 100644 index e4231d1069ee3419fc40462b684d89980f47a245..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/xquery/xquery.js +++ /dev/null @@ -1,450 +0,0 @@ -/* -Copyright (C) 2011 by MarkLogic Corporation -Author: Mike Brevoort <mike@brevoort.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ -CodeMirror.defineMode("xquery", function() { - - // The keywords object is set to the result of this self executing - // function. Each keyword is a property of the keywords object whose - // value is {type: atype, style: astyle} - var keywords = function(){ - // conveinence functions used to build keywords object - function kw(type) {return {type: type, style: "keyword"};} - var A = kw("keyword a") - , B = kw("keyword b") - , C = kw("keyword c") - , operator = kw("operator") - , atom = {type: "atom", style: "atom"} - , punctuation = {type: "punctuation", style: ""} - , qualifier = {type: "axis_specifier", style: "qualifier"}; - - // kwObj is what is return from this function at the end - var kwObj = { - 'if': A, 'switch': A, 'while': A, 'for': A, - 'else': B, 'then': B, 'try': B, 'finally': B, 'catch': B, - 'element': C, 'attribute': C, 'let': C, 'implements': C, 'import': C, 'module': C, 'namespace': C, - 'return': C, 'super': C, 'this': C, 'throws': C, 'where': C, 'private': C, - ',': punctuation, - 'null': atom, 'fn:false()': atom, 'fn:true()': atom - }; - - // a list of 'basic' keywords. For each add a property to kwObj with the value of - // {type: basic[i], style: "keyword"} e.g. 'after' --> {type: "after", style: "keyword"} - var basic = ['after','ancestor','ancestor-or-self','and','as','ascending','assert','attribute','before', - 'by','case','cast','child','comment','declare','default','define','descendant','descendant-or-self', - 'descending','document','document-node','element','else','eq','every','except','external','following', - 'following-sibling','follows','for','function','if','import','in','instance','intersect','item', - 'let','module','namespace','node','node','of','only','or','order','parent','precedes','preceding', - 'preceding-sibling','processing-instruction','ref','return','returns','satisfies','schema','schema-element', - 'self','some','sortby','stable','text','then','to','treat','typeswitch','union','variable','version','where', - 'xquery', 'empty-sequence']; - for(var i=0, l=basic.length; i < l; i++) { kwObj[basic[i]] = kw(basic[i]);}; - - // a list of types. For each add a property to kwObj with the value of - // {type: "atom", style: "atom"} - var types = ['xs:string', 'xs:float', 'xs:decimal', 'xs:double', 'xs:integer', 'xs:boolean', 'xs:date', 'xs:dateTime', - 'xs:time', 'xs:duration', 'xs:dayTimeDuration', 'xs:time', 'xs:yearMonthDuration', 'numeric', 'xs:hexBinary', - 'xs:base64Binary', 'xs:anyURI', 'xs:QName', 'xs:byte','xs:boolean','xs:anyURI','xf:yearMonthDuration']; - for(var i=0, l=types.length; i < l; i++) { kwObj[types[i]] = atom;}; - - // each operator will add a property to kwObj with value of {type: "operator", style: "keyword"} - var operators = ['eq', 'ne', 'lt', 'le', 'gt', 'ge', ':=', '=', '>', '>=', '<', '<=', '.', '|', '?', 'and', 'or', 'div', 'idiv', 'mod', '*', '/', '+', '-']; - for(var i=0, l=operators.length; i < l; i++) { kwObj[operators[i]] = operator;}; - - // each axis_specifiers will add a property to kwObj with value of {type: "axis_specifier", style: "qualifier"} - var axis_specifiers = ["self::", "attribute::", "child::", "descendant::", "descendant-or-self::", "parent::", - "ancestor::", "ancestor-or-self::", "following::", "preceding::", "following-sibling::", "preceding-sibling::"]; - for(var i=0, l=axis_specifiers.length; i < l; i++) { kwObj[axis_specifiers[i]] = qualifier; }; - - return kwObj; - }(); - - // Used as scratch variables to communicate multiple values without - // consing up tons of objects. - var type, content; - - function ret(tp, style, cont) { - type = tp; content = cont; - return style; - } - - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - - // the primary mode tokenizer - function tokenBase(stream, state) { - var ch = stream.next(), - mightBeFunction = false, - isEQName = isEQNameAhead(stream); - - // an XML tag (if not in some sub, chained tokenizer) - if (ch == "<") { - if(stream.match("!--", true)) - return chain(stream, state, tokenXMLComment); - - if(stream.match("![CDATA", false)) { - state.tokenize = tokenCDATA; - return ret("tag", "tag"); - } - - if(stream.match("?", false)) { - return chain(stream, state, tokenPreProcessing); - } - - var isclose = stream.eat("/"); - stream.eatSpace(); - var tagName = "", c; - while ((c = stream.eat(/[^\s\u00a0=<>\"\'\/?]/))) tagName += c; - - return chain(stream, state, tokenTag(tagName, isclose)); - } - // start code block - else if(ch == "{") { - pushStateStack(state,{ type: "codeblock"}); - return ret("", ""); - } - // end code block - else if(ch == "}") { - popStateStack(state); - return ret("", ""); - } - // if we're in an XML block - else if(isInXmlBlock(state)) { - if(ch == ">") - return ret("tag", "tag"); - else if(ch == "/" && stream.eat(">")) { - popStateStack(state); - return ret("tag", "tag"); - } - else - return ret("word", "variable"); - } - // if a number - else if (/\d/.test(ch)) { - stream.match(/^\d*(?:\.\d*)?(?:E[+\-]?\d+)?/); - return ret("number", "atom"); - } - // comment start - else if (ch === "(" && stream.eat(":")) { - pushStateStack(state, { type: "comment"}); - return chain(stream, state, tokenComment); - } - // quoted string - else if ( !isEQName && (ch === '"' || ch === "'")) - return chain(stream, state, tokenString(ch)); - // variable - else if(ch === "$") { - return chain(stream, state, tokenVariable); - } - // assignment - else if(ch ===":" && stream.eat("=")) { - return ret("operator", "keyword"); - } - // open paren - else if(ch === "(") { - pushStateStack(state, { type: "paren"}); - return ret("", ""); - } - // close paren - else if(ch === ")") { - popStateStack(state); - return ret("", ""); - } - // open paren - else if(ch === "[") { - pushStateStack(state, { type: "bracket"}); - return ret("", ""); - } - // close paren - else if(ch === "]") { - popStateStack(state); - return ret("", ""); - } - else { - var known = keywords.propertyIsEnumerable(ch) && keywords[ch]; - - // if there's a EQName ahead, consume the rest of the string portion, it's likely a function - if(isEQName && ch === '\"') while(stream.next() !== '"'){} - if(isEQName && ch === '\'') while(stream.next() !== '\''){} - - // gobble up a word if the character is not known - if(!known) stream.eatWhile(/[\w\$_-]/); - - // gobble a colon in the case that is a lib func type call fn:doc - var foundColon = stream.eat(":"); - - // if there's not a second colon, gobble another word. Otherwise, it's probably an axis specifier - // which should get matched as a keyword - if(!stream.eat(":") && foundColon) { - stream.eatWhile(/[\w\$_-]/); - } - // if the next non whitespace character is an open paren, this is probably a function (if not a keyword of other sort) - if(stream.match(/^[ \t]*\(/, false)) { - mightBeFunction = true; - } - // is the word a keyword? - var word = stream.current(); - known = keywords.propertyIsEnumerable(word) && keywords[word]; - - // if we think it's a function call but not yet known, - // set style to variable for now for lack of something better - if(mightBeFunction && !known) known = {type: "function_call", style: "variable def"}; - - // if the previous word was element, attribute, axis specifier, this word should be the name of that - if(isInXmlConstructor(state)) { - popStateStack(state); - return ret("word", "variable", word); - } - // as previously checked, if the word is element,attribute, axis specifier, call it an "xmlconstructor" and - // push the stack so we know to look for it on the next word - if(word == "element" || word == "attribute" || known.type == "axis_specifier") pushStateStack(state, {type: "xmlconstructor"}); - - // if the word is known, return the details of that else just call this a generic 'word' - return known ? ret(known.type, known.style, word) : - ret("word", "variable", word); - } - } - - // handle comments, including nested - function tokenComment(stream, state) { - var maybeEnd = false, maybeNested = false, nestedCount = 0, ch; - while (ch = stream.next()) { - if (ch == ")" && maybeEnd) { - if(nestedCount > 0) - nestedCount--; - else { - popStateStack(state); - break; - } - } - else if(ch == ":" && maybeNested) { - nestedCount++; - } - maybeEnd = (ch == ":"); - maybeNested = (ch == "("); - } - - return ret("comment", "comment"); - } - - // tokenizer for string literals - // optionally pass a tokenizer function to set state.tokenize back to when finished - function tokenString(quote, f) { - return function(stream, state) { - var ch; - - if(isInString(state) && stream.current() == quote) { - popStateStack(state); - if(f) state.tokenize = f; - return ret("string", "string"); - } - - pushStateStack(state, { type: "string", name: quote, tokenize: tokenString(quote, f) }); - - // if we're in a string and in an XML block, allow an embedded code block - if(stream.match("{", false) && isInXmlAttributeBlock(state)) { - state.tokenize = tokenBase; - return ret("string", "string"); - } - - - while (ch = stream.next()) { - if (ch == quote) { - popStateStack(state); - if(f) state.tokenize = f; - break; - } - else { - // if we're in a string and in an XML block, allow an embedded code block in an attribute - if(stream.match("{", false) && isInXmlAttributeBlock(state)) { - state.tokenize = tokenBase; - return ret("string", "string"); - } - - } - } - - return ret("string", "string"); - }; - } - - // tokenizer for variables - function tokenVariable(stream, state) { - var isVariableChar = /[\w\$_-]/; - - // a variable may start with a quoted EQName so if the next character is quote, consume to the next quote - if(stream.eat("\"")) { - while(stream.next() !== '\"'){}; - stream.eat(":"); - } else { - stream.eatWhile(isVariableChar); - if(!stream.match(":=", false)) stream.eat(":"); - } - stream.eatWhile(isVariableChar); - state.tokenize = tokenBase; - return ret("variable", "variable"); - } - - // tokenizer for XML tags - function tokenTag(name, isclose) { - return function(stream, state) { - stream.eatSpace(); - if(isclose && stream.eat(">")) { - popStateStack(state); - state.tokenize = tokenBase; - return ret("tag", "tag"); - } - // self closing tag without attributes? - if(!stream.eat("/")) - pushStateStack(state, { type: "tag", name: name, tokenize: tokenBase}); - if(!stream.eat(">")) { - state.tokenize = tokenAttribute; - return ret("tag", "tag"); - } - else { - state.tokenize = tokenBase; - } - return ret("tag", "tag"); - }; - } - - // tokenizer for XML attributes - function tokenAttribute(stream, state) { - var ch = stream.next(); - - if(ch == "/" && stream.eat(">")) { - if(isInXmlAttributeBlock(state)) popStateStack(state); - if(isInXmlBlock(state)) popStateStack(state); - return ret("tag", "tag"); - } - if(ch == ">") { - if(isInXmlAttributeBlock(state)) popStateStack(state); - return ret("tag", "tag"); - } - if(ch == "=") - return ret("", ""); - // quoted string - if (ch == '"' || ch == "'") - return chain(stream, state, tokenString(ch, tokenAttribute)); - - if(!isInXmlAttributeBlock(state)) - pushStateStack(state, { type: "attribute", name: name, tokenize: tokenAttribute}); - - stream.eat(/[a-zA-Z_:]/); - stream.eatWhile(/[-a-zA-Z0-9_:.]/); - stream.eatSpace(); - - // the case where the attribute has not value and the tag was closed - if(stream.match(">", false) || stream.match("/", false)) { - popStateStack(state); - state.tokenize = tokenBase; - } - - return ret("attribute", "attribute"); - } - - // handle comments, including nested - function tokenXMLComment(stream, state) { - var ch; - while (ch = stream.next()) { - if (ch == "-" && stream.match("->", true)) { - state.tokenize = tokenBase; - return ret("comment", "comment"); - } - } - } - - - // handle CDATA - function tokenCDATA(stream, state) { - var ch; - while (ch = stream.next()) { - if (ch == "]" && stream.match("]", true)) { - state.tokenize = tokenBase; - return ret("comment", "comment"); - } - } - } - - // handle preprocessing instructions - function tokenPreProcessing(stream, state) { - var ch; - while (ch = stream.next()) { - if (ch == "?" && stream.match(">", true)) { - state.tokenize = tokenBase; - return ret("comment", "comment meta"); - } - } - } - - - // functions to test the current context of the state - function isInXmlBlock(state) { return isIn(state, "tag"); } - function isInXmlAttributeBlock(state) { return isIn(state, "attribute"); } - function isInXmlConstructor(state) { return isIn(state, "xmlconstructor"); } - function isInString(state) { return isIn(state, "string"); } - - function isEQNameAhead(stream) { - // assume we've already eaten a quote (") - if(stream.current() === '"') - return stream.match(/^[^\"]+\"\:/, false); - else if(stream.current() === '\'') - return stream.match(/^[^\"]+\'\:/, false); - else - return false; - } - - function isIn(state, type) { - return (state.stack.length && state.stack[state.stack.length - 1].type == type); - } - - function pushStateStack(state, newState) { - state.stack.push(newState); - } - - function popStateStack(state) { - state.stack.pop(); - var reinstateTokenize = state.stack.length && state.stack[state.stack.length-1].tokenize; - state.tokenize = reinstateTokenize || tokenBase; - } - - // the interface for the mode API - return { - startState: function() { - return { - tokenize: tokenBase, - cc: [], - stack: [] - }; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - return style; - } - }; - -}); - -CodeMirror.defineMIME("application/xquery", "xquery"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/yaml/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/yaml/index.html deleted file mode 100644 index 65e1ea73fb525efc2449e3312fd51ae89cc97c6a..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/yaml/index.html +++ /dev/null @@ -1,68 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: YAML mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="yaml.js"></script> - <style>.CodeMirror { border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; }</style> - <link rel="stylesheet" href="../../doc/docs.css"> - </head> - <body> - <h1>CodeMirror: YAML mode</h1> - <form><textarea id="code" name="code"> ---- # Favorite movies -- Casablanca -- North by Northwest -- The Man Who Wasn't There ---- # Shopping list -[milk, pumpkin pie, eggs, juice] ---- # Indented Blocks, common in YAML data files, use indentation and new lines to separate the key: value pairs - name: John Smith - age: 33 ---- # Inline Blocks, common in YAML data streams, use commas to separate the key: value pairs between braces -{name: John Smith, age: 33} ---- -receipt: Oz-Ware Purchase Invoice -date: 2007-08-06 -customer: - given: Dorothy - family: Gale - -items: - - part_no: A4786 - descrip: Water Bucket (Filled) - price: 1.47 - quantity: 4 - - - part_no: E1628 - descrip: High Heeled "Ruby" Slippers - size: 8 - price: 100.27 - quantity: 1 - -bill-to: &id001 - street: | - 123 Tornado Alley - Suite 16 - city: East Centerville - state: KS - -ship-to: *id001 - -specialDelivery: > - Follow the Yellow Brick - Road to the Emerald City. - Pay no attention to the - man behind the curtain. -... -</textarea></form> - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), {}); - </script> - - <p><strong>MIME types defined:</strong> <code>text/x-yaml</code>.</p> - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/yaml/yaml.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/yaml/yaml.js deleted file mode 100644 index 59e2641a016eedc79ee7c43259ee1f6923c384ff..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/yaml/yaml.js +++ /dev/null @@ -1,95 +0,0 @@ -CodeMirror.defineMode("yaml", function() { - - var cons = ['true', 'false', 'on', 'off', 'yes', 'no']; - var keywordRegex = new RegExp("\\b(("+cons.join(")|(")+"))$", 'i'); - - return { - token: function(stream, state) { - var ch = stream.peek(); - var esc = state.escaped; - state.escaped = false; - /* comments */ - if (ch == "#") { stream.skipToEnd(); return "comment"; } - if (state.literal && stream.indentation() > state.keyCol) { - stream.skipToEnd(); return "string"; - } else if (state.literal) { state.literal = false; } - if (stream.sol()) { - state.keyCol = 0; - state.pair = false; - state.pairStart = false; - /* document start */ - if(stream.match(/---/)) { return "def"; } - /* document end */ - if (stream.match(/\.\.\./)) { return "def"; } - /* array list item */ - if (stream.match(/\s*-\s+/)) { return 'meta'; } - } - /* pairs (associative arrays) -> key */ - if (!state.pair && stream.match(/^\s*([a-z0-9\._-])+(?=\s*:)/i)) { - state.pair = true; - state.keyCol = stream.indentation(); - return "atom"; - } - if (state.pair && stream.match(/^:\s*/)) { state.pairStart = true; return 'meta'; } - - /* inline pairs/lists */ - if (stream.match(/^(\{|\}|\[|\])/)) { - if (ch == '{') - state.inlinePairs++; - else if (ch == '}') - state.inlinePairs--; - else if (ch == '[') - state.inlineList++; - else - state.inlineList--; - return 'meta'; - } - - /* list seperator */ - if (state.inlineList > 0 && !esc && ch == ',') { - stream.next(); - return 'meta'; - } - /* pairs seperator */ - if (state.inlinePairs > 0 && !esc && ch == ',') { - state.keyCol = 0; - state.pair = false; - state.pairStart = false; - stream.next(); - return 'meta'; - } - - /* start of value of a pair */ - if (state.pairStart) { - /* block literals */ - if (stream.match(/^\s*(\||\>)\s*/)) { state.literal = true; return 'meta'; }; - /* references */ - if (stream.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i)) { return 'variable-2'; } - /* numbers */ - if (state.inlinePairs == 0 && stream.match(/^\s*-?[0-9\.\,]+\s?$/)) { return 'number'; } - if (state.inlinePairs > 0 && stream.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/)) { return 'number'; } - /* keywords */ - if (stream.match(keywordRegex)) { return 'keyword'; } - } - - /* nothing found, continue */ - state.pairStart = false; - state.escaped = (ch == '\\'); - stream.next(); - return null; - }, - startState: function() { - return { - pair: false, - pairStart: false, - keyCol: 0, - inlinePairs: 0, - inlineList: 0, - literal: false, - escaped: false - }; - } - }; -}); - -CodeMirror.defineMIME("text/x-yaml", "yaml"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/z80/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/z80/index.html deleted file mode 100644 index 133c870e326feac6df2ebbd8f17fefade31a83f0..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/z80/index.html +++ /dev/null @@ -1,39 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Z80 assembly mode</title> - <link rel="stylesheet" href="../../lib/codemirror.css"> - <script src="../../lib/codemirror.js"></script> - <script src="z80.js"></script> - <link rel="stylesheet" href="../../doc/docs.css"> - <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> - </head> - <body> - <h1>CodeMirror: Z80 assembly mode</h1> - -<div><textarea id="code" name="code"> -#include "ti83plus.inc" -#define progStart $9D95 -.org progStart-2 -.db $BB,$6D - bcall(_ClrLCDFull) - ld HL, 0 - ld (PenCol), HL - ld HL, Message - bcall(_PutS) ; Displays the string - bcall(_NewLine) - ret -Message: -.db "Hello world!",0 -</textarea></div> - - <script> - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true - }); - </script> - - <p><strong>MIME type defined:</strong> <code>text/x-z80</code>.</p> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/z80/z80.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/z80/z80.js deleted file mode 100644 index c026790dc733d9918b5422c9e53c33777a7b162e..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/z80/z80.js +++ /dev/null @@ -1,113 +0,0 @@ -CodeMirror.defineMode('z80', function() -{ - var keywords1 = /^(exx?|(ld|cp|in)([di]r?)?|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|rst|[de]i|halt|im|ot[di]r|out[di]?)\b/i; - var keywords2 = /^(call|j[pr]|ret[in]?)\b/i; - var keywords3 = /^b_?(call|jump)\b/i; - var variables1 = /^(af?|bc?|c|de?|e|hl?|l|i[xy]?|r|sp)\b/i; - var variables2 = /^(n?[zc]|p[oe]?|m)\b/i; - var errors = /^([hl][xy]|i[xy][hl]|slia|sll)\b/i; - var numbers = /^([\da-f]+h|[0-7]+o|[01]+b|\d+)\b/i; - - return {startState: function() - { - return {context: 0}; - }, token: function(stream, state) - { - if (!stream.column()) - state.context = 0; - - if (stream.eatSpace()) - return null; - - var w; - - if (stream.eatWhile(/\w/)) - { - w = stream.current(); - - if (stream.indentation()) - { - if (state.context == 1 && variables1.test(w)) - return 'variable-2'; - - if (state.context == 2 && variables2.test(w)) - return 'variable-3'; - - if (keywords1.test(w)) - { - state.context = 1; - return 'keyword'; - } - else if (keywords2.test(w)) - { - state.context = 2; - return 'keyword'; - } - else if (keywords3.test(w)) - { - state.context = 3; - return 'keyword'; - } - - if (errors.test(w)) - return 'error'; - } - else if (numbers.test(w)) - { - return 'number'; - } - else - { - return null; - } - } - else if (stream.eat(';')) - { - stream.skipToEnd(); - return 'comment'; - } - else if (stream.eat('"')) - { - while (w = stream.next()) - { - if (w == '"') - break; - - if (w == '\\') - stream.next(); - } - - return 'string'; - } - else if (stream.eat('\'')) - { - if (stream.match(/\\?.'/)) - return 'number'; - } - else if (stream.eat('.') || stream.sol() && stream.eat('#')) - { - state.context = 4; - - if (stream.eatWhile(/\w/)) - return 'def'; - } - else if (stream.eat('$')) - { - if (stream.eatWhile(/[\da-f]/i)) - return 'number'; - } - else if (stream.eat('%')) - { - if (stream.eatWhile(/[01]/)) - return 'number'; - } - else - { - stream.next(); - } - - return null; - }}; -}); - -CodeMirror.defineMIME("text/x-z80", "z80"); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/package.json b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/package.json deleted file mode 100644 index ea18e6b97839c4c9f08175550e3c79b62121c5e2..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "codemirror", - "version":"3.0.2", - "main": "codemirror.js", - "description": "In-browser code editing made bearable", - "licenses": [{"type": "MIT", - "url": "http://codemirror.net/LICENSE"}], - "directories": {"lib": "./lib"}, - "scripts": {"test": "node ./test/run.js"}, - "devDependencies": {"node-static": "0.6.0"}, - "bugs": "http://github.com/marijnh/CodeMirror/issues", - "keywords": ["JavaScript", "CodeMirror", "Editor"], - "homepage": "http://codemirror.net", - "maintainers":[{"name": "Marijn Haverbeke", - "email": "marijnh@gmail.com", - "web": "http://marijnhaverbeke.nl"}], - "repositories": [{"type": "git", - "url": "http://marijnhaverbeke.nl/git/codemirror"}, - {"type": "git", - "url": "https://github.com/marijnh/CodeMirror.git"}] -} diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/driver.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/driver.js deleted file mode 100644 index 7f9dfd0ae3feea2450fedd6bc8cbc29536bc551a..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/driver.js +++ /dev/null @@ -1,134 +0,0 @@ -var tests = [], debug = null, debugUsed = new Array(), allNames = []; - -function Failure(why) {this.message = why;} -Failure.prototype.toString = function() { return this.message; }; - -function indexOf(collection, elt) { - if (collection.indexOf) return collection.indexOf(elt); - for (var i = 0, e = collection.length; i < e; ++i) - if (collection[i] == elt) return i; - return -1; -} - -function test(name, run, expectedFail) { - // Force unique names - var originalName = name; - var i = 2; // Second function would be NAME_2 - while (indexOf(allNames, name) !== -1){ - name = originalName + "_" + i; - i++; - } - allNames.push(name); - // Add test - tests.push({name: name, func: run, expectedFail: expectedFail}); - return name; -} -function testCM(name, run, opts, expectedFail) { - return test("core_" + name, function() { - var place = document.getElementById("testground"), cm = CodeMirror(place, opts); - var successful = false; - try { - run(cm); - successful = true; - } finally { - if ((debug && !successful) || verbose) { - place.style.visibility = ""; - } else { - place.removeChild(cm.getWrapperElement()); - } - } - }, expectedFail); -} - -function runTests(callback) { - if (debug) { - if (indexOf(debug, "verbose") === 0) { - verbose = true; - debug.splice(0, 1); - } - if (debug.length < 1) { - debug = null; - } else { - if (totalTests > debug.length) { - totalTests = debug.length; - } - } - } - var totalTime = 0; - function step(i) { - if (i === tests.length){ - running = false; - return callback("done"); - } - var test = tests[i], expFail = test.expectedFail, startTime = +new Date; - if (debug !== null) { - var debugIndex = indexOf(debug, test.name); - if (debugIndex !== -1) { - // Remove from array for reporting incorrect tests later - debug.splice(debugIndex, 1); - } else { - var wildcardName = test.name.split("_").shift() + "_*"; - debugIndex = indexOf(debug, wildcardName); - if (debugIndex !== -1) { - // Remove from array for reporting incorrect tests later - debug.splice(debugIndex, 1); - debugUsed.push(wildcardName); - } else { - debugIndex = indexOf(debugUsed, wildcardName); - if (debugIndex !== -1) { - totalTests++; - } else { - return step(i + 1); - } - } - } - } - var threw = false; - try { - var message = test.func(); - } catch(e) { - threw = true; - if (expFail) callback("expected", test.name); - else if (e instanceof Failure) callback("fail", test.name, e.message); - else { - var pos = /\bat .*?([^\/:]+):(\d+):/.exec(e.stack); - callback("error", test.name, e.toString() + (pos ? " (" + pos[1] + ":" + pos[2] + ")" : "")); - } - } - if (!threw) { - if (expFail) callback("fail", test.name, message || "expected failure, but succeeded"); - else callback("ok", test.name, message); - } - if (!quit) { // Run next test - var delay = 0; - totalTime += (+new Date) - startTime; - if (totalTime > 500){ - totalTime = 0; - delay = 50; - } - setTimeout(function(){step(i + 1);}, delay); - } else { // Quit tests - running = false; - return null; - } - } - step(0); -} - -function label(str, msg) { - if (msg) return str + " (" + msg + ")"; - return str; -} -function eq(a, b, msg) { - if (a != b) throw new Failure(label(a + " != " + b, msg)); -} -function eqPos(a, b, msg) { - function str(p) { return "{line:" + p.line + ",ch:" + p.ch + "}"; } - if (a == b) return; - if (a == null) throw new Failure(label("comparing null to " + str(b))); - if (b == null) throw new Failure(label("comparing " + str(a) + " to null")); - if (a.line != b.line || a.ch != b.ch) throw new Failure(label(str(a) + " != " + str(b), msg)); -} -function is(a, msg) { - if (!a) throw new Failure(label("assertion failed", msg)); -} diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/index.html b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/index.html deleted file mode 100644 index 5e3641aefed89e853fbf8daf35c7d69f4ee9593a..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/index.html +++ /dev/null @@ -1,177 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>CodeMirror: Test Suite</title> - <link rel="stylesheet" href="../lib/codemirror.css"> - <link rel="stylesheet" href="../doc/docs.css"> - <link rel="stylesheet" href="mode_test.css"> - <script src="../lib/codemirror.js"></script> - <script src="../lib/util/overlay.js"></script> - <script src="../lib/util/searchcursor.js"></script> - <script src="../mode/javascript/javascript.js"></script> - <script src="../mode/xml/xml.js"></script> - <script src="../keymap/vim.js"></script> - - <style type="text/css"> - .ok {color: #090;} - .fail {color: #e00;} - .error {color: #c90;} - .done {font-weight: bold;} - #progress { - background: #45d; - color: white; - text-shadow: 0 0 1px #45d, 0 0 2px #45d, 0 0 3px #45d; - font-weight: bold; - white-space: pre; - } - .CodeMirror { border: 1px solid black; } - </style> - </head> - <body> - <h1>CodeMirror: Test Suite</h1> - - <p>A limited set of programmatic sanity tests for CodeMirror.</p> - - <div style="border: 1px solid black; padding: 1px; max-width: 700px;"> - <div style="width: 0px;" id=progress><div style="padding: 3px;">Ran <span id="progress_ran">0</span><span id="progress_total"> of 0</span> tests</div></div> - </div> - <p id=status>Please enable JavaScript...</p> - <div id=output></div> - - <div style="visibility: hidden" id=testground></div> - - <script src="driver.js"></script> - <script src="test.js"></script> - <script src="mode_test.js"></script> - <script src="../mode/css/css.js"></script> - <script src="../mode/css/test.js"></script> - <script src="../mode/markdown/markdown.js"></script> - <script src="../mode/markdown/test.js"></script> - <script src="../mode/gfm/gfm.js"></script> - <script src="../mode/gfm/test.js"></script> - <script src="../mode/stex/stex.js"></script> - <script src="../mode/stex/test.js"></script> - <script src="../mode/xquery/xquery.js"></script> - <script src="../mode/xquery/test.js"></script> - <script src="vim_test.js"></script> - <script> - window.onload = function() { - runHarness(); - }; - CodeMirror.on(window, 'hashchange', function(){ - runHarness(); - }); - - function esc(str) { - return str.replace(/[<&]/, function(ch) { return ch == "<" ? "<" : "&"; }); - } - - var output = document.getElementById("output"), - progress = document.getElementById("progress"), - progressRan = document.getElementById("progress_ran").childNodes[0], - progressTotal = document.getElementById("progress_total").childNodes[0]; - var count = 0, - failed = 0, - bad = "", - running = false, // Flag that states tests are running - quit = false, // Flag to quit tests ASAP - verbose = false; // Adds message for *every* test to output - - function runHarness(){ - if (running) { - quit = true; - setStatus("Restarting tests...", '', true); - setTimeout(function(){runHarness();}, 500); - return; - } - if (window.location.hash.substr(1)){ - debug = window.location.hash.substr(1).split(","); - } else { - debug = null; - } - quit = false; - running = true; - setStatus("Loading tests..."); - count = 0; - failed = 0; - bad = ""; - verbose = false; - debugUsed = Array(); - totalTests = tests.length; - progressTotal.nodeValue = " of " + totalTests; - progressRan.nodeValue = count; - output.innerHTML = ''; - document.getElementById("testground").innerHTML = "<form>" + - "<textarea id=\"code\" name=\"code\"></textarea>" + - "<input type=submit value=ok name=submit>" + - "</form>"; - runTests(displayTest); - } - - function setStatus(message, className, force){ - if (quit && !force) return; - if (!message) throw("must provide message"); - var status = document.getElementById("status").childNodes[0]; - status.nodeValue = message; - status.parentNode.className = className; - } - function addOutput(name, className, code){ - var newOutput = document.createElement("dl"); - var newTitle = document.createElement("dt"); - newTitle.className = className; - newTitle.appendChild(document.createTextNode(name)); - newOutput.appendChild(newTitle); - var newMessage = document.createElement("dd"); - newMessage.innerHTML = code; - newOutput.appendChild(newTitle); - newOutput.appendChild(newMessage); - output.appendChild(newOutput); - } - function displayTest(type, name, customMessage) { - var message = "???"; - if (type != "done") ++count; - progress.style.width = (count * (progress.parentNode.clientWidth - 2) / totalTests) + "px"; - progressTotal.nodeValue = " of " + totalTests + - (debugUsed.length && type != "done" ? "+" : ""); - progressRan.nodeValue = count; - if (type == "ok") { - message = "Test '" + name + "' succeeded"; - if (!verbose) customMessage = false; - } else if (type == "expected") { - message = "Test '" + name + "' failed as expected"; - if (!verbose) customMessage = false; - } else if (type == "error" || type == "fail") { - ++failed; - message = "Test '" + name + "' failed"; - } else if (type == "done") { - if (failed) { - type += " fail"; - message = failed + " failure" + (failed > 1 ? "s" : ""); - } else if (count < totalTests) { - failed = totalTests - count; - type += " fail"; - message = failed + " failure" + (failed > 1 ? "s" : ""); - } else { - type += " ok"; - message = "All passed"; - } - if (debug && debug.length) { - var bogusTests = totalTests - count; - message += " — " + bogusTests + " nonexistent test" + - (bogusTests > 1 ? "s" : "") + " requested by location.hash: " + - "`" + debug.join("`, `") + "`"; - } else { - progressTotal.nodeValue = ''; - } - customMessage = true; // Hack to avoid adding to output - } - if (verbose && !customMessage) customMessage = message; - setStatus(message, type); - if (customMessage && customMessage.length > 0) { - addOutput(name, type, customMessage); - } - } - </script> - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/lint/acorn.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/lint/acorn.js deleted file mode 100644 index 6323b1fc6a039760ac7f87ebd03052669fe84269..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/lint/acorn.js +++ /dev/null @@ -1,1593 +0,0 @@ -// Acorn is a tiny, fast JavaScript parser written in JavaScript. -// -// Acorn was written by Marijn Haverbeke and released under an MIT -// license. The Unicode regexps (for identifiers and whitespace) were -// taken from [Esprima](http://esprima.org) by Ariya Hidayat. -// -// Git repositories for Acorn are available at -// -// http://marijnhaverbeke.nl/git/acorn -// https://github.com/marijnh/acorn.git -// -// Please use the [github bug tracker][ghbt] to report issues. -// -// [ghbt]: https://github.com/marijnh/acorn/issues - -(function(exports) { - "use strict"; - - exports.version = "0.0.1"; - - // The main exported interface (under `window.acorn` when in the - // browser) is a `parse` function that takes a code string and - // returns an abstract syntax tree as specified by [Mozilla parser - // API][api], with the caveat that the SpiderMonkey-specific syntax - // (`let`, `yield`, inline XML, etc) is not recognized. - // - // [api]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API - - var options, input, inputLen, sourceFile; - - exports.parse = function(inpt, opts) { - input = String(inpt); inputLen = input.length; - options = opts || {}; - for (var opt in defaultOptions) if (!options.hasOwnProperty(opt)) - options[opt] = defaultOptions[opt]; - sourceFile = options.sourceFile || null; - return parseTopLevel(options.program); - }; - - // A second optional argument can be given to further configure - // the parser process. These options are recognized: - - var defaultOptions = exports.defaultOptions = { - // `ecmaVersion` indicates the ECMAScript version to parse. Must - // be either 3 or 5. This - // influences support for strict mode, the set of reserved words, and - // support for getters and setter. - ecmaVersion: 5, - // Turn on `strictSemicolons` to prevent the parser from doing - // automatic semicolon insertion. - strictSemicolons: false, - // When `allowTrailingCommas` is false, the parser will not allow - // trailing commas in array and object literals. - allowTrailingCommas: true, - // By default, reserved words are not enforced. Enable - // `forbidReserved` to enforce them. - forbidReserved: false, - // When `trackComments` is turned on, the parser will attach - // `commentsBefore` and `commentsAfter` properties to AST nodes - // holding arrays of strings. A single comment may appear in both - // a `commentsBefore` and `commentsAfter` array (of the nodes - // after and before it), but never twice in the before (or after) - // array of different nodes. - trackComments: false, - // When `locations` is on, `loc` properties holding objects with - // `start` and `end` properties in `{line, column}` form (with - // line being 1-based and column 0-based) will be attached to the - // nodes. - locations: false, - // Nodes have their start and end characters offsets recorded in - // `start` and `end` properties (directly on the node, rather than - // the `loc` object, which holds line/column data. To also add a - // [semi-standardized][range] `range` property holding a `[start, - // end]` array with the same numbers, set the `ranges` option to - // `true`. - // - // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 - ranges: false, - // It is possible to parse multiple files into a single AST by - // passing the tree produced by parsing the first file as - // `program` option in subsequent parses. This will add the - // toplevel forms of the parsed file to the `Program` (top) node - // of an existing parse tree. - program: null, - // When `location` is on, you can pass this to record the source - // file in every node's `loc` object. - sourceFile: null - }; - - // The `getLineInfo` function is mostly useful when the - // `locations` option is off (for performance reasons) and you - // want to find the line/column position for a given character - // offset. `input` should be the code string that the offset refers - // into. - - var getLineInfo = exports.getLineInfo = function(input, offset) { - for (var line = 1, cur = 0;;) { - lineBreak.lastIndex = cur; - var match = lineBreak.exec(input); - if (match && match.index < offset) { - ++line; - cur = match.index + match[0].length; - } else break; - } - return {line: line, column: offset - cur}; - }; - - // Acorn is organized as a tokenizer and a recursive-descent parser. - // Both use (closure-)global variables to keep their state and - // communicate. We already saw the `options`, `input`, and - // `inputLen` variables above (set in `parse`). - - // The current position of the tokenizer in the input. - - var tokPos; - - // The start and end offsets of the current token. - - var tokStart, tokEnd; - - // When `options.locations` is true, these hold objects - // containing the tokens start and end line/column pairs. - - var tokStartLoc, tokEndLoc; - - // The type and value of the current token. Token types are objects, - // named by variables against which they can be compared, and - // holding properties that describe them (indicating, for example, - // the precedence of an infix operator, and the original name of a - // keyword token). The kind of value that's held in `tokVal` depends - // on the type of the token. For literals, it is the literal value, - // for operators, the operator name, and so on. - - var tokType, tokVal; - - // These are used to hold arrays of comments when - // `options.trackComments` is true. - - var tokCommentsBefore, tokCommentsAfter; - - // Interal state for the tokenizer. To distinguish between division - // operators and regular expressions, it remembers whether the last - // token was one that is allowed to be followed by an expression. - // (If it is, a slash is probably a regexp, if it isn't it's a - // division operator. See the `parseStatement` function for a - // caveat.) - - var tokRegexpAllowed, tokComments; - - // When `options.locations` is true, these are used to keep - // track of the current line, and know when a new line has been - // entered. See the `curLineLoc` function. - - var tokCurLine, tokLineStart, tokLineStartNext; - - // These store the position of the previous token, which is useful - // when finishing a node and assigning its `end` position. - - var lastStart, lastEnd, lastEndLoc; - - // This is the parser's state. `inFunction` is used to reject - // `return` statements outside of functions, `labels` to verify that - // `break` and `continue` have somewhere to jump to, and `strict` - // indicates whether strict mode is on. - - var inFunction, labels, strict; - - // This function is used to raise exceptions on parse errors. It - // takes either a `{line, column}` object or an offset integer (into - // the current `input`) as `pos` argument. It attaches the position - // to the end of the error message, and then raises a `SyntaxError` - // with that message. - - function raise(pos, message) { - if (typeof pos == "number") pos = getLineInfo(input, pos); - message += " (" + pos.line + ":" + pos.column + ")"; - throw new SyntaxError(message); - } - - // ## Token types - - // The assignment of fine-grained, information-carrying type objects - // allows the tokenizer to store the information it has about a - // token in a way that is very cheap for the parser to look up. - - // All token type variables start with an underscore, to make them - // easy to recognize. - - // These are the general types. The `type` property is only used to - // make them recognizeable when debugging. - - var _num = {type: "num"}, _regexp = {type: "regexp"}, _string = {type: "string"}; - var _name = {type: "name"}, _eof = {type: "eof"}; - - // Keyword tokens. The `keyword` property (also used in keyword-like - // operators) indicates that the token originated from an - // identifier-like word, which is used when parsing property names. - // - // The `beforeExpr` property is used to disambiguate between regular - // expressions and divisions. It is set on all token types that can - // be followed by an expression (thus, a slash after them would be a - // regular expression). - // - // `isLoop` marks a keyword as starting a loop, which is important - // to know when parsing a label, in order to allow or disallow - // continue jumps to that label. - - var _break = {keyword: "break"}, _case = {keyword: "case", beforeExpr: true}, _catch = {keyword: "catch"}; - var _continue = {keyword: "continue"}, _debugger = {keyword: "debugger"}, _default = {keyword: "default"}; - var _do = {keyword: "do", isLoop: true}, _else = {keyword: "else", beforeExpr: true}; - var _finally = {keyword: "finally"}, _for = {keyword: "for", isLoop: true}, _function = {keyword: "function"}; - var _if = {keyword: "if"}, _return = {keyword: "return", beforeExpr: true}, _switch = {keyword: "switch"}; - var _throw = {keyword: "throw", beforeExpr: true}, _try = {keyword: "try"}, _var = {keyword: "var"}; - var _while = {keyword: "while", isLoop: true}, _with = {keyword: "with"}, _new = {keyword: "new", beforeExpr: true}; - var _this = {keyword: "this"}; - - // The keywords that denote values. - - var _null = {keyword: "null", atomValue: null}, _true = {keyword: "true", atomValue: true}; - var _false = {keyword: "false", atomValue: false}; - - // Some keywords are treated as regular operators. `in` sometimes - // (when parsing `for`) needs to be tested against specifically, so - // we assign a variable name to it for quick comparing. - - var _in = {keyword: "in", binop: 7, beforeExpr: true}; - - // Map keyword names to token types. - - var keywordTypes = {"break": _break, "case": _case, "catch": _catch, - "continue": _continue, "debugger": _debugger, "default": _default, - "do": _do, "else": _else, "finally": _finally, "for": _for, - "function": _function, "if": _if, "return": _return, "switch": _switch, - "throw": _throw, "try": _try, "var": _var, "while": _while, "with": _with, - "null": _null, "true": _true, "false": _false, "new": _new, "in": _in, - "instanceof": {keyword: "instanceof", binop: 7}, "this": _this, - "typeof": {keyword: "typeof", prefix: true}, - "void": {keyword: "void", prefix: true}, - "delete": {keyword: "delete", prefix: true}}; - - // Punctuation token types. Again, the `type` property is purely for debugging. - - var _bracketL = {type: "[", beforeExpr: true}, _bracketR = {type: "]"}, _braceL = {type: "{", beforeExpr: true}; - var _braceR = {type: "}"}, _parenL = {type: "(", beforeExpr: true}, _parenR = {type: ")"}; - var _comma = {type: ",", beforeExpr: true}, _semi = {type: ";", beforeExpr: true}; - var _colon = {type: ":", beforeExpr: true}, _dot = {type: "."}, _question = {type: "?", beforeExpr: true}; - - // Operators. These carry several kinds of properties to help the - // parser use them properly (the presence of these properties is - // what categorizes them as operators). - // - // `binop`, when present, specifies that this operator is a binary - // operator, and will refer to its precedence. - // - // `prefix` and `postfix` mark the operator as a prefix or postfix - // unary operator. `isUpdate` specifies that the node produced by - // the operator should be of type UpdateExpression rather than - // simply UnaryExpression (`++` and `--`). - // - // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as - // binary operators with a very low precedence, that should result - // in AssignmentExpression nodes. - - var _slash = {binop: 10, beforeExpr: true}, _eq = {isAssign: true, beforeExpr: true}; - var _assign = {isAssign: true, beforeExpr: true}, _plusmin = {binop: 9, prefix: true, beforeExpr: true}; - var _incdec = {postfix: true, prefix: true, isUpdate: true}, _prefix = {prefix: true, beforeExpr: true}; - var _bin1 = {binop: 1, beforeExpr: true}, _bin2 = {binop: 2, beforeExpr: true}; - var _bin3 = {binop: 3, beforeExpr: true}, _bin4 = {binop: 4, beforeExpr: true}; - var _bin5 = {binop: 5, beforeExpr: true}, _bin6 = {binop: 6, beforeExpr: true}; - var _bin7 = {binop: 7, beforeExpr: true}, _bin8 = {binop: 8, beforeExpr: true}; - var _bin10 = {binop: 10, beforeExpr: true}; - - // This is a trick taken from Esprima. It turns out that, on - // non-Chrome browsers, to check whether a string is in a set, a - // predicate containing a big ugly `switch` statement is faster than - // a regular expression, and on Chrome the two are about on par. - // This function uses `eval` (non-lexical) to produce such a - // predicate from a space-separated string of words. - // - // It starts by sorting the words by length. - - function makePredicate(words) { - words = words.split(" "); - var f = "", cats = []; - out: for (var i = 0; i < words.length; ++i) { - for (var j = 0; j < cats.length; ++j) - if (cats[j][0].length == words[i].length) { - cats[j].push(words[i]); - continue out; - } - cats.push([words[i]]); - } - function compareTo(arr) { - if (arr.length == 1) return f += "return str === " + JSON.stringify(arr[0]) + ";"; - f += "switch(str){"; - for (var i = 0; i < arr.length; ++i) f += "case " + JSON.stringify(arr[i]) + ":"; - f += "return true}return false;"; - } - - // When there are more than three length categories, an outer - // switch first dispatches on the lengths, to save on comparisons. - - if (cats.length > 3) { - cats.sort(function(a, b) {return b.length - a.length;}); - f += "switch(str.length){"; - for (var i = 0; i < cats.length; ++i) { - var cat = cats[i]; - f += "case " + cat[0].length + ":"; - compareTo(cat); - } - f += "}"; - - // Otherwise, simply generate a flat `switch` statement. - - } else { - compareTo(words); - } - return new Function("str", f); - } - - // The ECMAScript 3 reserved word list. - - var isReservedWord3 = makePredicate("abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile"); - - // ECMAScript 5 reserved words. - - var isReservedWord5 = makePredicate("class enum extends super const export import"); - - // The additional reserved words in strict mode. - - var isStrictReservedWord = makePredicate("implements interface let package private protected public static yield"); - - // The forbidden variable names in strict mode. - - var isStrictBadIdWord = makePredicate("eval arguments"); - - // And the keywords. - - var isKeyword = makePredicate("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"); - - // ## Character categories - - // Big ugly regular expressions that match characters in the - // whitespace, identifier, and identifier-start categories. These - // are only applied when a character is found to actually have a - // code point above 128. - - var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]/; - var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; - var nonASCIIidentifierChars = "\u0371-\u0374\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u0620-\u0649\u0672-\u06d3\u06e7-\u06e8\u06fb-\u06fc\u0730-\u074a\u0800-\u0814\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0840-\u0857\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962-\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09d7\u09df-\u09e0\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5f-\u0b60\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2-\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d46-\u0d48\u0d57\u0d62-\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e34-\u0e3a\u0e40-\u0e45\u0e50-\u0e59\u0eb4-\u0eb9\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f41-\u0f47\u0f71-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1029\u1040-\u1049\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u170e-\u1710\u1720-\u1730\u1740-\u1750\u1772\u1773\u1780-\u17b2\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1920-\u192b\u1930-\u193b\u1951-\u196d\u19b0-\u19c0\u19c8-\u19c9\u19d0-\u19d9\u1a00-\u1a15\u1a20-\u1a53\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b46-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1bb0-\u1bb9\u1be6-\u1bf3\u1c00-\u1c22\u1c40-\u1c49\u1c5b-\u1c7d\u1cd0-\u1cd2\u1d00-\u1dbe\u1e01-\u1f15\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2d81-\u2d96\u2de0-\u2dff\u3021-\u3028\u3099\u309a\ua640-\ua66d\ua674-\ua67d\ua69f\ua6f0-\ua6f1\ua7f8-\ua800\ua806\ua80b\ua823-\ua827\ua880-\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8f3-\ua8f7\ua900-\ua909\ua926-\ua92d\ua930-\ua945\ua980-\ua983\ua9b3-\ua9c0\uaa00-\uaa27\uaa40-\uaa41\uaa4c-\uaa4d\uaa50-\uaa59\uaa7b\uaae0-\uaae9\uaaf2-\uaaf3\uabc0-\uabe1\uabec\uabed\uabf0-\uabf9\ufb20-\ufb28\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; - var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); - var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); - - // Whether a single character denotes a newline. - - var newline = /[\n\r\u2028\u2029]/; - - // Matches a whole line break (where CRLF is considered a single - // line break). Used to count lines. - - var lineBreak = /\r\n|[\n\r\u2028\u2029]/g; - - // Test whether a given character code starts an identifier. - - function isIdentifierStart(code) { - if (code < 65) return code === 36; - if (code < 91) return true; - if (code < 97) return code === 95; - if (code < 123)return true; - return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); - } - - // Test whether a given character is part of an identifier. - - function isIdentifierChar(code) { - if (code < 48) return code === 36; - if (code < 58) return true; - if (code < 65) return false; - if (code < 91) return true; - if (code < 97) return code === 95; - if (code < 123)return true; - return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); - } - - // ## Tokenizer - - // These are used when `options.locations` is on, in order to track - // the current line number and start of line offset, in order to set - // `tokStartLoc` and `tokEndLoc`. - - function nextLineStart() { - lineBreak.lastIndex = tokLineStart; - var match = lineBreak.exec(input); - return match ? match.index + match[0].length : input.length + 1; - } - - function curLineLoc() { - while (tokLineStartNext <= tokPos) { - ++tokCurLine; - tokLineStart = tokLineStartNext; - tokLineStartNext = nextLineStart(); - } - return {line: tokCurLine, column: tokPos - tokLineStart}; - } - - // Reset the token state. Used at the start of a parse. - - function initTokenState() { - tokCurLine = 1; - tokPos = tokLineStart = 0; - tokLineStartNext = nextLineStart(); - tokRegexpAllowed = true; - tokComments = null; - skipSpace(); - } - - // Called at the end of every token. Sets `tokEnd`, `tokVal`, - // `tokCommentsAfter`, and `tokRegexpAllowed`, and skips the space - // after the token, so that the next one's `tokStart` will point at - // the right position. - - function finishToken(type, val) { - tokEnd = tokPos; - if (options.locations) tokEndLoc = curLineLoc(); - tokType = type; - skipSpace(); - tokVal = val; - tokCommentsAfter = tokComments; - tokRegexpAllowed = type.beforeExpr; - } - - function skipBlockComment() { - var end = input.indexOf("*/", tokPos += 2); - if (end === -1) raise(tokPos - 2, "Unterminated comment"); - if (options.trackComments) - (tokComments || (tokComments = [])).push(input.slice(tokPos, end)); - tokPos = end + 2; - } - - function skipLineComment() { - var start = tokPos; - var ch = input.charCodeAt(tokPos+=2); - while (tokPos < inputLen && ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8329) { - ++tokPos; - ch = input.charCodeAt(tokPos); - } - (tokComments || (tokComments = [])).push(input.slice(start, tokPos)); - } - - // Called at the start of the parse and after every token. Skips - // whitespace and comments, and, if `options.trackComments` is on, - // will store all skipped comments in `tokComments`. - - function skipSpace() { - tokComments = null; - while (tokPos < inputLen) { - var ch = input.charCodeAt(tokPos); - if (ch === 47) { // '/' - var next = input.charCodeAt(tokPos+1); - if (next === 42) { // '*' - skipBlockComment(); - } else if (next === 47) { // '/' - skipLineComment(); - } else break; - } else if (ch < 14 && ch > 8) { - ++tokPos; - } else if (ch === 32 || ch === 160) { // ' ', '\xa0' - ++tokPos; - } else if (ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { - ++tokPos; - } else { - break; - } - } - } - - // ### Token reading - - // This is the function that is called to fetch the next token. It - // is somewhat obscure, because it works in character codes rather - // than characters, and because operator parsing has been inlined - // into it. - // - // All in the name of speed. - // - // The `forceRegexp` parameter is used in the one case where the - // `tokRegexpAllowed` trick does not work. See `parseStatement`. - - function readToken(forceRegexp) { - tokStart = tokPos; - if (options.locations) tokStartLoc = curLineLoc(); - tokCommentsBefore = tokComments; - if (forceRegexp) return readRegexp(); - if (tokPos >= inputLen) return finishToken(_eof); - - var code = input.charCodeAt(tokPos); - // Identifier or keyword. '\uXXXX' sequences are allowed in - // identifiers, so '\' also dispatches to that. - if (isIdentifierStart(code) || code === 92 /* '\' */) return readWord(); - var next = input.charCodeAt(tokPos+1); - - switch(code) { - // The interpretation of a dot depends on whether it is followed - // by a digit. - case 46: // '.' - if (next >= 48 && next <= 57) return readNumber(String.fromCharCode(code)); - ++tokPos; - return finishToken(_dot); - - // Punctuation tokens. - case 40: ++tokPos; return finishToken(_parenL); - case 41: ++tokPos; return finishToken(_parenR); - case 59: ++tokPos; return finishToken(_semi); - case 44: ++tokPos; return finishToken(_comma); - case 91: ++tokPos; return finishToken(_bracketL); - case 93: ++tokPos; return finishToken(_bracketR); - case 123: ++tokPos; return finishToken(_braceL); - case 125: ++tokPos; return finishToken(_braceR); - case 58: ++tokPos; return finishToken(_colon); - case 63: ++tokPos; return finishToken(_question); - - // '0x' is a hexadecimal number. - case 48: // '0' - if (next === 120 || next === 88) return readHexNumber(); - // Anything else beginning with a digit is an integer, octal - // number, or float. - case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: // 1-9 - return readNumber(String.fromCharCode(code)); - - // Quotes produce strings. - case 34: case 39: // '"', "'" - return readString(code); - - // Operators are parsed inline in tiny state machines. '=' (61) is - // often referred to. `finishOp` simply skips the amount of - // characters it is given as second argument, and returns a token - // of the type given by its first argument. - - case 47: // '/' - if (tokRegexpAllowed) {++tokPos; return readRegexp();} - if (next === 61) return finishOp(_assign, 2); - return finishOp(_slash, 1); - - case 37: case 42: // '%*' - if (next === 61) return finishOp(_assign, 2); - return finishOp(_bin10, 1); - - case 124: case 38: // '|&' - if (next === code) return finishOp(code === 124 ? _bin1 : _bin2, 2); - if (next === 61) return finishOp(_assign, 2); - return finishOp(code === 124 ? _bin3 : _bin5, 1); - - case 94: // '^' - if (next === 61) return finishOp(_assign, 2); - return finishOp(_bin4, 1); - - case 43: case 45: // '+-' - if (next === code) return finishOp(_incdec, 2); - if (next === 61) return finishOp(_assign, 2); - return finishOp(_plusmin, 1); - - case 60: case 62: // '<>' - var size = 1; - if (next === code) { - size = code === 62 && input.charCodeAt(tokPos+2) === 62 ? 3 : 2; - if (input.charCodeAt(tokPos + size) === 61) return finishOp(_assign, size + 1); - return finishOp(_bin8, size); - } - if (next === 61) - size = input.charCodeAt(tokPos+2) === 61 ? 3 : 2; - return finishOp(_bin7, size); - - case 61: case 33: // '=!' - if (next === 61) return finishOp(_bin6, input.charCodeAt(tokPos+2) === 61 ? 3 : 2); - return finishOp(code === 61 ? _eq : _prefix, 1); - - case 126: // '~' - return finishOp(_prefix, 1); - } - - // If we are here, we either found a non-ASCII identifier - // character, or something that's entirely disallowed. - var ch = String.fromCharCode(code); - if (ch === "\\" || nonASCIIidentifierStart.test(ch)) return readWord(); - raise(tokPos, "Unexpected character '" + ch + "'"); - } - - function finishOp(type, size) { - var str = input.slice(tokPos, tokPos + size); - tokPos += size; - finishToken(type, str); - } - - // Parse a regular expression. Some context-awareness is necessary, - // since a '/' inside a '[]' set does not end the expression. - - function readRegexp() { - var content = "", escaped, inClass, start = tokPos; - for (;;) { - if (tokPos >= inputLen) raise(start, "Unterminated regular expression"); - var ch = input.charAt(tokPos); - if (newline.test(ch)) raise(start, "Unterminated regular expression"); - if (!escaped) { - if (ch === "[") inClass = true; - else if (ch === "]" && inClass) inClass = false; - else if (ch === "/" && !inClass) break; - escaped = ch === "\\"; - } else escaped = false; - ++tokPos; - } - var content = input.slice(start, tokPos); - ++tokPos; - // Need to use `readWord1` because '\uXXXX' sequences are allowed - // here (don't ask). - var mods = readWord1(); - if (mods && !/^[gmsiy]*$/.test(mods)) raise(start, "Invalid regexp flag"); - return finishToken(_regexp, new RegExp(content, mods)); - } - - // Read an integer in the given radix. Return null if zero digits - // were read, the integer value otherwise. When `len` is given, this - // will return `null` unless the integer has exactly `len` digits. - - function readInt(radix, len) { - var start = tokPos, total = 0; - for (;;) { - var code = input.charCodeAt(tokPos), val; - if (code >= 97) val = code - 97 + 10; // a - else if (code >= 65) val = code - 65 + 10; // A - else if (code >= 48 && code <= 57) val = code - 48; // 0-9 - else val = Infinity; - if (val >= radix) break; - ++tokPos; - total = total * radix + val; - } - if (tokPos === start || len != null && tokPos - start !== len) return null; - - return total; - } - - function readHexNumber() { - tokPos += 2; // 0x - var val = readInt(16); - if (val == null) raise(tokStart + 2, "Expected hexadecimal number"); - if (isIdentifierStart(input.charCodeAt(tokPos))) raise(tokPos, "Identifier directly after number"); - return finishToken(_num, val); - } - - // Read an integer, octal integer, or floating-point number. - - function readNumber(ch) { - var start = tokPos, isFloat = ch === "."; - if (!isFloat && readInt(10) == null) raise(start, "Invalid number"); - if (isFloat || input.charAt(tokPos) === ".") { - var next = input.charAt(++tokPos); - if (next === "-" || next === "+") ++tokPos; - if (readInt(10) === null && ch === ".") raise(start, "Invalid number"); - isFloat = true; - } - if (/e/i.test(input.charAt(tokPos))) { - var next = input.charAt(++tokPos); - if (next === "-" || next === "+") ++tokPos; - if (readInt(10) === null) raise(start, "Invalid number") - isFloat = true; - } - if (isIdentifierStart(input.charCodeAt(tokPos))) raise(tokPos, "Identifier directly after number"); - - var str = input.slice(start, tokPos), val; - if (isFloat) val = parseFloat(str); - else if (ch !== "0" || str.length === 1) val = parseInt(str, 10); - else if (/[89]/.test(str) || strict) raise(start, "Invalid number"); - else val = parseInt(str, 8); - return finishToken(_num, val); - } - - // Read a string value, interpreting backslash-escapes. - - function readString(quote) { - tokPos++; - var str = []; - for (;;) { - if (tokPos >= inputLen) raise(tokStart, "Unterminated string constant"); - var ch = input.charCodeAt(tokPos); - if (ch === quote) { - ++tokPos; - return finishToken(_string, String.fromCharCode.apply(null, str)); - } - if (ch === 92) { // '\' - ch = input.charCodeAt(++tokPos); - var octal = /^[0-7]+/.exec(input.slice(tokPos, tokPos + 3)); - if (octal) octal = octal[0]; - while (octal && parseInt(octal, 8) > 255) octal = octal.slice(0, octal.length - 1); - if (octal === "0") octal = null; - ++tokPos; - if (octal) { - if (strict) raise(tokPos - 2, "Octal literal in strict mode"); - str.push(parseInt(octal, 8)); - tokPos += octal.length - 1; - } else { - switch (ch) { - case 110: str.push(10); break; // 'n' -> '\n' - case 114: str.push(13); break; // 'r' -> '\r' - case 120: str.push(readHexChar(2)); break; // 'x' - case 117: str.push(readHexChar(4)); break; // 'u' - case 85: str.push(readHexChar(8)); break; // 'U' - case 116: str.push(9); break; // 't' -> '\t' - case 98: str.push(8); break; // 'b' -> '\b' - case 118: str.push(11); break; // 'v' -> '\u000b' - case 102: str.push(12); break; // 'f' -> '\f' - case 48: str.push(0); break; // 0 -> '\0' - case 13: if (input.charCodeAt(tokPos) === 10) ++tokPos; // '\r\n' - case 10: break; // ' \n' - default: str.push(ch); break; - } - } - } else { - if (ch === 13 || ch === 10 || ch === 8232 || ch === 8329) raise(tokStart, "Unterminated string constant"); - if (ch !== 92) str.push(ch); // '\' - ++tokPos; - } - } - } - - // Used to read character escape sequences ('\x', '\u', '\U'). - - function readHexChar(len) { - var n = readInt(16, len); - if (n === null) raise(tokStart, "Bad character escape sequence"); - return n; - } - - // Used to signal to callers of `readWord1` whether the word - // contained any escape sequences. This is needed because words with - // escape sequences must not be interpreted as keywords. - - var containsEsc; - - // Read an identifier, and return it as a string. Sets `containsEsc` - // to whether the word contained a '\u' escape. - // - // Only builds up the word character-by-character when it actually - // containeds an escape, as a micro-optimization. - - function readWord1() { - containsEsc = false; - var word, first = true, start = tokPos; - for (;;) { - var ch = input.charCodeAt(tokPos); - if (isIdentifierChar(ch)) { - if (containsEsc) word += input.charAt(tokPos); - ++tokPos; - } else if (ch === 92) { // "\" - if (!containsEsc) word = input.slice(start, tokPos); - containsEsc = true; - if (input.charCodeAt(++tokPos) != 117) // "u" - raise(tokPos, "Expecting Unicode escape sequence \\uXXXX"); - ++tokPos; - var esc = readHexChar(4); - var escStr = String.fromCharCode(esc); - if (!escStr) raise(tokPos - 1, "Invalid Unicode escape"); - if (!(first ? isIdentifierStart(esc) : isIdentifierChar(esc))) - raise(tokPos - 4, "Invalid Unicode escape"); - word += escStr; - } else { - break; - } - first = false; - } - return containsEsc ? word : input.slice(start, tokPos); - } - - // Read an identifier or keyword token. Will check for reserved - // words when necessary. - - function readWord() { - var word = readWord1(); - var type = _name; - if (!containsEsc) { - if (isKeyword(word)) type = keywordTypes[word]; - else if (options.forbidReserved && - (options.ecmaVersion === 3 ? isReservedWord3 : isReservedWord5)(word) || - strict && isStrictReservedWord(word)) - raise(tokStart, "The keyword '" + word + "' is reserved"); - } - return finishToken(type, word); - } - - // ## Parser - - // A recursive descent parser operates by defining functions for all - // syntactic elements, and recursively calling those, each function - // advancing the input stream and returning an AST node. Precedence - // of constructs (for example, the fact that `!x[1]` means `!(x[1])` - // instead of `(!x)[1]` is handled by the fact that the parser - // function that parses unary prefix operators is called first, and - // in turn calls the function that parses `[]` subscripts — that - // way, it'll receive the node for `x[1]` already parsed, and wraps - // *that* in the unary operator node. - // - // Acorn uses an [operator precedence parser][opp] to handle binary - // operator precedence, because it is much more compact than using - // the technique outlined above, which uses different, nesting - // functions to specify precedence, for all of the ten binary - // precedence levels that JavaScript defines. - // - // [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser - - // ### Parser utilities - - // Continue to the next token. - - function next() { - lastStart = tokStart; - lastEnd = tokEnd; - lastEndLoc = tokEndLoc; - readToken(); - } - - // Enter strict mode. Re-reads the next token to please pedantic - // tests ("use strict"; 010; -- should fail). - - function setStrict(strct) { - strict = strct; - tokPos = lastEnd; - skipSpace(); - readToken(); - } - - // Start an AST node, attaching a start offset and optionally a - // `commentsBefore` property to it. - - function startNode() { - var node = {type: null, start: tokStart, end: null}; - if (options.trackComments && tokCommentsBefore) { - node.commentsBefore = tokCommentsBefore; - tokCommentsBefore = null; - } - if (options.locations) - node.loc = {start: tokStartLoc, end: null, source: sourceFile}; - if (options.ranges) - node.range = [tokStart, 0]; - return node; - } - - // Start a node whose start offset/comments information should be - // based on the start of another node. For example, a binary - // operator node is only started after its left-hand side has - // already been parsed. - - function startNodeFrom(other) { - var node = {type: null, start: other.start}; - if (other.commentsBefore) { - node.commentsBefore = other.commentsBefore; - other.commentsBefore = null; - } - if (options.locations) - node.loc = {start: other.loc.start, end: null, source: other.loc.source}; - if (options.ranges) - node.range = [other.range[0], 0]; - - return node; - } - - // Finish an AST node, adding `type`, `end`, and `commentsAfter` - // properties. - // - // We keep track of the last node that we finished, in order - // 'bubble' `commentsAfter` properties up to the biggest node. I.e. - // in '`1 + 1 // foo', the comment should be attached to the binary - // operator node, not the second literal node. - - var lastFinishedNode; - - function finishNode(node, type) { - node.type = type; - node.end = lastEnd; - if (options.trackComments) { - if (tokCommentsAfter) { - node.commentsAfter = tokCommentsAfter; - tokCommentsAfter = null; - } else if (lastFinishedNode && lastFinishedNode.end === lastEnd) { - node.commentsAfter = lastFinishedNode.commentsAfter; - lastFinishedNode.commentsAfter = null; - } - lastFinishedNode = node; - } - if (options.locations) - node.loc.end = lastEndLoc; - if (options.ranges) - node.range[1] = lastEnd; - return node; - } - - // Test whether a statement node is the string literal `"use strict"`. - - function isUseStrict(stmt) { - return options.ecmaVersion >= 5 && stmt.type === "ExpressionStatement" && - stmt.expression.type === "Literal" && stmt.expression.value === "use strict"; - } - - // Predicate that tests whether the next token is of the given - // type, and if yes, consumes it as a side effect. - - function eat(type) { - if (tokType === type) { - next(); - return true; - } - } - - // Test whether a semicolon can be inserted at the current position. - - function canInsertSemicolon() { - return !options.strictSemicolons && - (tokType === _eof || tokType === _braceR || newline.test(input.slice(lastEnd, tokStart))); - } - - // Consume a semicolon, or, failing that, see if we are allowed to - // pretend that there is a semicolon at this position. - - function semicolon() { - if (!eat(_semi) && !canInsertSemicolon()) unexpected(); - } - - // Expect a token of a given type. If found, consume it, otherwise, - // raise an unexpected token error. - - function expect(type) { - if (tokType === type) next(); - else unexpected(); - } - - // Raise an unexpected token error. - - function unexpected() { - raise(tokStart, "Unexpected token"); - } - - // Verify that a node is an lval — something that can be assigned - // to. - - function checkLVal(expr) { - if (expr.type !== "Identifier" && expr.type !== "MemberExpression") - raise(expr.start, "Assigning to rvalue"); - if (strict && expr.type === "Identifier" && isStrictBadIdWord(expr.name)) - raise(expr.start, "Assigning to " + expr.name + " in strict mode"); - } - - // ### Statement parsing - - // Parse a program. Initializes the parser, reads any number of - // statements, and wraps them in a Program node. Optionally takes a - // `program` argument. If present, the statements will be appended - // to its body instead of creating a new node. - - function parseTopLevel(program) { - initTokenState(); - lastStart = lastEnd = tokPos; - if (options.locations) lastEndLoc = curLineLoc(); - inFunction = strict = null; - labels = []; - readToken(); - - var node = program || startNode(), first = true; - if (!program) node.body = []; - while (tokType !== _eof) { - var stmt = parseStatement(); - node.body.push(stmt); - if (first && isUseStrict(stmt)) setStrict(true); - first = false; - } - return finishNode(node, "Program"); - }; - - var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"}; - - // Parse a single statement. - // - // If expecting a statement and finding a slash operator, parse a - // regular expression literal. This is to handle cases like - // `if (foo) /blah/.exec(foo);`, where looking at the previous token - // does not help. - - function parseStatement() { - if (tokType === _slash) - readToken(true); - - var starttype = tokType, node = startNode(); - - // Most types of statements are recognized by the keyword they - // start with. Many are trivial to parse, some require a bit of - // complexity. - - switch (starttype) { - case _break: case _continue: - next(); - var isBreak = starttype === _break; - if (eat(_semi) || canInsertSemicolon()) node.label = null; - else if (tokType !== _name) unexpected(); - else { - node.label = parseIdent(); - semicolon(); - } - - // Verify that there is an actual destination to break or - // continue to. - for (var i = 0; i < labels.length; ++i) { - var lab = labels[i]; - if (node.label == null || lab.name === node.label.name) { - if (lab.kind != null && (isBreak || lab.kind === "loop")) break; - if (node.label && isBreak) break; - } - } - if (i === labels.length) raise(node.start, "Unsyntactic " + starttype.keyword); - return finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); - - case _debugger: - next(); - return finishNode(node, "DebuggerStatement"); - - case _do: - next(); - labels.push(loopLabel); - node.body = parseStatement(); - labels.pop(); - expect(_while); - node.test = parseParenExpression(); - semicolon(); - return finishNode(node, "DoWhileStatement"); - - // Disambiguating between a `for` and a `for`/`in` loop is - // non-trivial. Basically, we have to parse the init `var` - // statement or expression, disallowing the `in` operator (see - // the second parameter to `parseExpression`), and then check - // whether the next token is `in`. When there is no init part - // (semicolon immediately after the opening parenthesis), it is - // a regular `for` loop. - - case _for: - next(); - labels.push(loopLabel); - expect(_parenL); - if (tokType === _semi) return parseFor(node, null); - if (tokType === _var) { - var init = startNode(); - next(); - parseVar(init, true); - if (init.declarations.length === 1 && eat(_in)) - return parseForIn(node, init); - return parseFor(node, init); - } - var init = parseExpression(false, true); - if (eat(_in)) {checkLVal(init); return parseForIn(node, init);} - return parseFor(node, init); - - case _function: - next(); - return parseFunction(node, true); - - case _if: - next(); - node.test = parseParenExpression(); - node.consequent = parseStatement(); - node.alternate = eat(_else) ? parseStatement() : null; - return finishNode(node, "IfStatement"); - - case _return: - if (!inFunction) raise(tokStart, "'return' outside of function"); - next(); - - // In `return` (and `break`/`continue`), the keywords with - // optional arguments, we eagerly look for a semicolon or the - // possibility to insert one. - - if (eat(_semi) || canInsertSemicolon()) node.argument = null; - else { node.argument = parseExpression(); semicolon(); } - return finishNode(node, "ReturnStatement"); - - case _switch: - next(); - node.discriminant = parseParenExpression(); - node.cases = []; - expect(_braceL); - labels.push(switchLabel); - - // Statements under must be grouped (by label) in SwitchCase - // nodes. `cur` is used to keep the node that we are currently - // adding statements to. - - for (var cur, sawDefault; tokType != _braceR;) { - if (tokType === _case || tokType === _default) { - var isCase = tokType === _case; - if (cur) finishNode(cur, "SwitchCase"); - node.cases.push(cur = startNode()); - cur.consequent = []; - next(); - if (isCase) cur.test = parseExpression(); - else { - if (sawDefault) raise(lastStart, "Multiple default clauses"); sawDefault = true; - cur.test = null; - } - expect(_colon); - } else { - if (!cur) unexpected(); - cur.consequent.push(parseStatement()); - } - } - if (cur) finishNode(cur, "SwitchCase"); - next(); // Closing brace - labels.pop(); - return finishNode(node, "SwitchStatement"); - - case _throw: - next(); - if (newline.test(input.slice(lastEnd, tokStart))) - raise(lastEnd, "Illegal newline after throw"); - node.argument = parseExpression(); - return finishNode(node, "ThrowStatement"); - - case _try: - next(); - node.block = parseBlock(); - node.handlers = []; - while (tokType === _catch) { - var clause = startNode(); - next(); - expect(_parenL); - clause.param = parseIdent(); - if (strict && isStrictBadIdWord(clause.param.name)) - raise(clause.param.start, "Binding " + clause.param.name + " in strict mode"); - expect(_parenR); - clause.guard = null; - clause.body = parseBlock(); - node.handlers.push(finishNode(clause, "CatchClause")); - } - node.finalizer = eat(_finally) ? parseBlock() : null; - if (!node.handlers.length && !node.finalizer) - raise(node.start, "Missing catch or finally clause"); - return finishNode(node, "TryStatement"); - - case _var: - next(); - node = parseVar(node); - semicolon(); - return node; - - case _while: - next(); - node.test = parseParenExpression(); - labels.push(loopLabel); - node.body = parseStatement(); - labels.pop(); - return finishNode(node, "WhileStatement"); - - case _with: - if (strict) raise(tokStart, "'with' in strict mode"); - next(); - node.object = parseParenExpression(); - node.body = parseStatement(); - return finishNode(node, "WithStatement"); - - case _braceL: - return parseBlock(); - - case _semi: - next(); - return finishNode(node, "EmptyStatement"); - - // If the statement does not start with a statement keyword or a - // brace, it's an ExpressionStatement or LabeledStatement. We - // simply start parsing an expression, and afterwards, if the - // next token is a colon and the expression was a simple - // Identifier node, we switch to interpreting it as a label. - - default: - var maybeName = tokVal, expr = parseExpression(); - if (starttype === _name && expr.type === "Identifier" && eat(_colon)) { - for (var i = 0; i < labels.length; ++i) - if (labels[i].name === maybeName) raise(expr.start, "Label '" + maybeName + "' is already declared"); - var kind = tokType.isLoop ? "loop" : tokType === _switch ? "switch" : null; - labels.push({name: maybeName, kind: kind}); - node.body = parseStatement(); - node.label = expr; - return finishNode(node, "LabeledStatement"); - } else { - node.expression = expr; - semicolon(); - return finishNode(node, "ExpressionStatement"); - } - } - } - - // Used for constructs like `switch` and `if` that insist on - // parentheses around their expression. - - function parseParenExpression() { - expect(_parenL); - var val = parseExpression(); - expect(_parenR); - return val; - } - - // Parse a semicolon-enclosed block of statements, handling `"use - // strict"` declarations when `allowStrict` is true (used for - // function bodies). - - function parseBlock(allowStrict) { - var node = startNode(), first = true, strict = false, oldStrict; - node.body = []; - expect(_braceL); - while (!eat(_braceR)) { - var stmt = parseStatement(); - node.body.push(stmt); - if (first && isUseStrict(stmt)) { - oldStrict = strict; - setStrict(strict = true); - } - first = false - } - if (strict && !oldStrict) setStrict(false); - return finishNode(node, "BlockStatement"); - } - - // Parse a regular `for` loop. The disambiguation code in - // `parseStatement` will already have parsed the init statement or - // expression. - - function parseFor(node, init) { - node.init = init; - expect(_semi); - node.test = tokType === _semi ? null : parseExpression(); - expect(_semi); - node.update = tokType === _parenR ? null : parseExpression(); - expect(_parenR); - node.body = parseStatement(); - labels.pop(); - return finishNode(node, "ForStatement"); - } - - // Parse a `for`/`in` loop. - - function parseForIn(node, init) { - node.left = init; - node.right = parseExpression(); - expect(_parenR); - node.body = parseStatement(); - labels.pop(); - return finishNode(node, "ForInStatement"); - } - - // Parse a list of variable declarations. - - function parseVar(node, noIn) { - node.declarations = []; - node.kind = "var"; - for (;;) { - var decl = startNode(); - decl.id = parseIdent(); - if (strict && isStrictBadIdWord(decl.id.name)) - raise(decl.id.start, "Binding " + decl.id.name + " in strict mode"); - decl.init = eat(_eq) ? parseExpression(true, noIn) : null; - node.declarations.push(finishNode(decl, "VariableDeclarator")); - if (!eat(_comma)) break; - } - return finishNode(node, "VariableDeclaration"); - } - - // ### Expression parsing - - // These nest, from the most general expression type at the top to - // 'atomic', nondivisible expression types at the bottom. Most of - // the functions will simply let the function(s) below them parse, - // and, *if* the syntactic construct they handle is present, wrap - // the AST node that the inner parser gave them in another node. - - // Parse a full expression. The arguments are used to forbid comma - // sequences (in argument lists, array literals, or object literals) - // or the `in` operator (in for loops initalization expressions). - - function parseExpression(noComma, noIn) { - var expr = parseMaybeAssign(noIn); - if (!noComma && tokType === _comma) { - var node = startNodeFrom(expr); - node.expressions = [expr]; - while (eat(_comma)) node.expressions.push(parseMaybeAssign(noIn)); - return finishNode(node, "SequenceExpression"); - } - return expr; - } - - // Parse an assignment expression. This includes applications of - // operators like `+=`. - - function parseMaybeAssign(noIn) { - var left = parseMaybeConditional(noIn); - if (tokType.isAssign) { - var node = startNodeFrom(left); - node.operator = tokVal; - node.left = left; - next(); - node.right = parseMaybeAssign(noIn); - checkLVal(left); - return finishNode(node, "AssignmentExpression"); - } - return left; - } - - // Parse a ternary conditional (`?:`) operator. - - function parseMaybeConditional(noIn) { - var expr = parseExprOps(noIn); - if (eat(_question)) { - var node = startNodeFrom(expr); - node.test = expr; - node.consequent = parseExpression(true); - expect(_colon); - node.alternate = parseExpression(true, noIn); - return finishNode(node, "ConditionalExpression"); - } - return expr; - } - - // Start the precedence parser. - - function parseExprOps(noIn) { - return parseExprOp(parseMaybeUnary(noIn), -1, noIn); - } - - // Parse binary operators with the operator precedence parsing - // algorithm. `left` is the left-hand side of the operator. - // `minPrec` provides context that allows the function to stop and - // defer further parser to one of its callers when it encounters an - // operator that has a lower precedence than the set it is parsing. - - function parseExprOp(left, minPrec, noIn) { - var prec = tokType.binop; - if (prec != null && (!noIn || tokType !== _in)) { - if (prec > minPrec) { - var node = startNodeFrom(left); - node.left = left; - node.operator = tokVal; - next(); - node.right = parseExprOp(parseMaybeUnary(noIn), prec, noIn); - var node = finishNode(node, /&&|\|\|/.test(node.operator) ? "LogicalExpression" : "BinaryExpression"); - return parseExprOp(node, minPrec, noIn); - } - } - return left; - } - - // Parse unary operators, both prefix and postfix. - - function parseMaybeUnary(noIn) { - if (tokType.prefix) { - var node = startNode(), update = tokType.isUpdate; - node.operator = tokVal; - node.prefix = true; - next(); - node.argument = parseMaybeUnary(noIn); - if (update) checkLVal(node.argument); - else if (strict && node.operator === "delete" && - node.argument.type === "Identifier") - raise(node.start, "Deleting local variable in strict mode"); - return finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); - } - var expr = parseExprSubscripts(); - while (tokType.postfix && !canInsertSemicolon()) { - var node = startNodeFrom(expr); - node.operator = tokVal; - node.prefix = false; - node.argument = expr; - checkLVal(expr); - next(); - expr = finishNode(node, "UpdateExpression"); - } - return expr; - } - - // Parse call, dot, and `[]`-subscript expressions. - - function parseExprSubscripts() { - return parseSubscripts(parseExprAtom()); - } - - function parseSubscripts(base, noCalls) { - if (eat(_dot)) { - var node = startNodeFrom(base); - node.object = base; - node.property = parseIdent(true); - node.computed = false; - return parseSubscripts(finishNode(node, "MemberExpression"), noCalls); - } else if (eat(_bracketL)) { - var node = startNodeFrom(base); - node.object = base; - node.property = parseExpression(); - node.computed = true; - expect(_bracketR); - return parseSubscripts(finishNode(node, "MemberExpression"), noCalls); - } else if (!noCalls && eat(_parenL)) { - var node = startNodeFrom(base); - node.callee = base; - node.arguments = parseExprList(_parenR, false); - return parseSubscripts(finishNode(node, "CallExpression"), noCalls); - } else return base; - } - - // Parse an atomic expression — either a single token that is an - // expression, an expression started by a keyword like `function` or - // `new`, or an expression wrapped in punctuation like `()`, `[]`, - // or `{}`. - - function parseExprAtom() { - switch (tokType) { - case _this: - var node = startNode(); - next(); - return finishNode(node, "ThisExpression"); - case _name: - return parseIdent(); - case _num: case _string: case _regexp: - var node = startNode(); - node.value = tokVal; - node.raw = input.slice(tokStart, tokEnd); - next(); - return finishNode(node, "Literal"); - - case _null: case _true: case _false: - var node = startNode(); - node.value = tokType.atomValue; - next(); - return finishNode(node, "Literal"); - - case _parenL: - next(); - var val = parseExpression(); - expect(_parenR); - return val; - - case _bracketL: - var node = startNode(); - next(); - node.elements = parseExprList(_bracketR, true, true); - return finishNode(node, "ArrayExpression"); - - case _braceL: - return parseObj(); - - case _function: - var node = startNode(); - next(); - return parseFunction(node, false); - - case _new: - return parseNew(); - - default: - unexpected(); - } - } - - // New's precedence is slightly tricky. It must allow its argument - // to be a `[]` or dot subscript expression, but not a call — at - // least, not without wrapping it in parentheses. Thus, it uses the - - function parseNew() { - var node = startNode(); - next(); - node.callee = parseSubscripts(parseExprAtom(false), true); - if (eat(_parenL)) node.arguments = parseExprList(_parenR, false); - else node.arguments = []; - return finishNode(node, "NewExpression"); - } - - // Parse an object literal. - - function parseObj() { - var node = startNode(), first = true, sawGetSet = false; - node.properties = []; - next(); - while (!eat(_braceR)) { - if (!first) { - expect(_comma); - if (options.allowTrailingCommas && eat(_braceR)) break; - } else first = false; - - var prop = {key: parsePropertyName()}, isGetSet = false, kind; - if (eat(_colon)) { - prop.value = parseExpression(true); - kind = prop.kind = "init"; - } else if (options.ecmaVersion >= 5 && prop.key.type === "Identifier" && - (prop.key.name === "get" || prop.key.name === "set")) { - isGetSet = sawGetSet = true; - kind = prop.kind = prop.key.name; - prop.key = parsePropertyName(); - if (!tokType === _parenL) unexpected(); - prop.value = parseFunction(startNode(), false); - } else unexpected(); - - // getters and setters are not allowed to clash — either with - // each other or with an init property — and in strict mode, - // init properties are also not allowed to be repeated. - - if (prop.key.type === "Identifier" && (strict || sawGetSet)) { - for (var i = 0; i < node.properties.length; ++i) { - var other = node.properties[i]; - if (other.key.name === prop.key.name) { - var conflict = kind == other.kind || isGetSet && other.kind === "init" || - kind === "init" && (other.kind === "get" || other.kind === "set"); - if (conflict && !strict && kind === "init" && other.kind === "init") conflict = false; - if (conflict) raise(prop.key.start, "Redefinition of property"); - } - } - } - node.properties.push(prop); - } - return finishNode(node, "ObjectExpression"); - } - - function parsePropertyName() { - if (tokType === _num || tokType === _string) return parseExprAtom(); - return parseIdent(true); - } - - // Parse a function declaration or literal (depending on the - // `isStatement` parameter). - - function parseFunction(node, isStatement) { - if (tokType === _name) node.id = parseIdent(); - else if (isStatement) unexpected(); - else node.id = null; - node.params = []; - var first = true; - expect(_parenL); - while (!eat(_parenR)) { - if (!first) expect(_comma); else first = false; - node.params.push(parseIdent()); - } - - // Start a new scope with regard to labels and the `inFunction` - // flag (restore them to their old value afterwards). - var oldInFunc = inFunction, oldLabels = labels; - inFunction = true; labels = []; - node.body = parseBlock(true); - inFunction = oldInFunc; labels = oldLabels; - - // If this is a strict mode function, verify that argument names - // are not repeated, and it does not try to bind the words `eval` - // or `arguments`. - if (strict || node.body.body.length && isUseStrict(node.body.body[0])) { - for (var i = node.id ? -1 : 0; i < node.params.length; ++i) { - var id = i < 0 ? node.id : node.params[i]; - if (isStrictReservedWord(id.name) || isStrictBadIdWord(id.name)) - raise(id.start, "Defining '" + id.name + "' in strict mode"); - if (i >= 0) for (var j = 0; j < i; ++j) if (id.name === node.params[j].name) - raise(id.start, "Argument name clash in strict mode"); - } - } - - return finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression"); - } - - // Parses a comma-separated list of expressions, and returns them as - // an array. `close` is the token type that ends the list, and - // `allowEmpty` can be turned on to allow subsequent commas with - // nothing in between them to be parsed as `null` (which is needed - // for array literals). - - function parseExprList(close, allowTrailingComma, allowEmpty) { - var elts = [], first = true; - while (!eat(close)) { - if (!first) { - expect(_comma); - if (allowTrailingComma && options.allowTrailingCommas && eat(close)) break; - } else first = false; - - if (allowEmpty && tokType === _comma) elts.push(null); - else elts.push(parseExpression(true)); - } - return elts; - } - - // Parse the next token as an identifier. If `liberal` is true (used - // when parsing properties), it will also convert keywords into - // identifiers. - - function parseIdent(liberal) { - var node = startNode(); - node.name = tokType === _name ? tokVal : (liberal && !options.forbidReserved && tokType.keyword) || unexpected(); - next(); - return finishNode(node, "Identifier"); - } - -})(typeof exports === "undefined" ? (window.acorn = {}) : exports); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/lint/lint.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/lint/lint.js deleted file mode 100644 index 01a9d01c32b558954af9f4acf627f5015725197c..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/lint/lint.js +++ /dev/null @@ -1,104 +0,0 @@ -/* - Simple linter, based on the Acorn [1] parser module - - All of the existing linters either cramp my style or have huge - dependencies (Closure). So here's a very simple, non-invasive one - that only spots - - - missing semicolons and trailing commas - - variables or properties that are reserved words - - assigning to a variable you didn't declare - - [1]: https://github.com/marijnh/acorn/ -*/ - -var fs = require("fs"), acorn = require("./acorn.js"), walk = require("./walk.js"); - -var scopePasser = walk.make({ - ScopeBody: function(node, prev, c) { c(node, node.scope); } -}); - -function checkFile(fileName) { - var file = fs.readFileSync(fileName, "utf8"); - var badChar = file.match(/[\x00-\x08\x0b\x0c\x0e-\x19\uFEFF]/); - if (badChar) - fail("Undesirable character " + badChar[0].charCodeAt(0) + " at position " + badChar.index, - {source: fileName}); - - try { - var parsed = acorn.parse(file, { - locations: true, - ecmaVersion: 3, - strictSemicolons: true, - forbidReserved: true, - sourceFile: fileName - }); - } catch (e) { - fail(e.message, {source: fileName}); - return; - } - - var scopes = []; - - walk.simple(parsed, { - ScopeBody: function(node, scope) { - node.scope = scope; - scopes.push(scope); - } - }, walk.scopeVisitor, {vars: Object.create(null)}); - - var ignoredGlobals = Object.create(null); - - function inScope(name, scope) { - for (var cur = scope; cur; cur = cur.prev) - if (name in cur.vars) return true; - } - function checkLHS(node, scope) { - if (node.type == "Identifier" && !(node.name in ignoredGlobals) && - !inScope(node.name, scope)) { - ignoredGlobals[node.name] = true; - fail("Assignment to global variable", node.loc); - } - } - - walk.simple(parsed, { - UpdateExpression: function(node, scope) {checkLHS(node.argument, scope);}, - AssignmentExpression: function(node, scope) {checkLHS(node.left, scope);}, - Identifier: function(node, scope) { - // Mark used identifiers - for (var cur = scope; cur; cur = cur.prev) - if (node.name in cur.vars) { - cur.vars[node.name].used = true; - return; - } - } - }, scopePasser); - - for (var i = 0; i < scopes.length; ++i) { - var scope = scopes[i]; - for (var name in scope.vars) { - var info = scope.vars[name]; - if (!info.used && info.type != "catch clause" && info.type != "function name" && name.charAt(0) != "_") - fail("Unused " + info.type + " " + name, info.node.loc); - } - } -} - -var failed = false; -function fail(msg, pos) { - if (pos.start) msg += " (" + pos.start.line + ":" + pos.start.column + ")"; - console.log(pos.source.match(/[^\/]+$/)[0] + ": " + msg); - failed = true; -} - -function checkDir(dir) { - fs.readdirSync(dir).forEach(function(file) { - var fname = dir + "/" + file; - if (/\.js$/.test(file)) checkFile(fname); - else if (fs.lstatSync(fname).isDirectory()) checkDir(fname); - }); -} - -exports.checkDir = checkDir; -exports.checkFile = checkFile; -exports.success = function() { return !failed; }; diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/lint/parse-js.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/lint/parse-js.js deleted file mode 100644 index c165a273f3ee61cfb83c38cb71a987c2b0a36cdc..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/lint/parse-js.js +++ /dev/null @@ -1,1372 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - - This version is suitable for Node.js. With minimal changes (the - exports stuff) it should work on any JS platform. - - This file contains the tokenizer/parser. It is a port to JavaScript - of parse-js [1], a JavaScript parser library written in Common Lisp - by Marijn Haverbeke. Thank you Marijn! - - [1] http://marijn.haverbeke.nl/parse-js/ - - Exported functions: - - - tokenizer(code) -- returns a function. Call the returned - function to fetch the next token. - - - parse(code) -- returns an AST of the given JavaScript code. - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - <mihai.bazon@gmail.com> - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2010 (c) Mihai Bazon <mihai.bazon@gmail.com> - Based on parse-js (http://marijn.haverbeke.nl/parse-js/). - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -/* -----[ Tokenizer (constants) ]----- */ - -var KEYWORDS = array_to_hash([ - "break", - "case", - "catch", - "const", - "continue", - "debugger", - "default", - "delete", - "do", - "else", - "finally", - "for", - "function", - "if", - "in", - "instanceof", - "new", - "return", - "switch", - "throw", - "try", - "typeof", - "var", - "void", - "while", - "with" -]); - -var RESERVED_WORDS = array_to_hash([ - "abstract", - "boolean", - "byte", - "char", - "class", - "double", - "enum", - "export", - "extends", - "final", - "float", - "goto", - "implements", - "import", - "int", - "interface", - "long", - "native", - "package", - "private", - "protected", - "public", - "short", - "static", - "super", - "synchronized", - "throws", - "transient", - "volatile" -]); - -var KEYWORDS_BEFORE_EXPRESSION = array_to_hash([ - "return", - "new", - "delete", - "throw", - "else", - "case" -]); - -var KEYWORDS_ATOM = array_to_hash([ - "false", - "null", - "true", - "undefined" -]); - -var OPERATOR_CHARS = array_to_hash(characters("+-*&%=<>!?|~^")); - -var RE_HEX_NUMBER = /^0x[0-9a-f]+$/i; -var RE_OCT_NUMBER = /^0[0-7]+$/; -var RE_DEC_NUMBER = /^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i; - -var OPERATORS = array_to_hash([ - "in", - "instanceof", - "typeof", - "new", - "void", - "delete", - "++", - "--", - "+", - "-", - "!", - "~", - "&", - "|", - "^", - "*", - "/", - "%", - ">>", - "<<", - ">>>", - "<", - ">", - "<=", - ">=", - "==", - "===", - "!=", - "!==", - "?", - "=", - "+=", - "-=", - "/=", - "*=", - "%=", - ">>=", - "<<=", - ">>>=", - "|=", - "^=", - "&=", - "&&", - "||" -]); - -var WHITESPACE_CHARS = array_to_hash(characters(" \u00a0\n\r\t\f\u000b\u200b\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000")); - -var PUNC_BEFORE_EXPRESSION = array_to_hash(characters("[{(,.;:")); - -var PUNC_CHARS = array_to_hash(characters("[]{}(),;:")); - -var REGEXP_MODIFIERS = array_to_hash(characters("gmsiy")); - -/* -----[ Tokenizer ]----- */ - -var UNICODE = { // Unicode 6.1 - letter: new RegExp("[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F0\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"), - combining_mark: new RegExp("[\\u0300-\\u036F\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08E4-\\u08FE\\u0900-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C01-\\u0C03\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C82\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0D02\\u0D03\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F\\u109A-\\u109D\\u135D-\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u19B0-\\u19C0\\u19C8\\u19C9\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1DC0-\\u1DE6\\u1DFC-\\u1DFF\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F\\uA674-\\uA67D\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7B\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE26]"), - connector_punctuation: new RegExp("[\\u005F\\u203F\\u2040\\u2054\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF3F]"), - digit: new RegExp("[\\u0030-\\u0039\\u0660-\\u0669\\u06F0-\\u06F9\\u07C0-\\u07C9\\u0966-\\u096F\\u09E6-\\u09EF\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0BE6-\\u0BEF\\u0C66-\\u0C6F\\u0CE6-\\u0CEF\\u0D66-\\u0D6F\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F29\\u1040-\\u1049\\u1090-\\u1099\\u17E0-\\u17E9\\u1810-\\u1819\\u1946-\\u194F\\u19D0-\\u19D9\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1B50-\\u1B59\\u1BB0-\\u1BB9\\u1C40-\\u1C49\\u1C50-\\u1C59\\uA620-\\uA629\\uA8D0-\\uA8D9\\uA900-\\uA909\\uA9D0-\\uA9D9\\uAA50-\\uAA59\\uABF0-\\uABF9\\uFF10-\\uFF19]") -}; - -function is_letter(ch) { - return UNICODE.letter.test(ch); -}; - -function is_digit(ch) { - ch = ch.charCodeAt(0); - return ch >= 48 && ch <= 57; -}; - -function is_unicode_digit(ch) { - return UNICODE.digit.test(ch); -} - -function is_alphanumeric_char(ch) { - return is_digit(ch) || is_letter(ch); -}; - -function is_unicode_combining_mark(ch) { - return UNICODE.combining_mark.test(ch); -}; - -function is_unicode_connector_punctuation(ch) { - return UNICODE.connector_punctuation.test(ch); -}; - -function is_identifier_start(ch) { - return ch == "$" || ch == "_" || is_letter(ch); -}; - -function is_identifier_char(ch) { - return is_identifier_start(ch) - || is_unicode_combining_mark(ch) - || is_unicode_digit(ch) - || is_unicode_connector_punctuation(ch) - || ch == "\u200c" // zero-width non-joiner <ZWNJ> - || ch == "\u200d" // zero-width joiner <ZWJ> (in my ECMA-262 PDF, this is also 200c) - ; -}; - -function parse_js_number(num) { - if (RE_HEX_NUMBER.test(num)) { - return parseInt(num.substr(2), 16); - } else if (RE_OCT_NUMBER.test(num)) { - return parseInt(num.substr(1), 8); - } else if (RE_DEC_NUMBER.test(num)) { - return parseFloat(num); - } -}; - -function JS_Parse_Error(message, line, col, pos) { - this.message = message; - this.line = line + 1; - this.col = col + 1; - this.pos = pos + 1; - this.stack = new Error().stack; -}; - -JS_Parse_Error.prototype.toString = function() { - return this.message + " (line: " + this.line + ", col: " + this.col + ", pos: " + this.pos + ")" + "\n\n" + this.stack; -}; - -function js_error(message, line, col, pos) { - throw new JS_Parse_Error(message, line, col, pos); -}; - -function is_token(token, type, val) { - return token.type == type && (val == null || token.value == val); -}; - -var EX_EOF = {}; - -function tokenizer($TEXT) { - - var S = { - text : $TEXT.replace(/\r\n?|[\n\u2028\u2029]/g, "\n").replace(/^\uFEFF/, ''), - pos : 0, - tokpos : 0, - line : 0, - tokline : 0, - col : 0, - tokcol : 0, - newline_before : false, - regex_allowed : false, - comments_before : [] - }; - - function peek() { return S.text.charAt(S.pos); }; - - function next(signal_eof, in_string) { - var ch = S.text.charAt(S.pos++); - if (signal_eof && !ch) - throw EX_EOF; - if (ch == "\n") { - S.newline_before = S.newline_before || !in_string; - ++S.line; - S.col = 0; - } else { - ++S.col; - } - return ch; - }; - - function eof() { - return !S.peek(); - }; - - function find(what, signal_eof) { - var pos = S.text.indexOf(what, S.pos); - if (signal_eof && pos == -1) throw EX_EOF; - return pos; - }; - - function start_token() { - S.tokline = S.line; - S.tokcol = S.col; - S.tokpos = S.pos; - }; - - function token(type, value, is_comment) { - S.regex_allowed = ((type == "operator" && !HOP(UNARY_POSTFIX, value)) || - (type == "keyword" && HOP(KEYWORDS_BEFORE_EXPRESSION, value)) || - (type == "punc" && HOP(PUNC_BEFORE_EXPRESSION, value))); - var ret = { - type : type, - value : value, - line : S.tokline, - col : S.tokcol, - pos : S.tokpos, - endpos : S.pos, - nlb : S.newline_before - }; - if (!is_comment) { - ret.comments_before = S.comments_before; - S.comments_before = []; - // make note of any newlines in the comments that came before - for (var i = 0, len = ret.comments_before.length; i < len; i++) { - ret.nlb = ret.nlb || ret.comments_before[i].nlb; - } - } - S.newline_before = false; - return ret; - }; - - function skip_whitespace() { - while (HOP(WHITESPACE_CHARS, peek())) - next(); - }; - - function read_while(pred) { - var ret = "", ch = peek(), i = 0; - while (ch && pred(ch, i++)) { - ret += next(); - ch = peek(); - } - return ret; - }; - - function parse_error(err) { - js_error(err, S.tokline, S.tokcol, S.tokpos); - }; - - function read_num(prefix) { - var has_e = false, after_e = false, has_x = false, has_dot = prefix == "."; - var num = read_while(function(ch, i){ - if (ch == "x" || ch == "X") { - if (has_x) return false; - return has_x = true; - } - if (!has_x && (ch == "E" || ch == "e")) { - if (has_e) return false; - return has_e = after_e = true; - } - if (ch == "-") { - if (after_e || (i == 0 && !prefix)) return true; - return false; - } - if (ch == "+") return after_e; - after_e = false; - if (ch == ".") { - if (!has_dot && !has_x && !has_e) - return has_dot = true; - return false; - } - return is_alphanumeric_char(ch); - }); - if (prefix) - num = prefix + num; - var valid = parse_js_number(num); - if (!isNaN(valid)) { - return token("num", valid); - } else { - parse_error("Invalid syntax: " + num); - } - }; - - function read_escaped_char(in_string) { - var ch = next(true, in_string); - switch (ch) { - case "n" : return "\n"; - case "r" : return "\r"; - case "t" : return "\t"; - case "b" : return "\b"; - case "v" : return "\u000b"; - case "f" : return "\f"; - case "0" : return "\0"; - case "x" : return String.fromCharCode(hex_bytes(2)); - case "u" : return String.fromCharCode(hex_bytes(4)); - case "\n": return ""; - default : return ch; - } - }; - - function hex_bytes(n) { - var num = 0; - for (; n > 0; --n) { - var digit = parseInt(next(true), 16); - if (isNaN(digit)) - parse_error("Invalid hex-character pattern in string"); - num = (num << 4) | digit; - } - return num; - }; - - function read_string() { - return with_eof_error("Unterminated string constant", function(){ - var quote = next(), ret = ""; - for (;;) { - var ch = next(true); - if (ch == "\\") { - // read OctalEscapeSequence (XXX: deprecated if "strict mode") - // https://github.com/mishoo/UglifyJS/issues/178 - var octal_len = 0, first = null; - ch = read_while(function(ch){ - if (ch >= "0" && ch <= "7") { - if (!first) { - first = ch; - return ++octal_len; - } - else if (first <= "3" && octal_len <= 2) return ++octal_len; - else if (first >= "4" && octal_len <= 1) return ++octal_len; - } - return false; - }); - if (octal_len > 0) ch = String.fromCharCode(parseInt(ch, 8)); - else ch = read_escaped_char(true); - } - else if (ch == quote) break; - ret += ch; - } - return token("string", ret); - }); - }; - - function read_line_comment() { - next(); - var i = find("\n"), ret; - if (i == -1) { - ret = S.text.substr(S.pos); - S.pos = S.text.length; - } else { - ret = S.text.substring(S.pos, i); - S.pos = i; - } - return token("comment1", ret, true); - }; - - function read_multiline_comment() { - next(); - return with_eof_error("Unterminated multiline comment", function(){ - var i = find("*/", true), - text = S.text.substring(S.pos, i); - S.pos = i + 2; - S.line += text.split("\n").length - 1; - S.newline_before = S.newline_before || text.indexOf("\n") >= 0; - - // https://github.com/mishoo/UglifyJS/issues/#issue/100 - if (/^@cc_on/i.test(text)) { - warn("WARNING: at line " + S.line); - warn("*** Found \"conditional comment\": " + text); - warn("*** UglifyJS DISCARDS ALL COMMENTS. This means your code might no longer work properly in Internet Explorer."); - } - - return token("comment2", text, true); - }); - }; - - function read_name() { - var backslash = false, name = "", ch, escaped = false, hex; - while ((ch = peek()) != null) { - if (!backslash) { - if (ch == "\\") escaped = backslash = true, next(); - else if (is_identifier_char(ch)) name += next(); - else break; - } - else { - if (ch != "u") parse_error("Expecting UnicodeEscapeSequence -- uXXXX"); - ch = read_escaped_char(); - if (!is_identifier_char(ch)) parse_error("Unicode char: " + ch.charCodeAt(0) + " is not valid in identifier"); - name += ch; - backslash = false; - } - } - if (HOP(KEYWORDS, name) && escaped) { - hex = name.charCodeAt(0).toString(16).toUpperCase(); - name = "\\u" + "0000".substr(hex.length) + hex + name.slice(1); - } - return name; - }; - - function read_regexp(regexp) { - return with_eof_error("Unterminated regular expression", function(){ - var prev_backslash = false, ch, in_class = false; - while ((ch = next(true))) if (prev_backslash) { - regexp += "\\" + ch; - prev_backslash = false; - } else if (ch == "[") { - in_class = true; - regexp += ch; - } else if (ch == "]" && in_class) { - in_class = false; - regexp += ch; - } else if (ch == "/" && !in_class) { - break; - } else if (ch == "\\") { - prev_backslash = true; - } else { - regexp += ch; - } - var mods = read_name(); - return token("regexp", [ regexp, mods ]); - }); - }; - - function read_operator(prefix) { - function grow(op) { - if (!peek()) return op; - var bigger = op + peek(); - if (HOP(OPERATORS, bigger)) { - next(); - return grow(bigger); - } else { - return op; - } - }; - return token("operator", grow(prefix || next())); - }; - - function handle_slash() { - next(); - var regex_allowed = S.regex_allowed; - switch (peek()) { - case "/": - S.comments_before.push(read_line_comment()); - S.regex_allowed = regex_allowed; - return next_token(); - case "*": - S.comments_before.push(read_multiline_comment()); - S.regex_allowed = regex_allowed; - return next_token(); - } - return S.regex_allowed ? read_regexp("") : read_operator("/"); - }; - - function handle_dot() { - next(); - return is_digit(peek()) - ? read_num(".") - : token("punc", "."); - }; - - function read_word() { - var word = read_name(); - return !HOP(KEYWORDS, word) - ? token("name", word) - : HOP(OPERATORS, word) - ? token("operator", word) - : HOP(KEYWORDS_ATOM, word) - ? token("atom", word) - : token("keyword", word); - }; - - function with_eof_error(eof_error, cont) { - try { - return cont(); - } catch(ex) { - if (ex === EX_EOF) parse_error(eof_error); - else throw ex; - } - }; - - function next_token(force_regexp) { - if (force_regexp != null) - return read_regexp(force_regexp); - skip_whitespace(); - start_token(); - var ch = peek(); - if (!ch) return token("eof"); - if (is_digit(ch)) return read_num(); - if (ch == '"' || ch == "'") return read_string(); - if (HOP(PUNC_CHARS, ch)) return token("punc", next()); - if (ch == ".") return handle_dot(); - if (ch == "/") return handle_slash(); - if (HOP(OPERATOR_CHARS, ch)) return read_operator(); - if (ch == "\\" || is_identifier_start(ch)) return read_word(); - parse_error("Unexpected character '" + ch + "'"); - }; - - next_token.context = function(nc) { - if (nc) S = nc; - return S; - }; - - return next_token; - -}; - -/* -----[ Parser (constants) ]----- */ - -var UNARY_PREFIX = array_to_hash([ - "typeof", - "void", - "delete", - "--", - "++", - "!", - "~", - "-", - "+" -]); - -var UNARY_POSTFIX = array_to_hash([ "--", "++" ]); - -var ASSIGNMENT = (function(a, ret, i){ - while (i < a.length) { - ret[a[i]] = a[i].substr(0, a[i].length - 1); - i++; - } - return ret; -})( - ["+=", "-=", "/=", "*=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&="], - { "=": true }, - 0 -); - -var PRECEDENCE = (function(a, ret){ - for (var i = 0, n = 1; i < a.length; ++i, ++n) { - var b = a[i]; - for (var j = 0; j < b.length; ++j) { - ret[b[j]] = n; - } - } - return ret; -})( - [ - ["||"], - ["&&"], - ["|"], - ["^"], - ["&"], - ["==", "===", "!=", "!=="], - ["<", ">", "<=", ">=", "in", "instanceof"], - [">>", "<<", ">>>"], - ["+", "-"], - ["*", "/", "%"] - ], - {} -); - -var STATEMENTS_WITH_LABELS = array_to_hash([ "for", "do", "while", "switch" ]); - -var ATOMIC_START_TOKEN = array_to_hash([ "atom", "num", "string", "regexp", "name" ]); - -/* -----[ Parser ]----- */ - -function NodeWithToken(str, start, end) { - this.name = str; - this.start = start; - this.end = end; -}; - -NodeWithToken.prototype.toString = function() { return this.name; }; - -function parse($TEXT, exigent_mode, embed_tokens) { - - var S = { - input : typeof $TEXT == "string" ? tokenizer($TEXT, true) : $TEXT, - token : null, - prev : null, - peeked : null, - in_function : 0, - in_directives : true, - in_loop : 0, - labels : [] - }; - - S.token = next(); - - function is(type, value) { - return is_token(S.token, type, value); - }; - - function peek() { return S.peeked || (S.peeked = S.input()); }; - - function next() { - S.prev = S.token; - if (S.peeked) { - S.token = S.peeked; - S.peeked = null; - } else { - S.token = S.input(); - } - S.in_directives = S.in_directives && ( - S.token.type == "string" || is("punc", ";") - ); - return S.token; - }; - - function prev() { - return S.prev; - }; - - function croak(msg, line, col, pos) { - var ctx = S.input.context(); - js_error(msg, - line != null ? line : ctx.tokline, - col != null ? col : ctx.tokcol, - pos != null ? pos : ctx.tokpos); - }; - - function token_error(token, msg) { - croak(msg, token.line, token.col); - }; - - function unexpected(token) { - if (token == null) - token = S.token; - token_error(token, "Unexpected token: " + token.type + " (" + token.value + ")"); - }; - - function expect_token(type, val) { - if (is(type, val)) { - return next(); - } - token_error(S.token, "Unexpected token " + S.token.type + ", expected " + type); - }; - - function expect(punc) { return expect_token("punc", punc); }; - - function can_insert_semicolon() { - return !exigent_mode && ( - S.token.nlb || is("eof") || is("punc", "}") - ); - }; - - function semicolon() { - if (is("punc", ";")) next(); - else if (!can_insert_semicolon()) unexpected(); - }; - - function as() { - return slice(arguments); - }; - - function parenthesised() { - expect("("); - var ex = expression(); - expect(")"); - return ex; - }; - - function add_tokens(str, start, end) { - return str instanceof NodeWithToken ? str : new NodeWithToken(str, start, end); - }; - - function maybe_embed_tokens(parser) { - if (embed_tokens) return function() { - var start = S.token; - var ast = parser.apply(this, arguments); - ast[0] = add_tokens(ast[0], start, prev()); - return ast; - }; - else return parser; - }; - - var statement = maybe_embed_tokens(function() { - if (is("operator", "/") || is("operator", "/=")) { - S.peeked = null; - S.token = S.input(S.token.value.substr(1)); // force regexp - } - switch (S.token.type) { - case "string": - var dir = S.in_directives, stat = simple_statement(); - if (dir && stat[1][0] == "string" && !is("punc", ",")) - return as("directive", stat[1][1]); - return stat; - case "num": - case "regexp": - case "operator": - case "atom": - return simple_statement(); - - case "name": - return is_token(peek(), "punc", ":") - ? labeled_statement(prog1(S.token.value, next, next)) - : simple_statement(); - - case "punc": - switch (S.token.value) { - case "{": - return as("block", block_()); - case "[": - case "(": - return simple_statement(); - case ";": - next(); - return as("block"); - default: - unexpected(); - } - - case "keyword": - switch (prog1(S.token.value, next)) { - case "break": - return break_cont("break"); - - case "continue": - return break_cont("continue"); - - case "debugger": - semicolon(); - return as("debugger"); - - case "do": - return (function(body){ - expect_token("keyword", "while"); - return as("do", prog1(parenthesised, semicolon), body); - })(in_loop(statement)); - - case "for": - return for_(); - - case "function": - return function_(true); - - case "if": - return if_(); - - case "return": - if (S.in_function == 0) - croak("'return' outside of function"); - return as("return", - is("punc", ";") - ? (next(), null) - : can_insert_semicolon() - ? null - : prog1(expression, semicolon)); - - case "switch": - return as("switch", parenthesised(), switch_block_()); - - case "throw": - if (S.token.nlb) - croak("Illegal newline after 'throw'"); - return as("throw", prog1(expression, semicolon)); - - case "try": - return try_(); - - case "var": - return prog1(var_, semicolon); - - case "const": - return prog1(const_, semicolon); - - case "while": - return as("while", parenthesised(), in_loop(statement)); - - case "with": - return as("with", parenthesised(), statement()); - - default: - unexpected(); - } - } - }); - - function labeled_statement(label) { - S.labels.push(label); - var start = S.token, stat = statement(); - if (exigent_mode && !HOP(STATEMENTS_WITH_LABELS, stat[0])) - unexpected(start); - S.labels.pop(); - return as("label", label, stat); - }; - - function simple_statement() { - return as("stat", prog1(expression, semicolon)); - }; - - function break_cont(type) { - var name; - if (!can_insert_semicolon()) { - name = is("name") ? S.token.value : null; - } - if (name != null) { - next(); - if (!member(name, S.labels)) - croak("Label " + name + " without matching loop or statement"); - } - else if (S.in_loop == 0) - croak(type + " not inside a loop or switch"); - semicolon(); - return as(type, name); - }; - - function for_() { - expect("("); - var init = null; - if (!is("punc", ";")) { - init = is("keyword", "var") - ? (next(), var_(true)) - : expression(true, true); - if (is("operator", "in")) { - if (init[0] == "var" && init[1].length > 1) - croak("Only one variable declaration allowed in for..in loop"); - return for_in(init); - } - } - return regular_for(init); - }; - - function regular_for(init) { - expect(";"); - var test = is("punc", ";") ? null : expression(); - expect(";"); - var step = is("punc", ")") ? null : expression(); - expect(")"); - return as("for", init, test, step, in_loop(statement)); - }; - - function for_in(init) { - var lhs = init[0] == "var" ? as("name", init[1][0]) : init; - next(); - var obj = expression(); - expect(")"); - return as("for-in", init, lhs, obj, in_loop(statement)); - }; - - var function_ = function(in_statement) { - var name = is("name") ? prog1(S.token.value, next) : null; - if (in_statement && !name) - unexpected(); - expect("("); - return as(in_statement ? "defun" : "function", - name, - // arguments - (function(first, a){ - while (!is("punc", ")")) { - if (first) first = false; else expect(","); - if (!is("name")) unexpected(); - a.push(S.token.value); - next(); - } - next(); - return a; - })(true, []), - // body - (function(){ - ++S.in_function; - var loop = S.in_loop; - S.in_directives = true; - S.in_loop = 0; - var a = block_(); - --S.in_function; - S.in_loop = loop; - return a; - })()); - }; - - function if_() { - var cond = parenthesised(), body = statement(), belse; - if (is("keyword", "else")) { - next(); - belse = statement(); - } - return as("if", cond, body, belse); - }; - - function block_() { - expect("{"); - var a = []; - while (!is("punc", "}")) { - if (is("eof")) unexpected(); - a.push(statement()); - } - next(); - return a; - }; - - var switch_block_ = curry(in_loop, function(){ - expect("{"); - var a = [], cur = null; - while (!is("punc", "}")) { - if (is("eof")) unexpected(); - if (is("keyword", "case")) { - next(); - cur = []; - a.push([ expression(), cur ]); - expect(":"); - } - else if (is("keyword", "default")) { - next(); - expect(":"); - cur = []; - a.push([ null, cur ]); - } - else { - if (!cur) unexpected(); - cur.push(statement()); - } - } - next(); - return a; - }); - - function try_() { - var body = block_(), bcatch, bfinally; - if (is("keyword", "catch")) { - next(); - expect("("); - if (!is("name")) - croak("Name expected"); - var name = S.token.value; - next(); - expect(")"); - bcatch = [ name, block_() ]; - } - if (is("keyword", "finally")) { - next(); - bfinally = block_(); - } - if (!bcatch && !bfinally) - croak("Missing catch/finally blocks"); - return as("try", body, bcatch, bfinally); - }; - - function vardefs(no_in) { - var a = []; - for (;;) { - if (!is("name")) - unexpected(); - var name = S.token.value; - next(); - if (is("operator", "=")) { - next(); - a.push([ name, expression(false, no_in) ]); - } else { - a.push([ name ]); - } - if (!is("punc", ",")) - break; - next(); - } - return a; - }; - - function var_(no_in) { - return as("var", vardefs(no_in)); - }; - - function const_() { - return as("const", vardefs()); - }; - - function new_() { - var newexp = expr_atom(false), args; - if (is("punc", "(")) { - next(); - args = expr_list(")"); - } else { - args = []; - } - return subscripts(as("new", newexp, args), true); - }; - - var expr_atom = maybe_embed_tokens(function(allow_calls) { - if (is("operator", "new")) { - next(); - return new_(); - } - if (is("punc")) { - switch (S.token.value) { - case "(": - next(); - return subscripts(prog1(expression, curry(expect, ")")), allow_calls); - case "[": - next(); - return subscripts(array_(), allow_calls); - case "{": - next(); - return subscripts(object_(), allow_calls); - } - unexpected(); - } - if (is("keyword", "function")) { - next(); - return subscripts(function_(false), allow_calls); - } - if (HOP(ATOMIC_START_TOKEN, S.token.type)) { - var atom = S.token.type == "regexp" - ? as("regexp", S.token.value[0], S.token.value[1]) - : as(S.token.type, S.token.value); - return subscripts(prog1(atom, next), allow_calls); - } - unexpected(); - }); - - function expr_list(closing, allow_trailing_comma, allow_empty) { - var first = true, a = []; - while (!is("punc", closing)) { - if (first) first = false; else expect(","); - if (allow_trailing_comma && is("punc", closing)) break; - if (is("punc", ",") && allow_empty) { - a.push([ "atom", "undefined" ]); - } else { - a.push(expression(false)); - } - } - next(); - return a; - }; - - function array_() { - return as("array", expr_list("]", !exigent_mode, true)); - }; - - function object_() { - var first = true, a = []; - while (!is("punc", "}")) { - if (first) first = false; else expect(","); - if (!exigent_mode && is("punc", "}")) - // allow trailing comma - break; - var type = S.token.type; - var name = as_property_name(); - if (type == "name" && (name == "get" || name == "set") && !is("punc", ":")) { - a.push([ as_name(), function_(false), name ]); - } else { - expect(":"); - a.push([ name, expression(false) ]); - } - // FIXME [!!] Line not in original parse-js, - // added to be able to warn about unquoted - // keyword properties - a[a.length - 1].type = type; - } - next(); - return as("object", a); - }; - - function as_property_name() { - switch (S.token.type) { - case "num": - case "string": - return prog1(S.token.value, next); - } - return as_name(); - }; - - function as_name() { - switch (S.token.type) { - case "name": - case "operator": - case "keyword": - case "atom": - return prog1(S.token.value, next); - default: - unexpected(); - } - }; - - function subscripts(expr, allow_calls) { - if (is("punc", ".")) { - next(); - return subscripts(as("dot", expr, as_name()), allow_calls); - } - if (is("punc", "[")) { - next(); - return subscripts(as("sub", expr, prog1(expression, curry(expect, "]"))), allow_calls); - } - if (allow_calls && is("punc", "(")) { - next(); - return subscripts(as("call", expr, expr_list(")")), true); - } - return expr; - }; - - function maybe_unary(allow_calls) { - if (is("operator") && HOP(UNARY_PREFIX, S.token.value)) { - return make_unary("unary-prefix", - prog1(S.token.value, next), - maybe_unary(allow_calls)); - } - var val = expr_atom(allow_calls); - while (is("operator") && HOP(UNARY_POSTFIX, S.token.value) && !S.token.nlb) { - val = make_unary("unary-postfix", S.token.value, val); - next(); - } - return val; - }; - - function make_unary(tag, op, expr) { - if ((op == "++" || op == "--") && !is_assignable(expr)) - croak("Invalid use of " + op + " operator"); - return as(tag, op, expr); - }; - - function expr_op(left, min_prec, no_in) { - var op = is("operator") ? S.token.value : null; - if (op && op == "in" && no_in) op = null; - var prec = op != null ? PRECEDENCE[op] : null; - if (prec != null && prec > min_prec) { - next(); - var right = expr_op(maybe_unary(true), prec, no_in); - return expr_op(as("binary", op, left, right), min_prec, no_in); - } - return left; - }; - - function expr_ops(no_in) { - return expr_op(maybe_unary(true), 0, no_in); - }; - - function maybe_conditional(no_in) { - var expr = expr_ops(no_in); - if (is("operator", "?")) { - next(); - var yes = expression(false); - expect(":"); - return as("conditional", expr, yes, expression(false, no_in)); - } - return expr; - }; - - function is_assignable(expr) { - if (!exigent_mode) return true; - switch (expr[0]+"") { - case "dot": - case "sub": - case "new": - case "call": - return true; - case "name": - return expr[1] != "this"; - } - }; - - function maybe_assign(no_in) { - var left = maybe_conditional(no_in), val = S.token.value; - if (is("operator") && HOP(ASSIGNMENT, val)) { - if (is_assignable(left)) { - next(); - return as("assign", ASSIGNMENT[val], left, maybe_assign(no_in)); - } - croak("Invalid assignment"); - } - return left; - }; - - var expression = maybe_embed_tokens(function(commas, no_in) { - if (arguments.length == 0) - commas = true; - var expr = maybe_assign(no_in); - if (commas && is("punc", ",")) { - next(); - return as("seq", expr, expression(true, no_in)); - } - return expr; - }); - - function in_loop(cont) { - try { - ++S.in_loop; - return cont(); - } finally { - --S.in_loop; - } - }; - - return as("toplevel", (function(a){ - while (!is("eof")) - a.push(statement()); - return a; - })([])); - -}; - -/* -----[ Utilities ]----- */ - -function curry(f) { - var args = slice(arguments, 1); - return function() { return f.apply(this, args.concat(slice(arguments))); }; -}; - -function prog1(ret) { - if (ret instanceof Function) - ret = ret(); - for (var i = 1, n = arguments.length; --n > 0; ++i) - arguments[i](); - return ret; -}; - -function array_to_hash(a) { - var ret = {}; - for (var i = 0; i < a.length; ++i) - ret[a[i]] = true; - return ret; -}; - -function slice(a, start) { - return Array.prototype.slice.call(a, start || 0); -}; - -function characters(str) { - return str.split(""); -}; - -function member(name, array) { - for (var i = array.length; --i >= 0;) - if (array[i] == name) - return true; - return false; -}; - -function HOP(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -}; - -var warn = function() {}; - -/* -----[ Exports ]----- */ - -exports.tokenizer = tokenizer; -exports.parse = parse; -exports.slice = slice; -exports.curry = curry; -exports.member = member; -exports.array_to_hash = array_to_hash; -exports.PRECEDENCE = PRECEDENCE; -exports.KEYWORDS_ATOM = KEYWORDS_ATOM; -exports.RESERVED_WORDS = RESERVED_WORDS; -exports.KEYWORDS = KEYWORDS; -exports.ATOMIC_START_TOKEN = ATOMIC_START_TOKEN; -exports.OPERATORS = OPERATORS; -exports.is_alphanumeric_char = is_alphanumeric_char; -exports.is_identifier_start = is_identifier_start; -exports.is_identifier_char = is_identifier_char; -exports.set_logger = function(logger) { - warn = logger; -}; - -// Local variables: -// js-indent-level: 8 -// End: diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/lint/walk.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/lint/walk.js deleted file mode 100644 index 97321acfc49bd3c7142e9ccdb45bbbafd5da4561..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/lint/walk.js +++ /dev/null @@ -1,216 +0,0 @@ -// AST walker module for Mozilla Parser API compatible trees - -(function(exports) { - "use strict"; - - // A simple walk is one where you simply specify callbacks to be - // called on specific nodes. The last two arguments are optional. A - // simple use would be - // - // walk.simple(myTree, { - // Expression: function(node) { ... } - // }); - // - // to do something with all expressions. All Parser API node types - // can be used to identify node types, as well as Expression, - // Statement, and ScopeBody, which denote categories of nodes. - // - // The base argument can be used to pass a custom (recursive) - // walker, and state can be used to give this walked an initial - // state. - exports.simple = function(node, visitors, base, state) { - if (!base) base = exports; - function c(node, st, override) { - var type = override || node.type, found = visitors[type]; - if (found) found(node, st); - base[type](node, st, c); - } - c(node, state); - }; - - // A recursive walk is one where your functions override the default - // walkers. They can modify and replace the state parameter that's - // threaded through the walk, and can opt how and whether to walk - // their child nodes (by calling their third argument on these - // nodes). - exports.recursive = function(node, state, funcs, base) { - var visitor = exports.make(funcs, base); - function c(node, st, override) { - visitor[override || node.type](node, st, c); - } - c(node, state); - }; - - // Used to create a custom walker. Will fill in all missing node - // type properties with the defaults. - exports.make = function(funcs, base) { - if (!base) base = exports; - var visitor = {}; - for (var type in base) - visitor[type] = funcs.hasOwnProperty(type) ? funcs[type] : base[type]; - return visitor; - }; - - function skipThrough(node, st, c) { c(node, st); } - function ignore(node, st, c) {} - - // Node walkers. - - exports.Program = exports.BlockStatement = function(node, st, c) { - for (var i = 0; i < node.body.length; ++i) - c(node.body[i], st, "Statement"); - }; - exports.Statement = skipThrough; - exports.EmptyStatement = ignore; - exports.ExpressionStatement = function(node, st, c) { - c(node.expression, st, "Expression"); - }; - exports.IfStatement = function(node, st, c) { - c(node.test, st, "Expression"); - c(node.consequent, st, "Statement"); - if (node.alternate) c(node.alternate, st, "Statement"); - }; - exports.LabeledStatement = function(node, st, c) { - c(node.body, st, "Statement"); - }; - exports.BreakStatement = exports.ContinueStatement = ignore; - exports.WithStatement = function(node, st, c) { - c(node.object, st, "Expression"); - c(node.body, st, "Statement"); - }; - exports.SwitchStatement = function(node, st, c) { - c(node.discriminant, st, "Expression"); - for (var i = 0; i < node.cases.length; ++i) { - var cs = node.cases[i]; - if (cs.test) c(cs.test, st, "Expression"); - for (var j = 0; j < cs.consequent.length; ++j) - c(cs.consequent[j], st, "Statement"); - } - }; - exports.ReturnStatement = function(node, st, c) { - if (node.argument) c(node.argument, st, "Expression"); - }; - exports.ThrowStatement = function(node, st, c) { - c(node.argument, st, "Expression"); - }; - exports.TryStatement = function(node, st, c) { - c(node.block, st, "Statement"); - for (var i = 0; i < node.handlers.length; ++i) - c(node.handlers[i].body, st, "ScopeBody"); - if (node.finalizer) c(node.finalizer, st, "Statement"); - }; - exports.WhileStatement = function(node, st, c) { - c(node.test, st, "Expression"); - c(node.body, st, "Statement"); - }; - exports.DoWhileStatement = exports.WhileStatement; - exports.ForStatement = function(node, st, c) { - if (node.init) c(node.init, st, "ForInit"); - if (node.test) c(node.test, st, "Expression"); - if (node.update) c(node.update, st, "Expression"); - c(node.body, st, "Statement"); - }; - exports.ForInStatement = function(node, st, c) { - c(node.left, st, "ForInit"); - c(node.right, st, "Expression"); - c(node.body, st, "Statement"); - }; - exports.ForInit = function(node, st, c) { - if (node.type == "VariableDeclaration") c(node, st); - else c(node, st, "Expression"); - }; - exports.DebuggerStatement = ignore; - - exports.FunctionDeclaration = function(node, st, c) { - c(node, st, "Function"); - }; - exports.VariableDeclaration = function(node, st, c) { - for (var i = 0; i < node.declarations.length; ++i) { - var decl = node.declarations[i]; - if (decl.init) c(decl.init, st, "Expression"); - } - }; - - exports.Function = function(node, st, c) { - c(node.body, st, "ScopeBody"); - }; - exports.ScopeBody = function(node, st, c) { - c(node, st, "Statement"); - }; - - exports.Expression = skipThrough; - exports.ThisExpression = ignore; - exports.ArrayExpression = function(node, st, c) { - for (var i = 0; i < node.elements.length; ++i) { - var elt = node.elements[i]; - if (elt) c(elt, st, "Expression"); - } - }; - exports.ObjectExpression = function(node, st, c) { - for (var i = 0; i < node.properties.length; ++i) - c(node.properties[i].value, st, "Expression"); - }; - exports.FunctionExpression = exports.FunctionDeclaration; - exports.SequenceExpression = function(node, st, c) { - for (var i = 0; i < node.expressions.length; ++i) - c(node.expressions[i], st, "Expression"); - }; - exports.UnaryExpression = exports.UpdateExpression = function(node, st, c) { - c(node.argument, st, "Expression"); - }; - exports.BinaryExpression = exports.AssignmentExpression = exports.LogicalExpression = function(node, st, c) { - c(node.left, st, "Expression"); - c(node.right, st, "Expression"); - }; - exports.ConditionalExpression = function(node, st, c) { - c(node.test, st, "Expression"); - c(node.consequent, st, "Expression"); - c(node.alternate, st, "Expression"); - }; - exports.NewExpression = exports.CallExpression = function(node, st, c) { - c(node.callee, st, "Expression"); - if (node.arguments) for (var i = 0; i < node.arguments.length; ++i) - c(node.arguments[i], st, "Expression"); - }; - exports.MemberExpression = function(node, st, c) { - c(node.object, st, "Expression"); - if (node.computed) c(node.property, st, "Expression"); - }; - exports.Identifier = exports.Literal = ignore; - - // A custom walker that keeps track of the scope chain and the - // variables defined in it. - function makeScope(prev) { - return {vars: Object.create(null), prev: prev}; - } - exports.scopeVisitor = exports.make({ - Function: function(node, scope, c) { - var inner = makeScope(scope); - for (var i = 0; i < node.params.length; ++i) - inner.vars[node.params[i].name] = {type: "argument", node: node.params[i]}; - if (node.id) { - var decl = node.type == "FunctionDeclaration"; - (decl ? scope : inner).vars[node.id.name] = - {type: decl ? "function" : "function name", node: node.id}; - } - c(node.body, inner, "ScopeBody"); - }, - TryStatement: function(node, scope, c) { - c(node.block, scope, "Statement"); - for (var i = 0; i < node.handlers.length; ++i) { - var handler = node.handlers[i], inner = makeScope(scope); - inner.vars[handler.param.name] = {type: "catch clause", node: handler.param}; - c(handler.body, inner, "ScopeBody"); - } - if (node.finalizer) c(node.finalizer, scope, "Statement"); - }, - VariableDeclaration: function(node, scope, c) { - for (var i = 0; i < node.declarations.length; ++i) { - var decl = node.declarations[i]; - scope.vars[decl.id.name] = {type: "var", node: decl.id}; - if (decl.init) c(decl.init, scope, "Expression"); - } - } - }); - -})(typeof exports == "undefined" ? acorn.walk = {} : exports); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/mode_test.css b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/mode_test.css deleted file mode 100644 index 1ac66737fb96a1df888ff48a49defb0a3b914a57..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/mode_test.css +++ /dev/null @@ -1,10 +0,0 @@ -.mt-output .mt-token { - border: 1px solid #ddd; - white-space: pre; - font-family: "Consolas", monospace; - text-align: center; -} - -.mt-output .mt-style { - font-size: x-small; -} diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/mode_test.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/mode_test.js deleted file mode 100644 index f2459b432e21e799bd05d8381703adc7f8b41d9d..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/mode_test.js +++ /dev/null @@ -1,192 +0,0 @@ -/** - * Helper to test CodeMirror highlighting modes. It pretty prints output of the - * highlighter and can check against expected styles. - * - * See test.html in the stex mode for examples. - */ -ModeTest = {}; - -ModeTest.modeOptions = {}; -ModeTest.modeName = CodeMirror.defaults.mode; - -/* keep track of results for printSummary */ -ModeTest.testCount = 0; -ModeTest.passes = 0; - -/** - * Run a test; prettyprints the results using document.write(). - * - * @param name Name of test - * @param text String to highlight. - * @param expected Expected styles and tokens: Array(style, token, [style, token,...]) - * @param modeName - * @param modeOptions - * @param expectedFail - */ -ModeTest.testMode = function(name, text, expected, modeName, modeOptions, expectedFail) { - ModeTest.testCount += 1; - - if (!modeName) modeName = ModeTest.modeName; - - if (!modeOptions) modeOptions = ModeTest.modeOptions; - - var mode = CodeMirror.getMode(modeOptions, modeName); - - if (expected.length < 0) { - throw "must have text for test (" + name + ")"; - } - if (expected.length % 2 != 0) { - throw "must have text for test (" + name + ") plus expected (style, token) pairs"; - } - return test( - modeName + "_" + name, - function(){ - return ModeTest.compare(text, expected, mode); - }, - expectedFail - ); - -} - -ModeTest.compare = function (text, expected, mode) { - - var expectedOutput = []; - for (var i = 0; i < expected.length; i += 2) { - var sty = expected[i]; - if (sty && sty.indexOf(" ")) sty = sty.split(' ').sort().join(' '); - expectedOutput.push(sty, expected[i + 1]); - } - - var observedOutput = ModeTest.highlight(text, mode); - - var pass, passStyle = ""; - pass = ModeTest.highlightOutputsEqual(expectedOutput, observedOutput); - passStyle = pass ? 'mt-pass' : 'mt-fail'; - ModeTest.passes += pass ? 1 : 0; - - var s = ''; - if (pass) { - s += '<div class="mt-test ' + passStyle + '">'; - s += '<pre>' + ModeTest.htmlEscape(text) + '</pre>'; - s += '<div class="cm-s-default">'; - s += ModeTest.prettyPrintOutputTable(observedOutput); - s += '</div>'; - s += '</div>'; - return s; - } else { - s += '<div class="mt-test ' + passStyle + '">'; - s += '<pre>' + ModeTest.htmlEscape(text) + '</pre>'; - s += '<div class="cm-s-default">'; - s += 'expected:'; - s += ModeTest.prettyPrintOutputTable(expectedOutput); - s += 'observed:'; - s += ModeTest.prettyPrintOutputTable(observedOutput); - s += '</div>'; - s += '</div>'; - throw s; - } -} - -/** - * Emulation of CodeMirror's internal highlight routine for testing. Multi-line - * input is supported. - * - * @param string to highlight - * - * @param mode the mode that will do the actual highlighting - * - * @return array of [style, token] pairs - */ -ModeTest.highlight = function(string, mode) { - var state = mode.startState() - - var lines = string.replace(/\r\n/g,'\n').split('\n'); - var st = [], pos = 0; - for (var i = 0; i < lines.length; ++i) { - var line = lines[i], newLine = true; - var stream = new CodeMirror.StringStream(line); - if (line == "" && mode.blankLine) mode.blankLine(state); - /* Start copied code from CodeMirror.highlight */ - while (!stream.eol()) { - var style = mode.token(stream, state), substr = stream.current(); - if (style && style.indexOf(" ") > -1) style = style.split(' ').sort().join(' '); - - stream.start = stream.pos; - if (pos && st[pos-2] == style && !newLine) { - st[pos-1] += substr; - } else if (substr) { - st[pos++] = style; st[pos++] = substr; - } - // Give up when line is ridiculously long - if (stream.pos > 5000) { - st[pos++] = null; st[pos++] = this.text.slice(stream.pos); - break; - } - newLine = false; - } - } - - return st; -} - -/** - * Compare two arrays of output from ModeTest.highlight. - * - * @param o1 array of [style, token] pairs - * - * @param o2 array of [style, token] pairs - * - * @return boolean; true iff outputs equal - */ -ModeTest.highlightOutputsEqual = function(o1, o2) { - if (o1.length != o2.length) return false; - for (var i = 0; i < o1.length; ++i) - if (o1[i] != o2[i]) return false; - return true; -} - -/** - * Print tokens and corresponding styles in a table. Spaces in the token are - * replaced with 'interpunct' dots (·). - * - * @param output array of [style, token] pairs - * - * @return html string - */ -ModeTest.prettyPrintOutputTable = function(output) { - var s = '<table class="mt-output">'; - s += '<tr>'; - for (var i = 0; i < output.length; i += 2) { - var style = output[i], val = output[i+1]; - s += - '<td class="mt-token">' + - '<span class="cm-' + String(style).replace(/ +/g, " cm-") + '">' + - ModeTest.htmlEscape(val).replace(/ /g,'·') + - '</span>' + - '</td>'; - } - s += '</tr><tr>'; - for (var i = 0; i < output.length; i += 2) { - s += '<td class="mt-style"><span>' + output[i] + '</span></td>'; - } - s += '</table>'; - return s; -} - -/** - * Print how many tests have run so far and how many of those passed. - */ -ModeTest.printSummary = function() { - ModeTest.runTests(ModeTest.displayTest); - document.write(ModeTest.passes + ' passes for ' + ModeTest.testCount + ' tests'); -} - -/** - * Basic HTML escaping. - */ -ModeTest.htmlEscape = function(str) { - str = str.toString(); - return str.replace(/[<&]/g, - function(str) {return str == "&" ? "&" : "<";}); -} - diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/phantom_driver.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/phantom_driver.js deleted file mode 100644 index dbad08db6334004729626bff6274cfa30ee798c4..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/phantom_driver.js +++ /dev/null @@ -1,31 +0,0 @@ -var page = require('webpage').create(); - -page.open("http://localhost:3000/test/index.html", function (status) { - if (status != "success") { - console.log("page couldn't be loaded successfully"); - phantom.exit(1); - } - waitFor(function () { - return page.evaluate(function () { - var output = document.getElementById('status'); - if (!output) { return false; } - return (/^(\d+ failures?|all passed)/i).test(output.innerText); - }); - }, function () { - var failed = page.evaluate(function () { return window.failed; }); - var output = page.evaluate(function () { - return document.getElementById('output').innerText + "\n" + - document.getElementById('status').innerText; - }); - console.log(output); - phantom.exit(failed > 0 ? 1 : 0); - }); -}); - -function waitFor (test, cb) { - if (test()) { - cb(); - } else { - setTimeout(function () { waitFor(test, cb); }, 250); - } -} diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/run.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/run.js deleted file mode 100644 index 8c7649a17dad40bea4f8b52912dc4430b2137227..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/run.js +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env node - -var lint = require("./lint/lint"); - -lint.checkDir("mode"); -lint.checkDir("lib"); - -var ok = lint.success(); - -var files = new (require('node-static').Server)('.'); - -var server = require('http').createServer(function (req, res) { - req.addListener('end', function () { - files.serve(req, res); - }); -}).addListener('error', function (err) { - throw err; -}).listen(3000, function () { - var child_process = require('child_process'); - child_process.exec("which phantomjs", function (err) { - if (err) { - console.error("PhantomJS is not installed. Download from http://phantomjs.org"); - process.exit(1); - } - var cmd = 'phantomjs test/phantom_driver.js'; - child_process.exec(cmd, function (err, stdout) { - server.close(); - console.log(stdout); - process.exit(err || !ok ? 1 : 0); - }); - }); -}); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/test.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/test.js deleted file mode 100644 index d42a29ddaf3a3bef6721db40cc4a9cc28551af7e..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/test.js +++ /dev/null @@ -1,1168 +0,0 @@ -function forEach(arr, f) { - for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]); -} - -function addDoc(cm, width, height) { - var content = [], line = ""; - for (var i = 0; i < width; ++i) line += "x"; - for (var i = 0; i < height; ++i) content.push(line); - cm.setValue(content.join("\n")); -} - -function byClassName(elt, cls) { - if (elt.getElementsByClassName) return elt.getElementsByClassName(cls); - var found = [], re = new RegExp("\\b" + cls + "\\b"); - function search(elt) { - if (elt.nodeType == 3) return; - if (re.test(elt.className)) found.push(elt); - for (var i = 0, e = elt.childNodes.length; i < e; ++i) - search(elt.childNodes[i]); - } - search(elt); - return found; -} - -var ie_lt8 = /MSIE [1-7]\b/.test(navigator.userAgent); -var mac = /Mac/.test(navigator.platform); -var phantom = /PhantomJS/.test(navigator.userAgent); -var opera_lt10 = /Opera\/[1-9]\./.test(navigator.userAgent); - -test("core_fromTextArea", function() { - var te = document.getElementById("code"); - te.value = "CONTENT"; - var cm = CodeMirror.fromTextArea(te); - is(!te.offsetHeight); - eq(cm.getValue(), "CONTENT"); - cm.setValue("foo\nbar"); - eq(cm.getValue(), "foo\nbar"); - cm.save(); - is(/^foo\r?\nbar$/.test(te.value)); - cm.setValue("xxx"); - cm.toTextArea(); - is(te.offsetHeight); - eq(te.value, "xxx"); -}); - -testCM("getRange", function(cm) { - eq(cm.getLine(0), "1234"); - eq(cm.getLine(1), "5678"); - eq(cm.getLine(2), null); - eq(cm.getLine(-1), null); - eq(cm.getRange({line: 0, ch: 0}, {line: 0, ch: 3}), "123"); - eq(cm.getRange({line: 0, ch: -1}, {line: 0, ch: 200}), "1234"); - eq(cm.getRange({line: 0, ch: 2}, {line: 1, ch: 2}), "34\n56"); - eq(cm.getRange({line: 1, ch: 2}, {line: 100, ch: 0}), "78"); -}, {value: "1234\n5678"}); - -testCM("replaceRange", function(cm) { - eq(cm.getValue(), ""); - cm.replaceRange("foo\n", {line: 0, ch: 0}); - eq(cm.getValue(), "foo\n"); - cm.replaceRange("a\nb", {line: 0, ch: 1}); - eq(cm.getValue(), "fa\nboo\n"); - eq(cm.lineCount(), 3); - cm.replaceRange("xyzzy", {line: 0, ch: 0}, {line: 1, ch: 1}); - eq(cm.getValue(), "xyzzyoo\n"); - cm.replaceRange("abc", {line: 0, ch: 0}, {line: 10, ch: 0}); - eq(cm.getValue(), "abc"); - eq(cm.lineCount(), 1); -}); - -testCM("selection", function(cm) { - cm.setSelection({line: 0, ch: 4}, {line: 2, ch: 2}); - is(cm.somethingSelected()); - eq(cm.getSelection(), "11\n222222\n33"); - eqPos(cm.getCursor(false), {line: 2, ch: 2}); - eqPos(cm.getCursor(true), {line: 0, ch: 4}); - cm.setSelection({line: 1, ch: 0}); - is(!cm.somethingSelected()); - eq(cm.getSelection(), ""); - eqPos(cm.getCursor(true), {line: 1, ch: 0}); - cm.replaceSelection("abc"); - eq(cm.getSelection(), "abc"); - eq(cm.getValue(), "111111\nabc222222\n333333"); - cm.replaceSelection("def", "end"); - eq(cm.getSelection(), ""); - eqPos(cm.getCursor(true), {line: 1, ch: 3}); - cm.setCursor({line: 2, ch: 1}); - eqPos(cm.getCursor(true), {line: 2, ch: 1}); - cm.setCursor(1, 2); - eqPos(cm.getCursor(true), {line: 1, ch: 2}); -}, {value: "111111\n222222\n333333"}); - -testCM("extendSelection", function(cm) { - cm.setExtending(true); - addDoc(cm, 10, 10); - cm.setSelection({line: 3, ch: 5}); - eqPos(cm.getCursor("head"), {line: 3, ch: 5}); - eqPos(cm.getCursor("anchor"), {line: 3, ch: 5}); - cm.setSelection({line: 2, ch: 5}, {line: 5, ch: 5}); - eqPos(cm.getCursor("head"), {line: 5, ch: 5}); - eqPos(cm.getCursor("anchor"), {line: 2, ch: 5}); - eqPos(cm.getCursor("start"), {line: 2, ch: 5}); - eqPos(cm.getCursor("end"), {line: 5, ch: 5}); - cm.setSelection({line: 5, ch: 5}, {line: 2, ch: 5}); - eqPos(cm.getCursor("head"), {line: 2, ch: 5}); - eqPos(cm.getCursor("anchor"), {line: 5, ch: 5}); - eqPos(cm.getCursor("start"), {line: 2, ch: 5}); - eqPos(cm.getCursor("end"), {line: 5, ch: 5}); - cm.extendSelection({line: 3, ch: 2}); - eqPos(cm.getCursor("head"), {line: 3, ch: 2}); - eqPos(cm.getCursor("anchor"), {line: 5, ch: 5}); - cm.extendSelection({line: 6, ch: 2}); - eqPos(cm.getCursor("head"), {line: 6, ch: 2}); - eqPos(cm.getCursor("anchor"), {line: 5, ch: 5}); - cm.extendSelection({line: 6, ch: 3}, {line: 6, ch: 4}); - eqPos(cm.getCursor("head"), {line: 6, ch: 4}); - eqPos(cm.getCursor("anchor"), {line: 5, ch: 5}); - cm.extendSelection({line: 0, ch: 3}, {line: 0, ch: 4}); - eqPos(cm.getCursor("head"), {line: 0, ch: 3}); - eqPos(cm.getCursor("anchor"), {line: 5, ch: 5}); - cm.extendSelection({line: 4, ch: 5}, {line: 6, ch: 5}); - eqPos(cm.getCursor("head"), {line: 6, ch: 5}); - eqPos(cm.getCursor("anchor"), {line: 4, ch: 5}); - cm.setExtending(false); - cm.extendSelection({line: 0, ch: 3}, {line: 0, ch: 4}); - eqPos(cm.getCursor("head"), {line: 0, ch: 4}); - eqPos(cm.getCursor("anchor"), {line: 0, ch: 3}); -}); - -testCM("lines", function(cm) { - eq(cm.getLine(0), "111111"); - eq(cm.getLine(1), "222222"); - eq(cm.getLine(-1), null); - cm.removeLine(1); - cm.setLine(1, "abc"); - eq(cm.getValue(), "111111\nabc"); -}, {value: "111111\n222222\n333333"}); - -testCM("indent", function(cm) { - cm.indentLine(1); - eq(cm.getLine(1), " blah();"); - cm.setOption("indentUnit", 8); - cm.indentLine(1); - eq(cm.getLine(1), "\tblah();"); - cm.setOption("indentUnit", 10); - cm.setOption("tabSize", 4); - cm.indentLine(1); - eq(cm.getLine(1), "\t\t blah();"); -}, {value: "if (x) {\nblah();\n}", indentUnit: 3, indentWithTabs: true, tabSize: 8}); - -test("core_defaults", function() { - var defsCopy = {}, defs = CodeMirror.defaults; - for (var opt in defs) defsCopy[opt] = defs[opt]; - defs.indentUnit = 5; - defs.value = "uu"; - defs.enterMode = "keep"; - defs.tabindex = 55; - var place = document.getElementById("testground"), cm = CodeMirror(place); - try { - eq(cm.getOption("indentUnit"), 5); - cm.setOption("indentUnit", 10); - eq(defs.indentUnit, 5); - eq(cm.getValue(), "uu"); - eq(cm.getOption("enterMode"), "keep"); - eq(cm.getInputField().tabIndex, 55); - } - finally { - for (var opt in defsCopy) defs[opt] = defsCopy[opt]; - place.removeChild(cm.getWrapperElement()); - } -}); - -testCM("lineInfo", function(cm) { - eq(cm.lineInfo(-1), null); - var mark = document.createElement("span"); - var lh = cm.setGutterMarker(1, "FOO", mark); - var info = cm.lineInfo(1); - eq(info.text, "222222"); - eq(info.gutterMarkers.FOO, mark); - eq(info.line, 1); - eq(cm.lineInfo(2).gutterMarkers, null); - cm.setGutterMarker(lh, "FOO", null); - eq(cm.lineInfo(1).gutterMarkers, null); - cm.setGutterMarker(1, "FOO", mark); - cm.setGutterMarker(0, "FOO", mark); - cm.clearGutter("FOO"); - eq(cm.lineInfo(0).gutterMarkers, null); - eq(cm.lineInfo(1).gutterMarkers, null); -}, {value: "111111\n222222\n333333"}); - -testCM("coords", function(cm) { - cm.setSize(null, 100); - addDoc(cm, 32, 200); - var top = cm.charCoords({line: 0, ch: 0}); - var bot = cm.charCoords({line: 200, ch: 30}); - is(top.left < bot.left); - is(top.top < bot.top); - is(top.top < top.bottom); - cm.scrollTo(null, 100); - var top2 = cm.charCoords({line: 0, ch: 0}); - is(top.top > top2.top); - eq(top.left, top2.left); -}); - -testCM("coordsChar", function(cm) { - addDoc(cm, 35, 70); - for (var ch = 0; ch <= 35; ch += 5) { - for (var line = 0; line < 70; line += 5) { - cm.setCursor(line, ch); - var coords = cm.charCoords({line: line, ch: ch}); - var pos = cm.coordsChar({left: coords.left, top: coords.top + 5}); - eqPos(pos, {line: line, ch: ch}); - } - } -}); - -testCM("posFromIndex", function(cm) { - cm.setValue( - "This function should\n" + - "convert a zero based index\n" + - "to line and ch." - ); - - var examples = [ - { index: -1, line: 0, ch: 0 }, // <- Tests clipping - { index: 0, line: 0, ch: 0 }, - { index: 10, line: 0, ch: 10 }, - { index: 39, line: 1, ch: 18 }, - { index: 55, line: 2, ch: 7 }, - { index: 63, line: 2, ch: 15 }, - { index: 64, line: 2, ch: 15 } // <- Tests clipping - ]; - - for (var i = 0; i < examples.length; i++) { - var example = examples[i]; - var pos = cm.posFromIndex(example.index); - eq(pos.line, example.line); - eq(pos.ch, example.ch); - if (example.index >= 0 && example.index < 64) - eq(cm.indexFromPos(pos), example.index); - } -}); - -testCM("undo", function(cm) { - cm.setLine(0, "def"); - eq(cm.historySize().undo, 1); - cm.undo(); - eq(cm.getValue(), "abc"); - eq(cm.historySize().undo, 0); - eq(cm.historySize().redo, 1); - cm.redo(); - eq(cm.getValue(), "def"); - eq(cm.historySize().undo, 1); - eq(cm.historySize().redo, 0); - cm.setValue("1\n\n\n2"); - cm.clearHistory(); - eq(cm.historySize().undo, 0); - for (var i = 0; i < 20; ++i) { - cm.replaceRange("a", {line: 0, ch: 0}); - cm.replaceRange("b", {line: 3, ch: 0}); - } - eq(cm.historySize().undo, 40); - for (var i = 0; i < 40; ++i) - cm.undo(); - eq(cm.historySize().redo, 40); - eq(cm.getValue(), "1\n\n\n2"); -}, {value: "abc"}); - -testCM("undoMultiLine", function(cm) { - cm.operation(function() { - cm.replaceRange("x", {line:0, ch: 0}); - cm.replaceRange("y", {line:1, ch: 0}); - }); - cm.undo(); - eq(cm.getValue(), "abc\ndef\nghi"); - cm.operation(function() { - cm.replaceRange("y", {line:1, ch: 0}); - cm.replaceRange("x", {line:0, ch: 0}); - }); - cm.undo(); - eq(cm.getValue(), "abc\ndef\nghi"); - cm.operation(function() { - cm.replaceRange("y", {line:2, ch: 0}); - cm.replaceRange("x", {line:1, ch: 0}); - cm.replaceRange("z", {line:2, ch: 0}); - }); - cm.undo(); - eq(cm.getValue(), "abc\ndef\nghi", 3); -}, {value: "abc\ndef\nghi"}); - -testCM("undoSelection", function(cm) { - cm.setSelection({line: 0, ch: 2}, {line: 0, ch: 4}); - cm.replaceSelection(""); - cm.setCursor({line: 1, ch: 0}); - cm.undo(); - eqPos(cm.getCursor(true), {line: 0, ch: 2}); - eqPos(cm.getCursor(false), {line: 0, ch: 4}); - cm.setCursor({line: 1, ch: 0}); - cm.redo(); - eqPos(cm.getCursor(true), {line: 0, ch: 2}); - eqPos(cm.getCursor(false), {line: 0, ch: 2}); -}, {value: "abcdefgh\n"}); - -testCM("markTextSingleLine", function(cm) { - forEach([{a: 0, b: 1, c: "", f: 2, t: 5}, - {a: 0, b: 4, c: "", f: 0, t: 2}, - {a: 1, b: 2, c: "x", f: 3, t: 6}, - {a: 4, b: 5, c: "", f: 3, t: 5}, - {a: 4, b: 5, c: "xx", f: 3, t: 7}, - {a: 2, b: 5, c: "", f: 2, t: 3}, - {a: 2, b: 5, c: "abcd", f: 6, t: 7}, - {a: 2, b: 6, c: "x", f: null, t: null}, - {a: 3, b: 6, c: "", f: null, t: null}, - {a: 0, b: 9, c: "hallo", f: null, t: null}, - {a: 4, b: 6, c: "x", f: 3, t: 4}, - {a: 4, b: 8, c: "", f: 3, t: 4}, - {a: 6, b: 6, c: "a", f: 3, t: 6}, - {a: 8, b: 9, c: "", f: 3, t: 6}], function(test) { - cm.setValue("1234567890"); - var r = cm.markText({line: 0, ch: 3}, {line: 0, ch: 6}, {className: "foo"}); - cm.replaceRange(test.c, {line: 0, ch: test.a}, {line: 0, ch: test.b}); - var f = r.find(); - eq(f && f.from.ch, test.f); eq(f && f.to.ch, test.t); - }); -}); - -testCM("markTextMultiLine", function(cm) { - function p(v) { return v && {line: v[0], ch: v[1]}; } - forEach([{a: [0, 0], b: [0, 5], c: "", f: [0, 0], t: [2, 5]}, - {a: [0, 0], b: [0, 5], c: "foo\n", f: [1, 0], t: [3, 5]}, - {a: [0, 1], b: [0, 10], c: "", f: [0, 1], t: [2, 5]}, - {a: [0, 5], b: [0, 6], c: "x", f: [0, 6], t: [2, 5]}, - {a: [0, 0], b: [1, 0], c: "", f: [0, 0], t: [1, 5]}, - {a: [0, 6], b: [2, 4], c: "", f: [0, 5], t: [0, 7]}, - {a: [0, 6], b: [2, 4], c: "aa", f: [0, 5], t: [0, 9]}, - {a: [1, 2], b: [1, 8], c: "", f: [0, 5], t: [2, 5]}, - {a: [0, 5], b: [2, 5], c: "xx", f: null, t: null}, - {a: [0, 0], b: [2, 10], c: "x", f: null, t: null}, - {a: [1, 5], b: [2, 5], c: "", f: [0, 5], t: [1, 5]}, - {a: [2, 0], b: [2, 3], c: "", f: [0, 5], t: [2, 2]}, - {a: [2, 5], b: [3, 0], c: "a\nb", f: [0, 5], t: [2, 5]}, - {a: [2, 3], b: [3, 0], c: "x", f: [0, 5], t: [2, 3]}, - {a: [1, 1], b: [1, 9], c: "1\n2\n3", f: [0, 5], t: [4, 5]}], function(test) { - cm.setValue("aaaaaaaaaa\nbbbbbbbbbb\ncccccccccc\ndddddddd\n"); - var r = cm.markText({line: 0, ch: 5}, {line: 2, ch: 5}, - {className: "CodeMirror-matchingbracket"}); - cm.replaceRange(test.c, p(test.a), p(test.b)); - var f = r.find(); - eqPos(f && f.from, p(test.f)); eqPos(f && f.to, p(test.t)); - }); -}); - -testCM("markTextUndo", function(cm) { - var marker1, marker2, bookmark; - marker1 = cm.markText({line: 0, ch: 1}, {line: 0, ch: 3}, - {className: "CodeMirror-matchingbracket"}); - marker2 = cm.markText({line: 0, ch: 0}, {line: 2, ch: 1}, - {className: "CodeMirror-matchingbracket"}); - bookmark = cm.setBookmark({line: 1, ch: 5}); - cm.operation(function(){ - cm.replaceRange("foo", {line: 0, ch: 2}); - cm.replaceRange("bar\baz\bug\n", {line: 2, ch: 0}, {line: 3, ch: 0}); - }); - cm.setValue(""); - eq(marker1.find(), null); eq(marker2.find(), null); eq(bookmark.find(), null); - cm.undo(); - eqPos(bookmark.find(), {line: 1, ch: 5}); - cm.undo(); - var m1Pos = marker1.find(), m2Pos = marker2.find(); - eqPos(m1Pos.from, {line: 0, ch: 1}); eqPos(m1Pos.to, {line: 0, ch: 3}); - eqPos(m2Pos.from, {line: 0, ch: 0}); eqPos(m2Pos.to, {line: 2, ch: 1}); - eqPos(bookmark.find(), {line: 1, ch: 5}); -}, {value: "1234\n56789\n00\n"}); - -testCM("markTextStayGone", function(cm) { - var m1 = cm.markText({line: 0, ch: 0}, {line: 0, ch: 1}); - cm.replaceRange("hi", {line: 0, ch: 2}); - m1.clear(); - cm.undo(); - eq(m1.find(), null); -}, {value: "hello"}); - -testCM("markClearBetween", function(cm) { - cm.setValue("aaa\nbbb\nccc\nddd\n"); - cm.markText({line: 0, ch: 0}, {line: 2}); - cm.replaceRange("aaa\nbbb\nccc", {line: 0, ch: 0}, {line: 2}); - eq(cm.findMarksAt({line: 1, ch: 1}).length, 0); -}); - -testCM("bookmark", function(cm) { - function p(v) { return v && {line: v[0], ch: v[1]}; } - forEach([{a: [1, 0], b: [1, 1], c: "", d: [1, 4]}, - {a: [1, 1], b: [1, 1], c: "xx", d: [1, 7]}, - {a: [1, 4], b: [1, 5], c: "ab", d: [1, 6]}, - {a: [1, 4], b: [1, 6], c: "", d: null}, - {a: [1, 5], b: [1, 6], c: "abc", d: [1, 5]}, - {a: [1, 6], b: [1, 8], c: "", d: [1, 5]}, - {a: [1, 4], b: [1, 4], c: "\n\n", d: [3, 1]}, - {bm: [1, 9], a: [1, 1], b: [1, 1], c: "\n", d: [2, 8]}], function(test) { - cm.setValue("1234567890\n1234567890\n1234567890"); - var b = cm.setBookmark(p(test.bm) || {line: 1, ch: 5}); - cm.replaceRange(test.c, p(test.a), p(test.b)); - eqPos(b.find(), p(test.d)); - }); -}); - -testCM("bug577", function(cm) { - cm.setValue("a\nb"); - cm.clearHistory(); - cm.setValue("fooooo"); - cm.undo(); -}); - -testCM("scrollSnap", function(cm) { - cm.setSize(100, 100); - addDoc(cm, 200, 200); - cm.setCursor({line: 100, ch: 180}); - var info = cm.getScrollInfo(); - is(info.left > 0 && info.top > 0); - cm.setCursor({line: 0, ch: 0}); - info = cm.getScrollInfo(); - is(info.left == 0 && info.top == 0, "scrolled clean to top"); - cm.setCursor({line: 100, ch: 180}); - cm.setCursor({line: 199, ch: 0}); - info = cm.getScrollInfo(); - is(info.left == 0 && info.top + 2 > info.height - cm.getScrollerElement().clientHeight, "scrolled clean to bottom"); -}); - -testCM("selectionPos", function(cm) { - cm.setSize(100, 100); - addDoc(cm, 200, 100); - cm.setSelection({line: 1, ch: 100}, {line: 98, ch: 100}); - var lineWidth = cm.charCoords({line: 0, ch: 200}, "local").left; - var lineHeight = (cm.charCoords({line: 99}).top - cm.charCoords({line: 0}).top) / 100; - cm.scrollTo(0, 0); - var selElt = byClassName(cm.getWrapperElement(), "CodeMirror-selected"); - var outer = cm.getWrapperElement().getBoundingClientRect(); - var sawMiddle, sawTop, sawBottom; - for (var i = 0, e = selElt.length; i < e; ++i) { - var box = selElt[i].getBoundingClientRect(); - var atLeft = box.left - outer.left < 30; - var width = box.right - box.left; - var atRight = box.right - outer.left > .8 * lineWidth; - if (atLeft && atRight) { - sawMiddle = true; - is(box.bottom - box.top > 90 * lineHeight, "middle high"); - is(width > .9 * lineWidth, "middle wide"); - } else { - is(width > .4 * lineWidth, "top/bot wide enough"); - is(width < .6 * lineWidth, "top/bot slim enough"); - if (atLeft) { - sawBottom = true; - is(box.top - outer.top > 96 * lineHeight, "bot below"); - } else if (atRight) { - sawTop = true; - is(box.top - outer.top < 2.1 * lineHeight, "top above"); - } - } - } - is(sawTop && sawBottom && sawMiddle, "all parts"); -}, null); - -testCM("restoreHistory", function(cm) { - cm.setValue("abc\ndef"); - cm.setLine(1, "hello"); - cm.setLine(0, "goop"); - cm.undo(); - var storedVal = cm.getValue(), storedHist = cm.getHistory(); - if (window.JSON) storedHist = JSON.parse(JSON.stringify(storedHist)); - eq(storedVal, "abc\nhello"); - cm.setValue(""); - cm.clearHistory(); - eq(cm.historySize().undo, 0); - cm.setValue(storedVal); - cm.setHistory(storedHist); - cm.redo(); - eq(cm.getValue(), "goop\nhello"); - cm.undo(); cm.undo(); - eq(cm.getValue(), "abc\ndef"); -}); - -testCM("doubleScrollbar", function(cm) { - var dummy = document.body.appendChild(document.createElement("p")); - dummy.style.cssText = "height: 50px; overflow: scroll; width: 50px"; - var scrollbarWidth = dummy.offsetWidth + 1 - dummy.clientWidth; - document.body.removeChild(dummy); - cm.setSize(null, 100); - addDoc(cm, 1, 300); - var wrap = cm.getWrapperElement(); - is(wrap.offsetWidth - byClassName(wrap, "CodeMirror-lines")[0].offsetWidth <= scrollbarWidth * 1.5); -}); - -testCM("weirdLinebreaks", function(cm) { - cm.setValue("foo\nbar\rbaz\r\nquux\n\rplop"); - is(cm.getValue(), "foo\nbar\nbaz\nquux\n\nplop"); - is(cm.lineCount(), 6); - cm.setValue("\n\n"); - is(cm.lineCount(), 3); -}); - -testCM("setSize", function(cm) { - cm.setSize(100, 100); - var wrap = cm.getWrapperElement(); - is(wrap.offsetWidth, 100); - is(wrap.offsetHeight, 100); - cm.setSize("100%", "3em"); - is(wrap.style.width, "100%"); - is(wrap.style.height, "3em"); - cm.setSize(null, 40); - is(wrap.style.width, "100%"); - is(wrap.style.height, "40px"); -}); - -function foldLines(cm, start, end, autoClear) { - return cm.markText({line: start, ch: 0}, {line: end - 1}, { - inclusiveLeft: true, - inclusiveRight: true, - collapsed: true, - clearOnEnter: autoClear - }); -} - -testCM("collapsedLines", function(cm) { - addDoc(cm, 4, 10); - var range = foldLines(cm, 4, 5), cleared = 0; - CodeMirror.on(range, "clear", function() {cleared++;}); - cm.setCursor({line: 3, ch: 0}); - CodeMirror.commands.goLineDown(cm); - eqPos(cm.getCursor(), {line: 5, ch: 0}); - cm.setLine(3, "abcdefg"); - cm.setCursor({line: 3, ch: 6}); - CodeMirror.commands.goLineDown(cm); - eqPos(cm.getCursor(), {line: 5, ch: 4}); - cm.setLine(3, "ab"); - cm.setCursor({line: 3, ch: 2}); - CodeMirror.commands.goLineDown(cm); - eqPos(cm.getCursor(), {line: 5, ch: 2}); - range.clear(); range.clear(); - eq(cleared, 1); -}); - -testCM("hiddenLinesAutoUnfold", function(cm) { - var range = foldLines(cm, 1, 3, true), cleared = 0; - CodeMirror.on(range, "clear", function() {cleared++;}); - cm.setCursor({line: 3, ch: 0}); - eq(cleared, 0); - cm.execCommand("goCharLeft"); - eq(cleared, 1); - range = foldLines(cm, 1, 3, true); - CodeMirror.on(range, "clear", function() {cleared++;}); - eqPos(cm.getCursor(), {line: 3, ch: 0}); - cm.setCursor({line: 0, ch: 3}); - cm.execCommand("goCharRight"); - eq(cleared, 2); -}, {value: "abc\ndef\nghi\njkl"}); - -testCM("hiddenLinesSelectAll", function(cm) { // Issue #484 - addDoc(cm, 4, 20); - foldLines(cm, 0, 10); - foldLines(cm, 11, 20); - CodeMirror.commands.selectAll(cm); - eqPos(cm.getCursor(true), {line: 10, ch: 0}); - eqPos(cm.getCursor(false), {line: 10, ch: 4}); -}); - - -testCM("everythingFolded", function(cm) { - addDoc(cm, 2, 2); - function enterPress() { - cm.triggerOnKeyDown({type: "keydown", keyCode: 13, preventDefault: function(){}, stopPropagation: function(){}}); - } - var fold = foldLines(cm, 0, 2); - enterPress(); - eq(cm.getValue(), "xx\nxx"); - fold.clear(); - fold = foldLines(cm, 0, 2, true); - eq(fold.find(), null); - enterPress(); - eq(cm.getValue(), "\nxx\nxx"); -}); - -testCM("structuredFold", function(cm) { - addDoc(cm, 4, 8); - var range = cm.markText({line: 1, ch: 2}, {line: 6, ch: 2}, { - replacedWith: document.createTextNode("Q") - }); - cm.setCursor(0, 3); - CodeMirror.commands.goLineDown(cm); - eqPos(cm.getCursor(), {line: 6, ch: 2}); - CodeMirror.commands.goCharLeft(cm); - eqPos(cm.getCursor(), {line: 1, ch: 2}); - CodeMirror.commands.delCharAfter(cm); - eq(cm.getValue(), "xxxx\nxxxx\nxxxx"); - addDoc(cm, 4, 8); - range = cm.markText({line: 1, ch: 2}, {line: 6, ch: 2}, { - replacedWith: document.createTextNode("x"), - clearOnEnter: true - }); - var cleared = 0; - CodeMirror.on(range, "clear", function(){++cleared;}); - cm.setCursor(0, 3); - CodeMirror.commands.goLineDown(cm); - eqPos(cm.getCursor(), {line: 6, ch: 2}); - CodeMirror.commands.goCharLeft(cm); - eqPos(cm.getCursor(), {line: 6, ch: 1}); - eq(cleared, 1); - range.clear(); - eq(cleared, 1); - range = cm.markText({line: 1, ch: 2}, {line: 6, ch: 2}, { - replacedWith: document.createTextNode("Q"), - clearOnEnter: true - }); - range.clear(); - cm.setCursor(1, 2); - CodeMirror.commands.goCharRight(cm); - eqPos(cm.getCursor(), {line: 1, ch: 3}); -}, null); - -testCM("nestedFold", function(cm) { - addDoc(cm, 10, 3); - function fold(ll, cl, lr, cr) { - return cm.markText({line: ll, ch: cl}, {line: lr, ch: cr}, {collapsed: true}); - } - var inner1 = fold(0, 6, 1, 3), inner2 = fold(0, 2, 1, 8), outer = fold(0, 1, 2, 3), inner0 = fold(0, 5, 0, 6); - cm.setCursor(0, 1); - CodeMirror.commands.goCharRight(cm); - eqPos(cm.getCursor(), {line: 2, ch: 3}); - inner0.clear(); - CodeMirror.commands.goCharLeft(cm); - eqPos(cm.getCursor(), {line: 0, ch: 1}); - outer.clear(); - CodeMirror.commands.goCharRight(cm); - eqPos(cm.getCursor(), {line: 0, ch: 2}); - CodeMirror.commands.goCharRight(cm); - eqPos(cm.getCursor(), {line: 1, ch: 8}); - inner2.clear(); - CodeMirror.commands.goCharLeft(cm); - eqPos(cm.getCursor(), {line: 1, ch: 7}); - cm.setCursor(0, 5); - CodeMirror.commands.goCharRight(cm); - eqPos(cm.getCursor(), {line: 0, ch: 6}); - CodeMirror.commands.goCharRight(cm); - eqPos(cm.getCursor(), {line: 1, ch: 3}); -}); - -testCM("badNestedFold", function(cm) { - addDoc(cm, 4, 4); - cm.markText({line: 0, ch: 2}, {line: 3, ch: 2}, {collapsed: true}); - var caught; - try {cm.markText({line: 0, ch: 1}, {line: 0, ch: 3}, {collapsed: true});} - catch(e) {caught = e;} - is(caught instanceof Error, "no error"); - is(/overlap/i.test(caught.message), "wrong error"); -}); - -testCM("inlineWidget", function(cm) { - var w = cm.setBookmark({line: 0, ch: 2}, document.createTextNode("uu")); - cm.setCursor(0, 2); - CodeMirror.commands.goLineDown(cm); - eqPos(cm.getCursor(), {line: 1, ch: 4}); - cm.setCursor(0, 2); - cm.replaceSelection("hi"); - eqPos(w.find(), {line: 0, ch: 2}); - cm.setCursor(0, 1); - cm.replaceSelection("ay"); - eqPos(w.find(), {line: 0, ch: 4}); - eq(cm.getLine(0), "uayuhiuu"); -}, {value: "uuuu\nuuuuuu"}); - -testCM("wrappingAndResizing", function(cm) { - cm.setSize(null, "auto"); - cm.setOption("lineWrapping", true); - var wrap = cm.getWrapperElement(), h0 = wrap.offsetHeight; - var doc = "xxx xxx xxx xxx xxx"; - cm.setValue(doc); - for (var step = 10, w = cm.charCoords({line: 0, ch: 18}, "div").right;; w += step) { - cm.setSize(w); - if (wrap.offsetHeight <= h0 * (opera_lt10 ? 1.2 : 1.5)) { - if (step == 10) { w -= 10; step = 1; } - else break; - } - } - // Ensure that putting the cursor at the end of the maximally long - // line doesn't cause wrapping to happen. - cm.setCursor({line: 0, ch: doc.length}); - eq(wrap.offsetHeight, h0); - cm.replaceSelection("x"); - is(wrap.offsetHeight > h0, "wrapping happens"); - // Now add a max-height and, in a document consisting of - // almost-wrapped lines, go over it so that a scrollbar appears. - cm.setValue(doc + "\n" + doc + "\n"); - cm.getScrollerElement().style.maxHeight = "100px"; - cm.replaceRange("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n!\n", {line: 2, ch: 0}); - forEach([{line: 0, ch: doc.length}, {line: 0, ch: doc.length - 1}, - {line: 0, ch: 0}, {line: 1, ch: doc.length}, {line: 1, ch: doc.length - 1}], - function(pos) { - var coords = cm.charCoords(pos); - eqPos(pos, cm.coordsChar({left: coords.left + 2, top: coords.top + 5})); - }); -}, null, ie_lt8); - -testCM("measureEndOfLine", function(cm) { - cm.setSize(null, "auto"); - var inner = byClassName(cm.getWrapperElement(), "CodeMirror-lines")[0].firstChild; - var lh = inner.offsetHeight; - for (var step = 10, w = cm.charCoords({line: 0, ch: 7}, "div").right;; w += step) { - cm.setSize(w); - if (inner.offsetHeight < 2.5 * lh) { - if (step == 10) { w -= 10; step = 1; } - else break; - } - } - cm.setValue(cm.getValue() + "\n\n"); - var endPos = cm.charCoords({line: 0, ch: 18}, "local"); - is(endPos.top > lh * .8, "not at top"); - is(endPos.left > w - 20, "not at right"); - endPos = cm.charCoords({line: 0, ch: 18}); - eqPos(cm.coordsChar({left: endPos.left, top: endPos.top + 5}), {line: 0, ch: 18}); -}, {mode: "text/html", value: "<!-- foo barrr -->", lineWrapping: true}, ie_lt8 || opera_lt10); - -testCM("scrollVerticallyAndHorizontally", function(cm) { - cm.setSize(100, 100); - addDoc(cm, 40, 40); - cm.setCursor(39); - var wrap = cm.getWrapperElement(), bar = byClassName(wrap, "CodeMirror-vscrollbar")[0]; - is(bar.offsetHeight < wrap.offsetHeight, "vertical scrollbar limited by horizontal one"); - var cursorBox = byClassName(wrap, "CodeMirror-cursor")[0].getBoundingClientRect(); - var editorBox = wrap.getBoundingClientRect(); - is(cursorBox.bottom < editorBox.top + cm.getScrollerElement().clientHeight, - "bottom line visible"); -}, {lineNumbers: true}); - -testCM("moveVstuck", function(cm) { - var lines = byClassName(cm.getWrapperElement(), "CodeMirror-lines")[0].firstChild, h0 = lines.offsetHeight; - var val = "fooooooooooooooooooooooooo baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar\n"; - cm.setValue(val); - for (var w = cm.charCoords({line: 0, ch: 26}, "div").right * 2.8;; w += 5) { - cm.setSize(w); - if (lines.offsetHeight <= 3.5 * h0) break; - } - cm.setCursor({line: 0, ch: val.length - 1}); - cm.moveV(-1, "line"); - eqPos(cm.getCursor(), {line: 0, ch: 26}); -}, {lineWrapping: true}, ie_lt8 || opera_lt10); - -testCM("clickTab", function(cm) { - var p0 = cm.charCoords({line: 0, ch: 0}); - eqPos(cm.coordsChar({left: p0.left + 5, top: p0.top + 5}), {line: 0, ch: 0}); - eqPos(cm.coordsChar({left: p0.right - 5, top: p0.top + 5}), {line: 0, ch: 1}); -}, {value: "\t\n\n", lineWrapping: true, tabSize: 8}); - -testCM("verticalScroll", function(cm) { - cm.setSize(100, 200); - cm.setValue("foo\nbar\nbaz\n"); - var sc = cm.getScrollerElement(), baseWidth = sc.scrollWidth; - cm.setLine(0, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaah"); - is(sc.scrollWidth > baseWidth, "scrollbar present"); - cm.setLine(0, "foo"); - eq(sc.scrollWidth, baseWidth, "scrollbar gone"); - cm.setLine(0, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaah"); - cm.setLine(1, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbh"); - is(sc.scrollWidth > baseWidth, "present again"); - var curWidth = sc.scrollWidth; - cm.setLine(0, "foo"); - is(sc.scrollWidth < curWidth, "scrollbar smaller"); - is(sc.scrollWidth > baseWidth, "but still present"); -}); - -testCM("extraKeys", function(cm) { - var outcome; - function fakeKey(expected, code, props) { - if (typeof code == "string") code = code.charCodeAt(0); - var e = {type: "keydown", keyCode: code, preventDefault: function(){}, stopPropagation: function(){}}; - if (props) for (var n in props) e[n] = props[n]; - outcome = null; - cm.triggerOnKeyDown(e); - eq(outcome, expected); - } - CodeMirror.commands.testCommand = function() {outcome = "tc";}; - CodeMirror.commands.goTestCommand = function() {outcome = "gtc";}; - cm.setOption("extraKeys", {"Shift-X": function() {outcome = "sx";}, - "X": function() {outcome = "x";}, - "Ctrl-Alt-U": function() {outcome = "cau";}, - "End": "testCommand", - "Home": "goTestCommand", - "Tab": false}); - fakeKey(null, "U"); - fakeKey("cau", "U", {ctrlKey: true, altKey: true}); - fakeKey(null, "U", {shiftKey: true, ctrlKey: true, altKey: true}); - fakeKey("x", "X"); - fakeKey("sx", "X", {shiftKey: true}); - fakeKey("tc", 35); - fakeKey(null, 35, {shiftKey: true}); - fakeKey("gtc", 36); - fakeKey("gtc", 36, {shiftKey: true}); - fakeKey(null, 9); -}, null, window.opera && mac); - -testCM("wordMovementCommands", function(cm) { - cm.execCommand("goWordLeft"); - eqPos(cm.getCursor(), {line: 0, ch: 0}); - cm.execCommand("goWordRight"); cm.execCommand("goWordRight"); - eqPos(cm.getCursor(), {line: 0, ch: 7}); - cm.execCommand("goWordLeft"); - eqPos(cm.getCursor(), {line: 0, ch: 5}); - cm.execCommand("goWordRight"); cm.execCommand("goWordRight"); - eqPos(cm.getCursor(), {line: 0, ch: 12}); - cm.execCommand("goWordLeft"); - eqPos(cm.getCursor(), {line: 0, ch: 9}); - cm.execCommand("goWordRight"); cm.execCommand("goWordRight"); cm.execCommand("goWordRight"); - eqPos(cm.getCursor(), {line: 1, ch: 1}); - cm.execCommand("goWordRight"); - eqPos(cm.getCursor(), {line: 1, ch: 9}); - cm.execCommand("goWordRight"); - eqPos(cm.getCursor(), {line: 1, ch: 13}); - cm.execCommand("goWordRight"); cm.execCommand("goWordRight"); - eqPos(cm.getCursor(), {line: 2, ch: 0}); -}, {value: "this is (the) firstline.\na foo12\u00e9\u00f8\u00d7bar\n"}); - -testCM("charMovementCommands", function(cm) { - cm.execCommand("goCharLeft"); cm.execCommand("goColumnLeft"); - eqPos(cm.getCursor(), {line: 0, ch: 0}); - cm.execCommand("goCharRight"); cm.execCommand("goCharRight"); - eqPos(cm.getCursor(), {line: 0, ch: 2}); - cm.setCursor({line: 1, ch: 0}); - cm.execCommand("goColumnLeft"); - eqPos(cm.getCursor(), {line: 1, ch: 0}); - cm.execCommand("goCharLeft"); - eqPos(cm.getCursor(), {line: 0, ch: 5}); - cm.execCommand("goColumnRight"); - eqPos(cm.getCursor(), {line: 0, ch: 5}); - cm.execCommand("goCharRight"); - eqPos(cm.getCursor(), {line: 1, ch: 0}); - cm.execCommand("goLineEnd"); - eqPos(cm.getCursor(), {line: 1, ch: 5}); - cm.execCommand("goLineStartSmart"); - eqPos(cm.getCursor(), {line: 1, ch: 1}); - cm.execCommand("goLineStartSmart"); - eqPos(cm.getCursor(), {line: 1, ch: 0}); - cm.setCursor({line: 2, ch: 0}); - cm.execCommand("goCharRight"); cm.execCommand("goColumnRight"); - eqPos(cm.getCursor(), {line: 2, ch: 0}); -}, {value: "line1\n ine2\n"}); - -testCM("verticalMovementCommands", function(cm) { - cm.execCommand("goLineUp"); - eqPos(cm.getCursor(), {line: 0, ch: 0}); - cm.execCommand("goLineDown"); - if (!phantom) // This fails in PhantomJS, though not in a real Webkit - eqPos(cm.getCursor(), {line: 1, ch: 0}); - cm.setCursor({line: 1, ch: 12}); - cm.execCommand("goLineDown"); - eqPos(cm.getCursor(), {line: 2, ch: 5}); - cm.execCommand("goLineDown"); - eqPos(cm.getCursor(), {line: 3, ch: 0}); - cm.execCommand("goLineUp"); - eqPos(cm.getCursor(), {line: 2, ch: 5}); - cm.execCommand("goLineUp"); - eqPos(cm.getCursor(), {line: 1, ch: 12}); - cm.execCommand("goPageDown"); - eqPos(cm.getCursor(), {line: 5, ch: 0}); - cm.execCommand("goPageDown"); cm.execCommand("goLineDown"); - eqPos(cm.getCursor(), {line: 5, ch: 0}); - cm.execCommand("goPageUp"); - eqPos(cm.getCursor(), {line: 0, ch: 0}); -}, {value: "line1\nlong long line2\nline3\n\nline5\n"}); - -testCM("verticalMovementCommandsWrapping", function(cm) { - cm.setSize(120); - cm.setCursor({line: 0, ch: 5}); - cm.execCommand("goLineDown"); - eq(cm.getCursor().line, 0); - is(cm.getCursor().ch > 5, "moved beyond wrap"); - for (var i = 0; ; ++i) { - is(i < 20, "no endless loop"); - cm.execCommand("goLineDown"); - var cur = cm.getCursor(); - if (cur.line == 1) eq(cur.ch, 5); - if (cur.line == 2) { eq(cur.ch, 1); break; } - } -}, {value: "a very long line that wraps around somehow so that we can test cursor movement\nshortone\nk", - lineWrapping: true}); - -testCM("rtlMovement", function(cm) { - forEach(["خحج", "خحabcخحج", "abخحخحجcd", "abخde", "abخح2342خ1حج", "خ1ح2خح3حxج", "خحcd", "1خحcd", "abcdeح1ج"], function(line) { - var inv = line.charAt(0) == "خ"; - cm.setValue(line + "\n"); cm.execCommand(inv ? "goLineEnd" : "goLineStart"); - var cursor = byClassName(cm.getWrapperElement(), "CodeMirror-cursor")[0]; - var prevX = cursor.offsetLeft, prevY = cursor.offsetTop; - for (var i = 0; i <= line.length; ++i) { - cm.execCommand("goCharRight"); - if (i == line.length) is(cursor.offsetTop > prevY, "next line"); - else is(cursor.offsetLeft > prevX, "moved right"); - prevX = cursor.offsetLeft; prevY = cursor.offsetTop; - } - cm.setCursor(0, 0); cm.execCommand(inv ? "goLineStart" : "goLineEnd"); - prevX = cursor.offsetLeft; - for (var i = 0; i < line.length; ++i) { - cm.execCommand("goCharLeft"); - is(cursor.offsetLeft < prevX, "moved left"); - prevX = cursor.offsetLeft; - } - }); -}); - -// Verify that updating a line clears its bidi ordering -testCM("bidiUpdate", function(cm) { - cm.setCursor({line: 0, ch: 2}); - cm.replaceSelection("خحج", "start"); - cm.execCommand("goCharRight"); - eqPos(cm.getCursor(), {line: 0, ch: 4}); -}, {value: "abcd\n"}); - -testCM("movebyTextUnit", function(cm) { - cm.setValue("בְּרֵאשִ\ńéée\n"); - cm.execCommand("goLineEnd"); - for (var i = 0; i < 4; ++i) cm.execCommand("goCharRight"); - eqPos(cm.getCursor(), {line: 0, ch: 0}); - cm.execCommand("goCharRight"); - eqPos(cm.getCursor(), {line: 1, ch: 0}); - cm.execCommand("goCharRight"); - cm.execCommand("goCharRight"); - eqPos(cm.getCursor(), {line: 1, ch: 3}); - cm.execCommand("goCharRight"); - cm.execCommand("goCharRight"); - eqPos(cm.getCursor(), {line: 1, ch: 6}); -}); - -testCM("lineChangeEvents", function(cm) { - addDoc(cm, 3, 5); - var log = [], want = ["ch 0", "ch 1", "del 2", "ch 0", "ch 0", "del 1", "del 3", "del 4"]; - for (var i = 0; i < 5; ++i) { - CodeMirror.on(cm.getLineHandle(i), "delete", function(i) { - return function() {log.push("del " + i);}; - }(i)); - CodeMirror.on(cm.getLineHandle(i), "change", function(i) { - return function() {log.push("ch " + i);}; - }(i)); - } - cm.replaceRange("x", {line: 0, ch: 1}); - cm.replaceRange("xy", {line: 1, ch: 1}, {line: 2}); - cm.replaceRange("foo\nbar", {line: 0, ch: 1}); - cm.replaceRange("", {line: 0, ch: 0}, {line: cm.lineCount()}); - eq(log.length, want.length, "same length"); - for (var i = 0; i < log.length; ++i) - eq(log[i], want[i]); -}); - -testCM("scrollEntirelyToRight", function(cm) { - addDoc(cm, 500, 2); - cm.setCursor({line: 0, ch: 500}); - var wrap = cm.getWrapperElement(), cur = byClassName(wrap, "CodeMirror-cursor")[0]; - is(wrap.getBoundingClientRect().right > cur.getBoundingClientRect().left); -}); - -testCM("lineWidgets", function(cm) { - addDoc(cm, 500, 3); - var last = cm.charCoords({line: 2, ch: 0}); - var node = document.createElement("div"); - node.innerHTML = "hi"; - var widget = cm.addLineWidget(1, node); - is(last.top < cm.charCoords({line: 2, ch: 0}).top, "took up space"); - cm.setCursor({line: 1, ch: 1}); - cm.execCommand("goLineDown"); - eqPos(cm.getCursor(), {line: 2, ch: 1}); - cm.execCommand("goLineUp"); - eqPos(cm.getCursor(), {line: 1, ch: 1}); -}); - -testCM("getLineNumber", function(cm) { - addDoc(cm, 2, 20); - var h1 = cm.getLineHandle(1); - eq(cm.getLineNumber(h1), 1); - cm.replaceRange("hi\nbye\n", {line: 0, ch: 0}); - eq(cm.getLineNumber(h1), 3); - cm.setValue(""); - eq(cm.getLineNumber(h1), null); -}); - -testCM("jumpTheGap", function(cm) { - var longLine = "abcdef ghiklmnop qrstuvw xyz "; - longLine += longLine; longLine += longLine; longLine += longLine; - cm.setLine(2, longLine); - cm.setSize("200px", null); - cm.getWrapperElement().style.lineHeight = 2; - cm.refresh(); - cm.setCursor({line: 0, ch: 1}); - cm.execCommand("goLineDown"); - eqPos(cm.getCursor(), {line: 1, ch: 1}); - cm.execCommand("goLineDown"); - eqPos(cm.getCursor(), {line: 2, ch: 1}); - cm.execCommand("goLineDown"); - eq(cm.getCursor().line, 2); - is(cm.getCursor().ch > 1); - cm.execCommand("goLineUp"); - eqPos(cm.getCursor(), {line: 2, ch: 1}); - cm.execCommand("goLineUp"); - eqPos(cm.getCursor(), {line: 1, ch: 1}); - var node = document.createElement("div"); - node.innerHTML = "hi"; node.style.height = "30px"; - cm.addLineWidget(0, node); - cm.addLineWidget(1, node.cloneNode(true), {above: true}); - cm.setCursor({line: 0, ch: 2}); - cm.execCommand("goLineDown"); - eqPos(cm.getCursor(), {line: 1, ch: 2}); - cm.execCommand("goLineUp"); - eqPos(cm.getCursor(), {line: 0, ch: 2}); -}, {lineWrapping: true, value: "abc\ndef\nghi\njkl\n"}); - -testCM("addLineClass", function(cm) { - function cls(line, text, bg, wrap) { - var i = cm.lineInfo(line); - eq(i.textClass, text); - eq(i.bgClass, bg); - eq(i.wrapClass, wrap); - } - cm.addLineClass(0, "text", "foo"); - cm.addLineClass(0, "text", "bar"); - cm.addLineClass(1, "background", "baz"); - cm.addLineClass(1, "wrap", "foo"); - cls(0, "foo bar", null, null); - cls(1, null, "baz", "foo"); - eq(byClassName(cm.getWrapperElement(), "foo").length, 2); - eq(byClassName(cm.getWrapperElement(), "bar").length, 1); - eq(byClassName(cm.getWrapperElement(), "baz").length, 1); - cm.removeLineClass(0, "text", "foo"); - cls(0, "bar", null, null); - cm.removeLineClass(0, "text", "foo"); - cls(0, "bar", null, null); - cm.removeLineClass(0, "text", "bar"); - cls(0, null, null, null); - cm.addLineClass(1, "wrap", "quux"); - cls(1, null, "baz", "foo quux"); - cm.removeLineClass(1, "wrap"); - cls(1, null, "baz", null); -}, {value: "hohoho\n"}); - -testCM("atomicMarker", function(cm) { - addDoc(cm, 10, 10); - function atom(ll, cl, lr, cr, li, ri) { - return cm.markText({line: ll, ch: cl}, {line: lr, ch: cr}, - {atomic: true, inclusiveLeft: li, inclusiveRight: ri}); - } - var m = atom(0, 1, 0, 5); - cm.setCursor({line: 0, ch: 1}); - cm.execCommand("goCharRight"); - eqPos(cm.getCursor(), {line: 0, ch: 5}); - cm.execCommand("goCharLeft"); - eqPos(cm.getCursor(), {line: 0, ch: 1}); - m.clear(); - m = atom(0, 0, 0, 5, true); - eqPos(cm.getCursor(), {line: 0, ch: 5}, "pushed out"); - cm.execCommand("goCharLeft"); - eqPos(cm.getCursor(), {line: 0, ch: 5}); - m.clear(); - m = atom(8, 4, 9, 10, false, true); - cm.setCursor({line: 9, ch: 8}); - eqPos(cm.getCursor(), {line: 8, ch: 4}, "set"); - cm.execCommand("goCharRight"); - eqPos(cm.getCursor(), {line: 8, ch: 4}, "char right"); - cm.execCommand("goLineDown"); - eqPos(cm.getCursor(), {line: 8, ch: 4}, "line down"); - cm.execCommand("goCharLeft"); - eqPos(cm.getCursor(), {line: 8, ch: 3}); - m.clear(); - m = atom(1, 1, 3, 8); - cm.setCursor({line: 2, ch: 0}); - eqPos(cm.getCursor(), {line: 3, ch: 8}); - cm.execCommand("goCharLeft"); - eqPos(cm.getCursor(), {line: 1, ch: 1}); - cm.execCommand("goCharRight"); - eqPos(cm.getCursor(), {line: 3, ch: 8}); - cm.execCommand("goLineUp"); - eqPos(cm.getCursor(), {line: 1, ch: 1}); - cm.execCommand("goLineDown"); - eqPos(cm.getCursor(), {line: 3, ch: 8}); - cm.execCommand("delCharBefore"); - eq(cm.getValue().length, 80, "del chunk"); - m = atom(3, 0, 5, 5); - cm.setCursor({line: 3, ch: 0}); - cm.execCommand("delWordAfter"); - eq(cm.getValue().length, 53, "del chunk"); -}); - -testCM("readOnlyMarker", function(cm) { - function mark(ll, cl, lr, cr, at) { - return cm.markText({line: ll, ch: cl}, {line: lr, ch: cr}, - {readOnly: true, atomic: at}); - } - var m = mark(0, 1, 0, 4); - cm.setCursor({line: 0, ch: 2}); - cm.replaceSelection("hi", "end"); - eqPos(cm.getCursor(), {line: 0, ch: 2}); - eq(cm.getLine(0), "abcde"); - cm.execCommand("selectAll"); - cm.replaceSelection("oops"); - eq(cm.getValue(), "oopsbcd"); - cm.undo(); - eqPos(m.find().from, {line: 0, ch: 1}); - eqPos(m.find().to, {line: 0, ch: 4}); - m.clear(); - cm.setCursor({line: 0, ch: 2}); - cm.replaceSelection("hi"); - eq(cm.getLine(0), "abhicde"); - eqPos(cm.getCursor(), {line: 0, ch: 4}); - m = mark(0, 2, 2, 2, true); - cm.setSelection({line: 1, ch: 1}, {line: 2, ch: 4}); - cm.replaceSelection("t", "end"); - eqPos(cm.getCursor(), {line: 2, ch: 3}); - eq(cm.getLine(2), "klto"); - cm.execCommand("goCharLeft"); - cm.execCommand("goCharLeft"); - eqPos(cm.getCursor(), {line: 0, ch: 2}); - cm.setSelection({line: 0, ch: 1}, {line: 0, ch: 3}); - cm.replaceSelection("xx"); - eqPos(cm.getCursor(), {line: 0, ch: 3}); - eq(cm.getLine(0), "axxhicde"); -}, {value: "abcde\nfghij\nklmno\n"}); - -testCM("dirtyBit", function(cm) { - eq(cm.isClean(), true); - cm.replaceSelection("boo"); - eq(cm.isClean(), false); - cm.undo(); - eq(cm.isClean(), true); - cm.replaceSelection("boo"); - cm.replaceSelection("baz"); - cm.undo(); - eq(cm.isClean(), false); - cm.markClean(); - eq(cm.isClean(), true); - cm.undo(); - eq(cm.isClean(), false); - cm.redo(); - eq(cm.isClean(), true); -}); - -testCM("addKeyMap", function(cm) { - function sendKey(code) { - cm.triggerOnKeyDown({type: "keydown", keyCode: code, - preventDefault: function(){}, stopPropagation: function(){}}); - } - - sendKey(39); - eqPos(cm.getCursor(), {line: 0, ch: 1}); - var test = 0; - var map1 = {Right: function() { ++test; }}, map2 = {Right: function() { test += 10; }} - cm.addKeyMap(map1); - sendKey(39); - eqPos(cm.getCursor(), {line: 0, ch: 1}); - eq(test, 1); - cm.addKeyMap(map2); - sendKey(39); - eq(test, 2); - cm.removeKeyMap(map1); - sendKey(39); - eq(test, 12); - cm.removeKeyMap(map2); - sendKey(39); - eq(test, 12); - eqPos(cm.getCursor(), {line: 0, ch: 2}); - cm.addKeyMap({Right: function() { test = 55; }, name: "mymap"}); - sendKey(39); - eq(test, 55); - cm.removeKeyMap("mymap"); - sendKey(39); - eqPos(cm.getCursor(), {line: 0, ch: 3}); -}, {value: "abc"}); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/vim_test.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/vim_test.js deleted file mode 100644 index f8c13d64a4346a40535c6d3c94d090f1b9fcf7f9..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/test/vim_test.js +++ /dev/null @@ -1,812 +0,0 @@ -var code = '' + -' wOrd1 (#%\n' + -' word3] \n' + -'aopop pop 0 1 2 3 4\n' + -' (a) [b] {c} \n' + -'int getchar(void) {\n' + -' static char buf[BUFSIZ];\n' + -' static char *bufp = buf;\n' + -' if (n == 0) { /* buffer is empty */\n' + -' n = read(0, buf, sizeof buf);\n' + -' bufp = buf;\n' + -' }\n' + -' return (--n >= 0) ? (unsigned char) *bufp++ : EOF;\n' + -'}\n'; - -var lines = (function() { - lineText = code.split('\n'); - var ret = []; - for (var i = 0; i < lineText.length; i++) { - ret[i] = { - line: i, - length: lineText[i].length, - lineText: lineText[i], - textStart: /^\s*/.exec(lineText[i])[0].length - }; - } - return ret; -})(); -var endOfDocument = makeCursor(lines.length - 1, - lines[lines.length - 1].length); -var wordLine = lines[0]; -var bigWordLine = lines[1]; -var charLine = lines[2]; -var bracesLine = lines[3]; - -var word1 = { - start: { line: wordLine.line, ch: 1 }, - end: { line: wordLine.line, ch: 5 } -}; -var word2 = { - start: { line: wordLine.line, ch: word1.end.ch + 2 }, - end: { line: wordLine.line, ch: word1.end.ch + 4 } -}; -var word3 = { - start: { line: bigWordLine.line, ch: 1 }, - end: { line: bigWordLine.line, ch: 5 } -}; -var bigWord1 = word1; -var bigWord2 = word2; -var bigWord3 = { - start: { line: bigWordLine.line, ch: 1 }, - end: { line: bigWordLine.line, ch: 7 } -}; -var bigWord4 = { - start: { line: bigWordLine.line, ch: bigWord1.end.ch + 3 }, - end: { line: bigWordLine.line, ch: bigWord1.end.ch + 7 } -} -var oChars = [ { line: charLine.line, ch: 1 }, - { line: charLine.line, ch: 3 }, - { line: charLine.line, ch: 7 } ]; -var pChars = [ { line: charLine.line, ch: 2 }, - { line: charLine.line, ch: 4 }, - { line: charLine.line, ch: 6 }, - { line: charLine.line, ch: 8 } ]; -var numChars = [ { line: charLine.line, ch: 10 }, - { line: charLine.line, ch: 12 }, - { line: charLine.line, ch: 14 }, - { line: charLine.line, ch: 16 }, - { line: charLine.line, ch: 18 }]; -var parens1 = { - start: { line: bracesLine.line, ch: 1 }, - end: { line: bracesLine.line, ch: 3 } -}; -var squares1 = { - start: { line: bracesLine.line, ch: 5 }, - end: { line: bracesLine.line, ch: 7 } -}; -var curlys1 = { - start: { line: bracesLine.line, ch: 9 }, - end: { line: bracesLine.line, ch: 11 } -}; - -function copyCursor(cur) { - return { ch: cur.ch, line: cur.line }; -} - -function testVim(name, run, opts, expectedFail) { - var vimOpts = { - lineNumbers: true, - mode: 'text/x-csrc', - keyMap: 'vim', - showCursorWhenSelecting: true, - value: code - }; - for (var prop in opts) { - if (opts.hasOwnProperty(prop)) { - vimOpts[prop] = opts[prop]; - } - } - return test('vim_' + name, function() { - var place = document.getElementById("testground"); - var cm = CodeMirror(place, vimOpts); - CodeMirror.Vim.maybeInitState(cm); - var vim = cm.vimState; - - function doKeysFn(cm) { - return function(args) { - if (args instanceof Array) { - arguments = args; - } - for (var i = 0; i < arguments.length; i++) { - CodeMirror.Vim.handleKey(cm, arguments[i]); - } - } - } - function assertCursorAtFn(cm) { - return function(line, ch) { - var pos; - if (ch == null && typeof line.line == 'number') { - pos = line; - } else { - pos = makeCursor(line, ch); - } - eqPos(pos, cm.getCursor()); - } - } - function fakeOpenDialog(result) { - return function(text, callback) { - return callback(result); - } - } - var helpers = { - doKeys: doKeysFn(cm), - assertCursorAt: assertCursorAtFn(cm), - fakeOpenDialog: fakeOpenDialog, - getRegisterController: function() { - return CodeMirror.Vim.getRegisterController(); - } - } - CodeMirror.Vim.clearVimGlobalState_(); - var successful = false; - try { - run(cm, vim, helpers); - successful = true; - } finally { - if ((debug && !successful) || verbose) { - place.style.visibility = ""; - } else { - place.removeChild(cm.getWrapperElement()); - } - } - }, expectedFail); -}; - -/** - * @param name Name of the test - * @param keys An array of keys or a string with a single key to simulate. - * @param endPos The expected end position of the cursor. - * @param startPos The position the cursor should start at, defaults to 0, 0. - */ -function testMotion(name, keys, endPos, startPos) { - testVim(name, function(cm, vim, helpers) { - if (!startPos) { - startPos = { line: 0, ch: 0 }; - } - cm.setCursor(startPos); - helpers.doKeys(keys); - helpers.assertCursorAt(endPos); - }); -}; - -function makeCursor(line, ch) { - return { line: line, ch: ch }; -}; - -function offsetCursor(cur, offsetLine, offsetCh) { - return { line: cur.line + offsetLine, ch: cur.ch + offsetCh }; -}; - -// Motion tests -testMotion('|', '|', makeCursor(0, 0), makeCursor(0,4)); -testMotion('|_repeat', ['3', '|'], makeCursor(0, 2), makeCursor(0,4)); -testMotion('h', 'h', makeCursor(0, 0), word1.start); -testMotion('h_repeat', ['3', 'h'], offsetCursor(word1.end, 0, -3), word1.end); -testMotion('l', 'l', makeCursor(0, 1)); -testMotion('l_repeat', ['2', 'l'], makeCursor(0, 2)); -testMotion('j', 'j', offsetCursor(word1.end, 1, 0), word1.end); -testMotion('j_repeat', ['2', 'j'], offsetCursor(word1.end, 2, 0), word1.end); -testMotion('k', 'k', offsetCursor(word3.end, -1, 0), word3.end); -testMotion('k_repeat', ['2', 'k'], makeCursor(0, 4), makeCursor(2, 4)); -testMotion('w', 'w', word1.start); -testMotion('w_repeat', ['2', 'w'], word2.start); -testMotion('w_wrap', ['w'], word3.start, word2.start); -testMotion('w_endOfDocument', 'w', endOfDocument, endOfDocument); -testMotion('W', 'W', bigWord1.start); -testMotion('W_repeat', ['2', 'W'], bigWord3.start, bigWord1.start); -testMotion('e', 'e', word1.end); -testMotion('e_repeat', ['2', 'e'], word2.end); -testMotion('e_wrap', 'e', word3.end, word2.end); -testMotion('e_endOfDocument', 'e', endOfDocument, endOfDocument); -testMotion('b', 'b', word3.start, word3.end); -testMotion('b_repeat', ['2', 'b'], word2.start, word3.end); -testMotion('b_wrap', 'b', word2.start, word3.start); -testMotion('b_startOfDocument', 'b', makeCursor(0, 0), makeCursor(0, 0)); -testMotion('ge', ['g', 'e'], word2.end, word3.end); -testMotion('ge_repeat', ['2', 'g', 'e'], word1.end, word3.start); -testMotion('ge_wrap', ['g', 'e'], word2.end, word3.start); -testMotion('ge_startOfDocument', ['g', 'e'], makeCursor(0, 0), - makeCursor(0, 0)); -testMotion('gg', ['g', 'g'], makeCursor(lines[0].line, lines[0].textStart), - makeCursor(3, 1)); -testMotion('gg_repeat', ['3', 'g', 'g'], - makeCursor(lines[2].line, lines[2].textStart)); -testMotion('G', 'G', - makeCursor(lines[lines.length - 1].line, lines[lines.length - 1].textStart), - makeCursor(3, 1)); -testMotion('G_repeat', ['3', 'G'], makeCursor(lines[2].line, - lines[2].textStart)); -// TODO: Make the test code long enough to test Ctrl-F and Ctrl-B. -testMotion('0', '0', makeCursor(0, 0), makeCursor(0, 8)); -testMotion('^', '^', makeCursor(0, lines[0].textStart), makeCursor(0, 8)); -testMotion('$', '$', makeCursor(0, lines[0].length - 1), makeCursor(0, 1)); -testMotion('$_repeat', ['2', '$'], makeCursor(1, lines[1].length - 1), - makeCursor(0, 3)); -testMotion('f', ['f', 'p'], pChars[0], makeCursor(charLine.line, 0)); -testMotion('f_repeat', ['2', 'f', 'p'], pChars[2], pChars[0]); -testMotion('f_num', ['f', '2'], numChars[2], makeCursor(charLine.line, 0)); -testMotion('t', ['t','p'], offsetCursor(pChars[0], 0, -1), - makeCursor(charLine.line, 0)); -testMotion('t_repeat', ['2', 't', 'p'], offsetCursor(pChars[2], 0, -1), - pChars[0]); -testMotion('F', ['F', 'p'], pChars[0], pChars[1]); -testMotion('F_repeat', ['2', 'F', 'p'], pChars[0], pChars[2]); -testMotion('T', ['T', 'p'], offsetCursor(pChars[0], 0, 1), pChars[1]); -testMotion('T_repeat', ['2', 'T', 'p'], offsetCursor(pChars[0], 0, 1), pChars[2]); -testMotion('%_parens', ['%'], parens1.end, parens1.start); -testMotion('%_squares', ['%'], squares1.end, squares1.start); -testMotion('%_braces', ['%'], curlys1.end, curlys1.start); -// Make sure that moving down after going to the end of a line always leaves you -// at the end of a line, but preserves the offset in other cases -testVim('Changing lines after Eol operation', function(cm, vim, helpers) { - var startPos = { line: 0, ch: 0 }; - cm.setCursor(startPos); - helpers.doKeys(['$']); - helpers.doKeys(['j']); - // After moving to Eol and then down, we should be at Eol of line 2 - helpers.assertCursorAt({ line: 1, ch: lines[1].length - 1 }); - helpers.doKeys(['j']); - // After moving down, we should be at Eol of line 3 - helpers.assertCursorAt({ line: 2, ch: lines[2].length - 1 }); - helpers.doKeys(['h']); - helpers.doKeys(['j']); - // After moving back one space and then down, since line 4 is shorter than line 2, we should - // be at Eol of line 2 - 1 - helpers.assertCursorAt({ line: 3, ch: lines[3].length - 1 }); - helpers.doKeys(['j']); - helpers.doKeys(['j']); - // After moving down again, since line 3 has enough characters, we should be back to the - // same place we were at on line 1 - helpers.assertCursorAt({ line: 5, ch: lines[2].length - 2 }); -}); - -// Operator tests -testVim('dl', function(cm, vim, helpers) { - var curStart = makeCursor(0, 0); - cm.setCursor(curStart); - helpers.doKeys('d', 'l'); - eq('word1 ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq(' ', register.text); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1 ' }); -testVim('dl_eol', function(cm, vim, helpers) { - var curStart = makeCursor(0, 6); - cm.setCursor(curStart); - helpers.doKeys('d', 'l'); - eq(' word1', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq(' ', register.text); - is(!register.linewise); - helpers.assertCursorAt(makeCursor(0, 6)); -}, { value: ' word1 ' }); -testVim('dl_repeat', function(cm, vim, helpers) { - var curStart = makeCursor(0, 0); - cm.setCursor(curStart); - helpers.doKeys('2', 'd', 'l'); - eq('ord1 ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq(' w', register.text); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1 ' }); -testVim('dh', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - helpers.doKeys('d', 'h'); - eq(' wrd1 ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('o', register.text); - is(!register.linewise); - eqPos(offsetCursor(curStart, 0 , -1), cm.getCursor()); -}, { value: ' word1 ' }); -testVim('dj', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - helpers.doKeys('d', 'j'); - eq(' word3', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq(' word1\nword2\n', register.text); - is(register.linewise); - eqPos(makeCursor(0, 1), cm.getCursor()); -}, { value: ' word1\nword2\n word3' }); -testVim('dj_end_of_document', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - helpers.doKeys('d', 'j'); - eq(' word1 ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.text); - is(!register.linewise); - helpers.assertCursorAt(0, 3); -}, { value: ' word1 ' }); -testVim('dk', function(cm, vim, helpers) { - var curStart = makeCursor(1, 3); - cm.setCursor(curStart); - helpers.doKeys('d', 'k'); - eq(' word3', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq(' word1\nword2\n', register.text); - is(register.linewise); - eqPos(makeCursor(0, 1), cm.getCursor()); -}, { value: ' word1\nword2\n word3' }); -testVim('dk_start_of_document', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - helpers.doKeys('d', 'k'); - eq(' word1 ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.text); - is(!register.linewise); - helpers.assertCursorAt(0, 3); -}, { value: ' word1 ' }); -testVim('dw_space', function(cm, vim, helpers) { - var curStart = makeCursor(0, 0); - cm.setCursor(curStart); - helpers.doKeys('d', 'w'); - eq('word1 ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq(' ', register.text); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1 ' }); -testVim('dw_word', function(cm, vim, helpers) { - var curStart = makeCursor(0, 1); - cm.setCursor(curStart); - helpers.doKeys('d', 'w'); - eq(' word2', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1 ', register.text); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1 word2' }); -testVim('dw_only_word', function(cm, vim, helpers) { - // Test that if there is only 1 word left, dw deletes till the end of the - // line. - var curStart = makeCursor(0, 1); - cm.setCursor(curStart); - helpers.doKeys('d', 'w'); - eq(' ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1 ', register.text); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1 ' }); -testVim('dw_eol', function(cm, vim, helpers) { - // Assert that dw does not delete the newline if last word to delete is at end - // of line. - var curStart = makeCursor(0, 1); - cm.setCursor(curStart); - helpers.doKeys('d', 'w'); - eq(' \nword2', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1', register.text); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1\nword2' }); -testVim('dw_repeat', function(cm, vim, helpers) { - // Assert that dw does delete newline if it should go to the next line, and - // that repeat works properly. - var curStart = makeCursor(0, 1); - cm.setCursor(curStart); - helpers.doKeys('d', '2', 'w'); - eq(' ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1\nword2', register.text); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1\nword2' }); -testVim('d_inclusive', function(cm, vim, helpers) { - // Assert that when inclusive is set, the character the cursor is on gets - // deleted too. - var curStart = makeCursor(0, 1); - cm.setCursor(curStart); - helpers.doKeys('d', 'e'); - eq(' ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1', register.text); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1 ' }); -testVim('d_reverse', function(cm, vim, helpers) { - // Test that deleting in reverse works. - cm.setCursor(1, 0); - helpers.doKeys('d', 'b'); - eq(' word2 ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1\n', register.text); - is(!register.linewise); - eqPos(makeCursor(0, 1), cm.getCursor()); -}, { value: ' word1\nword2 ' }); -testVim('dd', function(cm, vim, helpers) { - cm.setCursor(0, 3); - var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, - { line: 1, ch: 0 }); - var expectedLineCount = cm.lineCount() - 1; - helpers.doKeys('d', 'd'); - eq(expectedLineCount, cm.lineCount()); - var register = helpers.getRegisterController().getRegister(); - eq(expectedBuffer, register.text); - is(register.linewise); - eqPos(makeCursor(0, lines[1].textStart), cm.getCursor()); -}); -testVim('dd_prefix_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 3); - var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, - { line: 2, ch: 0 }); - var expectedLineCount = cm.lineCount() - 2; - helpers.doKeys('2', 'd', 'd'); - eq(expectedLineCount, cm.lineCount()); - var register = helpers.getRegisterController().getRegister(); - eq(expectedBuffer, register.text); - is(register.linewise); - eqPos(makeCursor(0, lines[2].textStart), cm.getCursor()); -}); -testVim('dd_motion_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 3); - var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, - { line: 2, ch: 0 }); - var expectedLineCount = cm.lineCount() - 2; - helpers.doKeys('d', '2', 'd'); - eq(expectedLineCount, cm.lineCount()); - var register = helpers.getRegisterController().getRegister(); - eq(expectedBuffer, register.text); - is(register.linewise); - eqPos(makeCursor(0, lines[2].textStart), cm.getCursor()); -}); -testVim('dd_multiply_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 3); - var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, - { line: 6, ch: 0 }); - var expectedLineCount = cm.lineCount() - 6; - helpers.doKeys('2', 'd', '3', 'd'); - eq(expectedLineCount, cm.lineCount()); - var register = helpers.getRegisterController().getRegister(); - eq(expectedBuffer, register.text); - is(register.linewise); - eqPos(makeCursor(0, lines[6].textStart), cm.getCursor()); -}); -// Yank commands should behave the exact same as d commands, expect that nothing -// gets deleted. -testVim('yw_repeat', function(cm, vim, helpers) { - // Assert that yw does yank newline if it should go to the next line, and - // that repeat works properly. - var curStart = makeCursor(0, 1); - cm.setCursor(curStart); - helpers.doKeys('y', '2', 'w'); - eq(' word1\nword2', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1\nword2', register.text); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1\nword2' }); -testVim('yy_multiply_repeat', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, - { line: 6, ch: 0 }); - var expectedLineCount = cm.lineCount(); - helpers.doKeys('2', 'y', '3', 'y'); - eq(expectedLineCount, cm.lineCount()); - var register = helpers.getRegisterController().getRegister(); - eq(expectedBuffer, register.text); - is(register.linewise); - eqPos(curStart, cm.getCursor()); -}); -// Change commands behave like d commands except that it also enters insert -// mode. In addition, when the change is linewise, an additional newline is -// inserted so that insert mode starts on that line. -testVim('cw_repeat', function(cm, vim, helpers) { - // Assert that cw does delete newline if it should go to the next line, and - // that repeat works properly. - var curStart = makeCursor(0, 1); - cm.setCursor(curStart); - helpers.doKeys('c', '2', 'w'); - eq(' ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1\nword2', register.text); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); - eq('vim-insert', cm.getOption('keyMap')); -}, { value: ' word1\nword2' }); -testVim('cc_multiply_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 3); - var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, - { line: 6, ch: 0 }); - var expectedLineCount = cm.lineCount() - 5; - helpers.doKeys('2', 'c', '3', 'c'); - eq(expectedLineCount, cm.lineCount()); - var register = helpers.getRegisterController().getRegister(); - eq(expectedBuffer, register.text); - is(register.linewise); - eqPos(makeCursor(0, lines[0].textStart), cm.getCursor()); - eq('vim-insert', cm.getOption('keyMap')); -}); -// Swapcase commands edit in place and do not modify registers. -testVim('g~w_repeat', function(cm, vim, helpers) { - // Assert that dw does delete newline if it should go to the next line, and - // that repeat works properly. - var curStart = makeCursor(0, 1); - cm.setCursor(curStart); - helpers.doKeys('g', '~', '2', 'w'); - eq(' WORD1\nWORD2', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.text); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1\nword2' }); -testVim('g~g~', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - var expectedLineCount = cm.lineCount(); - var expectedValue = cm.getValue().toUpperCase(); - helpers.doKeys('2', 'g', '~', '3', 'g', '~'); - eq(expectedValue, cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.text); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1\nword2\nword3\nword4\nword5\nword6' }); -testVim('>{motion}', function(cm, vim, helpers) { - cm.setCursor(1, 3); - var expectedLineCount = cm.lineCount(); - var expectedValue = ' word1\n word2\nword3 '; - helpers.doKeys('>', 'k'); - eq(expectedValue, cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.text); - is(!register.linewise); - eqPos(makeCursor(0, 3), cm.getCursor()); -}, { value: ' word1\nword2\nword3 ', indentUnit: 2 }); -testVim('>>', function(cm, vim, helpers) { - cm.setCursor(0, 3); - var expectedLineCount = cm.lineCount(); - var expectedValue = ' word1\n word2\nword3 '; - helpers.doKeys('2', '>', '>'); - eq(expectedValue, cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.text); - is(!register.linewise); - eqPos(makeCursor(0, 3), cm.getCursor()); -}, { value: ' word1\nword2\nword3 ', indentUnit: 2 }); -testVim('<{motion}', function(cm, vim, helpers) { - cm.setCursor(1, 3); - var expectedLineCount = cm.lineCount(); - var expectedValue = ' word1\nword2\nword3 '; - helpers.doKeys('<', 'k'); - eq(expectedValue, cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.text); - is(!register.linewise); - eqPos(makeCursor(0, 1), cm.getCursor()); -}, { value: ' word1\n word2\nword3 ', indentUnit: 2 }); -testVim('<<', function(cm, vim, helpers) { - cm.setCursor(0, 3); - var expectedLineCount = cm.lineCount(); - var expectedValue = ' word1\nword2\nword3 '; - helpers.doKeys('2', '<', '<'); - eq(expectedValue, cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.text); - is(!register.linewise); - eqPos(makeCursor(0, 1), cm.getCursor()); -}, { value: ' word1\n word2\nword3 ', indentUnit: 2 }); - -// Operator-motion tests -testVim('D', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - helpers.doKeys('D'); - eq(' wo\nword2\n word3', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('rd1', register.text); - is(!register.linewise); - eqPos(makeCursor(0, 3), cm.getCursor()); -}, { value: ' word1\nword2\n word3' }); -testVim('C', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - helpers.doKeys('C'); - eq(' wo\nword2\n word3', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('rd1', register.text); - is(!register.linewise); - eqPos(makeCursor(0, 3), cm.getCursor()); - eq('vim-insert', cm.getOption('keyMap')); -}, { value: ' word1\nword2\n word3' }); -testVim('Y', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - helpers.doKeys('Y'); - eq(' word1\nword2\n word3', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('rd1', register.text); - is(!register.linewise); - eqPos(makeCursor(0, 3), cm.getCursor()); -}, { value: ' word1\nword2\n word3' }); - -// Action tests -testVim('a', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('a'); - eqPos(makeCursor(0, 2), cm.getCursor()); - eq('vim-insert', cm.getOption('keyMap')); -}); -testVim('a_eol', function(cm, vim, helpers) { - cm.setCursor(0, lines[0].length - 1); - helpers.doKeys('a'); - helpers.assertCursorAt(makeCursor(0, lines[0].length)); - eq('vim-insert', cm.getOption('keyMap')); -}); -testVim('i', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('i'); - eqPos(makeCursor(0, 1), cm.getCursor()); - eq('vim-insert', cm.getOption('keyMap')); -}); -testVim('A', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('A'); - eqPos(makeCursor(0, lines[0].length), cm.getCursor()); - eq('vim-insert', cm.getOption('keyMap')); -}); -testVim('I', function(cm, vim, helpers) { - cm.setCursor(0, 4); - helpers.doKeys('I'); - eqPos(makeCursor(0, lines[0].textStart), cm.getCursor()); - eq('vim-insert', cm.getOption('keyMap')); -}); -testVim('o', function(cm, vim, helpers) { - cm.setCursor(0, 4); - helpers.doKeys('o'); - eq('word1\n\nword2', cm.getValue()); - eqPos(makeCursor(1, 0), cm.getCursor()); - eq('vim-insert', cm.getOption('keyMap')); -}, { value: 'word1\nword2' }); -testVim('O', function(cm, vim, helpers) { - cm.setCursor(0, 4); - helpers.doKeys('O'); - eq('\nword1\nword2', cm.getValue()); - eqPos(makeCursor(0, 0), cm.getCursor()); - eq('vim-insert', cm.getOption('keyMap')); -}, { value: 'word1\nword2' }); -testVim('J', function(cm, vim, helpers) { - cm.setCursor(0, 4); - helpers.doKeys('J'); - var expectedValue = 'word1 word2\nword3\n word4'; - eq(expectedValue, cm.getValue()); - eqPos(makeCursor(0, expectedValue.indexOf('word2') - 1), cm.getCursor()); -}, { value: 'word1 \n word2\nword3\n word4' }); -testVim('J_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 4); - helpers.doKeys('3', 'J'); - var expectedValue = 'word1 word2 word3\n word4'; - eq(expectedValue, cm.getValue()); - eqPos(makeCursor(0, expectedValue.indexOf('word3') - 1), cm.getCursor()); -}, { value: 'word1 \n word2\nword3\n word4' }); -testVim('p', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.getRegisterController().pushText('"', 'yank', 'abc\ndef', false); - helpers.doKeys('p'); - eq('__abc\ndef_', cm.getValue()); - eqPos(makeCursor(1, 2), cm.getCursor()); -}, { value: '___' }); -testVim('p_register', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.getRegisterController().getRegister('a').set('abc\ndef', false); - helpers.doKeys('"', 'a', 'p'); - eq('__abc\ndef_', cm.getValue()); - eqPos(makeCursor(1, 2), cm.getCursor()); -}, { value: '___' }); -testVim('p_wrong_register', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.getRegisterController().getRegister('a').set('abc\ndef', false); - helpers.doKeys('p'); - eq('___', cm.getValue()); - eqPos(makeCursor(0, 1), cm.getCursor()); -}, { value: '___' }); -testVim('p_line', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.getRegisterController().pushText('"', 'yank', ' a\nd\n', true); - helpers.doKeys('2', 'p'); - eq('___\n a\nd\n a\nd', cm.getValue()); - eqPos(makeCursor(1, 2), cm.getCursor()); -}, { value: '___' }); -testVim('P', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.getRegisterController().pushText('"', 'yank', 'abc\ndef', false); - helpers.doKeys('P'); - eq('_abc\ndef__', cm.getValue()); - eqPos(makeCursor(1, 3), cm.getCursor()); -}, { value: '___' }); -testVim('P_line', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.getRegisterController().pushText('"', 'yank', ' a\nd\n', true); - helpers.doKeys('2', 'P'); - eq(' a\nd\n a\nd\n___', cm.getValue()); - eqPos(makeCursor(0, 2), cm.getCursor()); -}, { value: '___' }); -testVim('r', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('3', 'r', 'u'); - eq('wuuuet', cm.getValue()); - eqPos(makeCursor(0, 3), cm.getCursor()); -}, { value: 'wordet' }); -testVim('/ and n/N', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('match'); - helpers.doKeys('/'); - helpers.assertCursorAt(makeCursor(0, 11)); - helpers.doKeys('n'); - helpers.assertCursorAt(makeCursor(1, 6)); - helpers.doKeys('N'); - helpers.assertCursorAt(makeCursor(0, 11)); - - cm.setCursor(0, 0); - helpers.doKeys('2', '/'); - helpers.assertCursorAt(makeCursor(1, 6)); -}, { value: 'match nope match \n nope Match' }); -testVim('/_case', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('Match'); - helpers.doKeys('/'); - helpers.assertCursorAt(makeCursor(1, 6)); -}, { value: 'match nope match \n nope Match' }); -testVim('? and n/N', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('match'); - helpers.doKeys('?'); - helpers.assertCursorAt(makeCursor(1, 6)); - helpers.doKeys('n'); - helpers.assertCursorAt(makeCursor(0, 11)); - helpers.doKeys('N'); - helpers.assertCursorAt(makeCursor(1, 6)); - - cm.setCursor(0, 0); - helpers.doKeys('2', '?'); - helpers.assertCursorAt(makeCursor(0, 11)); -}, { value: 'match nope match \n nope Match' }); -testVim(',/ clearSearchHighlight', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('match'); - helpers.doKeys('?'); - helpers.doKeys(',', '/', 'n'); - helpers.assertCursorAt(0, 11); -}, { value: 'match nope match \n nope Match' }); -testVim('*', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('*'); - helpers.assertCursorAt(makeCursor(0, 22)); - - cm.setCursor(0, 9); - helpers.doKeys('2', '*'); - helpers.assertCursorAt(makeCursor(1, 8)); -}, { value: 'nomatch match nomatch match \nnomatch Match' }); -testVim('*_no_word', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('*'); - helpers.assertCursorAt(0, 0); -}, { value: ' \n match \n' }); -testVim('*_symbol', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('*'); - helpers.assertCursorAt(1, 0); -}, { value: ' /}\n/} match \n' }); -testVim('#', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('#'); - helpers.assertCursorAt(makeCursor(1, 8)); - - cm.setCursor(0, 9); - helpers.doKeys('2', '#'); - helpers.assertCursorAt(makeCursor(0, 22)); -}, { value: 'nomatch match nomatch match \nnomatch Match' }); -testVim('*_seek', function(cm, vim, helpers) { - // Should skip over space and symbols. - cm.setCursor(0, 3); - helpers.doKeys('*'); - helpers.assertCursorAt(makeCursor(0, 22)); -}, { value: ' := match nomatch match \nnomatch Match' }); -testVim('#', function(cm, vim, helpers) { - // Should skip over space and symbols. - cm.setCursor(0, 3); - helpers.doKeys('#'); - helpers.assertCursorAt(makeCursor(1, 8)); -}, { value: ' := match nomatch match \nnomatch Match' }); diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/ambiance-mobile.css b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/ambiance-mobile.css deleted file mode 100644 index 35b3750c1b3795b11e38f906d5a32a41462cc911..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/ambiance-mobile.css +++ /dev/null @@ -1,6 +0,0 @@ -.cm-s-ambiance.CodeMirror { - -webkit-box-shadow: none; - -moz-box-shadow: none; - -o-box-shadow: none; - box-shadow: none; -} diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/ambiance.css b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/ambiance.css deleted file mode 100644 index beec553851a9788de14dbea06ca21f6abc12adf6..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/ambiance.css +++ /dev/null @@ -1,76 +0,0 @@ -/* ambiance theme for codemirror */ - -/* Color scheme */ - -.cm-s-ambiance .cm-keyword { color: #cda869; } -.cm-s-ambiance .cm-atom { color: #CF7EA9; } -.cm-s-ambiance .cm-number { color: #78CF8A; } -.cm-s-ambiance .cm-def { color: #aac6e3; } -.cm-s-ambiance .cm-variable { color: #ffb795; } -.cm-s-ambiance .cm-variable-2 { color: #eed1b3; } -.cm-s-ambiance .cm-variable-3 { color: #faded3; } -.cm-s-ambiance .cm-property { color: #eed1b3; } -.cm-s-ambiance .cm-operator {color: #fa8d6a;} -.cm-s-ambiance .cm-comment { color: #555; font-style:italic; } -.cm-s-ambiance .cm-string { color: #8f9d6a; } -.cm-s-ambiance .cm-string-2 { color: #9d937c; } -.cm-s-ambiance .cm-meta { color: #D2A8A1; } -.cm-s-ambiance .cm-error { color: #AF2018; } -.cm-s-ambiance .cm-qualifier { color: yellow; } -.cm-s-ambiance .cm-builtin { color: #9999cc; } -.cm-s-ambiance .cm-bracket { color: #24C2C7; } -.cm-s-ambiance .cm-tag { color: #fee4ff } -.cm-s-ambiance .cm-attribute { color: #9B859D; } -.cm-s-ambiance .cm-header {color: blue;} -.cm-s-ambiance .cm-quote { color: #24C2C7; } -.cm-s-ambiance .cm-hr { color: pink; } -.cm-s-ambiance .cm-link { color: #F4C20B; } -.cm-s-ambiance .cm-special { color: #FF9D00; } - -.cm-s-ambiance .CodeMirror-matchingbracket { color: #0f0; } -.cm-s-ambiance .CodeMirror-nonmatchingbracket { color: #f22; } - -.cm-s-ambiance .CodeMirror-selected { - background: rgba(255, 255, 255, 0.15); -} -.cm-s-ambiance .CodeMirror-focused .CodeMirror-selected { - background: rgba(255, 255, 255, 0.10); -} - -/* Editor styling */ - -.cm-s-ambiance.CodeMirror { - line-height: 1.40em; - font-family: Monaco, Menlo,"Andale Mono","lucida console","Courier New",monospace !important; - color: #E6E1DC; - background-color: #202020; - -webkit-box-shadow: inset 0 0 10px black; - -moz-box-shadow: inset 0 0 10px black; - -o-box-shadow: inset 0 0 10px black; - box-shadow: inset 0 0 10px black; -} - -.cm-s-ambiance .CodeMirror-gutters { - background: #3D3D3D; - border-right: 1px solid #4D4D4D; - box-shadow: 0 10px 20px black; -} - -.cm-s-ambiance .CodeMirror-linenumber { - text-shadow: 0px 1px 1px #4d4d4d; - color: #222; - padding: 0 5px; -} - -.cm-s-ambiance .CodeMirror-lines .CodeMirror-cursor { - border-left: 1px solid #7991E8; -} - -.cm-s-ambiance .activeline { - background: none repeat scroll 0% 0% rgba(255, 255, 255, 0.031); -} - -.cm-s-ambiance.CodeMirror, -.cm-s-ambiance .CodeMirror-gutters { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAQAAAAHUWYVAABFFUlEQVQYGbzBCeDVU/74/6fj9HIcx/FRHx9JCFmzMyGRURhLZIkUsoeRfUjS2FNDtr6WkMhO9sm+S8maJfu+Jcsg+/o/c+Z4z/t97/vezy3z+z8ekGlnYICG/o7gdk+wmSHZ1z4pJItqapjoKXWahm8NmV6eOTbWUOp6/6a/XIg6GQqmenJ2lDHyvCFZ2cBDbmtHA043VFhHwXxClWmeYAdLhV00Bd85go8VmaFCkbVkzlQENzfBDZ5gtN7HwF0KDrTwJ0dypSOzpaKCMwQHKTIreYIxlmhXTzTWkVm+LTynZhiSBT3RZQ7aGfjGEd3qyXQ1FDymqbKxpspERQN2MiRjNZlFFQXfCNFm9nM1zpAsoYjmtRTc5ajwuaXc5xrWskT97RaKzAGe5ARHhVUsDbjKklziiX5WROcJwSNCNI+9w1Jwv4Zb2r7lCMZ4oq5C0EdTx+2GzNuKpJ+iFf38JEWkHJn9DNF7mmBDITrWEg0VWL3pHU20tSZnuqWu+R3BtYa8XxV1HO7GyD32UkOpL/yDloINFTmvtId+nmAjxRw40VMwVKiwrKLE4bK5UOVntYwhOcSSXKrJHKPJedocpGjVz/ZMIbnYUPB10/eKCrs5apqpgVmWzBYWpmtKHecJPjaUuEgRDDaU0oZghCJ6zNMQ5ZhDYx05r5v2muQdM0EILtXUsaKiQX9WMEUotagQzFbUNN6NUPC2nm5pxEWGCjMc3GdJHjSU2kORLK/JGSrkfGEIjncU/CYUnOipoYemwj8tST9NsJmB7TUVXtbUtXATJVZXBMvYeTXJfobgJUPmGMP/yFaWonaa6BcFO3nqcIqCozSZoZoSr1g4zJOzuyGnxTEX3lUEJ7WcZgme8ddaWvWJo2AJR9DZU3CUIbhCSG6ybSwN6qtJVnCU2svDTP2ZInOw2cBTrqtQahtNZn9NcJ4l2NaSmSkkP1noZWnVwkLmdUPOwLZEwy2Z3S3R+4rIG9hcbpPXHFVWcQdZkn2FOta3cKWQnNRC5g1LsJah4GCzSVsKnCOY5OAFRTBekyyryeyilhFKva75r4Mc0aWanGEaThcy31s439KKxTzJYY5WTHPU1FtIHjQU3Oip4xlNzj/lBw23dYZVliQa7WAXf4shetcQfatI+jWRDBPmyNeW6A1P5kdDgyYJlba0BIM8BZu1JfrFwItyjcAMR3K0BWOIrtMEXyhyrlVEx3ui5dUBjmB/Q3CXW85R4mBD0s7B+4q5tKUjOlb9qqmhi5AZ6GFIC5HXtOobdYGlVdMVbNJ8toNTFcHxnoL+muBagcctjWnbNMuR00uI7nQESwg5q2qqrKWIfrNUmeQocY6HuyxJV02wj36w00yhpmUFenv4p6fUkZYqLyuinx2RGOjhCXYyJF84oiU00YMOOhhquNdfbOB7gU88pY4xJO8LVdp6/q2voeB4R04vIdhSE40xZObx1HGGJ/ja0LBthFInKaLPPFzuCaYaoj8JjPME8yoyxo6zlBqkiUZYgq00OYMswbWO5NGmq+xhipxHLRW29ARjNKXO0wRnear8XSg4XFPLKEPUS1GqvyLwiuBUoa7zpZ0l5xxFwWmWZC1H5h5FwU8eQ7K+g8UcVY6TMQreVQT/8uQ8Z+ALIXnSEa2pYZQneE9RZbSBNYXfWYJzW/h/4j4Dp1tYVcFIC5019Vyi4ThPqSFCzjGWaHQTBU8q6vrVwgxP9Lkm840imWKpcLCjYTtrKuwvsKSnrvHCXGkSMk9p6lhckfRpIeis+N2PiszT+mFLspyGleUhDwcLrZqmyeylxwjBcKHEapqkmyangyLZRVOijwOtCY5SsG5zL0OwlCJ4y5KznF3EUNDDrinwiyLZRzOXtlBbK5ITHFGLp8Q0R6ab6mS7enI2cFrxOyHvOCFaT1HThS1krjCwqWeurCkk+willhCC+RSZnRXBiZaC5RXRIZYKp2lyfrHwiKPKR0JDzrdU2EFgpidawlFDR6FgXUMNa+g1FY3bUQh2cLCwosRdnuQTS/S+JVrGLeWIvtQUvONJxlqSQYYKpwoN2kaocLjdVsis4Mk80ESF2YpSkzwldjHkjFCUutI/r+EHDU8oCs6yzL3PhWiEooZdFMkymlas4AcI3KmoMMNSQ3tHzjGWCrcJJdYyZC7QFGwjRL9p+MrRkAGWzIaWCn9W0F3TsK01c2ZvQw0byvxuQU0r1lM0qJO7wW0kRIMdDTtXEdzi4VIh+EoIHm0mWtAtpCixlabgn83fKTI7anJe9ST7WIK1DMGpQmYeA58ImV6ezOGOzK2Kgq01pd60cKWiUi9Lievb/0vIDPHQ05Kzt4ddPckQBQtoaurjyHnek/nKzpQLrVgKPjIkh2v4uyezpv+Xoo7fPFXaGFp1vaLKxQ4uUpQQS5VuQs7BCq4xRJv7fwpVvvFEB3j+620haOuocqMhWd6TTPAEx+mdFNGHdranFe95WrWmIvlY4F1Dle2ECgc6cto7SryuqGGGha0tFQ5V53migUKmg6XKAo4qS3mik+0OZpAhOLeZKicacgaYcyx5hypYQE02ZA4xi/pNhOQxR4klNKyqacj+mpxnLTnnGSo85++3ZCZq6lrZkXlGEX3o+C9FieccJbZWVFjC0Yo1FZnJhoYMFoI1hEZ9r6hwg75HwzBNhbZCdJEfJwTPGzJvaKImw1yYX1HDAmpXR+ZJQ/SmgqMNVQb5vgamGwLtt7VwvP7Qk1xpiM5x5Cyv93E06MZmgs0Nya2azIKOYKCGBQQW97RmhKNKF02JZqHEJ4o58qp7X5EcZmc56trXEqzjCBZ1MFGR87Ql2tSTs6CGxS05PTzRQorkbw7aKoKXFDXsYW42VJih/q+FP2BdTzDTwVqOYB13liM50vG7wy28qagyuIXMeQI/Oqq8bcn5wJI50xH00CRntyfpL1T4hydYpoXgNiFzoIUTDZnLNRzh4TBHwbYGDvZkxmlyJloyr6tRihpeUG94GnKtIznREF0tzJG/OOr73JBcrSh1k6WuTprgLU+mnSGnv6Zge0NNz+kTDdH8nuAuTdJDCNb21LCiIuqlYbqGzT3RAoZofQfjFazkqeNWdYaGvYTM001EW2oKPvVk1ldUGSgUtHFwjKM1h9jnFcmy5lChoLNaQMGGDsYbKixlaMBmmsx1QjCfflwTfO/gckW0ruZ3jugKR3R5W9hGUWqCgxuFgsuaCHorotGKzGaeZB9DMsaTnKCpMtwTvOzhYk0rdrArKCqcaWmVk1+F372ur1YkKxgatI8Qfe1gIX9wE9FgS8ESmuABIXnRUbCapcKe+nO7slClSZFzpV/LkLncEb1qiO42fS3R855Su2mCLh62t1SYZZYVmKwIHjREF2uihTzB20JOkz7dkxzYQnK0UOU494wh+VWRc6Un2kpTaVgLDFEkJ/uhzRcI0YKGgpGWOlocBU/a4fKoJ/pEaNV6jip3+Es9VXY078rGnmAdf7t9ylPXS34RBSuYPs1UecZTU78WanhBCHpZ5sAoTz0LGZKjPf9TRypqWEiTvOFglL1fCEY3wY/++rbk7C8bWebA6p6om6PgOL2kp44TFJlVNBXae2rqqdZztOJpT87GQsE9jqCPIe9VReZuQ/CIgacsyZdCpIScSYqcZk8r+nsyCzhyfhOqHGOIvrLknC8wTpFcaYiGC/RU1NRbUeUpocQOnkRpGOrIOcNRx+1uA0UrzhSSt+VyS3SJpnFWkzNDqOFGIWcfR86DnmARTQ1HKIL33ExPiemeOhYSSjzlSUZZuE4TveoJLnBUOFof6KiysCbnAEcZgcUNTDOwkqWu3RWtmGpZwlHhJENdZ3miGz0lJlsKnjbwqSHQjpxnFDlTLLwqJPMZMjd7KrzkSG7VsxXBZE+F8YZkb01Oe00yyRK9psh5SYh29ySPKBo2ylNht7ZkZnsKenjKNJu9PNEyZpaCHv4Kt6RQsLvAVp7M9kIimmCUwGeWqLMmGuIotYMmWNpSahkhZw9FqZsVnKJhsjAHvtHMsTM9fCI06Dx/u3vfUXCqfsKRc4oFY2jMsoo/7DJDwZ1CsIKnJu+J9ldkpmiCxQx1rWjI+T9FwcWWzOuaYH0Hj7klNRVWEQpmaqosakiGNTFHdjS/qnUdmf0NJW5xsL0HhimCCZZSRzmSPTXJQ4aaztAwtZnoabebJ+htCaZ7Cm535ByoqXKbX1WRc4Eh2MkRXWzImVc96Cj4VdOKVxR84VdQsIUM8Psoou2byVHyZFuq7O8otbSQ2UAoeEWTudATLGSpZzVLlXVkPU2Jc+27lsw2jmg5T5VhbeE3BT083K9WsTTkFU/Osi0rC5lRlpwRHUiesNS0sOvmqGML1aRbPAxTJD9ZKtxuob+hhl8cwYGWpJ8nub7t5p6coYbMovZ1BTdaKn1jYD6h4GFDNFyT/Kqe1XCXphXHOKLZmuRSRdBPEfVUXQzJm5YGPGGJdvAEr7hHNdGZnuBvrpciGmopOLf5N0uVMy0FfYToJk90uUCbJupaVpO53UJXR2bVpoU00V2KOo4zMFrBd0Jtz2pa0clT5Q5L8IpQ177mWQejPMEJhuQjS10ref6HHjdEhy1P1EYR7GtO0uSsKJQYLiTnG1rVScj5lyazpqWGl5uBbRWl7m6ixGOOnEsMJR7z8J0n6KMnCdxhiNYQCoZ6CmYLnO8omC3MkW3bktlPmEt/VQQHejL3+dOE5FlPdK/Mq8hZxxJtLyRrepLThYKbLZxkSb5W52vYxNOaOxUF0yxMUPwBTYqCzy01XayYK0sJyWBLqX0MwU5CzoymRzV0EjjeUeLgDpTo6ij42ZAzvD01dHUUTPLU96MdLbBME8nFBn7zJCMtJcZokn8YoqU0FS5WFKyniHobguMcmW8N0XkWZjkyN3hqOMtS08r+/xTBwpZSZ3qiVRX8SzMHHjfUNFjgHEPmY9PL3ykEzxkSre/1ZD6z/NuznuB0RcE1TWTm9zRgfUWVJiG6yrzgmWPXC8EAR4Wxhlad0ZbgQyEz3pG5RVEwwDJH2mgKpjcTiCOzn1lfUWANFbZ2BA8balnEweJC9J0iuaeZoI+ippFCztEKVvckR2iice1JvhVytrQwUAZpgsubCPaU7xUe9vWnaOpaSBEspalykhC9bUlOMpT42ZHca6hyrqKmw/wMR8H5ZmdFoBVJb03O4UL0tSNnvIeRmkrLWqrs78gcrEn2tpcboh0UPOW3UUR9PMk4T4nnNKWmCjlrefhCwxRNztfmIQVdDElvS4m1/WuOujoZCs5XVOjtKPGokJzsYCtFYoWonSPT21DheU/wWhM19FcElwqNGOsp9Q8N/cwXaiND1MmeL1Q5XROtYYgGeFq1aTMsoMmcrKjQrOFQTQ1fmBYhmW6o8Jkjc7iDJRTBIo5kgJD5yMEYA3srCg7VFKwiVJkmRCc5ohGOKhsYMn/XBLdo5taZjlb9YAlGWRimqbCsoY7HFAXLa5I1HPRxMMsQDHFkWtRNniqT9UEeNjcE7RUlrCJ4R2CSJuqlKHWvJXjAUNcITYkenuBRB84TbeepcqTj3zZyFJzgYQdHnqfgI0ddUwS6GqWpsKWhjq9cV0vBAEMN2znq+EBfIWT+pClYw5xsTlJU6GeIBsjGmmANTzJZiIYpgrM0Oa8ZMjd7NP87jxhqGOhJlnQtjuQpB+8aEE00wZFznSJPyHxgH3HkPOsJFvYk8zqCHzTs1BYOa4J3PFU+UVRZxlHDM4YavlNUuMoRveiZA2d7grMNc2g+RbSCEKzmgYsUmWmazFJyoiOZ4KnyhKOGRzWJa0+moyV4TVHDzn51Awtqaphfk/lRQ08FX1iiqxTB/kLwd0VynKfEvI6cd4XMV5bMhZ7gZUWVzYQ6Nm2BYzxJbw3bGthEUUMfgbGeorae6DxHtJoZ6alhZ0+ytiVoK1R4z5PTrOECT/SugseEOlb1MMNR4VRNcJy+V1Hg9ONClSZFZjdHlc6W6FBLdJja2MC5hhpu0DBYEY1TFGwiFAxRRCsYkiM9JRb0JNMVkW6CZYT/2EiTGWmo8k+h4FhDNE7BvppoTSFnmCV5xZKzvcCdDo7VVPnIU+I+Rc68juApC90MwcFCsJ5hDqxgScYKreruyQwTqrzoqDCmhWi4IbhB0Yrt3RGa6GfDv52rKXWhh28dyZaWUvcZeMTBaZoSGyiCtRU5J8iviioHaErs7Jkj61syVzTTgOcUOQ8buFBTYWdL5g3T4qlpe0+wvD63heAXRfCCIed9RbCsp2CiI7raUOYOTU13N8PNHvpaGvayo4a3LLT1lDrVEPT2zLUlheB1R+ZTRfKWJ+dcocLJfi11vyJ51lLqJ0WD7tRwryezjiV5W28uJO9qykzX8JDe2lHl/9oyBwa2UMfOngpXCixvKdXTk3wrsKmiVYdZIqsoWEERjbcUNDuiaQomGoIbFdEHmsyWnuR+IeriKDVLnlawlyNHKwKlSU631PKep8J4Q+ayjkSLKYLhalNHlYvttb6fHm0p6OApsZ4l2VfdqZkjuysy6ysKLlckf1KUutCTs39bmCgEyyoasIWlVaMF7mgmWtBT8Kol5xpH9IGllo8cJdopcvZ2sImlDmMIbtDk3KIpeNiS08lQw11NFPTwVFlPP6pJ2gvRfI7gQUfmNAtf6Gs0wQxDsKGlVBdF8rCa3jzdwMaGHOsItrZk7hAyOzpK9VS06j5F49b0VNGOOfKs3lDToMsMBe9ZWtHFEgxTJLs7qrygKZjUnmCYoeAqeU6jqWuLJup4WghOdvCYJnrSkSzoyRkm5M2StQwVltPkfCAk58tET/CSg+8MUecmotMEnhBKfWBIZsg2ihruMJQaoIm+tkTLKEqspMh00w95gvFCQRtDwTT1gVDDSEVdlwqZfxoQRbK0g+tbiBZxzKlpnpypejdDwTaeOvorMk/IJE10h9CqRe28hhLbe0pMsdSwv4ZbhKivo2BjDWfL8UKJgeavwlwb5KlwhyE4u4XkGE2ytZCznKLCDZZq42VzT8HLCrpruFbIfOIINmh/qCdZ1ZBc65kLHR1Bkyf5zn6pN3SvGKIlFNGplhrO9QSXanLOMQTLCa0YJCRrCZm/CZmrLTm7WzCK4GJDiWUdFeYx1LCFg3NMd0XmCuF3Y5rITLDUsYS9zoHVzwnJoYpSTQoObyEzr4cFBNqYTopoaU/wkyLZ2lPhX/5Y95ulxGTV7KjhWrOZgl8MyUUafjYraNjNU1N3IWcjT5WzWqjwtoarHSUObGYO3GCJZpsBlnJGPd6ZYLyl1GdCA2625IwwJDP8GUKymbzuyPlZlvTUsaUh5zFDhRWFzPKKZLAlWdcQbObgF9tOqOsmB1dqcqYJmWstFbZRRI9poolmqiLnU0POvxScpah2iSL5UJNzgScY5+AuIbpO0YD3NCW+dLMszFSdFCWGqG6eVq2uYVNDdICGD6W7EPRWZEY5gpsE9rUkS3mijzzJnm6UpUFXG1hCUeVoS5WfNcFpblELL2qqrCvMvRfd45oalvKU2tiQ6ePJOVMRXase9iTtLJztPxJKLWpo2CRDcJwn2sWSLKIO1WQWNTCvpVUvOZhgSC40JD0dOctaSqzkCRbXsKlb11Oip6PCJ0IwSJM31j3akRxlP7Rwn6aGaUL0qiLnJkvB3xWZ2+Q1TfCwpQH3G0o92UzmX4o/oJNQMMSQc547wVHhdk+VCw01DFYEnTxzZKAm74QmeNNR1w6WzEhNK15VJzuCdxQ53dRUDws5KvwgBMOEgpcVNe0hZI6RXT1Jd0cyj5nsaEAHgVmGaJIlWdsc5Ui2ElrRR6jrRAttNMEAIWrTDFubkZaok7/AkzfIwfuWVq0jHzuCK4QabtLUMVPB3kJ0oyHTSVFlqMALilJf2Rf8k5aaHtMfayocLBS8L89oKoxpJvnAkDPa0qp5DAUTHKWmCcnthlou8iCKaFFLHWcINd1nyIwXqrSxMNmSs6KmoL2QrKuWtlQ5V0120xQ5vRyZS1rgFkWwhiOwiuQbR0OOVhQM9iS3tiXp4RawRPMp5tDletOOBL95MpM01dZTBM9pkn5qF010rIeHFcFZhmSGpYpTsI6nwhqe5C9ynhlpp5ophuRb6WcJFldkVnVEwwxVfrVkvnWUuNLCg5bgboFHPDlDPDmnK7hUrWiIbjadDclujlZcaokOFup4Ri1kacV6jmrrK1hN9bGwpKEBQ4Q6DvIUXOmo6U5LqQM6EPyiKNjVkPnJkDPNEaxhiFay5ExW1NXVUGqcpYYdPcGiCq7z/TSlbhL4pplWXKd7NZO5QQFrefhRQW/NHOsqcIglc4UhWklR8K0QzbAw08CBDnpbgqXdeD/QUsM4RZXDFBW6WJKe/mFPdH0LtBgiq57wFLzlyQzz82qYx5D5WJP5yVJDW01BfyHnS6HKO/reZqId1WGa4Hkh2kWodJ8i6KoIPlAj2hPt76CzXsVR6koPRzWTfKqIentatYpQw2me4AA3y1Kind3SwoOKZDcFXTwl9tWU6mfgRk9d71sKtlNwrjnYw5tC5n5LdKiGry3JKNlHEd3oaMCFHrazBPMp/uNJ+V7IudcSbeOIdjUEdwl0VHCOZo5t6YluEuaC9mQeMgSfOyKnYGFHcIeQ84yQWbuJYJpZw5CzglDH7gKnWqqM9ZTaXcN0TeYhR84eQtJT76JJ1lREe7WnnvsMmRc9FQ7SBBM9mV3lCUdmHk/S2RAMt0QjFNFqQpWjDPQ01DXWUdDBkXziKPjGEP3VP+zIWU2t7im41FOloyWzn/L6dkUy3VLDaZ6appgDLHPjJEsyvJngWEPUyVBiAaHCTEXwrLvSEbV1e1gKJniicWorC1MUrVjB3uDhJE/wgSOzk1DXpk0k73qCM8xw2UvD5kJmDUfOomqMpWCkJRlvKXGmoeBm18USjVIk04SClxTB6YrgLAPLWYK9HLUt5cmc0vYES8GnTeRc6skZbQkWdxRsIcyBRzx1DbTk9FbU0caTPOgJHhJKnOGIVhQqvKmo0llRw9sabrZkDtdg3PqaKi9oatjY8B+G371paMg6+mZFNNtQ04mWBq3rYLOmtWWQp8KJnpy9DdFensyjdqZ+yY40VJlH8wcdLzC8PZnvHMFUTZUrDTkLyQaGus5X5LzpYAf3i+e/ZlhqGqWhh6Ou6xTR9Z6oi5AZZtp7Mj2EEm8oSpxiYZCHU/1fbGdNNNRRoZMhmilEb2gqHOEJDtXkHK/JnG6IrvbPCwV3NhONVdS1thBMs1T4QOBcTWa2IzhMk2nW5Kyn9tXUtpv9RsG2msxk+ZsQzRQacJncpgke0+T8y5Fzj8BiGo7XlJjaTIlpQs7KFjpqGnKuoyEPeIKnFMkZHvopgh81ySxNFWvJWcKRs70j2FOT012IllEEO1n4pD1513Yg2ssQPOThOkvyrqHUdEXOSEsihmBbTbKX1kLBPWqWkLOqJbjB3GBIZmoa8qWl4CG/iZ7oiA72ZL7TJNeZUY7kFQftDcHHluBzRbCegzMtrRjVQpX2lgoPKKLJAkcbMl01XK2p7yhL8pCBbQ3BN2avJgKvttcrWDK3CiUOVxQ8ZP+pqXKyIxnmBymCg5vJjNfkPK4+c8cIfK8ocVt7kmfd/I5SR1hKvCzUtb+lhgc00ZaO6CyhIQP1Uv4yIZjload72PXX0OIJvnFU+0Zf6MhsJwTfW0r0UwQfW4LNLZl5HK261JCZ4qnBaAreVAS3WrjV0LBnNDUNNDToCEeFfwgcb4gOEqLRhirWkexrCEYKVV711DLYEE1XBEsp5tpTGjorkomKYF9FDXv7fR3BGwbettSxnyL53MBPjsxDZjMh+VUW9NRxq1DhVk+FSxQcaGjV9Pawv6eGByw5qzoy7xk4RsOShqjJwWKe/1pEEfzkobeD/dQJmpqedcyBTy2sr4nGNRH0c0SPWTLrqAc0OQcb/gemKgqucQT7ySWKCn2EUotoCvpZct7RO2sy/QW0IWcXd7pQRQyZVwT2USRO87uhjioTLKV2brpMUcMQRbKH/N2T+UlTpaMls6cmc6CCNy3JdYYSUzzJQ4oSD3oKLncULOiJvjBEC2oqnCJkJluCYy2ZQ5so9YYlZ1VLlQU1mXEW1jZERwj/MUSRc24TdexlqLKfQBtDTScJUV8FszXBEY5ktpD5Ur9hYB4Nb1iikw3JoYpkKX+RodRKFt53MMuRnKSpY31PwYaGaILh3wxJGz9TkTPEETxoCWZrgvOlmyMzxFEwVJE5xZKzvyJ4WxEc16Gd4Xe3Weq4XH2jKRikqOkGQ87hQnC7wBmGYLAnesX3M+S87eFATauuN+Qcrh7xIxXJbUIdMw3JGE3ylCWzrieaqCn4zhGM19TQ3z1oH1AX+pWEqIc7wNGAkULBo/ZxRaV9NNyh4Br3rCHZzbzmSfawBL0dNRwpW1kK9mxPXR9povcdrGSZK9c2k0xwFGzjuniCtRSZCZ6ccZ7gaktmgAOtKbG/JnOkJrjcQTdFMsxRQ2cLY3WTIrlCw1eWKn8R6pvt4GFDso3QoL4a3nLk3G6JrtME3dSenpx7PNFTmga0EaJTLQ061sEeQoWXhSo9LTXsaSjoJQRXeZLtDclbCrYzfzHHeaKjHCVOUkQHO3JeEepr56mhiyaYYKjjNU+Fed1wS5VlhWSqI/hYUdDOkaxiKehoyOnrCV5yBHtbWFqTHCCwtpDcYolesVR5yUzTZBb3RNMd0d6WP+SvhuBmRcGxnuQzT95IC285cr41cLGQ6aJJhmi4TMGempxeimBRQw1tFKV+8jd6KuzoSTqqDxzRtpZkurvKEHxlqXKRIjjfUNNXQsNOsRScoWFLT+YeRZVD3GRN0MdQcKqQjHDMrdGGVu3iYJpQx3WGUvfbmxwFfR20WBq0oYY7LMFhhgYtr8jpaEnaOzjawWWaTP8mMr0t/EPDPoqcnxTBI5o58L7uoWnMrpoqPwgVrlAUWE+V+TQl9rawoyP6QGAlQw2TPRX+YSkxyBC8Z6jhHkXBgQL7WII3DVFnRfCrBfxewv9D6xsyjys4VkhWb9pUU627JllV0YDNHMku/ldNMMXDEo4aFnAkk4U6frNEU4XgZUPmEKHUl44KrzmYamjAbh0JFvGnaTLPu1s9jPCwjFpYiN7z1DTOk/nc07CfDFzmCf7i+bfNHXhDtLeBXzTBT5rkMvWOIxpl4EMh2LGJBu2syDnAEx2naEhHDWMMzPZEhygyS1mS5RTJr5ZkoKbEUoYqr2kqdDUE8ztK7OaIntJkFrIECwv8LJTaVx5XJE86go8dFeZ3FN3rjabCAYpoYEeC9zzJVULBbmZhDyd7ko09ydpNZ3nm2Kee4FPPXHnYEF1nqOFEC08LUVcDvYXkJHW8gTaKCk9YGOeIJhqiE4ToPEepdp7IWFjdwnWaufGMwJJCMtUTTBBK9BGCOy2tGGrJTHIwyEOzp6aPzNMOtlZkDvcEWpP5SVNhfkvDxhmSazTJXYrM9U1E0xwFVwqZQwzJxw6+kGGGUj2FglGGmnb1/G51udRSMNlTw6GGnCcUwVcOpmsqTHa06o72sw1RL02p9z0VbnMLOaIX3QKaYKSCFQzBKEUNHTSc48k53RH9wxGMtpQa5KjjW0W0n6XCCCG4yxNNdhQ4R4l1Ff+2sSd6UFHiIEOyqqFgT01mEUMD+joy75jPhOA+oVVLm309FR4yVOlp4RhLiScNmSmaYF5Pw0STrOIoWMSR2UkRXOMp+M4SHW8o8Zoi6OZgjKOaFar8zZDzkWzvKOjkKBjmCXby8JahhjXULY4KlzgKLvAwxVGhvyd4zxB1d9T0piazmKLCVZY5sKiD0y2ZSYrkUEPUbIk+dlQ4SJHTR50k1DPaUWIdTZW9NJwnJMOECgd7ou/MnppMJ02O1VT4Wsh85MnZzcFTngpXGKo84qmwgKbCL/orR/SzJ2crA+t6Mp94KvxJUeIbT3CQu1uIdlQEOzlKfS3UMcrTiFmOuroocrZrT2AcmamOKg8YomeEKm/rlT2sociMaybaUlFhuqHCM2qIJ+rg4EcDFymiDSxzaHdPcpE62pD5kyM5SBMoA1PaUtfIthS85ig1VPiPPYXgYEMNk4Qq7TXBgo7oT57gPUdwgCHzhIVFPFU6OYJzHAX9m5oNrVjeE61miDrqQ4VSa1oiURTsKHC0IfjNwU2WzK6eqK8jWln4g15TVBnqmDteCJ501PGAocJhhqjZdtBEB6lnhLreFJKxmlKbeGrqLiSThVIbCdGzloasa6lpMQXHCME2boLpJgT7yWaemu6wBONbqGNVRS0PKIL7LckbjmQtR7K8I5qtqel+T/ChJTNIKLjdUMNIRyvOEko9YYl2cwQveBikCNawJKcLBbc7+JM92mysNvd/Fqp8a0k6CNEe7cnZrxlW0wQXaXjaktnRwNOGZKYiONwS7a1JVheq3WgJHlQUGKHKmp4KAxXR/ULURcNgoa4zhKSLpZR3kxRRb0NmD0OFn+UCS7CzI1nbP6+o4x47QZE5xRCt3ZagnYcvmpYQktXdk5YKXTzBC57kKEe0VVuiSYqapssMS3C9p2CKkHOg8B8Pa8p5atrIw3qezIWanMGa5HRDNF6RM9wcacl0N+Q8Z8hsIkSnaIIdHRUOEebAPy1zbCkhM062FCJtif7PU+UtoVXzWKqM1PxXO8cfdruhFQ/a6x3JKYagvVDhQEtNiyiiSQ7OsuRsZUku0CRNDs4Sog6KKjsZgk2bYJqijgsEenoKeniinRXBn/U3lgpPdyDZynQx8IiioMnCep5Ky8mjGs6Wty0l1hUQTcNWswS3WRp2kCNZwJG8omG8JphPUaFbC8lEfabwP7VtM9yoaNCAjpR41VNhrD9LkbN722v0CoZMByFzhaW+MyzRYEWFDQwN2M4/JiT76PuljT3VU/A36eaIThb+R9oZGOAJ9tewkgGvqOMNRWYjT/Cwu99Q8LqDE4TgbLWxJ1jaDDAERsFOFrobgjUsBScaguXU8kKm2RL19tRypSHnHNlHiIZqgufs4opgQdVdwxBNNFBR6kVFqb8ogimOzB6a6HTzrlDHEpYaxjiiA4TMQobkDg2vejjfwJGWmnbVFAw3H3hq2NyQfG7hz4aC+w3BbwbesG0swYayvpAs6++Ri1Vfzx93mFChvyN5xVHTS+0p9aqCAxyZ6ZacZyw5+7uuQkFPR9DDk9NOiE7X1PCYJVjVUqq7JlrHwWALF5nfHNGjApdpqgzx5OwilDhCiDYTgnc9waGW4BdLNNUQvOtpzDOWHDH8D7TR/A/85KljEQu3NREc4Pl/6B1Hhc8Umb5CsKMmGC9EPcxoT2amwHNCmeOEnOPbklnMkbOgIvO5UMOpQrS9UGVdt6iH/fURjhI/WOpaW9OKLYRod6HCUEdOX000wpDZQ6hwg6LgZfOqo1RfT/CrJzjekXOGhpc1VW71ZLbXyyp+93ILbC1kPtIEYx0FIx1VDrLoVzXRKRYWk809yYlC9ImcrinxtabKnzRJk3lAU1OLEN1j2zrYzr2myHRXJFf4h4QKT1qSTzTB5+ZNTzTRkAxX8FcLV2uS8eoQQ2aAkFzvCM72sJIcJET3WPjRk5wi32uSS9rfZajpWEvj9hW42F4o5NytSXYy8IKHay10VYdrcl4SkqscrXpMwyGOgtkajheSxdQqmpxP1L3t4R5PqasFnrQEjytq6qgp9Y09Qx9o4S1FzhUCn1kyHSzBWLemoSGvOqLNhZyBjmCaAUYpMgt4Ck7wBBMMwWKWgjsUwTaGVsxWC1mYoKiyqqeGKYqonSIRQ3KIkHO0pmAxTdBHkbOvfllfr+AA+7gnc50huVKYK393FOyg7rbPO/izI7hE4CnHHHnJ0ogNPRUGeUpsrZZTBJcrovUcJe51BPsr6GkJdhCCsZ6aTtMEb2pqWkqeVtDXE/QVggsU/Nl86d9RMF3DxvZTA58agu810RWawCiSzzXBeU3MMW9oyJUedvNEvQyNu1f10BSMddR1vaLCYpYa/mGocLSiYDcLbQz8aMn5iyF4xBNMs1P0QEOV7o5gaWGuzSeLue4tt3ro7y4Tgm4G/mopdZgl6q0o6KzJWE3mMksNr3r+a6CbT8g5wZNzT9O7fi/zpaOmnz3BRoqos+tv9zMbdpxsqDBOEewtJLt7cg5wtKKbvldpSzRRCD43VFheCI7yZLppggMVBS/KMAdHODJvOwq2NQSbKKKPLdFWQs7Fqo+mpl01JXYRgq8dnGLhTiFzqmWsUMdpllZdbKlyvSdYxhI9YghOtxR8LgSLWHK62mGGVoxzBE8LNWzqH9CUesQzFy5RQzTc56mhi6fgXEWwpKfE5Z7M05ZgZUPmo6auiv8YKzDYwWBLMErIbKHJvOwIrvEdhOBcQ9JdU1NHQ7CXn2XIDFBKU2WAgcX9UAUzDXWd5alwuyJ41Z9rjKLCL4aCp4WarhPm2rH+SaHUYE001JDZ2ZAzXPjdMpZWvC9wmqIB2lLhQ01D5jO06hghWMndbM7yRJMsoCj1vYbnFQVrW9jak3OlEJ3s/96+p33dEPRV5GxiqaGjIthUU6FFEZyqCa5qJrpBdzSw95IUnOPIrCUUjRZQFrbw5PR0R1qiYx3cb6nrWUMrBmmiBQxVHtTew5ICP/ip6g4hed/Akob/32wvBHsIOX83cI8hGeNeNPCIkPmXe8fPKx84OMSRM1MTdXSwjCZ4S30jVGhvqTRak/OVhgGazHuOCud5onEO1lJr6ecVyaOK6H7zqlBlIaHE0oroCgfvGJIdPcmfLNGLjpz7hZwZQpUbFME0A1cIJa7VNORkgfsMBatbKgwwJM9bSvQXeNOvbIjelg6WWvo5kvbKaJJNHexkKNHL9xRyFlH8Ti2riB5wVPhUk7nGkJnoCe428LR/wRGdYIlmWebCyxou1rCk4g/ShugBDX0V0ZQWkh0dOVsagkM0yV6OoLd5ye+pRlsCr0n+KiQrGuq5yJDzrTAXHtLUMduTDBVKrSm3eHL+6ijxhFDX9Z5gVU/wliHYTMiMFpKLNMEywu80wd3meoFmt6VbRMPenhrOc6DVe4pgXU8DnnHakLOIIrlF4FZPIw6R+zxBP0dyq6OOZ4Q5sLKCcz084ok+VsMMyQhNZmmBgX5xIXOEJTmi7VsGTvMTNdHHhpzdbE8Du2oKxgvBqQKdDDnTFOylCFaxR1syz2iqrOI/FEpNc3C6f11/7+ASS6l2inq2ciTrCCzgyemrCL5SVPjQkdPZUmGy2c9Sw9FtR1sS30RmsKPCS4rkIC/2U0MduwucYolGaPjKEyhzmiPYXagyWbYz8LWBDdzRimAXzxx4z8K9hpzlhLq+NiQ97HuKorMUfK/OVvC2JfiHUPCQI/q7J2gjK+tTDNxkCc4TMssqCs4TGtLVwQihyoAWgj9bosU80XGW6Ac9TJGziaUh5+hnFcHOnlaM1iRn29NaqGENTTTSUHCH2tWTeV0osUhH6psuVLjRUmGWhm6OZEshGeNowABHcJ2Bpy2ZszRcKkRXd2QuKVEeXnbfaEq825FguqfgfE2whlChSRMdron+LATTPQ2Z369t4B9C5gs/ylzv+CMmepIDPclFQl13W0rspPd1JOcbghGOEutqCv5qacURQl3dDKyvyJlqKXGPgcM9FfawJAMVmdcspcYKOZc4GjDYkFlK05olNMHyHn4zFNykyOxt99RkHlfwmiHo60l2EKI+mhreEKp080Tbug08BVPcgoqC5zWt+NLDTZ7oNSF51N1qie7Va3uCCwyZbkINf/NED6jzOsBdZjFN8oqG3wxVunqCSYYKf3EdhJyf9YWGf7tRU2oH3VHgPr1fe5J9hOgHd7xQ0y7qBwXr23aGErP0cm64JVjZwsOGqL+mhNgZmhJLW2oY4UhedsyBgzrCKrq7BmcpNVhR6jBPq64Vgi+kn6XE68pp8J5/+0wRHGOpsKenQn9DZntPzjRLZpDAdD2fnSgkG9tmIXnUwQ6WVighs7Yi2MxQ0N3CqYaCXkJ0oyOztMDJjmSSpcpvlrk0RMMOjmArQ04PRV1DO1FwhCVaUVPpKUM03JK5SxPsIWRu8/CGHi8UHChiqGFDTbSRJWeYUDDcH6vJWUxR4k1FXbMUwV6e4AJFXS8oMqsZKqzvYQ9DDQdZckY4aGsIhtlubbd2r3j4QBMoTamdPZk7O/Bf62lacZwneNjQoGcdVU7zJOd7ghsUHOkosagic6cnWc8+4gg285R6zZP5s1/LUbCKIznTwK36PkdwlOrl4U1LwfdCCa+IrvFkmgw1PCAUXKWo0sURXWcI2muKJlgyFzhynCY4RBOsqCjoI1R5zREco0n2Vt09BQtYSizgKNHfUmUrQ5UOCh51BFcLmY7umhYqXKQomOop8bUnWNNQcIiBcYaC6xzMNOS8JQQfeqKBmmglB+97ok/lfk3ygaHSyZaCRTzRxQo6GzLfa2jWBPepw+UmT7SQEJyiyRkhBLMVOfcoMjcK0eZChfUNzFAUzCsEN5vP/X1uP/n/aoMX+K+nw/Hjr/9xOo7j7Pju61tLcgvJpTWXNbfN5jLpi6VfCOviTktKlFusQixdEKWmEBUKNaIpjZRSSOXSgzaaKLdabrm1/9nZ+/f+vd/vz/v9+Xy+zZ7PRorYoZqyLrCwQdEAixxVOEXNNnjX2nUSRlkqGmWowk8lxR50JPy9Bo6qJXaXwNvREBvnThPEPrewryLhcAnj5WE15Fqi8W7R1sAuEu86S4ENikItFN4xkv9Af4nXSnUVcLiA9xzesFpivRRVeFKtsMRaKBhuSbjOELnAUtlSQUpXgdfB4Z1oSbnFEetbQ0IrAe+Y+pqnDcEJFj6S8LDZzZHwY4e3XONNlARraomNEt2bkvGsosA3ioyHm+6jCMbI59wqt4eeara28IzEmyPgoRaUOEDhTVdEJhmCoTWfC0p8aNkCp0oYqih2iqGi4yXeMkOsn4LdLLnmKfh/YogjNsPebeFGR4m9BJHLzB61XQ3BtpISfS2FugsK9FAtLWX1dCRcrCnUp44CNzuCowUZmxSRgYaE6Za0W2u/E7CVXCiI/UOR8aAm1+OSyE3mOUcwyc1zBBeoX1kiKy0Zfxck1Gsyulti11i83QTBF5Kg3pDQThFMVHiPSlK+0cSedng/VaS8bOZbtsBcTcZAR8JP5KeqQ1OYKAi20njdNNRpgnsU//K+JnaXJaGTomr7aYIphoRn9aeShJWKEq9LcozSF7QleEfDI5LYm5bgVkFkRwVDBCVu0DDIkGupo8TZBq+/pMQURYErJQmPKGKjNDkWOLx7Jd5QizdUweIaKrlP7SwJDhZvONjLkOsBBX9UpGxnydhXkfBLQ8IxgojQbLFnJf81JytSljclYYyEFyx0kVBvKWOFJmONpshGAcsduQY5giVNCV51eOdJYo/pLhbvM0uDHSevNKRcrKZIqnCtJeEsO95RoqcgGK4ocZcho1tTYtcZvH41pNQ7vA0WrhIfOSraIIntIAi+NXWCErdbkvrWwjRLrt0NKUdL6KSOscTOdMSOUtBHwL6OLA0vNSdynaWQEnCpIvKaIrJJEbvHkmuNhn6OjM8VkSGSqn1uYJCGHnq9I3aLhNME3t6GjIkO7xrNFumpyTNX/NrwX7CrIRiqqWijI9JO4d1iieykyfiposQIQ8YjjsjlBh6oHWbwRjgYJQn2NgSnNycmJAk3NiXhx44Sxykihxm8ybUwT1OVKySc7vi3OXVkdBJ4AyXBeksDXG0IhgtYY0lY5ahCD0ehborIk5aUWRJviMA7Xt5kyRjonrXENkm8yYqgs8VzgrJmClK20uMM3jRJ0FiQICQF9hdETlLQWRIb5ki6WDfWRPobvO6a4GP5mcOrNzDFELtTkONLh9dXE8xypEg7z8A9jkhrQ6Fhjlg/QVktJXxt4WXzT/03Q8IaQWSqIuEvloQ2mqC9Jfi7wRul4RX3pSPlzpoVlmCtI2jvKHCFhjcM3sN6lqF6HxnKelLjXWbwrpR4xzuCrTUZx2qq9oAh8p6ixCUGr78g8oyjRAtB5CZFwi80VerVpI0h+IeBxa6Zg6kWvpDHaioYYuEsRbDC3eOmC2JvGYLeioxGknL2UATNJN6hmtj1DlpLvDVmocYbrGCVJKOrg4X6DgddLA203BKMFngdJJFtFd7vJLm6KEpc5yjQrkk7M80SGe34X24nSex1Ra5Omgb71JKyg8SrU3i/kARKwWpH0kOGhKkObyfd0ZGjvyXlAkVZ4xRbYJ2irFMkFY1SwyWxr2oo4zlNiV+7zmaweFpT4kR3kaDAFW6xpSqzJay05FtYR4HmZhc9UxKbbfF2V8RG1MBmSaE+kmC6JnaRXK9gsiXhJHl/U0qM0WTcbyhwkYIvFGwjSbjfwhiJt8ZSQU+Bd5+marPMOkVkD0muxYLIfEuhh60x/J92itguihJSEMySVPQnTewnEm+620rTQEMsOfo4/kP/0ARvWjitlpSX7GxBgcMEsd3EEeYWvdytd+Saawi6aCIj1CkGb6Aj9rwhx16Cf3vAwFy5pyLhVonXzy51FDpdEblbkdJbUcEPDEFzQ8qNmhzzLTmmKWKbFCXeEuRabp6rxbvAtLF442QjQ+wEA9eL1xSR7Q0JXzlSHjJ4exq89yR0laScJ/FW6z4a73pFMEfDiRZvuvijIt86RaSFOl01riV2mD1UEvxGk/Geg5aWwGki1zgKPG9J2U8PEg8qYvMsZeytiTRXBMslCU8JSlxi8EabjwUldlDNLfzTUmCgxWsjqWCOHavYAqsknKFIO0yQ61VL5AVFxk6WhEaCAkdJgt9aSkzXlKNX2jEa79waYuc7gq0N3GDJGCBhoiTXUEPsdknCUE1CK0fwsiaylSF2uiDyO4XX3pFhNd7R4itFGc0k/ElBZwWvq+GC6szVeEoS/MZ+qylwpKNKv9Z469UOjqCjwlusicyTxG6VpNxcQ8IncoR4RhLbR+NdpGGmJWOcIzJGUuKPGpQg8rrG21dOMqQssJQ4RxH5jaUqnZuQ0F4Q+cjxLwPtpZbIAk3QTJHQWBE5S1BokoVtDd6lhqr9UpHSUxMcIYl9pojsb8h4SBOsMQcqvOWC2E8EVehqiJ1hrrAEbQxeK0NGZ0Gkq+guSRgniM23bIHVkqwx4hiHd7smaOyglyIyQuM978j4VS08J/A2G1KeMBRo4fBaSNhKUEZfQewVQ/C1I+MgfbEleEzCUw7mKXI0M3hd1EESVji8x5uQ41nxs1q4RMJCCXs7Iq9acpxn22oSDnQ/sJTxsCbHIYZiLyhY05TY0ZLIOQrGaSJDDN4t8pVaIrsqqFdEegtizc1iTew5Q4ayBDMUsQMkXocaYkc0hZua412siZ1rSXlR460zRJ5SlHGe5j801RLMlJTxtaOM3Q1pvxJ45zUlWFD7rsAbpfEm1JHxG0eh8w2R7QQVzBUw28FhFp5QZzq8t2rx2joqulYTWSuJdTYfWwqMFMcovFmSyJPNyLhE4E10pHzYjOC3huArRa571ZsGajQpQx38SBP5pyZB6lMU3khDnp0MBV51BE9o2E+TY5Ml2E8S7C0o6w1xvCZjf0HkVEHCzFoyNmqC+9wdcqN+Tp7jSDheE9ws8Y5V0NJCn2bk2tqSY4okdrEhx1iDN8cSudwepWmAGXKcJXK65H9to8jYQRH7SBF01ESUJdd0TayVInaWhLkOjlXE5irKGOnI6GSWGCJa482zBI9rCr0jyTVcEuzriC1vcr6mwFGSiqy5zMwxBH/TJHwjSPhL8+01kaaSUuMFKTcLEvaUePcrSmwn8DZrgikWb7CGPxkSjhQwrRk57tctmxLsb9sZvL9LSlyuSLlWkqOjwduo8b6Uv1DkmudIeFF2dHCgxVtk8dpIvHpBxhEOdhKk7OLIUSdJ+cSRY57B+0DgGUUlNfpthTfGkauzxrvTsUUaCVhlKeteTXCoJDCa2NOKhOmC4G1H8JBd4OBZReSRGkqcb/CO1PyLJTLB4j1q8JYaIutEjSLX8YKM+a6phdMsdLFUoV5RTm9JSkuDN8WcIon0NZMNZWh1q8C7SJEwV5HxrmnnTrf3KoJBlmCYI2ilSLlfEvlE4011NNgjgthzEua0oKK7JLE7HZHlEl60BLMVFewg4EWNt0ThrVNEVkkiTwpKXSWJzdRENgvKGq4IhjsiezgSFtsfCUq8qki5S1LRQeYQQ4nemmCkImWMw3tFUoUBZk4NOeZYEp4XRKTGa6wJjrWNHBVJR4m3FCnbuD6aak2WsMTh3SZImGCIPKNgsDpVwnsa70K31lCFJZYcwwSMFcQulGTsZuEaSdBXkPGZhu0FsdUO73RHjq8MPGGIfaGIbVTk6iuI3GFgucHrIQkmWSJdBd7BBu+uOryWAhY7+Lki9rK5wtEQzWwvtbqGhIMFwWRJsElsY4m9IIg9L6lCX0VklaPAYkfkZEGDnOWowlBJjtMUkcGK4Lg6EtoZInMUBVYLgn0UsdmCyCz7gIGHFfk+k1QwTh5We7A9x+IdJ6CvIkEagms0hR50eH9UnTQJ+2oiKyVlLFUE+8gBGu8MQ3CppUHesnjTHN4QB/UGPhCTHLFPHMFrCqa73gqObUJGa03wgbhHkrCfpEpzNLE7JDS25FMKhlhKKWKfCgqstLCPu1zBXy0J2ztwjtixBu8UTRn9LVtkmCN2iyFhtME70JHRQ1KVZXqKI/KNIKYMCYs1GUMEKbM1bKOI9LDXC7zbHS+bt+1MTWS9odA9DtrYtpbImQJ2VHh/lisEwaHqUk1kjKTAKknkBEXkbkdMGwq0dnhzLJF3NJH3JVwrqOB4Sca2hti75nmJN0WzxS6UxDYoEpxpa4htVlRjkYE7DZGzJVU72uC9IyhQL4i8YfGWSYLLNcHXloyz7QhNifmKSE9JgfGmuyLhc403Xm9vqcp6gXe3xuuv8F6VJNxkyTHEkHG2g0aKXL0MsXc1bGfgas2//dCONXiNLCX+5mB7eZIl1kHh7ajwpikyzlUUWOVOsjSQlsS+M0R+pPje/dzBXRZGO0rMtgQrLLG9VSu9n6CMXS3BhwYmSoIBhsjNBmZbgusE9BCPCP5triU4VhNbJfE+swSP27aayE8tuTpYYjtrYjMVGZdp2NpS1s6aBnKSHDsbKuplKbHM4a0wMFd/5/DmGyKrJSUaW4IBrqUhx0vyfzTBBLPIUcnZdrAkNsKR0sWRspumSns6Ch0v/qqIbBYUWKvPU/CFoyrDJGwSNFhbA/MlzKqjrO80hRbpKx0Jewsi/STftwGSlKc1JZyAzx05dhLEdnfQvhZOqiHWWEAHC7+30FuRcZUgaO5gpaIK+xsiHRUsqaPElTV40xQZQ107Q9BZE1nryDVGU9ZSQ47bmhBpLcYpUt7S+xuK/FiT8qKjwXYw5ypS2iuCv7q1gtgjhuBuB8LCFY5cUuCNtsQOFcT+4Ih9JX+k8Ea6v0iCIRZOtCT0Et00JW5UeC85Cg0ScK0k411HcG1zKtre3SeITBRk7WfwDhEvaYLTHP9le0m8By0JDwn4TlLW/aJOvGHxdjYUes+ScZigCkYQdNdEOhkiezgShqkx8ueKjI8lDfK2oNiOFvrZH1hS+tk7NV7nOmLHicGWEgubkXKdwdtZknCLJXaCpkrjZBtLZFsDP9CdxWsSr05Sxl6CMmoFbCOgryX40uDtamB7SVmXW4Ihlgpmq+00tBKUUa83WbjLUNkzDmY7cow1JDygyPGlhgGKYKz4vcV7QBNbJIgM11TUqZaMdwTeSguH6rOaw1JRKzaaGyxVm2EJ/uCIrVWUcZUkcp2grMsEjK+DMwS59jQk3Kd6SEq1d0S6uVmO4Bc1lDXTUcHjluCXEq+1OlBDj1pi9zgiXxnKuE0SqTXwhqbETW6RggMEnGl/q49UT2iCzgJvRwVXS2K/d6+ZkyUl7jawSVLit46EwxVljDZwoSQ20sDBihztHfk2yA8NVZghiXwrYHQdfKAOtzsayjhY9bY0yE2CWEeJ9xfzO423xhL5syS2TFJofO2pboHob0nY4GiAgRrvGQEDa/FWSsoaaYl0syRsEt3kWoH3B01shCXhTUWe9w3Bt44SC9QCh3eShQctwbaK2ApLroGCMlZrYqvlY3qYhM0aXpFkPOuoqJ3Dm6fxXrGwVF9gCWZagjPqznfkuMKQ8DPTQRO8ZqG1hPGKEm9IgpGW4DZDgTNriTxvFiq+Lz+0cKfp4wj6OCK9JSnzNSn9LFU7UhKZZMnYwcJ8s8yRsECScK4j5UOB95HFO0CzhY4xJxuCix0lDlEUeMdS6EZBkTsUkZ4K74dugyTXS7aNgL8aqjDfkCE0ZbwkCXpaWCKhl8P7VD5jxykivSyxyZrYERbe168LYu9ZYh86IkscgVLE7tWPKmJv11CgoyJltMEbrohtVAQfO4ImltiHEroYEs7RxAarVpY8AwXMcMReFOTYWe5iiLRQxJ5Q8DtJ8LQhWOhIeFESPGsILhbNDRljNbHzNRlTFbk2S3L0NOS6V1KFJYKUbSTcIIhM0wQ/s2TM0SRMNcQmSap3jCH4yhJZKSkwyRHpYYgsFeQ4U7xoCB7VVOExhXepo9ABBsYbvGWKXPME3lyH95YioZ0gssQRWWbI+FaSMkXijZXwgiTlYdPdkNLaETxlyDVIwqeaEus0aTcYcg0RVOkpR3CSJqIddK+90JCxzsDVloyrFd5ZAr4TBKfaWa6boEA7C7s6EpYaeFPjveooY72mjIccLHJ9HUwVlDhKkmutJDJBwnp1rvulJZggKDRfbXAkvC/4l3ozQOG9a8lxjx0i7nV4jSXc7vhe3OwIxjgSHjdEhhsif9YkPGlus3iLFDnWOFhtCZbJg0UbQcIaR67JjthoCyMEZRwhiXWyxO5QxI6w5NhT4U1WsJvDO60J34fW9hwzwlKij6ZAW9ne4L0s8C6XeBMEkd/LQy1VucBRot6QMlbivaBhoBgjqGiCJNhsqVp/S2SsG6DIONCR0dXhvWbJ+MRRZJkkuEjgDXJjFQW6SSL7GXK8Z2CZg7cVsbWGoKmEpzQ5elpiy8Ryg7dMkLLUEauzeO86CuwlSOlgYLojZWeJ9xM3S1PWfEfKl5ISLQ0MEKR8YOB2QfCxJBjrKPCN4f9MkaSsqoVXJBmP7EpFZ9UQfOoOFwSzBN4MQ8LsGrymlipcJQhmy0GaQjPqCHaXRwuCZwRbqK2Fg9wlClZqYicrIgMdZfxTQ0c7TBIbrChxmuzoKG8XRaSrIhhiyNFJkrC7oIAWMEOQa5aBekPCRknCo4IKPrYkvCDI8aYmY7WFtprgekcJZ3oLIqssCSMtFbQTJKwXYy3BY5oCh2iKPCpJOE+zRdpYgi6O2KmOAgvVCYaU4ySRek1sgyFhJ403QFHiVEmJHwtybO1gs8Hr5+BETQX3War0qZngYGgtVZtoqd6vFSk/UwdZElYqyjrF4HXUeFspIi9IGKf4j92pKGAdCYMVsbcV3kRF0N+R8LUd5PCsIGWoxDtBkCI0nKofdJQxT+LtZflvuc8Q3CjwWkq8KwUpHzkK/NmSsclCL0nseQdj5FRH5CNHSgtLiW80Of5HU9Hhlsga9bnBq3fEVltKfO5IaSTmGjjc4J0otcP7QsJUSQM8pEj5/wCuUuC2DWz8AAAAAElFTkSuQmCC"); -} diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/blackboard.css b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/blackboard.css deleted file mode 100644 index f2bde690c8528a8f6cd47d3ce0e0d2c56b62e222..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/blackboard.css +++ /dev/null @@ -1,25 +0,0 @@ -/* Port of TextMate's Blackboard theme */ - -.cm-s-blackboard.CodeMirror { background: #0C1021; color: #F8F8F8; } -.cm-s-blackboard .CodeMirror-selected { background: #253B76 !important; } -.cm-s-blackboard .CodeMirror-gutters { background: #0C1021; border-right: 0; } -.cm-s-blackboard .CodeMirror-linenumber { color: #888; } -.cm-s-blackboard .CodeMirror-cursor { border-left: 1px solid #A7A7A7 !important; } - -.cm-s-blackboard .cm-keyword { color: #FBDE2D; } -.cm-s-blackboard .cm-atom { color: #D8FA3C; } -.cm-s-blackboard .cm-number { color: #D8FA3C; } -.cm-s-blackboard .cm-def { color: #8DA6CE; } -.cm-s-blackboard .cm-variable { color: #FF6400; } -.cm-s-blackboard .cm-operator { color: #FBDE2D;} -.cm-s-blackboard .cm-comment { color: #AEAEAE; } -.cm-s-blackboard .cm-string { color: #61CE3C; } -.cm-s-blackboard .cm-string-2 { color: #61CE3C; } -.cm-s-blackboard .cm-meta { color: #D8FA3C; } -.cm-s-blackboard .cm-error { background: #9D1E15; color: #F8F8F8; } -.cm-s-blackboard .cm-builtin { color: #8DA6CE; } -.cm-s-blackboard .cm-tag { color: #8DA6CE; } -.cm-s-blackboard .cm-attribute { color: #8DA6CE; } -.cm-s-blackboard .cm-header { color: #FF6400; } -.cm-s-blackboard .cm-hr { color: #AEAEAE; } -.cm-s-blackboard .cm-link { color: #8DA6CE; } diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/cobalt.css b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/cobalt.css deleted file mode 100644 index 6095799f364dba2c3c876b0d875dd2364b0e21c1..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/cobalt.css +++ /dev/null @@ -1,18 +0,0 @@ -.cm-s-cobalt.CodeMirror { background: #002240; color: white; } -.cm-s-cobalt div.CodeMirror-selected { background: #b36539 !important; } -.cm-s-cobalt .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } -.cm-s-cobalt .CodeMirror-linenumber { color: #d0d0d0; } -.cm-s-cobalt .CodeMirror-cursor { border-left: 1px solid white !important; } - -.cm-s-cobalt span.cm-comment { color: #08f; } -.cm-s-cobalt span.cm-atom { color: #845dc4; } -.cm-s-cobalt span.cm-number, .cm-s-cobalt span.cm-attribute { color: #ff80e1; } -.cm-s-cobalt span.cm-keyword { color: #ffee80; } -.cm-s-cobalt span.cm-string { color: #3ad900; } -.cm-s-cobalt span.cm-meta { color: #ff9d00; } -.cm-s-cobalt span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #9effff; } -.cm-s-cobalt span.cm-variable-3, .cm-s-cobalt span.cm-def { color: white; } -.cm-s-cobalt span.cm-error { color: #9d1e15; } -.cm-s-cobalt span.cm-bracket { color: #d8d8d8; } -.cm-s-cobalt span.cm-builtin, .cm-s-cobalt span.cm-special { color: #ff9e59; } -.cm-s-cobalt span.cm-link { color: #845dc4; } diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/eclipse.css b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/eclipse.css deleted file mode 100644 index 47d66a012e6f0b765ad64e6807c24ffbffa83658..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/eclipse.css +++ /dev/null @@ -1,25 +0,0 @@ -.cm-s-eclipse span.cm-meta {color: #FF1717;} -.cm-s-eclipse span.cm-keyword { line-height: 1em; font-weight: bold; color: #7F0055; } -.cm-s-eclipse span.cm-atom {color: #219;} -.cm-s-eclipse span.cm-number {color: #164;} -.cm-s-eclipse span.cm-def {color: #00f;} -.cm-s-eclipse span.cm-variable {color: black;} -.cm-s-eclipse span.cm-variable-2 {color: #0000C0;} -.cm-s-eclipse span.cm-variable-3 {color: #0000C0;} -.cm-s-eclipse span.cm-property {color: black;} -.cm-s-eclipse span.cm-operator {color: black;} -.cm-s-eclipse span.cm-comment {color: #3F7F5F;} -.cm-s-eclipse span.cm-string {color: #2A00FF;} -.cm-s-eclipse span.cm-string-2 {color: #f50;} -.cm-s-eclipse span.cm-error {color: #f00;} -.cm-s-eclipse span.cm-qualifier {color: #555;} -.cm-s-eclipse span.cm-builtin {color: #30a;} -.cm-s-eclipse span.cm-bracket {color: #cc7;} -.cm-s-eclipse span.cm-tag {color: #170;} -.cm-s-eclipse span.cm-attribute {color: #00c;} -.cm-s-eclipse span.cm-link {color: #219;} - -.cm-s-eclipse .CodeMirror-matchingbracket { - border:1px solid grey; - color:black !important;; -} diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/elegant.css b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/elegant.css deleted file mode 100644 index d0ce0cb566b9fb4334fdbaede603aa72ece2800f..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/elegant.css +++ /dev/null @@ -1,10 +0,0 @@ -.cm-s-elegant span.cm-number, .cm-s-elegant span.cm-string, .cm-s-elegant span.cm-atom {color: #762;} -.cm-s-elegant span.cm-comment {color: #262; font-style: italic; line-height: 1em;} -.cm-s-elegant span.cm-meta {color: #555; font-style: italic; line-height: 1em;} -.cm-s-elegant span.cm-variable {color: black;} -.cm-s-elegant span.cm-variable-2 {color: #b11;} -.cm-s-elegant span.cm-qualifier {color: #555;} -.cm-s-elegant span.cm-keyword {color: #730;} -.cm-s-elegant span.cm-builtin {color: #30a;} -.cm-s-elegant span.cm-error {background-color: #fdd;} -.cm-s-elegant span.cm-link {color: #762;} diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/erlang-dark.css b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/erlang-dark.css deleted file mode 100644 index ea9c26c44da21c9847eb2384b19da7907dae84fa..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/erlang-dark.css +++ /dev/null @@ -1,21 +0,0 @@ -.cm-s-erlang-dark.CodeMirror { background: #002240; color: white; } -.cm-s-erlang-dark div.CodeMirror-selected { background: #b36539 !important; } -.cm-s-erlang-dark .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } -.cm-s-erlang-dark .CodeMirror-linenumber { color: #d0d0d0; } -.cm-s-erlang-dark .CodeMirror-cursor { border-left: 1px solid white !important; } - -.cm-s-erlang-dark span.cm-atom { color: #845dc4; } -.cm-s-erlang-dark span.cm-attribute { color: #ff80e1; } -.cm-s-erlang-dark span.cm-bracket { color: #ff9d00; } -.cm-s-erlang-dark span.cm-builtin { color: #eeaaaa; } -.cm-s-erlang-dark span.cm-comment { color: #7777ff; } -.cm-s-erlang-dark span.cm-def { color: #ee77aa; } -.cm-s-erlang-dark span.cm-error { color: #9d1e15; } -.cm-s-erlang-dark span.cm-keyword { color: #ffee80; } -.cm-s-erlang-dark span.cm-meta { color: #50fefe; } -.cm-s-erlang-dark span.cm-number { color: #ffd0d0; } -.cm-s-erlang-dark span.cm-operator { color: #dd1111; } -.cm-s-erlang-dark span.cm-string { color: #3ad900; } -.cm-s-erlang-dark span.cm-tag { color: #9effff; } -.cm-s-erlang-dark span.cm-variable { color: #50fe50; } -.cm-s-erlang-dark span.cm-variable-2 { color: #ee00ee; } diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/lesser-dark.css b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/lesser-dark.css deleted file mode 100644 index 67f71ad7272b4947b2b0ac26a85952ee219b80c9..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/lesser-dark.css +++ /dev/null @@ -1,44 +0,0 @@ -/* -http://lesscss.org/ dark theme -Ported to CodeMirror by Peter Kroon -*/ -.cm-s-lesser-dark { - line-height: 1.3em; -} -.cm-s-lesser-dark { - font-family: 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', 'Monaco', Courier, monospace !important; -} - -.cm-s-lesser-dark.CodeMirror { background: #262626; color: #EBEFE7; text-shadow: 0 -1px 1px #262626; } -.cm-s-lesser-dark div.CodeMirror-selected {background: #45443B !important;} /* 33322B*/ -.cm-s-lesser-dark .CodeMirror-cursor { border-left: 1px solid white !important; } -.cm-s-lesser-dark pre { padding: 0 8px; }/*editable code holder*/ - -div.CodeMirror span.CodeMirror-matchingbracket { color: #7EFC7E; }/*65FC65*/ - -.cm-s-lesser-dark .CodeMirror-gutters { background: #262626; border-right:1px solid #aaa; } -.cm-s-lesser-dark .CodeMirror-linenumber { color: #777; } - -.cm-s-lesser-dark span.cm-keyword { color: #599eff; } -.cm-s-lesser-dark span.cm-atom { color: #C2B470; } -.cm-s-lesser-dark span.cm-number { color: #B35E4D; } -.cm-s-lesser-dark span.cm-def {color: white;} -.cm-s-lesser-dark span.cm-variable { color:#D9BF8C; } -.cm-s-lesser-dark span.cm-variable-2 { color: #669199; } -.cm-s-lesser-dark span.cm-variable-3 { color: white; } -.cm-s-lesser-dark span.cm-property {color: #92A75C;} -.cm-s-lesser-dark span.cm-operator {color: #92A75C;} -.cm-s-lesser-dark span.cm-comment { color: #666; } -.cm-s-lesser-dark span.cm-string { color: #BCD279; } -.cm-s-lesser-dark span.cm-string-2 {color: #f50;} -.cm-s-lesser-dark span.cm-meta { color: #738C73; } -.cm-s-lesser-dark span.cm-error { color: #9d1e15; } -.cm-s-lesser-dark span.cm-qualifier {color: #555;} -.cm-s-lesser-dark span.cm-builtin { color: #ff9e59; } -.cm-s-lesser-dark span.cm-bracket { color: #EBEFE7; } -.cm-s-lesser-dark span.cm-tag { color: #669199; } -.cm-s-lesser-dark span.cm-attribute {color: #00c;} -.cm-s-lesser-dark span.cm-header {color: #a0a;} -.cm-s-lesser-dark span.cm-quote {color: #090;} -.cm-s-lesser-dark span.cm-hr {color: #999;} -.cm-s-lesser-dark span.cm-link {color: #00c;} diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/monokai.css b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/monokai.css deleted file mode 100644 index a0b3c7c0afeba20b004492b77091948d9bd4b59c..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/monokai.css +++ /dev/null @@ -1,28 +0,0 @@ -/* Based on Sublime Text's Monokai theme */ - -.cm-s-monokai.CodeMirror {background: #272822; color: #f8f8f2;} -.cm-s-monokai div.CodeMirror-selected {background: #49483E !important;} -.cm-s-monokai .CodeMirror-gutters {background: #272822; border-right: 0px;} -.cm-s-monokai .CodeMirror-linenumber {color: #d0d0d0;} -.cm-s-monokai .CodeMirror-cursor {border-left: 1px solid #f8f8f0 !important;} - -.cm-s-monokai span.cm-comment {color: #75715e;} -.cm-s-monokai span.cm-atom {color: #ae81ff;} -.cm-s-monokai span.cm-number {color: #ae81ff;} - -.cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute {color: #a6e22e;} -.cm-s-monokai span.cm-keyword {color: #f92672;} -.cm-s-monokai span.cm-string {color: #e6db74;} - -.cm-s-monokai span.cm-variable {color: #a6e22e;} -.cm-s-monokai span.cm-variable-2 {color: #9effff;} -.cm-s-monokai span.cm-def {color: #fd971f;} -.cm-s-monokai span.cm-error {background: #f92672; color: #f8f8f0;} -.cm-s-monokai span.cm-bracket {color: #f8f8f2;} -.cm-s-monokai span.cm-tag {color: #f92672;} -.cm-s-monokai span.cm-link {color: #ae81ff;} - -.cm-s-monokai .CodeMirror-matchingbracket { - text-decoration: underline; - color: white !important; -} diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/neat.css b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/neat.css deleted file mode 100644 index 8a307f802c4b24d14b75f04fb2cb679080d1b75c..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/neat.css +++ /dev/null @@ -1,9 +0,0 @@ -.cm-s-neat span.cm-comment { color: #a86; } -.cm-s-neat span.cm-keyword { line-height: 1em; font-weight: bold; color: blue; } -.cm-s-neat span.cm-string { color: #a22; } -.cm-s-neat span.cm-builtin { line-height: 1em; font-weight: bold; color: #077; } -.cm-s-neat span.cm-special { line-height: 1em; font-weight: bold; color: #0aa; } -.cm-s-neat span.cm-variable { color: black; } -.cm-s-neat span.cm-number, .cm-s-neat span.cm-atom { color: #3a3; } -.cm-s-neat span.cm-meta {color: #555;} -.cm-s-neat span.cm-link { color: #3a3; } diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/night.css b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/night.css deleted file mode 100644 index 8804a399a189efc06c01fcc9bca41549d3f28e92..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/night.css +++ /dev/null @@ -1,21 +0,0 @@ -/* Loosely based on the Midnight Textmate theme */ - -.cm-s-night.CodeMirror { background: #0a001f; color: #f8f8f8; } -.cm-s-night div.CodeMirror-selected { background: #447 !important; } -.cm-s-night .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; } -.cm-s-night .CodeMirror-linenumber { color: #f8f8f8; } -.cm-s-night .CodeMirror-cursor { border-left: 1px solid white !important; } - -.cm-s-night span.cm-comment { color: #6900a1; } -.cm-s-night span.cm-atom { color: #845dc4; } -.cm-s-night span.cm-number, .cm-s-night span.cm-attribute { color: #ffd500; } -.cm-s-night span.cm-keyword { color: #599eff; } -.cm-s-night span.cm-string { color: #37f14a; } -.cm-s-night span.cm-meta { color: #7678e2; } -.cm-s-night span.cm-variable-2, .cm-s-night span.cm-tag { color: #99b2ff; } -.cm-s-night span.cm-variable-3, .cm-s-night span.cm-def { color: white; } -.cm-s-night span.cm-error { color: #9d1e15; } -.cm-s-night span.cm-bracket { color: #8da6ce; } -.cm-s-night span.cm-comment { color: #6900a1; } -.cm-s-night span.cm-builtin, .cm-s-night span.cm-special { color: #ff9e59; } -.cm-s-night span.cm-link { color: #845dc4; } diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/rubyblue.css b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/rubyblue.css deleted file mode 100644 index 8817de07bf6a39fdaf744f4a687a268cf4a753dc..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/rubyblue.css +++ /dev/null @@ -1,21 +0,0 @@ -.cm-s-rubyblue { font:13px/1.4em Trebuchet, Verdana, sans-serif; } /* - customized editor font - */ - -.cm-s-rubyblue.CodeMirror { background: #112435; color: white; } -.cm-s-rubyblue div.CodeMirror-selected { background: #38566F !important; } -.cm-s-rubyblue .CodeMirror-gutters { background: #1F4661; border-right: 7px solid #3E7087; } -.cm-s-rubyblue .CodeMirror-linenumber { color: white; } -.cm-s-rubyblue .CodeMirror-cursor { border-left: 1px solid white !important; } - -.cm-s-rubyblue span.cm-comment { color: #999; font-style:italic; line-height: 1em; } -.cm-s-rubyblue span.cm-atom { color: #F4C20B; } -.cm-s-rubyblue span.cm-number, .cm-s-rubyblue span.cm-attribute { color: #82C6E0; } -.cm-s-rubyblue span.cm-keyword { color: #F0F; } -.cm-s-rubyblue span.cm-string { color: #F08047; } -.cm-s-rubyblue span.cm-meta { color: #F0F; } -.cm-s-rubyblue span.cm-variable-2, .cm-s-rubyblue span.cm-tag { color: #7BD827; } -.cm-s-rubyblue span.cm-variable-3, .cm-s-rubyblue span.cm-def { color: white; } -.cm-s-rubyblue span.cm-error { color: #AF2018; } -.cm-s-rubyblue span.cm-bracket { color: #F0F; } -.cm-s-rubyblue span.cm-link { color: #F4C20B; } -.cm-s-rubyblue span.CodeMirror-matchingbracket { color:#F0F !important; } -.cm-s-rubyblue span.cm-builtin, .cm-s-rubyblue span.cm-special { color: #FF9D00; } diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/solarized.css b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/solarized.css deleted file mode 100644 index 06a6c7fa1b7d85c7fc3443077456c6b61156a0e0..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/solarized.css +++ /dev/null @@ -1,207 +0,0 @@ -/* -Solarized theme for code-mirror -http://ethanschoonover.com/solarized -*/ - -/* -Solarized color pallet -http://ethanschoonover.com/solarized/img/solarized-palette.png -*/ - -.solarized.base03 { color: #002b36; } -.solarized.base02 { color: #073642; } -.solarized.base01 { color: #586e75; } -.solarized.base00 { color: #657b83; } -.solarized.base0 { color: #839496; } -.solarized.base1 { color: #93a1a1; } -.solarized.base2 { color: #eee8d5; } -.solarized.base3 { color: #fdf6e3; } -.solarized.solar-yellow { color: #b58900; } -.solarized.solar-orange { color: #cb4b16; } -.solarized.solar-red { color: #dc322f; } -.solarized.solar-magenta { color: #d33682; } -.solarized.solar-violet { color: #6c71c4; } -.solarized.solar-blue { color: #268bd2; } -.solarized.solar-cyan { color: #2aa198; } -.solarized.solar-green { color: #859900; } - -/* Color scheme for code-mirror */ - -.cm-s-solarized { - line-height: 1.45em; - font-family: Menlo,Monaco,"Andale Mono","lucida console","Courier New",monospace !important; - color-profile: sRGB; - rendering-intent: auto; -} -.cm-s-solarized.cm-s-dark { - color: #839496; - background-color: #002b36; - text-shadow: #002b36 0 1px; -} -.cm-s-solarized.cm-s-light { - background-color: #fdf6e3; - color: #657b83; - text-shadow: #eee8d5 0 1px; -} - -.cm-s-solarized .CodeMirror-widget { - text-shadow: none; -} - - -.cm-s-solarized .cm-keyword { color: #cb4b16 } -.cm-s-solarized .cm-atom { color: #d33682; } -.cm-s-solarized .cm-number { color: #d33682; } -.cm-s-solarized .cm-def { color: #2aa198; } - -.cm-s-solarized .cm-variable { color: #268bd2; } -.cm-s-solarized .cm-variable-2 { color: #b58900; } -.cm-s-solarized .cm-variable-3 { color: #6c71c4; } - -.cm-s-solarized .cm-property { color: #2aa198; } -.cm-s-solarized .cm-operator {color: #6c71c4;} - -.cm-s-solarized .cm-comment { color: #586e75; font-style:italic; } - -.cm-s-solarized .cm-string { color: #859900; } -.cm-s-solarized .cm-string-2 { color: #b58900; } - -.cm-s-solarized .cm-meta { color: #859900; } -.cm-s-solarized .cm-error, -.cm-s-solarized .cm-invalidchar { - color: #586e75; - border-bottom: 1px dotted #dc322f; -} -.cm-s-solarized .cm-qualifier { color: #b58900; } -.cm-s-solarized .cm-builtin { color: #d33682; } -.cm-s-solarized .cm-bracket { color: #cb4b16; } -.cm-s-solarized .CodeMirror-matchingbracket { color: #859900; } -.cm-s-solarized .CodeMirror-nonmatchingbracket { color: #dc322f; } -.cm-s-solarized .cm-tag { color: #93a1a1 } -.cm-s-solarized .cm-attribute { color: #2aa198; } -.cm-s-solarized .cm-header { color: #586e75; } -.cm-s-solarized .cm-quote { color: #93a1a1; } -.cm-s-solarized .cm-hr { - color: transparent; - border-top: 1px solid #586e75; - display: block; -} -.cm-s-solarized .cm-link { color: #93a1a1; cursor: pointer; } -.cm-s-solarized .cm-special { color: #6c71c4; } -.cm-s-solarized .cm-em { - color: #999; - text-decoration: underline; - text-decoration-style: dotted; -} -.cm-s-solarized .cm-strong { color: #eee; } -.cm-s-solarized .cm-tab:before { - content: "➤"; /*visualize tab character*/ - color: #586e75; -} - -.cm-s-solarized.cm-s-dark .CodeMirror-focused .CodeMirror-selected { - background: #386774; - color: inherit; -} - -.cm-s-solarized.cm-s-dark ::selection { - background: #386774; - color: inherit; -} - -.cm-s-solarized.cm-s-dark .CodeMirror-selected { - background: #586e75; -} - -.cm-s-solarized.cm-s-light .CodeMirror-focused .CodeMirror-selected { - background: #eee8d5; - color: inherit; -} - -.cm-s-solarized.cm-s-light ::selection { - background: #eee8d5; - color: inherit; -} - -.cm-s-solarized.cm-s-light .CodeMirror-selected { - background: #93a1a1; -} - - - -/* Editor styling */ - - - -/* Little shadow on the view-port of the buffer view */ -.cm-s-solarized.CodeMirror { - -moz-box-shadow: inset 7px 0 12px -6px #000; - -webkit-box-shadow: inset 7px 0 12px -6px #000; - box-shadow: inset 7px 0 12px -6px #000; -} - -/* Gutter border and some shadow from it */ -.cm-s-solarized .CodeMirror-gutters { - padding: 0 15px 0 10px; - box-shadow: 0 10px 20px black; - border-right: 1px solid; -} - -/* Gutter colors and line number styling based of color scheme (dark / light) */ - -/* Dark */ -.cm-s-solarized.cm-s-dark .CodeMirror-gutters { - background-color: #073642; - border-color: #00232c; -} - -.cm-s-solarized.cm-s-dark .CodeMirror-linenumber { - text-shadow: #021014 0 -1px; -} - -/* Light */ -.cm-s-solarized.cm-s-light .CodeMirror-gutters { - background-color: #eee8d5; - border-color: #eee8d5; -} - -/* Common */ -.cm-s-solarized .CodeMirror-linenumber { - color: #586e75; -} - -.cm-s-solarized .CodeMirror-gutter .CodeMirror-gutter-text { - color: #586e75; -} - -.cm-s-solarized .CodeMirror-lines { - padding-left: 5px; -} - -.cm-s-solarized .CodeMirror-lines .CodeMirror-cursor { - border-left: 1px solid #819090; -} - -/* -Active line. Negative margin compensates left padding of the text in the -view-port -*/ -.cm-s-solarized .activeline { - margin-left: -20px; -} - -.cm-s-solarized.cm-s-dark .activeline { - background: rgba(255, 255, 255, 0.05); - -} -.cm-s-solarized.cm-s-light .activeline { - background: rgba(0, 0, 0, 0.05); -} - -/* -View-port and gutter both get little noise background to give it a real feel. -*/ -.cm-s-solarized.CodeMirror, -.cm-s-solarized .CodeMirror-gutters { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAQAAAAHUWYVAABFFUlEQVQYGbzBCeDVU/74/6fj9HIcx/FRHx9JCFmzMyGRURhLZIkUsoeRfUjS2FNDtr6WkMhO9sm+S8maJfu+Jcsg+/o/c+Z4z/t97/vezy3z+z8ekGlnYICG/o7gdk+wmSHZ1z4pJItqapjoKXWahm8NmV6eOTbWUOp6/6a/XIg6GQqmenJ2lDHyvCFZ2cBDbmtHA043VFhHwXxClWmeYAdLhV00Bd85go8VmaFCkbVkzlQENzfBDZ5gtN7HwF0KDrTwJ0dypSOzpaKCMwQHKTIreYIxlmhXTzTWkVm+LTynZhiSBT3RZQ7aGfjGEd3qyXQ1FDymqbKxpspERQN2MiRjNZlFFQXfCNFm9nM1zpAsoYjmtRTc5ajwuaXc5xrWskT97RaKzAGe5ARHhVUsDbjKklziiX5WROcJwSNCNI+9w1Jwv4Zb2r7lCMZ4oq5C0EdTx+2GzNuKpJ+iFf38JEWkHJn9DNF7mmBDITrWEg0VWL3pHU20tSZnuqWu+R3BtYa8XxV1HO7GyD32UkOpL/yDloINFTmvtId+nmAjxRw40VMwVKiwrKLE4bK5UOVntYwhOcSSXKrJHKPJedocpGjVz/ZMIbnYUPB10/eKCrs5apqpgVmWzBYWpmtKHecJPjaUuEgRDDaU0oZghCJ6zNMQ5ZhDYx05r5v2muQdM0EILtXUsaKiQX9WMEUotagQzFbUNN6NUPC2nm5pxEWGCjMc3GdJHjSU2kORLK/JGSrkfGEIjncU/CYUnOipoYemwj8tST9NsJmB7TUVXtbUtXATJVZXBMvYeTXJfobgJUPmGMP/yFaWonaa6BcFO3nqcIqCozSZoZoSr1g4zJOzuyGnxTEX3lUEJ7WcZgme8ddaWvWJo2AJR9DZU3CUIbhCSG6ybSwN6qtJVnCU2svDTP2ZInOw2cBTrqtQahtNZn9NcJ4l2NaSmSkkP1noZWnVwkLmdUPOwLZEwy2Z3S3R+4rIG9hcbpPXHFVWcQdZkn2FOta3cKWQnNRC5g1LsJah4GCzSVsKnCOY5OAFRTBekyyryeyilhFKva75r4Mc0aWanGEaThcy31s439KKxTzJYY5WTHPU1FtIHjQU3Oip4xlNzj/lBw23dYZVliQa7WAXf4shetcQfatI+jWRDBPmyNeW6A1P5kdDgyYJlba0BIM8BZu1JfrFwItyjcAMR3K0BWOIrtMEXyhyrlVEx3ui5dUBjmB/Q3CXW85R4mBD0s7B+4q5tKUjOlb9qqmhi5AZ6GFIC5HXtOobdYGlVdMVbNJ8toNTFcHxnoL+muBagcctjWnbNMuR00uI7nQESwg5q2qqrKWIfrNUmeQocY6HuyxJV02wj36w00yhpmUFenv4p6fUkZYqLyuinx2RGOjhCXYyJF84oiU00YMOOhhquNdfbOB7gU88pY4xJO8LVdp6/q2voeB4R04vIdhSE40xZObx1HGGJ/ja0LBthFInKaLPPFzuCaYaoj8JjPME8yoyxo6zlBqkiUZYgq00OYMswbWO5NGmq+xhipxHLRW29ARjNKXO0wRnear8XSg4XFPLKEPUS1GqvyLwiuBUoa7zpZ0l5xxFwWmWZC1H5h5FwU8eQ7K+g8UcVY6TMQreVQT/8uQ8Z+ALIXnSEa2pYZQneE9RZbSBNYXfWYJzW/h/4j4Dp1tYVcFIC5019Vyi4ThPqSFCzjGWaHQTBU8q6vrVwgxP9Lkm840imWKpcLCjYTtrKuwvsKSnrvHCXGkSMk9p6lhckfRpIeis+N2PiszT+mFLspyGleUhDwcLrZqmyeylxwjBcKHEapqkmyangyLZRVOijwOtCY5SsG5zL0OwlCJ4y5KznF3EUNDDrinwiyLZRzOXtlBbK5ITHFGLp8Q0R6ab6mS7enI2cFrxOyHvOCFaT1HThS1krjCwqWeurCkk+willhCC+RSZnRXBiZaC5RXRIZYKp2lyfrHwiKPKR0JDzrdU2EFgpidawlFDR6FgXUMNa+g1FY3bUQh2cLCwosRdnuQTS/S+JVrGLeWIvtQUvONJxlqSQYYKpwoN2kaocLjdVsis4Mk80ESF2YpSkzwldjHkjFCUutI/r+EHDU8oCs6yzL3PhWiEooZdFMkymlas4AcI3KmoMMNSQ3tHzjGWCrcJJdYyZC7QFGwjRL9p+MrRkAGWzIaWCn9W0F3TsK01c2ZvQw0byvxuQU0r1lM0qJO7wW0kRIMdDTtXEdzi4VIh+EoIHm0mWtAtpCixlabgn83fKTI7anJe9ST7WIK1DMGpQmYeA58ImV6ezOGOzK2Kgq01pd60cKWiUi9Lievb/0vIDPHQ05Kzt4ddPckQBQtoaurjyHnek/nKzpQLrVgKPjIkh2v4uyezpv+Xoo7fPFXaGFp1vaLKxQ4uUpQQS5VuQs7BCq4xRJv7fwpVvvFEB3j+620haOuocqMhWd6TTPAEx+mdFNGHdranFe95WrWmIvlY4F1Dle2ECgc6cto7SryuqGGGha0tFQ5V53migUKmg6XKAo4qS3mik+0OZpAhOLeZKicacgaYcyx5hypYQE02ZA4xi/pNhOQxR4klNKyqacj+mpxnLTnnGSo85++3ZCZq6lrZkXlGEX3o+C9FieccJbZWVFjC0Yo1FZnJhoYMFoI1hEZ9r6hwg75HwzBNhbZCdJEfJwTPGzJvaKImw1yYX1HDAmpXR+ZJQ/SmgqMNVQb5vgamGwLtt7VwvP7Qk1xpiM5x5Cyv93E06MZmgs0Nya2azIKOYKCGBQQW97RmhKNKF02JZqHEJ4o58qp7X5EcZmc56trXEqzjCBZ1MFGR87Ql2tSTs6CGxS05PTzRQorkbw7aKoKXFDXsYW42VJih/q+FP2BdTzDTwVqOYB13liM50vG7wy28qagyuIXMeQI/Oqq8bcn5wJI50xH00CRntyfpL1T4hydYpoXgNiFzoIUTDZnLNRzh4TBHwbYGDvZkxmlyJloyr6tRihpeUG94GnKtIznREF0tzJG/OOr73JBcrSh1k6WuTprgLU+mnSGnv6Zge0NNz+kTDdH8nuAuTdJDCNb21LCiIuqlYbqGzT3RAoZofQfjFazkqeNWdYaGvYTM001EW2oKPvVk1ldUGSgUtHFwjKM1h9jnFcmy5lChoLNaQMGGDsYbKixlaMBmmsx1QjCfflwTfO/gckW0ruZ3jugKR3R5W9hGUWqCgxuFgsuaCHorotGKzGaeZB9DMsaTnKCpMtwTvOzhYk0rdrArKCqcaWmVk1+F372ur1YkKxgatI8Qfe1gIX9wE9FgS8ESmuABIXnRUbCapcKe+nO7slClSZFzpV/LkLncEb1qiO42fS3R855Su2mCLh62t1SYZZYVmKwIHjREF2uihTzB20JOkz7dkxzYQnK0UOU494wh+VWRc6Un2kpTaVgLDFEkJ/uhzRcI0YKGgpGWOlocBU/a4fKoJ/pEaNV6jip3+Es9VXY078rGnmAdf7t9ylPXS34RBSuYPs1UecZTU78WanhBCHpZ5sAoTz0LGZKjPf9TRypqWEiTvOFglL1fCEY3wY/++rbk7C8bWebA6p6om6PgOL2kp44TFJlVNBXae2rqqdZztOJpT87GQsE9jqCPIe9VReZuQ/CIgacsyZdCpIScSYqcZk8r+nsyCzhyfhOqHGOIvrLknC8wTpFcaYiGC/RU1NRbUeUpocQOnkRpGOrIOcNRx+1uA0UrzhSSt+VyS3SJpnFWkzNDqOFGIWcfR86DnmARTQ1HKIL33ExPiemeOhYSSjzlSUZZuE4TveoJLnBUOFof6KiysCbnAEcZgcUNTDOwkqWu3RWtmGpZwlHhJENdZ3miGz0lJlsKnjbwqSHQjpxnFDlTLLwqJPMZMjd7KrzkSG7VsxXBZE+F8YZkb01Oe00yyRK9psh5SYh29ySPKBo2ylNht7ZkZnsKenjKNJu9PNEyZpaCHv4Kt6RQsLvAVp7M9kIimmCUwGeWqLMmGuIotYMmWNpSahkhZw9FqZsVnKJhsjAHvtHMsTM9fCI06Dx/u3vfUXCqfsKRc4oFY2jMsoo/7DJDwZ1CsIKnJu+J9ldkpmiCxQx1rWjI+T9FwcWWzOuaYH0Hj7klNRVWEQpmaqosakiGNTFHdjS/qnUdmf0NJW5xsL0HhimCCZZSRzmSPTXJQ4aaztAwtZnoabebJ+htCaZ7Cm535ByoqXKbX1WRc4Eh2MkRXWzImVc96Cj4VdOKVxR84VdQsIUM8Psoou2byVHyZFuq7O8otbSQ2UAoeEWTudATLGSpZzVLlXVkPU2Jc+27lsw2jmg5T5VhbeE3BT083K9WsTTkFU/Osi0rC5lRlpwRHUiesNS0sOvmqGML1aRbPAxTJD9ZKtxuob+hhl8cwYGWpJ8nub7t5p6coYbMovZ1BTdaKn1jYD6h4GFDNFyT/Kqe1XCXphXHOKLZmuRSRdBPEfVUXQzJm5YGPGGJdvAEr7hHNdGZnuBvrpciGmopOLf5N0uVMy0FfYToJk90uUCbJupaVpO53UJXR2bVpoU00V2KOo4zMFrBd0Jtz2pa0clT5Q5L8IpQ177mWQejPMEJhuQjS10ref6HHjdEhy1P1EYR7GtO0uSsKJQYLiTnG1rVScj5lyazpqWGl5uBbRWl7m6ixGOOnEsMJR7z8J0n6KMnCdxhiNYQCoZ6CmYLnO8omC3MkW3bktlPmEt/VQQHejL3+dOE5FlPdK/Mq8hZxxJtLyRrepLThYKbLZxkSb5W52vYxNOaOxUF0yxMUPwBTYqCzy01XayYK0sJyWBLqX0MwU5CzoymRzV0EjjeUeLgDpTo6ij42ZAzvD01dHUUTPLU96MdLbBME8nFBn7zJCMtJcZokn8YoqU0FS5WFKyniHobguMcmW8N0XkWZjkyN3hqOMtS08r+/xTBwpZSZ3qiVRX8SzMHHjfUNFjgHEPmY9PL3ykEzxkSre/1ZD6z/NuznuB0RcE1TWTm9zRgfUWVJiG6yrzgmWPXC8EAR4Wxhlad0ZbgQyEz3pG5RVEwwDJH2mgKpjcTiCOzn1lfUWANFbZ2BA8balnEweJC9J0iuaeZoI+ippFCztEKVvckR2iice1JvhVytrQwUAZpgsubCPaU7xUe9vWnaOpaSBEspalykhC9bUlOMpT42ZHca6hyrqKmw/wMR8H5ZmdFoBVJb03O4UL0tSNnvIeRmkrLWqrs78gcrEn2tpcboh0UPOW3UUR9PMk4T4nnNKWmCjlrefhCwxRNztfmIQVdDElvS4m1/WuOujoZCs5XVOjtKPGokJzsYCtFYoWonSPT21DheU/wWhM19FcElwqNGOsp9Q8N/cwXaiND1MmeL1Q5XROtYYgGeFq1aTMsoMmcrKjQrOFQTQ1fmBYhmW6o8Jkjc7iDJRTBIo5kgJD5yMEYA3srCg7VFKwiVJkmRCc5ohGOKhsYMn/XBLdo5taZjlb9YAlGWRimqbCsoY7HFAXLa5I1HPRxMMsQDHFkWtRNniqT9UEeNjcE7RUlrCJ4R2CSJuqlKHWvJXjAUNcITYkenuBRB84TbeepcqTj3zZyFJzgYQdHnqfgI0ddUwS6GqWpsKWhjq9cV0vBAEMN2znq+EBfIWT+pClYw5xsTlJU6GeIBsjGmmANTzJZiIYpgrM0Oa8ZMjd7NP87jxhqGOhJlnQtjuQpB+8aEE00wZFznSJPyHxgH3HkPOsJFvYk8zqCHzTs1BYOa4J3PFU+UVRZxlHDM4YavlNUuMoRveiZA2d7grMNc2g+RbSCEKzmgYsUmWmazFJyoiOZ4KnyhKOGRzWJa0+moyV4TVHDzn51Awtqaphfk/lRQ08FX1iiqxTB/kLwd0VynKfEvI6cd4XMV5bMhZ7gZUWVzYQ6Nm2BYzxJbw3bGthEUUMfgbGeorae6DxHtJoZ6alhZ0+ytiVoK1R4z5PTrOECT/SugseEOlb1MMNR4VRNcJy+V1Hg9ONClSZFZjdHlc6W6FBLdJja2MC5hhpu0DBYEY1TFGwiFAxRRCsYkiM9JRb0JNMVkW6CZYT/2EiTGWmo8k+h4FhDNE7BvppoTSFnmCV5xZKzvcCdDo7VVPnIU+I+Rc68juApC90MwcFCsJ5hDqxgScYKreruyQwTqrzoqDCmhWi4IbhB0Yrt3RGa6GfDv52rKXWhh28dyZaWUvcZeMTBaZoSGyiCtRU5J8iviioHaErs7Jkj61syVzTTgOcUOQ8buFBTYWdL5g3T4qlpe0+wvD63heAXRfCCIed9RbCsp2CiI7raUOYOTU13N8PNHvpaGvayo4a3LLT1lDrVEPT2zLUlheB1R+ZTRfKWJ+dcocLJfi11vyJ51lLqJ0WD7tRwryezjiV5W28uJO9qykzX8JDe2lHl/9oyBwa2UMfOngpXCixvKdXTk3wrsKmiVYdZIqsoWEERjbcUNDuiaQomGoIbFdEHmsyWnuR+IeriKDVLnlawlyNHKwKlSU631PKep8J4Q+ayjkSLKYLhalNHlYvttb6fHm0p6OApsZ4l2VfdqZkjuysy6ysKLlckf1KUutCTs39bmCgEyyoasIWlVaMF7mgmWtBT8Kol5xpH9IGllo8cJdopcvZ2sImlDmMIbtDk3KIpeNiS08lQw11NFPTwVFlPP6pJ2gvRfI7gQUfmNAtf6Gs0wQxDsKGlVBdF8rCa3jzdwMaGHOsItrZk7hAyOzpK9VS06j5F49b0VNGOOfKs3lDToMsMBe9ZWtHFEgxTJLs7qrygKZjUnmCYoeAqeU6jqWuLJup4WghOdvCYJnrSkSzoyRkm5M2StQwVltPkfCAk58tET/CSg+8MUecmotMEnhBKfWBIZsg2ihruMJQaoIm+tkTLKEqspMh00w95gvFCQRtDwTT1gVDDSEVdlwqZfxoQRbK0g+tbiBZxzKlpnpypejdDwTaeOvorMk/IJE10h9CqRe28hhLbe0pMsdSwv4ZbhKivo2BjDWfL8UKJgeavwlwb5KlwhyE4u4XkGE2ytZCznKLCDZZq42VzT8HLCrpruFbIfOIINmh/qCdZ1ZBc65kLHR1Bkyf5zn6pN3SvGKIlFNGplhrO9QSXanLOMQTLCa0YJCRrCZm/CZmrLTm7WzCK4GJDiWUdFeYx1LCFg3NMd0XmCuF3Y5rITLDUsYS9zoHVzwnJoYpSTQoObyEzr4cFBNqYTopoaU/wkyLZ2lPhX/5Y95ulxGTV7KjhWrOZgl8MyUUafjYraNjNU1N3IWcjT5WzWqjwtoarHSUObGYO3GCJZpsBlnJGPd6ZYLyl1GdCA2625IwwJDP8GUKymbzuyPlZlvTUsaUh5zFDhRWFzPKKZLAlWdcQbObgF9tOqOsmB1dqcqYJmWstFbZRRI9poolmqiLnU0POvxScpah2iSL5UJNzgScY5+AuIbpO0YD3NCW+dLMszFSdFCWGqG6eVq2uYVNDdICGD6W7EPRWZEY5gpsE9rUkS3mijzzJnm6UpUFXG1hCUeVoS5WfNcFpblELL2qqrCvMvRfd45oalvKU2tiQ6ePJOVMRXase9iTtLJztPxJKLWpo2CRDcJwn2sWSLKIO1WQWNTCvpVUvOZhgSC40JD0dOctaSqzkCRbXsKlb11Oip6PCJ0IwSJM31j3akRxlP7Rwn6aGaUL0qiLnJkvB3xWZ2+Q1TfCwpQH3G0o92UzmX4o/oJNQMMSQc547wVHhdk+VCw01DFYEnTxzZKAm74QmeNNR1w6WzEhNK15VJzuCdxQ53dRUDws5KvwgBMOEgpcVNe0hZI6RXT1Jd0cyj5nsaEAHgVmGaJIlWdsc5Ui2ElrRR6jrRAttNMEAIWrTDFubkZaok7/AkzfIwfuWVq0jHzuCK4QabtLUMVPB3kJ0oyHTSVFlqMALilJf2Rf8k5aaHtMfayocLBS8L89oKoxpJvnAkDPa0qp5DAUTHKWmCcnthlou8iCKaFFLHWcINd1nyIwXqrSxMNmSs6KmoL2QrKuWtlQ5V0120xQ5vRyZS1rgFkWwhiOwiuQbR0OOVhQM9iS3tiXp4RawRPMp5tDletOOBL95MpM01dZTBM9pkn5qF010rIeHFcFZhmSGpYpTsI6nwhqe5C9ynhlpp5ophuRb6WcJFldkVnVEwwxVfrVkvnWUuNLCg5bgboFHPDlDPDmnK7hUrWiIbjadDclujlZcaokOFup4Ri1kacV6jmrrK1hN9bGwpKEBQ4Q6DvIUXOmo6U5LqQM6EPyiKNjVkPnJkDPNEaxhiFay5ExW1NXVUGqcpYYdPcGiCq7z/TSlbhL4pplWXKd7NZO5QQFrefhRQW/NHOsqcIglc4UhWklR8K0QzbAw08CBDnpbgqXdeD/QUsM4RZXDFBW6WJKe/mFPdH0LtBgiq57wFLzlyQzz82qYx5D5WJP5yVJDW01BfyHnS6HKO/reZqId1WGa4Hkh2kWodJ8i6KoIPlAj2hPt76CzXsVR6koPRzWTfKqIentatYpQw2me4AA3y1Kind3SwoOKZDcFXTwl9tWU6mfgRk9d71sKtlNwrjnYw5tC5n5LdKiGry3JKNlHEd3oaMCFHrazBPMp/uNJ+V7IudcSbeOIdjUEdwl0VHCOZo5t6YluEuaC9mQeMgSfOyKnYGFHcIeQ84yQWbuJYJpZw5CzglDH7gKnWqqM9ZTaXcN0TeYhR84eQtJT76JJ1lREe7WnnvsMmRc9FQ7SBBM9mV3lCUdmHk/S2RAMt0QjFNFqQpWjDPQ01DXWUdDBkXziKPjGEP3VP+zIWU2t7im41FOloyWzn/L6dkUy3VLDaZ6appgDLHPjJEsyvJngWEPUyVBiAaHCTEXwrLvSEbV1e1gKJniicWorC1MUrVjB3uDhJE/wgSOzk1DXpk0k73qCM8xw2UvD5kJmDUfOomqMpWCkJRlvKXGmoeBm18USjVIk04SClxTB6YrgLAPLWYK9HLUt5cmc0vYES8GnTeRc6skZbQkWdxRsIcyBRzx1DbTk9FbU0caTPOgJHhJKnOGIVhQqvKmo0llRw9sabrZkDtdg3PqaKi9oatjY8B+G371paMg6+mZFNNtQ04mWBq3rYLOmtWWQp8KJnpy9DdFensyjdqZ+yY40VJlH8wcdLzC8PZnvHMFUTZUrDTkLyQaGus5X5LzpYAf3i+e/ZlhqGqWhh6Ou6xTR9Z6oi5AZZtp7Mj2EEm8oSpxiYZCHU/1fbGdNNNRRoZMhmilEb2gqHOEJDtXkHK/JnG6IrvbPCwV3NhONVdS1thBMs1T4QOBcTWa2IzhMk2nW5Kyn9tXUtpv9RsG2msxk+ZsQzRQacJncpgke0+T8y5Fzj8BiGo7XlJjaTIlpQs7KFjpqGnKuoyEPeIKnFMkZHvopgh81ySxNFWvJWcKRs70j2FOT012IllEEO1n4pD1513Yg2ssQPOThOkvyrqHUdEXOSEsihmBbTbKX1kLBPWqWkLOqJbjB3GBIZmoa8qWl4CG/iZ7oiA72ZL7TJNeZUY7kFQftDcHHluBzRbCegzMtrRjVQpX2lgoPKKLJAkcbMl01XK2p7yhL8pCBbQ3BN2avJgKvttcrWDK3CiUOVxQ8ZP+pqXKyIxnmBymCg5vJjNfkPK4+c8cIfK8ocVt7kmfd/I5SR1hKvCzUtb+lhgc00ZaO6CyhIQP1Uv4yIZjload72PXX0OIJvnFU+0Zf6MhsJwTfW0r0UwQfW4LNLZl5HK261JCZ4qnBaAreVAS3WrjV0LBnNDUNNDToCEeFfwgcb4gOEqLRhirWkexrCEYKVV711DLYEE1XBEsp5tpTGjorkomKYF9FDXv7fR3BGwbettSxnyL53MBPjsxDZjMh+VUW9NRxq1DhVk+FSxQcaGjV9Pawv6eGByw5qzoy7xk4RsOShqjJwWKe/1pEEfzkobeD/dQJmpqedcyBTy2sr4nGNRH0c0SPWTLrqAc0OQcb/gemKgqucQT7ySWKCn2EUotoCvpZct7RO2sy/QW0IWcXd7pQRQyZVwT2USRO87uhjioTLKV2brpMUcMQRbKH/N2T+UlTpaMls6cmc6CCNy3JdYYSUzzJQ4oSD3oKLncULOiJvjBEC2oqnCJkJluCYy2ZQ5so9YYlZ1VLlQU1mXEW1jZERwj/MUSRc24TdexlqLKfQBtDTScJUV8FszXBEY5ktpD5Ur9hYB4Nb1iikw3JoYpkKX+RodRKFt53MMuRnKSpY31PwYaGaILh3wxJGz9TkTPEETxoCWZrgvOlmyMzxFEwVJE5xZKzvyJ4WxEc16Gd4Xe3Weq4XH2jKRikqOkGQ87hQnC7wBmGYLAnesX3M+S87eFATauuN+Qcrh7xIxXJbUIdMw3JGE3ylCWzrieaqCn4zhGM19TQ3z1oH1AX+pWEqIc7wNGAkULBo/ZxRaV9NNyh4Br3rCHZzbzmSfawBL0dNRwpW1kK9mxPXR9povcdrGSZK9c2k0xwFGzjuniCtRSZCZ6ccZ7gaktmgAOtKbG/JnOkJrjcQTdFMsxRQ2cLY3WTIrlCw1eWKn8R6pvt4GFDso3QoL4a3nLk3G6JrtME3dSenpx7PNFTmga0EaJTLQ061sEeQoWXhSo9LTXsaSjoJQRXeZLtDclbCrYzfzHHeaKjHCVOUkQHO3JeEepr56mhiyaYYKjjNU+Fed1wS5VlhWSqI/hYUdDOkaxiKehoyOnrCV5yBHtbWFqTHCCwtpDcYolesVR5yUzTZBb3RNMd0d6WP+SvhuBmRcGxnuQzT95IC285cr41cLGQ6aJJhmi4TMGempxeimBRQw1tFKV+8jd6KuzoSTqqDxzRtpZkurvKEHxlqXKRIjjfUNNXQsNOsRScoWFLT+YeRZVD3GRN0MdQcKqQjHDMrdGGVu3iYJpQx3WGUvfbmxwFfR20WBq0oYY7LMFhhgYtr8jpaEnaOzjawWWaTP8mMr0t/EPDPoqcnxTBI5o58L7uoWnMrpoqPwgVrlAUWE+V+TQl9rawoyP6QGAlQw2TPRX+YSkxyBC8Z6jhHkXBgQL7WII3DVFnRfCrBfxewv9D6xsyjys4VkhWb9pUU627JllV0YDNHMku/ldNMMXDEo4aFnAkk4U6frNEU4XgZUPmEKHUl44KrzmYamjAbh0JFvGnaTLPu1s9jPCwjFpYiN7z1DTOk/nc07CfDFzmCf7i+bfNHXhDtLeBXzTBT5rkMvWOIxpl4EMh2LGJBu2syDnAEx2naEhHDWMMzPZEhygyS1mS5RTJr5ZkoKbEUoYqr2kqdDUE8ztK7OaIntJkFrIECwv8LJTaVx5XJE86go8dFeZ3FN3rjabCAYpoYEeC9zzJVULBbmZhDyd7ko09ydpNZ3nm2Kee4FPPXHnYEF1nqOFEC08LUVcDvYXkJHW8gTaKCk9YGOeIJhqiE4ToPEepdp7IWFjdwnWaufGMwJJCMtUTTBBK9BGCOy2tGGrJTHIwyEOzp6aPzNMOtlZkDvcEWpP5SVNhfkvDxhmSazTJXYrM9U1E0xwFVwqZQwzJxw6+kGGGUj2FglGGmnb1/G51udRSMNlTw6GGnCcUwVcOpmsqTHa06o72sw1RL02p9z0VbnMLOaIX3QKaYKSCFQzBKEUNHTSc48k53RH9wxGMtpQa5KjjW0W0n6XCCCG4yxNNdhQ4R4l1Ff+2sSd6UFHiIEOyqqFgT01mEUMD+joy75jPhOA+oVVLm309FR4yVOlp4RhLiScNmSmaYF5Pw0STrOIoWMSR2UkRXOMp+M4SHW8o8Zoi6OZgjKOaFar8zZDzkWzvKOjkKBjmCXby8JahhjXULY4KlzgKLvAwxVGhvyd4zxB1d9T0piazmKLCVZY5sKiD0y2ZSYrkUEPUbIk+dlQ4SJHTR50k1DPaUWIdTZW9NJwnJMOECgd7ou/MnppMJ02O1VT4Wsh85MnZzcFTngpXGKo84qmwgKbCL/orR/SzJ2crA+t6Mp94KvxJUeIbT3CQu1uIdlQEOzlKfS3UMcrTiFmOuroocrZrT2AcmamOKg8YomeEKm/rlT2sociMaybaUlFhuqHCM2qIJ+rg4EcDFymiDSxzaHdPcpE62pD5kyM5SBMoA1PaUtfIthS85ig1VPiPPYXgYEMNk4Qq7TXBgo7oT57gPUdwgCHzhIVFPFU6OYJzHAX9m5oNrVjeE61miDrqQ4VSa1oiURTsKHC0IfjNwU2WzK6eqK8jWln4g15TVBnqmDteCJ501PGAocJhhqjZdtBEB6lnhLreFJKxmlKbeGrqLiSThVIbCdGzloasa6lpMQXHCME2boLpJgT7yWaemu6wBONbqGNVRS0PKIL7LckbjmQtR7K8I5qtqel+T/ChJTNIKLjdUMNIRyvOEko9YYl2cwQveBikCNawJKcLBbc7+JM92mysNvd/Fqp8a0k6CNEe7cnZrxlW0wQXaXjaktnRwNOGZKYiONwS7a1JVheq3WgJHlQUGKHKmp4KAxXR/ULURcNgoa4zhKSLpZR3kxRRb0NmD0OFn+UCS7CzI1nbP6+o4x47QZE5xRCt3ZagnYcvmpYQktXdk5YKXTzBC57kKEe0VVuiSYqapssMS3C9p2CKkHOg8B8Pa8p5atrIw3qezIWanMGa5HRDNF6RM9wcacl0N+Q8Z8hsIkSnaIIdHRUOEebAPy1zbCkhM062FCJtif7PU+UtoVXzWKqM1PxXO8cfdruhFQ/a6x3JKYagvVDhQEtNiyiiSQ7OsuRsZUku0CRNDs4Sog6KKjsZgk2bYJqijgsEenoKeniinRXBn/U3lgpPdyDZynQx8IiioMnCep5Ky8mjGs6Wty0l1hUQTcNWswS3WRp2kCNZwJG8omG8JphPUaFbC8lEfabwP7VtM9yoaNCAjpR41VNhrD9LkbN722v0CoZMByFzhaW+MyzRYEWFDQwN2M4/JiT76PuljT3VU/A36eaIThb+R9oZGOAJ9tewkgGvqOMNRWYjT/Cwu99Q8LqDE4TgbLWxJ1jaDDAERsFOFrobgjUsBScaguXU8kKm2RL19tRypSHnHNlHiIZqgufs4opgQdVdwxBNNFBR6kVFqb8ogimOzB6a6HTzrlDHEpYaxjiiA4TMQobkDg2vejjfwJGWmnbVFAw3H3hq2NyQfG7hz4aC+w3BbwbesG0swYayvpAs6++Ri1Vfzx93mFChvyN5xVHTS+0p9aqCAxyZ6ZacZyw5+7uuQkFPR9DDk9NOiE7X1PCYJVjVUqq7JlrHwWALF5nfHNGjApdpqgzx5OwilDhCiDYTgnc9waGW4BdLNNUQvOtpzDOWHDH8D7TR/A/85KljEQu3NREc4Pl/6B1Hhc8Umb5CsKMmGC9EPcxoT2amwHNCmeOEnOPbklnMkbOgIvO5UMOpQrS9UGVdt6iH/fURjhI/WOpaW9OKLYRod6HCUEdOX000wpDZQ6hwg6LgZfOqo1RfT/CrJzjekXOGhpc1VW71ZLbXyyp+93ILbC1kPtIEYx0FIx1VDrLoVzXRKRYWk809yYlC9ImcrinxtabKnzRJk3lAU1OLEN1j2zrYzr2myHRXJFf4h4QKT1qSTzTB5+ZNTzTRkAxX8FcLV2uS8eoQQ2aAkFzvCM72sJIcJET3WPjRk5wi32uSS9rfZajpWEvj9hW42F4o5NytSXYy8IKHay10VYdrcl4SkqscrXpMwyGOgtkajheSxdQqmpxP1L3t4R5PqasFnrQEjytq6qgp9Y09Qx9o4S1FzhUCn1kyHSzBWLemoSGvOqLNhZyBjmCaAUYpMgt4Ck7wBBMMwWKWgjsUwTaGVsxWC1mYoKiyqqeGKYqonSIRQ3KIkHO0pmAxTdBHkbOvfllfr+AA+7gnc50huVKYK393FOyg7rbPO/izI7hE4CnHHHnJ0ogNPRUGeUpsrZZTBJcrovUcJe51BPsr6GkJdhCCsZ6aTtMEb2pqWkqeVtDXE/QVggsU/Nl86d9RMF3DxvZTA58agu810RWawCiSzzXBeU3MMW9oyJUedvNEvQyNu1f10BSMddR1vaLCYpYa/mGocLSiYDcLbQz8aMn5iyF4xBNMs1P0QEOV7o5gaWGuzSeLue4tt3ro7y4Tgm4G/mopdZgl6q0o6KzJWE3mMksNr3r+a6CbT8g5wZNzT9O7fi/zpaOmnz3BRoqos+tv9zMbdpxsqDBOEewtJLt7cg5wtKKbvldpSzRRCD43VFheCI7yZLppggMVBS/KMAdHODJvOwq2NQSbKKKPLdFWQs7Fqo+mpl01JXYRgq8dnGLhTiFzqmWsUMdpllZdbKlyvSdYxhI9YghOtxR8LgSLWHK62mGGVoxzBE8LNWzqH9CUesQzFy5RQzTc56mhi6fgXEWwpKfE5Z7M05ZgZUPmo6auiv8YKzDYwWBLMErIbKHJvOwIrvEdhOBcQ9JdU1NHQ7CXn2XIDFBKU2WAgcX9UAUzDXWd5alwuyJ41Z9rjKLCL4aCp4WarhPm2rH+SaHUYE001JDZ2ZAzXPjdMpZWvC9wmqIB2lLhQ01D5jO06hghWMndbM7yRJMsoCj1vYbnFQVrW9jak3OlEJ3s/96+p33dEPRV5GxiqaGjIthUU6FFEZyqCa5qJrpBdzSw95IUnOPIrCUUjRZQFrbw5PR0R1qiYx3cb6nrWUMrBmmiBQxVHtTew5ICP/ip6g4hed/Akob/32wvBHsIOX83cI8hGeNeNPCIkPmXe8fPKx84OMSRM1MTdXSwjCZ4S30jVGhvqTRak/OVhgGazHuOCud5onEO1lJr6ecVyaOK6H7zqlBlIaHE0oroCgfvGJIdPcmfLNGLjpz7hZwZQpUbFME0A1cIJa7VNORkgfsMBatbKgwwJM9bSvQXeNOvbIjelg6WWvo5kvbKaJJNHexkKNHL9xRyFlH8Ti2riB5wVPhUk7nGkJnoCe428LR/wRGdYIlmWebCyxou1rCk4g/ShugBDX0V0ZQWkh0dOVsagkM0yV6OoLd5ye+pRlsCr0n+KiQrGuq5yJDzrTAXHtLUMduTDBVKrSm3eHL+6ijxhFDX9Z5gVU/wliHYTMiMFpKLNMEywu80wd3meoFmt6VbRMPenhrOc6DVe4pgXU8DnnHakLOIIrlF4FZPIw6R+zxBP0dyq6OOZ4Q5sLKCcz084ok+VsMMyQhNZmmBgX5xIXOEJTmi7VsGTvMTNdHHhpzdbE8Du2oKxgvBqQKdDDnTFOylCFaxR1syz2iqrOI/FEpNc3C6f11/7+ASS6l2inq2ciTrCCzgyemrCL5SVPjQkdPZUmGy2c9Sw9FtR1sS30RmsKPCS4rkIC/2U0MduwucYolGaPjKEyhzmiPYXagyWbYz8LWBDdzRimAXzxx4z8K9hpzlhLq+NiQ97HuKorMUfK/OVvC2JfiHUPCQI/q7J2gjK+tTDNxkCc4TMssqCs4TGtLVwQihyoAWgj9bosU80XGW6Ac9TJGziaUh5+hnFcHOnlaM1iRn29NaqGENTTTSUHCH2tWTeV0osUhH6psuVLjRUmGWhm6OZEshGeNowABHcJ2Bpy2ZszRcKkRXd2QuKVEeXnbfaEq825FguqfgfE2whlChSRMdron+LATTPQ2Z369t4B9C5gs/ylzv+CMmepIDPclFQl13W0rspPd1JOcbghGOEutqCv5qacURQl3dDKyvyJlqKXGPgcM9FfawJAMVmdcspcYKOZc4GjDYkFlK05olNMHyHn4zFNykyOxt99RkHlfwmiHo60l2EKI+mhreEKp080Tbug08BVPcgoqC5zWt+NLDTZ7oNSF51N1qie7Va3uCCwyZbkINf/NED6jzOsBdZjFN8oqG3wxVunqCSYYKf3EdhJyf9YWGf7tRU2oH3VHgPr1fe5J9hOgHd7xQ0y7qBwXr23aGErP0cm64JVjZwsOGqL+mhNgZmhJLW2oY4UhedsyBgzrCKrq7BmcpNVhR6jBPq64Vgi+kn6XE68pp8J5/+0wRHGOpsKenQn9DZntPzjRLZpDAdD2fnSgkG9tmIXnUwQ6WVighs7Yi2MxQ0N3CqYaCXkJ0oyOztMDJjmSSpcpvlrk0RMMOjmArQ04PRV1DO1FwhCVaUVPpKUM03JK5SxPsIWRu8/CGHi8UHChiqGFDTbSRJWeYUDDcH6vJWUxR4k1FXbMUwV6e4AJFXS8oMqsZKqzvYQ9DDQdZckY4aGsIhtlubbd2r3j4QBMoTamdPZk7O/Bf62lacZwneNjQoGcdVU7zJOd7ghsUHOkosagic6cnWc8+4gg285R6zZP5s1/LUbCKIznTwK36PkdwlOrl4U1LwfdCCa+IrvFkmgw1PCAUXKWo0sURXWcI2muKJlgyFzhynCY4RBOsqCjoI1R5zREco0n2Vt09BQtYSizgKNHfUmUrQ5UOCh51BFcLmY7umhYqXKQomOop8bUnWNNQcIiBcYaC6xzMNOS8JQQfeqKBmmglB+97ok/lfk3ygaHSyZaCRTzRxQo6GzLfa2jWBPepw+UmT7SQEJyiyRkhBLMVOfcoMjcK0eZChfUNzFAUzCsEN5vP/X1uP/n/aoMX+K+nw/Hjr/9xOo7j7Pju61tLcgvJpTWXNbfN5jLpi6VfCOviTktKlFusQixdEKWmEBUKNaIpjZRSSOXSgzaaKLdabrm1/9nZ+/f+vd/vz/v9+Xy+zZ7PRorYoZqyLrCwQdEAixxVOEXNNnjX2nUSRlkqGmWowk8lxR50JPy9Bo6qJXaXwNvREBvnThPEPrewryLhcAnj5WE15Fqi8W7R1sAuEu86S4ENikItFN4xkv9Af4nXSnUVcLiA9xzesFpivRRVeFKtsMRaKBhuSbjOELnAUtlSQUpXgdfB4Z1oSbnFEetbQ0IrAe+Y+pqnDcEJFj6S8LDZzZHwY4e3XONNlARraomNEt2bkvGsosA3ioyHm+6jCMbI59wqt4eeara28IzEmyPgoRaUOEDhTVdEJhmCoTWfC0p8aNkCp0oYqih2iqGi4yXeMkOsn4LdLLnmKfh/YogjNsPebeFGR4m9BJHLzB61XQ3BtpISfS2FugsK9FAtLWX1dCRcrCnUp44CNzuCowUZmxSRgYaE6Za0W2u/E7CVXCiI/UOR8aAm1+OSyE3mOUcwyc1zBBeoX1kiKy0Zfxck1Gsyulti11i83QTBF5Kg3pDQThFMVHiPSlK+0cSedng/VaS8bOZbtsBcTcZAR8JP5KeqQ1OYKAi20njdNNRpgnsU//K+JnaXJaGTomr7aYIphoRn9aeShJWKEq9LcozSF7QleEfDI5LYm5bgVkFkRwVDBCVu0DDIkGupo8TZBq+/pMQURYErJQmPKGKjNDkWOLx7Jd5QizdUweIaKrlP7SwJDhZvONjLkOsBBX9UpGxnydhXkfBLQ8IxgojQbLFnJf81JytSljclYYyEFyx0kVBvKWOFJmONpshGAcsduQY5giVNCV51eOdJYo/pLhbvM0uDHSevNKRcrKZIqnCtJeEsO95RoqcgGK4ocZcho1tTYtcZvH41pNQ7vA0WrhIfOSraIIntIAi+NXWCErdbkvrWwjRLrt0NKUdL6KSOscTOdMSOUtBHwL6OLA0vNSdynaWQEnCpIvKaIrJJEbvHkmuNhn6OjM8VkSGSqn1uYJCGHnq9I3aLhNME3t6GjIkO7xrNFumpyTNX/NrwX7CrIRiqqWijI9JO4d1iieykyfiposQIQ8YjjsjlBh6oHWbwRjgYJQn2NgSnNycmJAk3NiXhx44Sxykihxm8ybUwT1OVKySc7vi3OXVkdBJ4AyXBeksDXG0IhgtYY0lY5ahCD0ehborIk5aUWRJviMA7Xt5kyRjonrXENkm8yYqgs8VzgrJmClK20uMM3jRJ0FiQICQF9hdETlLQWRIb5ki6WDfWRPobvO6a4GP5mcOrNzDFELtTkONLh9dXE8xypEg7z8A9jkhrQ6Fhjlg/QVktJXxt4WXzT/03Q8IaQWSqIuEvloQ2mqC9Jfi7wRul4RX3pSPlzpoVlmCtI2jvKHCFhjcM3sN6lqF6HxnKelLjXWbwrpR4xzuCrTUZx2qq9oAh8p6ixCUGr78g8oyjRAtB5CZFwi80VerVpI0h+IeBxa6Zg6kWvpDHaioYYuEsRbDC3eOmC2JvGYLeioxGknL2UATNJN6hmtj1DlpLvDVmocYbrGCVJKOrg4X6DgddLA203BKMFngdJJFtFd7vJLm6KEpc5yjQrkk7M80SGe34X24nSex1Ra5Omgb71JKyg8SrU3i/kARKwWpH0kOGhKkObyfd0ZGjvyXlAkVZ4xRbYJ2irFMkFY1SwyWxr2oo4zlNiV+7zmaweFpT4kR3kaDAFW6xpSqzJay05FtYR4HmZhc9UxKbbfF2V8RG1MBmSaE+kmC6JnaRXK9gsiXhJHl/U0qM0WTcbyhwkYIvFGwjSbjfwhiJt8ZSQU+Bd5+marPMOkVkD0muxYLIfEuhh60x/J92itguihJSEMySVPQnTewnEm+620rTQEMsOfo4/kP/0ARvWjitlpSX7GxBgcMEsd3EEeYWvdytd+Saawi6aCIj1CkGb6Aj9rwhx16Cf3vAwFy5pyLhVonXzy51FDpdEblbkdJbUcEPDEFzQ8qNmhzzLTmmKWKbFCXeEuRabp6rxbvAtLF442QjQ+wEA9eL1xSR7Q0JXzlSHjJ4exq89yR0laScJ/FW6z4a73pFMEfDiRZvuvijIt86RaSFOl01riV2mD1UEvxGk/Geg5aWwGki1zgKPG9J2U8PEg8qYvMsZeytiTRXBMslCU8JSlxi8EabjwUldlDNLfzTUmCgxWsjqWCOHavYAqsknKFIO0yQ61VL5AVFxk6WhEaCAkdJgt9aSkzXlKNX2jEa79waYuc7gq0N3GDJGCBhoiTXUEPsdknCUE1CK0fwsiaylSF2uiDyO4XX3pFhNd7R4itFGc0k/ElBZwWvq+GC6szVeEoS/MZ+qylwpKNKv9Z469UOjqCjwlusicyTxG6VpNxcQ8IncoR4RhLbR+NdpGGmJWOcIzJGUuKPGpQg8rrG21dOMqQssJQ4RxH5jaUqnZuQ0F4Q+cjxLwPtpZbIAk3QTJHQWBE5S1BokoVtDd6lhqr9UpHSUxMcIYl9pojsb8h4SBOsMQcqvOWC2E8EVehqiJ1hrrAEbQxeK0NGZ0Gkq+guSRgniM23bIHVkqwx4hiHd7smaOyglyIyQuM978j4VS08J/A2G1KeMBRo4fBaSNhKUEZfQewVQ/C1I+MgfbEleEzCUw7mKXI0M3hd1EESVji8x5uQ41nxs1q4RMJCCXs7Iq9acpxn22oSDnQ/sJTxsCbHIYZiLyhY05TY0ZLIOQrGaSJDDN4t8pVaIrsqqFdEegtizc1iTew5Q4ayBDMUsQMkXocaYkc0hZua412siZ1rSXlR460zRJ5SlHGe5j801RLMlJTxtaOM3Q1pvxJ45zUlWFD7rsAbpfEm1JHxG0eh8w2R7QQVzBUw28FhFp5QZzq8t2rx2joqulYTWSuJdTYfWwqMFMcovFmSyJPNyLhE4E10pHzYjOC3huArRa571ZsGajQpQx38SBP5pyZB6lMU3khDnp0MBV51BE9o2E+TY5Ml2E8S7C0o6w1xvCZjf0HkVEHCzFoyNmqC+9wdcqN+Tp7jSDheE9ws8Y5V0NJCn2bk2tqSY4okdrEhx1iDN8cSudwepWmAGXKcJXK65H9to8jYQRH7SBF01ESUJdd0TayVInaWhLkOjlXE5irKGOnI6GSWGCJa482zBI9rCr0jyTVcEuzriC1vcr6mwFGSiqy5zMwxBH/TJHwjSPhL8+01kaaSUuMFKTcLEvaUePcrSmwn8DZrgikWb7CGPxkSjhQwrRk57tctmxLsb9sZvL9LSlyuSLlWkqOjwduo8b6Uv1DkmudIeFF2dHCgxVtk8dpIvHpBxhEOdhKk7OLIUSdJ+cSRY57B+0DgGUUlNfpthTfGkauzxrvTsUUaCVhlKeteTXCoJDCa2NOKhOmC4G1H8JBd4OBZReSRGkqcb/CO1PyLJTLB4j1q8JYaIutEjSLX8YKM+a6phdMsdLFUoV5RTm9JSkuDN8WcIon0NZMNZWh1q8C7SJEwV5HxrmnnTrf3KoJBlmCYI2ilSLlfEvlE4011NNgjgthzEua0oKK7JLE7HZHlEl60BLMVFewg4EWNt0ThrVNEVkkiTwpKXSWJzdRENgvKGq4IhjsiezgSFtsfCUq8qki5S1LRQeYQQ4nemmCkImWMw3tFUoUBZk4NOeZYEp4XRKTGa6wJjrWNHBVJR4m3FCnbuD6aak2WsMTh3SZImGCIPKNgsDpVwnsa70K31lCFJZYcwwSMFcQulGTsZuEaSdBXkPGZhu0FsdUO73RHjq8MPGGIfaGIbVTk6iuI3GFgucHrIQkmWSJdBd7BBu+uOryWAhY7+Lki9rK5wtEQzWwvtbqGhIMFwWRJsElsY4m9IIg9L6lCX0VklaPAYkfkZEGDnOWowlBJjtMUkcGK4Lg6EtoZInMUBVYLgn0UsdmCyCz7gIGHFfk+k1QwTh5We7A9x+IdJ6CvIkEagms0hR50eH9UnTQJ+2oiKyVlLFUE+8gBGu8MQ3CppUHesnjTHN4QB/UGPhCTHLFPHMFrCqa73gqObUJGa03wgbhHkrCfpEpzNLE7JDS25FMKhlhKKWKfCgqstLCPu1zBXy0J2ztwjtixBu8UTRn9LVtkmCN2iyFhtME70JHRQ1KVZXqKI/KNIKYMCYs1GUMEKbM1bKOI9LDXC7zbHS+bt+1MTWS9odA9DtrYtpbImQJ2VHh/lisEwaHqUk1kjKTAKknkBEXkbkdMGwq0dnhzLJF3NJH3JVwrqOB4Sca2hti75nmJN0WzxS6UxDYoEpxpa4htVlRjkYE7DZGzJVU72uC9IyhQL4i8YfGWSYLLNcHXloyz7QhNifmKSE9JgfGmuyLhc403Xm9vqcp6gXe3xuuv8F6VJNxkyTHEkHG2g0aKXL0MsXc1bGfgas2//dCONXiNLCX+5mB7eZIl1kHh7ajwpikyzlUUWOVOsjSQlsS+M0R+pPje/dzBXRZGO0rMtgQrLLG9VSu9n6CMXS3BhwYmSoIBhsjNBmZbgusE9BCPCP5triU4VhNbJfE+swSP27aayE8tuTpYYjtrYjMVGZdp2NpS1s6aBnKSHDsbKuplKbHM4a0wMFd/5/DmGyKrJSUaW4IBrqUhx0vyfzTBBLPIUcnZdrAkNsKR0sWRspumSns6Ch0v/qqIbBYUWKvPU/CFoyrDJGwSNFhbA/MlzKqjrO80hRbpKx0Jewsi/STftwGSlKc1JZyAzx05dhLEdnfQvhZOqiHWWEAHC7+30FuRcZUgaO5gpaIK+xsiHRUsqaPElTV40xQZQ107Q9BZE1nryDVGU9ZSQ47bmhBpLcYpUt7S+xuK/FiT8qKjwXYw5ypS2iuCv7q1gtgjhuBuB8LCFY5cUuCNtsQOFcT+4Ih9JX+k8Ea6v0iCIRZOtCT0Et00JW5UeC85Cg0ScK0k411HcG1zKtre3SeITBRk7WfwDhEvaYLTHP9le0m8By0JDwn4TlLW/aJOvGHxdjYUes+ScZigCkYQdNdEOhkiezgShqkx8ueKjI8lDfK2oNiOFvrZH1hS+tk7NV7nOmLHicGWEgubkXKdwdtZknCLJXaCpkrjZBtLZFsDP9CdxWsSr05Sxl6CMmoFbCOgryX40uDtamB7SVmXW4Ihlgpmq+00tBKUUa83WbjLUNkzDmY7cow1JDygyPGlhgGKYKz4vcV7QBNbJIgM11TUqZaMdwTeSguH6rOaw1JRKzaaGyxVm2EJ/uCIrVWUcZUkcp2grMsEjK+DMwS59jQk3Kd6SEq1d0S6uVmO4Bc1lDXTUcHjluCXEq+1OlBDj1pi9zgiXxnKuE0SqTXwhqbETW6RggMEnGl/q49UT2iCzgJvRwVXS2K/d6+ZkyUl7jawSVLit46EwxVljDZwoSQ20sDBihztHfk2yA8NVZghiXwrYHQdfKAOtzsayjhY9bY0yE2CWEeJ9xfzO423xhL5syS2TFJofO2pboHob0nY4GiAgRrvGQEDa/FWSsoaaYl0syRsEt3kWoH3B01shCXhTUWe9w3Bt44SC9QCh3eShQctwbaK2ApLroGCMlZrYqvlY3qYhM0aXpFkPOuoqJ3Dm6fxXrGwVF9gCWZagjPqznfkuMKQ8DPTQRO8ZqG1hPGKEm9IgpGW4DZDgTNriTxvFiq+Lz+0cKfp4wj6OCK9JSnzNSn9LFU7UhKZZMnYwcJ8s8yRsECScK4j5UOB95HFO0CzhY4xJxuCix0lDlEUeMdS6EZBkTsUkZ4K74dugyTXS7aNgL8aqjDfkCE0ZbwkCXpaWCKhl8P7VD5jxykivSyxyZrYERbe168LYu9ZYh86IkscgVLE7tWPKmJv11CgoyJltMEbrohtVAQfO4ImltiHEroYEs7RxAarVpY8AwXMcMReFOTYWe5iiLRQxJ5Q8DtJ8LQhWOhIeFESPGsILhbNDRljNbHzNRlTFbk2S3L0NOS6V1KFJYKUbSTcIIhM0wQ/s2TM0SRMNcQmSap3jCH4yhJZKSkwyRHpYYgsFeQ4U7xoCB7VVOExhXepo9ABBsYbvGWKXPME3lyH95YioZ0gssQRWWbI+FaSMkXijZXwgiTlYdPdkNLaETxlyDVIwqeaEus0aTcYcg0RVOkpR3CSJqIddK+90JCxzsDVloyrFd5ZAr4TBKfaWa6boEA7C7s6EpYaeFPjveooY72mjIccLHJ9HUwVlDhKkmutJDJBwnp1rvulJZggKDRfbXAkvC/4l3ozQOG9a8lxjx0i7nV4jSXc7vhe3OwIxjgSHjdEhhsif9YkPGlus3iLFDnWOFhtCZbJg0UbQcIaR67JjthoCyMEZRwhiXWyxO5QxI6w5NhT4U1WsJvDO60J34fW9hwzwlKij6ZAW9ne4L0s8C6XeBMEkd/LQy1VucBRot6QMlbivaBhoBgjqGiCJNhsqVp/S2SsG6DIONCR0dXhvWbJ+MRRZJkkuEjgDXJjFQW6SSL7GXK8Z2CZg7cVsbWGoKmEpzQ5elpiy8Ryg7dMkLLUEauzeO86CuwlSOlgYLojZWeJ9xM3S1PWfEfKl5ISLQ0MEKR8YOB2QfCxJBjrKPCN4f9MkaSsqoVXJBmP7EpFZ9UQfOoOFwSzBN4MQ8LsGrymlipcJQhmy0GaQjPqCHaXRwuCZwRbqK2Fg9wlClZqYicrIgMdZfxTQ0c7TBIbrChxmuzoKG8XRaSrIhhiyNFJkrC7oIAWMEOQa5aBekPCRknCo4IKPrYkvCDI8aYmY7WFtprgekcJZ3oLIqssCSMtFbQTJKwXYy3BY5oCh2iKPCpJOE+zRdpYgi6O2KmOAgvVCYaU4ySRek1sgyFhJ403QFHiVEmJHwtybO1gs8Hr5+BETQX3War0qZngYGgtVZtoqd6vFSk/UwdZElYqyjrF4HXUeFspIi9IGKf4j92pKGAdCYMVsbcV3kRF0N+R8LUd5PCsIGWoxDtBkCI0nKofdJQxT+LtZflvuc8Q3CjwWkq8KwUpHzkK/NmSsclCL0nseQdj5FRH5CNHSgtLiW80Of5HU9Hhlsga9bnBq3fEVltKfO5IaSTmGjjc4J0otcP7QsJUSQM8pEj5/wCuUuC2DWz8AAAAAElFTkSuQmCC"); -} diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/twilight.css b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/twilight.css deleted file mode 100644 index fd8944ba8daeb613c7938a27ce1bd2376e41a16d..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/twilight.css +++ /dev/null @@ -1,26 +0,0 @@ -.cm-s-twilight.CodeMirror { background: #141414; color: #f7f7f7; } /**/ -.cm-s-twilight .CodeMirror-selected { background: #323232 !important; } /**/ - -.cm-s-twilight .CodeMirror-gutters { background: #222; border-right: 1px solid #aaa; } -.cm-s-twilight .CodeMirror-linenumber { color: #aaa; } -.cm-s-twilight .CodeMirror-cursor { border-left: 1px solid white !important; } - -.cm-s-twilight .cm-keyword { color: #f9ee98; } /**/ -.cm-s-twilight .cm-atom { color: #FC0; } -.cm-s-twilight .cm-number { color: #ca7841; } /**/ -.cm-s-twilight .cm-def { color: #8DA6CE; } -.cm-s-twilight span.cm-variable-2, .cm-s-twilight span.cm-tag { color: #607392; } /**/ -.cm-s-twilight span.cm-variable-3, .cm-s-twilight span.cm-def { color: #607392; } /**/ -.cm-s-twilight .cm-operator { color: #cda869; } /**/ -.cm-s-twilight .cm-comment { color:#777; font-style:italic; font-weight:normal; } /**/ -.cm-s-twilight .cm-string { color:#8f9d6a; font-style:italic; } /**/ -.cm-s-twilight .cm-string-2 { color:#bd6b18 } /*?*/ -.cm-s-twilight .cm-meta { background-color:#141414; color:#f7f7f7; } /*?*/ -.cm-s-twilight .cm-error { border-bottom: 1px solid red; } -.cm-s-twilight .cm-builtin { color: #cda869; } /*?*/ -.cm-s-twilight .cm-tag { color: #997643; } /**/ -.cm-s-twilight .cm-attribute { color: #d6bb6d; } /*?*/ -.cm-s-twilight .cm-header { color: #FF6400; } -.cm-s-twilight .cm-hr { color: #AEAEAE; } -.cm-s-twilight .cm-link { color:#ad9361; font-style:italic; text-decoration:none; } /**/ - diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/vibrant-ink.css b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/vibrant-ink.css deleted file mode 100644 index 22024a489a70246df6e20e91ecbb3296c234ba8f..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/vibrant-ink.css +++ /dev/null @@ -1,27 +0,0 @@ -/* Taken from the popular Visual Studio Vibrant Ink Schema */ - -.cm-s-vibrant-ink.CodeMirror { background: black; color: white; } -.cm-s-vibrant-ink .CodeMirror-selected { background: #35493c !important; } - -.cm-s-vibrant-ink .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } -.cm-s-vibrant-ink .CodeMirror-linenumber { color: #d0d0d0; } -.cm-s-vibrant-ink .CodeMirror-cursor { border-left: 1px solid white !important; } - -.cm-s-vibrant-ink .cm-keyword { color: #CC7832; } -.cm-s-vibrant-ink .cm-atom { color: #FC0; } -.cm-s-vibrant-ink .cm-number { color: #FFEE98; } -.cm-s-vibrant-ink .cm-def { color: #8DA6CE; } -.cm-s-vibrant-ink span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #FFC66D } -.cm-s-vibrant-ink span.cm-variable-3, .cm-s-cobalt span.cm-def { color: #FFC66D } -.cm-s-vibrant-ink .cm-operator { color: #888; } -.cm-s-vibrant-ink .cm-comment { color: gray; font-weight: bold; } -.cm-s-vibrant-ink .cm-string { color: #A5C25C } -.cm-s-vibrant-ink .cm-string-2 { color: red } -.cm-s-vibrant-ink .cm-meta { color: #D8FA3C; } -.cm-s-vibrant-ink .cm-error { border-bottom: 1px solid red; } -.cm-s-vibrant-ink .cm-builtin { color: #8DA6CE; } -.cm-s-vibrant-ink .cm-tag { color: #8DA6CE; } -.cm-s-vibrant-ink .cm-attribute { color: #8DA6CE; } -.cm-s-vibrant-ink .cm-header { color: #FF6400; } -.cm-s-vibrant-ink .cm-hr { color: #AEAEAE; } -.cm-s-vibrant-ink .cm-link { color: blue; } diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/xq-dark.css b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/xq-dark.css deleted file mode 100644 index fd9bb12abc00c0e5500429b15ff46689d365e81b..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/theme/xq-dark.css +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright (C) 2011 by MarkLogic Corporation -Author: Mike Brevoort <mike@brevoort.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ -.cm-s-xq-dark.CodeMirror { background: #0a001f; color: #f8f8f8; } -.cm-s-xq-dark span.CodeMirror-selected { background: #a8f !important; } -.cm-s-xq-dark .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; } -.cm-s-xq-dark .CodeMirror-linenumber { color: #f8f8f8; } -.cm-s-xq-dark .CodeMirror-cursor { border-left: 1px solid white !important; } - -.cm-s-xq-dark span.cm-keyword {color: #FFBD40;} -.cm-s-xq-dark span.cm-atom {color: #6C8CD5;} -.cm-s-xq-dark span.cm-number {color: #164;} -.cm-s-xq-dark span.cm-def {color: #FFF; text-decoration:underline;} -.cm-s-xq-dark span.cm-variable {color: #FFF;} -.cm-s-xq-dark span.cm-variable-2 {color: #EEE;} -.cm-s-xq-dark span.cm-variable-3 {color: #DDD;} -.cm-s-xq-dark span.cm-property {} -.cm-s-xq-dark span.cm-operator {} -.cm-s-xq-dark span.cm-comment {color: gray;} -.cm-s-xq-dark span.cm-string {color: #9FEE00;} -.cm-s-xq-dark span.cm-meta {color: yellow;} -.cm-s-xq-dark span.cm-error {color: #f00;} -.cm-s-xq-dark span.cm-qualifier {color: #FFF700;} -.cm-s-xq-dark span.cm-builtin {color: #30a;} -.cm-s-xq-dark span.cm-bracket {color: #cc7;} -.cm-s-xq-dark span.cm-tag {color: #FFBD40;} -.cm-s-xq-dark span.cm-attribute {color: #FFF700;} diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/encrier-nom.jpg b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/encrier-nom.jpg deleted file mode 100644 index 3dc1933b9e515c4a6d44511fe6c122c65216a347..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/encrier-nom.jpg and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/encrier.jpg b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/encrier.jpg deleted file mode 100644 index 133cea3f4ab8dd1b30ddf489c6353c1c0be30e3b..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/encrier.jpg and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/loupe.png b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/loupe.png deleted file mode 100644 index a2633b7a38f6258ae6478988b29fdf50e4e9fe54..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/loupe.png and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/loupe2.avif b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/loupe2.avif deleted file mode 100644 index 80fa911d906e306fc62a1393a17443d84b72701d..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/loupe2.avif and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/ron_blood_014.png b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/ron_blood_014.png deleted file mode 100644 index fb65be64ed9ee30de5cae3c384986212e243ba78..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/ron_blood_014.png and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/ron_blood_017.png b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/ron_blood_017.png deleted file mode 100644 index 28577141cf5900ec2f1c5773fb861b03519f2f02..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/ron_blood_017.png and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/ron_blood_019.png b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/ron_blood_019.png deleted file mode 100644 index 795ce5c920e8cedfb9be6545b0f32c8c136aa882..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/ron_blood_019.png and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/ron_blood_028.png b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/ron_blood_028.png deleted file mode 100644 index 691b5f8e9bd245e04f7586dbd48ad65a2be455f2..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/ron_blood_028.png and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/ron_blood_032.png b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/ron_blood_032.png deleted file mode 100644 index 0704a5a3f9e11df243073401fd7bbb550a3312e3..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/ron_blood_032.png and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/ron_blood_038.png b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/ron_blood_038.png deleted file mode 100644 index f85fa1e021b57851fc3858690450271dadf93fc8..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/ron_blood_038.png and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/script.js b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/script.js deleted file mode 100644 index afcaa27bcb9afabe42bab0be783efb347d2b4242..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/script.js +++ /dev/null @@ -1,146 +0,0 @@ -let questions = ["chargement des questions"]; -let turtleArea; -let sparqlResult; -let sparqlEditor; -let currentQuestion = 0; -let apresP1 = false; - -async function getQuestions(lang = document.querySelector("#lang").textContent) { - const quest = await fetch(`./questions-${lang}.json`); - return await quest.json(); -} - -getQuestions().then((questions) => { - document.querySelector("#commencer").addEventListener('click', () => { - document.querySelector('#hero1').innerHTML = '<em>' + (document.querySelector('#binome1').value? document.querySelector('#binome1').value:"Bibi")+ '</em>'; - document.querySelector('#hero2').innerHTML = '<em>' + (document.querySelector('#binome2').value?document.querySelector('#binome2').value:"Bibo") + '</em>'; - document.querySelector('#consignes').style.display = 'none'; - document.querySelector('#enquete').style.display = 'block'; - document.querySelector('body').style.background = "url('media/ron_blood_032.png') repeat scroll 0 0 black"; - - turtleArea = CodeMirror.fromTextArea(document.querySelector("#codeturtle"), { - mode: "text/turtle", - tabMode: "indent", - matchBrackets: true, - readOnly: "true" - }); - sparqlEditor = CodeMirror.fromTextArea(document.querySelector("#codesparql"), { - mode: "application/x-sparql-query", - tabMode: "indent", - matchBrackets: true, - }); - sparqlResult = CodeMirror.fromTextArea(document.querySelector("#codexml"), { - mode: { name: "javascript", json: true }, - matchBrackets: true, - readOnly: "true" - }); - - updateQuestion(currentQuestion, questions); - }); - document.querySelector('#executeSparqlButton').addEventListener('click', () => { - - executeSparql(sparqlEditor.getValue(), document.querySelector('#sparqlendpoint').value); - }); - - document.querySelector('#questpred').addEventListener('click', () => { - if (currentQuestion > 0) { - currentQuestion--; - updateQuestion(currentQuestion,questions,false); - } - }); - document.querySelector('#questsuiv').addEventListener('click', () => { - if (currentQuestion < questions.length - 1) { - currentQuestion++; - updateQuestion(currentQuestion,questions,true); - } - }); -}); - - - //$(document).mousemove(function(e){ - /*document.querySelector('document').addEventListener('mouseover',() =>{ - $('body').css('background-position', '-'+e.pageX/10+'px -'+e.pageY/10+'px'); - }); - */ - -/*});*/ - -function updateQuestion(currentQuestion,questions,avance) { - - document.querySelector('#numquestion').textContent = currentQuestion + 1; - if (questions[currentQuestion]["partie"]) { - apresP1 = true; - document.querySelector('#partie').innerHTML = questions[currentQuestion]["partie"]; - document.querySelector('#info').innerHTML = questions[currentQuestion]["info"]; - document.querySelector('#question').innerHTML = questions[currentQuestion]["question"]; - document.querySelector('#sparqlquery').style.display = 'none'; - document.querySelector('#executeSparqlButton').style.display = 'none'; - document.querySelector('#ontology').style.display = 'none'; - document.querySelector('#response').style.display = 'none'; - - - } - else { - - if (document.querySelector('#sparqlquery').style.display === 'none') { - document.querySelector('#sparqlquery').style.display = 'block'; - document.querySelector('#executeSparqlButton').style.display = 'block'; - document.querySelector('#ontology').style.display = 'inline-block'; - document.querySelector('#response').style.display = 'block'; - //sparqlEditor.setValue('SELECT distinct ?a \nWHERE {\nSERVICE <http://dbpedia.org/sparql> { ?a ?b ?c}\n LIMIT 2\n} '); - if (apresP1 && !avance) document.querySelector('#partie').innerHTML = ""; - } - - - document.querySelector('#info').innerHTML = questions[currentQuestion]["info"]; - document.querySelector('#question').innerHTML = questions[currentQuestion]["question"]; - turtleArea.setValue(questions[currentQuestion]["ontology"]) - - document.querySelector('#questpred').style.color = (currentQuestion == 0 ? '#555' : 'white'); - document.querySelector('#questsuiv').style.color = (currentQuestion == questions.length - 1 ? '#555' : 'white'); - } -} - - -function executeSparql(sparqlQuery, sparqlServerUrl) { - sparqlResult.setValue("Requête en cours..."); - console.log(sparqlQuery); - - /*fetch(`${sparqlServerUrl}?${new URLSearchParams({ - query: sparqlQuery - })}`,*/ - fetch (sparqlServerUrl, - { - method: "POST", // *GET, POST, PUT, DELETE, etc. - //cache: "no-cache", // *default, no-cache, reload, force-cache, only-if-cached - - headers: { - //'Content-Type': "application/json", - 'Content-Type': 'application/x-www-form-urlencoded', - //'Accept': 'application/sparql-results+json' - }, - body: `query=${sparqlQuery}`/*new URLSearchParams({ - query: sparqlQuery - }) - /*body: { - query : sparqlQuery - }*/ - }) - - .then(response => { - console.log(response); - if (! response.ok) alert("Problem with the SPARQL endpoint!"); - return response.text(); - }) - .then(response => { - console.log(response); - sparqlResult.setValue(response); - }) - .catch(err => { - - alert("Problem with the query or the SPARQL endpoint!"); - sparqlResult.setValue(err); - }); - - -} diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/style.css b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/style.css deleted file mode 100644 index 6091eb82fc360a4f252b58034fb73d6281dc9fab..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/style.css +++ /dev/null @@ -1,109 +0,0 @@ -#intro { - margin: 20px 20px 20px 60px; - font-style: italic; -} - -/*#executeSparqlButton{ - width: 1rem; -}*/ -label,em{ - color: rgb(248, 226, 245); - font-weight: bold; - } - - - -#partie{ - font-size: larger; - color:bisque, -} -#consignes,#qui { - width: 80%; - margin: 0 auto; - padding: 30px; - - background-color: rgba(118, 39, 39, 0.85); - border-radius: 30px; -} - -#qui{ - margin-top: 1rem; - background-color: rgba(66, 22, 22, 0.85); -} - -#enquete { - display: none; - width: 80%; - margin: 0 auto; - padding: 30px; - background-color: rgba(66, 22, 22, 0.85); - border-radius: 30px; -} - -h1 { - font-family: Tahoma, Geneva, Kalimati, sans-serif; - font-weight: bold; -} - -#info { - padding-left: 10px; - border-left: solid 4px white; -} - -#questions { - vertical-align: top; - display: inline-block; - width: 45%; -} - -#nav p{ - font-size: 1.5em; - margin-top: 0; -} - -#questpred, #questsuiv { - font-size: 3em; - font-family: Tahoma, Geneva, Kalimati, sans-serif; -} - -#questpred:hover, #questsuiv:hover { - cursor: pointer; -} - -#question { - font-weight: bold; -} - -#ontology { - display: inline-block; - margin-left: 4%; - width: 50%; -} - -.CodeMirror { - background-color: #E4CA95; -} - -.CodeMirror { - /*border-top: 1px solid white; - border-bottom: 1px solid white;*/ - height: auto; -} - -.CodeMirror-scroll { - overflow-y: hidden; - overflow-x: auto; - max-height: 20rem; -} - -#sparqlquery .CodeMirror-scroll, #response .CodeMirror-scroll { - /* min-height: 200px;*/ -} - - - -.uri { - font-family: Monaco, "DejaVu Sans Mono", "Lucida Console", "Andale Mono", monospace; - font-size: .8em; -} - diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/tache-de-sang.gif b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/tache-de-sang.gif deleted file mode 100644 index 5442fa6942b666fe6773013df9a0d58e002f0df6..0000000000000000000000000000000000000000 Binary files a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/tache-de-sang.gif and /dev/null differ diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/questions-EN.json b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/questions-EN.json deleted file mode 100644 index 0ab65552a1488b0ec11f4cb88536bd42f9618f85..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/questions-EN.json +++ /dev/null @@ -1,114 +0,0 @@ -[ - { "info": "<p>The house of Professeur Piece has for IRI <span class='uri'>https://w3id.org/cluedo4KG/KG#LaMaisonDuMeurtre</span></p>", - "question": "<p>What rooms does this house contain?</p>", - "ontology": "@prefix : <https://w3id.org/cluedo4KG/onto#> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owl: <http://www.w3.org/2002/07/owl#> .\n\n:Maison rdf:type owl:Class ;\n rdfs:label \"maison\"@fr , \"house\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Piece rdf:type owl:Class ;\n rdfs:label \"pièce\"@fr , \"room\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:maisonContientPiece rdf:type owl:ObjectProperty ;\n rdfs:domain :Maison ;\n rdfs:range :Piece ;\n owl:inverseOf :pieceDansMaison ;\n rdfs:label \"house contains room\"@en , \"maison contient pièce\"@fr .\n"}, - - { "info": "<p>The house of Professeur Piece has for IRI <span class='uri'>https://w3id.org/cluedo4KG/KG#LaMaisonDuMeurtre</span></p>", - "question": "<p>How many rooms are there in the house?</p>", - "ontology": "@prefix : <https://w3id.org/cluedo4KG/onto#> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owl: <http://www.w3.org/2002/07/owl#> .\n\n:Maison rdf:type owl:Class ;\n rdfs:label \"maison\"@fr , \"house\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Piece rdf:type owl:Class ;\n rdfs:label \"pièce\"@fr , \"room\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:maisonContientPiece rdf:type owl:ObjectProperty ;\n rdfs:domain :Maison ;\n rdfs:range :Piece ;\n owl:inverseOf :pieceDansMaison ;\n rdfs:label \"house contains room\"@en , \"maison contient pièce\"@fr .\n"}, - - { "info": "<p></p>", - "question": "<p>How many people are in the house?</p>", - "ontology": "@prefix : <https://w3id.org/cluedo4KG/onto#> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owl: <http://www.w3.org/2002/07/owl#> .\n\n:Personne rdf:type owl:Class ;\n rdfs:label \"personne\"@fr , \"person\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Piece rdf:type owl:Class ;\n rdfs:label \"pièce\"@fr , \"room\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Maison rdf:type owl:Class ;\n rdfs:label \"maison\"@fr , \"house\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:maisonContientPiece rdf:type owl:ObjectProperty ;\n rdfs:domain :Maison ;\n rdfs:range :Piece ;\n owl:inverseOf :pieceDansMaison ;\n rdfs:label \"house contains room\"@en , \"maison contient pièce\"@fr.\n\n:pieceContientPersonne rdf:type owl:ObjectProperty ;\n rdfs:range :Personne ;\n rdfs:domain :Piece ;\n owl:inverseOf :personneDansPiece ;\n rdfs:label \"room contains person\"@en ,\"pièce contient personne\"@fr .\n"}, - - { "info": "<p></p>", - "question": "<p>Who is the victim?</p>", - "ontology": "@prefix : <https://w3id.org/cluedo4KG/onto#> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owl: <http://www.w3.org/2002/07/owl#> .\n\n:Personne rdf:type owl:Class ;\n rdfs:label \"personne\"@fr , \"person\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:estVivant rdf:type owl:DatatypeProperty ;\n rdfs:label \"est vivant\"@fr , \"is alive\"@en ;\n rdfs:comment \"indique si une personne est vivante (True) ou morte (False)\"@fr ;\n rdfs:comment \"indicate if a person is alive (True) ou dead (False)\"@en ;\n rdfs:domain :Personne ;\n rdfs:range xsd:boolean ."}, - - { "info": "<p>Anyone still alive is considered a suspect.</p>", - "question": "<p>List the suspects.</p>", - "ontology": "@prefix : <https://w3id.org/cluedo4KG/onto#> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owl: <http://www.w3.org/2002/07/owl#> .\n\n:Personne rdf:type owl:Class ;\n rdfs:label \"personne\"@fr , \"person\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:estVivant rdf:type owl:DatatypeProperty ;\n rdfs:label \"est vivant\"@fr , \"is alive\"@en ;\n rdfs:comment \"indique si une personne est vivante (True) ou morte (False)\"@fr ;\n rdfs:comment \"indicate if a person is alive (True) ou dead (False)\"@en ;\n rdfs:domain :Personne ;\n rdfs:range xsd:boolean ."}, - - { "info": "<p></p>", - "question": "<p>What room is the victim in?</p>", - "ontology": "@prefix : <https://w3id.org/cluedo4KG/onto#> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owl: <http://www.w3.org/2002/07/owl#> .\n\n:Personne rdf:type owl:Class ;\n rdfs:label \"personne\"@fr , \"person\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:estVivant rdf:type owl:DatatypeProperty ;\n rdfs:label \"est vivant\"@fr , \"is alive\"@en ;\n rdfs:comment \"indique si une personne est vivante (True) ou morte (False)\"@fr ;\n rdfs:comment \"indicate if a person is alive (True) ou dead (False)\"@en ;\n rdfs:domain :Personne ;\n rdfs:range xsd:boolean .\n\n:pieceContientPersonne rdf:type owl:ObjectProperty ;\n rdfs:range :Objet ;\n rdfs:domain :Piece ;\n owl:inverseOf :personneDansPiece ;\n rdfs:label \"room contains person\"@en ,\"pièce contient personne\"@fr."}, - - { "info": "<p></p>", - "question": "<p>Are there other people in this room? (transform the previous query; use ASK)</p>", - "ontology": "@prefix : <https://w3id.org/cluedo4KG/onto#> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owl: <http://www.w3.org/2002/07/owl#> .\n\n:Personne rdf:type owl:Class ;\n rdfs:label \"personne\"@fr , \"person\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:estVivant rdf:type owl:DatatypeProperty ;\n rdfs:label \"est vivant\"@fr , \"is alive\"@en ;\n rdfs:comment \"indique si une personne est vivante (True) ou morte (False)\"@fr ;\n rdfs:comment \"indicate if a person is alive (True) ou dead (False)\"@en ;\n rdfs:domain :Personne ;\n rdfs:range xsd:boolean .\n\n:pieceContientPersonne rdf:type owl:ObjectProperty ;\n rdfs:range :Objet ;\n rdfs:domain :Piece ;\n owl:inverseOf :personneDansPiece ;\n rdfs:label \"room contains person\"@en ,\"pièce contient personne\"@fr ."}, - - { "info": "<p></p>", - "question": "<p>List the people in each room.</p>", - "ontology": "@prefix : <https://w3id.org/cluedo4KG/onto#> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owl: <http://www.w3.org/2002/07/owl#> .\n\n:Personne rdf:type owl:Class ;\n rdfs:label \"personne\"@fr , \"person\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Piece rdf:type owl:Class ;\n rdfs:label \"pièce\"@fr , \"room\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:pieceContientPersonne rdf:type owl:ObjectProperty ;\n rdfs:range :Objet ;\n rdfs:domain :Piece ;\n owl:inverseOf :personneDansPiece ;\n rdfs:label \"room contains person\"@en ,\"pièce contient personne\"@fr."}, - - { "info": "<p></p>", - "question": "<p>How many people are in each room (containing at least one person)?</p>", - "ontology": "@prefix : <https://w3id.org/cluedo4KG/onto#> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owl: <http://www.w3.org/2002/07/owl#> .\n\n:Personne rdf:type owl:Class ;\n rdfs:label \"personne\"@fr , \"person\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Piece rdf:type owl:Class ;\n rdfs:label \"pièce\"@fr , \"room\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:pieceContientPersonne rdf:type owl:ObjectProperty ;\n rdfs:range :Objet ;\n rdfs:domain :Piece ;\n owl:inverseOf :personneDansPiece ;\n rdfs:label \"room contains person\"@en ,\"pièce contient personne\"@fr ."}, - - { "info": "<p></p>", - "question": "<p>Which room(s) contain at least two people? (hint: use the previous query as a subquery)</p>", - "ontology": "@prefix : <https://w3id.org/cluedo4KG/onto#> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owl: <http://www.w3.org/2002/07/owl#> .\n\n:Personne rdf:type owl:Class ;\n rdfs:label \"personne\"@fr , \"person\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Piece rdf:type owl:Class ;\n rdfs:label \"pièce\"@fr , \"room\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:pieceContientPersonne rdf:type owl:ObjectProperty ;\n rdfs:range :Objet ;\n rdfs:domain :Piece ;\n owl:inverseOf :personneDansPiece ;\n rdfs:label \"room contains person\"@en ,\"pièce contient personne\"@fr ."}, - - { "info": "<p></p>", - "question": "<p>Which room(s) are empty?</p>", - "ontology": "@prefix : <https://w3id.org/cluedo4KG/onto#> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owl: <http://www.w3.org/2002/07/owl#> .\n\n:Personne rdf:type owl:Class ;\n rdfs:label \"personne\"@fr , \"person\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Piece rdf:type owl:Class ;\n rdfs:label \"pièce\"@fr , \"room\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:pieceContientPersonne rdf:type owl:ObjectProperty ;\n rdfs:range :Objet ;\n rdfs:domain :Piece ;\n owl:inverseOf :personneDansPiece ;\n rdfs:label \"room contains person\"@en ,\"pièce contient personne\"@fr ."}, - - { "info": "<p>The victim tried to write his killer's name on a notebook with a pen, but the ink pot spilled, making the murderer's name partly illegible.<br /><img src='media/encrier-nom.jpg' /><br />However, we can decipher that his/her surname or first name ends with ‘n.’.</p>", - "question": "<p>Who are the remaining suspects? (increase the query listing the suspects)</p>", - "ontology": "..."}, - - { "info": "<p>The murderer is not in one of the rooms next to the victim's.</p>", - "question": "<p>Who is therefore innocent?</p>", - "ontology": "@prefix : <https://w3id.org/cluedo4KG/onto#> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owl: <http://www.w3.org/2002/07/owl#> .\n\n:Personne rdf:type owl:Class ;\n rdfs:label \"personne\"@fr , \"person\"@en .\n\n:Piece rdf:type owl:Class ;\n rdfs:label \"pièce\"@fr , \"room\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:pieceContientPersonne rdf:type owl:ObjectProperty ;\n rdfs:range :Objet ;\n rdfs:domain :Piece ;\n owl:inverseOf :personneDansPiece ;\n rdfs:label \"room contains person\"@en ,\"pièce contient personne\"@fr .\n\n:aPourPieceVoisine rdf:type owl:ObjectProperty ,\n owl:SymmetricProperty ;\n rdfs:range :Piece ;\n rdfs:domain :Piece ;\n rdfs:label \"a pour pièce voisine\"@fr , \"has as neighbour room\"@en ."}, - - { "info": "<p>The murderer is not in one of the rooms next to the victim's.</p>", - "question": "<p>Who are the remaining suspects? (increase the query listing the suspects)</p>", - "ontology": "@prefix : <https://w3id.org/cluedo4KG/onto#> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owl: <http://www.w3.org/2002/07/owl#> .\n\n:Personne rdf:type owl:Class ;\n rdfs:label \"personne\"@fr , \"person\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Piece rdf:type owl:Class ;\n rdfs:label \"pièce\"@fr , \"room\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:pieceContientPersonne rdf:type owl:ObjectProperty ;\n rdfs:range :Objet ;\n rdfs:domain :Piece ;\n owl:inverseOf :personneDansPiece ;\n rdfs:label \"room contains person\"@en ,\"pièce contient personne\"@fr .\n\n:aPourPieceVoisine rdf:type owl:ObjectProperty ,\n owl:SymmetricProperty ;\n rdfs:range :Piece ;\n rdfs:domain :Piece ;\n rdfs:label \"a pour pièce voisine\"@fr , \"has as neighbour room\"@en."}, - - { "info": "<p>A number of suspicious objects have been identified in the house. One of them is the murder weapon.</p>", - "question": "<p>How many objects are there in the house?</p>", - "ontology": ":Maison rdf:type owl:Class ;\n rdfs:label \"maison\"@fr , \"house\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Piece rdf:type owl:Class ;\n rdfs:label \"pièce\"@fr , \"room\"@en;\n rdfs:subClassOf owl:Thing .\n\n:Objet rdf:type owl:Class ;\n rdfs:label \"objet\"@fr , \"object\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:maisonContientPiece rdf:type owl:ObjectProperty ;\n rdfs:domain :Maison ;\n rdfs:range :Piece ;\n owl:inverseOf :pieceDansMaison ;\n rdfs:label \"house contains room\"@en , \"maison contient pièce\"@fr.\n\n:pieceContientObjet rdf:type owl:ObjectProperty ;\n rdfs:range :Objet ;\n rdfs:domain :Piece ;\n owl:inverseOf :objetDansPiece ;\n rdfs:label \"pièce contient objet\"@en ,\"room contains object\"@fr .\n"}, - - { "info": "<p>The murder weapon is not in the victim's room</p>", - "question": "<p>What objects cannot be the murder weapon?</p>", - "ontology": ":Maison rdf:type owl:Class ;\n rdfs:label \"maison\"@fr , \"house\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Piece rdf:type owl:Class ;\n rdfs:label \"pièce\"@fr , \"room\"@en;\n rdfs:subClassOf owl:Thing .\n\n:Objet rdf:type owl:Class ;\n rdfs:label \"objet\"@fr , \"object\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:maisonContientPiece rdf:type owl:ObjectProperty ;\n rdfs:domain :Maison ;\n rdfs:range :Piece ;\n owl:inverseOf :pieceDansMaison .\n rdfs:label \"house contains room\"@en , \"maison contient pièce\"@fr .\n\n:pieceContientObjet rdf:type owl:ObjectProperty ;\n rdfs:range :Objet ;\n rdfs:domain :Piece ;\n owl:inverseOf :objetDansPiece ;\n rdfs:label \"pièce contient objet\"@en ,\"room contains object\"@fr .\n"}, - - { "info": "<p>No one is in the room where the murder weapon was found.</p>", - "question": "<p>Which object is the murder weapon?</p>", - "ontology": ":Maison rdf:type owl:Class ;\n rdfs:label \"maison\"@fr , \"house\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Personne rdf:type owl:Class ;\n rdfs:label \"personne\"@fr , \"person\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Piece rdf:type owl:Class ;\n rdfs:label \"pièce\"@fr , \"room\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Objet rdf:type owl:Class ;\n rdfs:label \"objet\"@fr , \"object\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:maisonContientPiece rdf:type owl:ObjectProperty ;\n rdfs:domain :Maison ;\n rdfs:range :Piece ;\n owl:inverseOf :pieceDansMaison ;\n rdfs:label \"house contains room\"@en , \"maison contient pièce\"@fr .\n\n:pieceContientObjet rdf:type owl:ObjectProperty ;\n rdfs:range :Objet ;\n rdfs:domain :Piece ;\n owl:inverseOf :objetDansPiece ; \n rdfs:label \"pièce contient objet\"@fr ,\"room contains object\"@en.\n\n:pieceContientPersonne rdf:type owl:ObjectProperty ;\n rdfs:range :Objet ;\n rdfs:domain :Piece ;\n owl:inverseOf :personneDansPiece ;\n rdfs:label \"room contains person\"@en ,\"pièce contient personne\"@fr ."}, - - { "info": "<p>The murderer is in an empty room. </p>", - "question": "<p>Who is the murderer? (increase the request listing the suspects)</p>", - "ontology": ":Maison rdf:type owl:Class ;\n rdfs:label \"maison\"@fr , \"house\"@en , ;\n rdfs:subClassOf owl:Thing .\n\n:Personne rdf:type owl:Class ;\n rdfs:label \"personne\"@fr , \"person\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Piece rdf:type owl:Class ;\n rdfs:label \"pièce\"@fr , \"room\"@en;\n rdfs:subClassOf owl:Thing .\n\n:Objet rdf:type owl:Class ;\n rdfs:label \"objet\"@fr , \"object\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:maisonContientPiece rdf:type owl:ObjectProperty ;\n rdfs:domain :Maison ;\n rdfs:range :Piece ;\n owl:inverseOf :pieceDansMaison ;\n rdfs:label \"house contains room\"@en , \"maison contient pièce\"@fr .\n\n:pieceContientObjet rdf:type owl:ObjectProperty ;\n rdfs:range :Objet ;\n rdfs:domain :Piece ;\n owl:inverseOf :objetDansPiece ; \n rdfs:label \"pièce contient objet\"@en ,\"room contains object\"@fr.\n\n:pieceContientPersonne rdf:type owl:ObjectProperty ;\n rdfs:range :Objet ;\n rdfs:domain :Piece ;\n owl:inverseOf :personneDansPiece ;\n rdfs:label \"room contains person\"@en ,\"pièce contient personne\"@fr ."}, - { - "partie":"Using DBpedia to solve the crime! ", - "info":"<p>You will continue the investigation using federated queries on the <a href=\"https://dbpedia.org/sparql\" target=\"_blank\"> sparql endpoint</a> of <a href=\"https://www.dbpedia.org/\" target=\"_blank\">DBpedia</a></p>", - "question":"<p>Note that</p><ul><li>The ontology IRI you need to consider when querying DBpedia is <a href=\"http://dbpedia.org/ontology/\" target=\"_blank\"><span class=\"uri\">http://dbpedia.org/ontology/</span></a></li><li> the IRI of DBpedia public SPARQL endpoint is <span class=\"uri\"> https://dbpedia.org/sparql.</span></li> <li>you should <ol><li>write your query on the <a href=\"https://dbpedia.org/sparql\" target=\"_blank\">web interface associated with DBpedia endpoint</a></li><li>integrate the correct query into this application via a federated query to solve the investigation.</li></ol></li></ul>" - }, - { - "info":"<p>The murderer had an <b>accomplice</b> in the house. This accomplice's parents are fans of TBL (the famous inventor of the web!). </p>", - "question":"What is the IRI in DBpedia of the resource referred to in English by the alias TBL? (first write your query on the <a href=\"https://dbpedia.org/sparql\" target=\"_blank\">web interface associated with DBpedia endpoint)", - "ontology":"Have a look at the DBpedia ontology documentation!" - }, - { - "info":"<p>The accomplice has the same first name as TBL's brother. </p>", - "question":" What is his first name? (first write your query on the <a href=\"https://dbpedia.org/sparql\" target=\"_blank\">web interface associated with DBpedia endpoint)", - "ontology":"Have a look at the DBpedia ontology documentation!" - }, - { - "info":"<p>The accomplice has the same first name as TBL's brother.</p>", - "question":"Who are the potential accomplices to our crime? (use the potentiel of federated queries with the previous query to find the answer in our crime scene knowldege graph)", - "ontology":"..." - }, - { - "partie":"Federated queries : DBpedia et Wikidata ", - "info":"<p>You can continue the investigation using federated queries on the <a href=\"https://www.wikidata.org/wiki/Wikidata:Main_Page\">Wikidata</a></p>", - "question":"<p>You are deliberately not given any information about the ontology to be considered.</li><li> the IRI of Wikidata Public SPARQL Endpoint is <span class=\"uri\"> https://query.wikidata.org/sparql.</span></li><li> you should use <a href= \"https://query.wikidata.org\" target=target=\"_blank\">the web interface associated to this endpoint to have a first version of your query. </a></li></ul>" - }, - { - "info":"", - "question":"What is TBL's IRI in Wikidata? (use the name of the person found in DBPedia) First formulate your query on <a href= \"https://query.wikidata.org\" target=target=\"_blank\">the web interface associated to Wikidata endpoint.", - "ontology":"you are on your own !" - }, - { - "info":"<p>The accomplice's surname is the honorific title given to TBL in English. </p>", - "question":" What is the accomplice's surname? (augment the previous query with this new information)", - "ontology":"you are on your own !" - }, - { - "info":"<p></p>", - "question":"Find the accomplice and the room he is hiding in! (use a federated query to find the answer in cluedo4KG knowledge graph.)", - "ontology":"you are on your own !" - } - - ] \ No newline at end of file diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/questions-FR.json b/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/questions-FR.json deleted file mode 100644 index 40074c7ba85468c10a420c1fc717719deaaf4e3e..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/questions-FR.json +++ /dev/null @@ -1,114 +0,0 @@ -[ - { "info": "<p>La maison du Professeur Piece a pour IRI <span class='uri'>https://w3id.org/cluedo4KG/KG#LaMaisonDuMeurtre</span></p>", - "question": "<p>Quelles sont les pièces que contient cette maison ?</p>", - "ontology": "@prefix : <https://w3id.org/cluedo4KG/onto#> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owl: <http://www.w3.org/2002/07/owl#> .\n\n:Maison rdf:type owl:Class ;\n rdfs:label \"maison\"@fr , \"house\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Piece rdf:type owl:Class ;\n rdfs:label \"pièce\"@fr , \"room\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:maisonContientPiece rdf:type owl:ObjectProperty ;\n rdfs:domain :Maison ;\n rdfs:range :Piece ;\n owl:inverseOf :pieceDansMaison ;\n rdfs:label \"house contains room\"@en , \"maison contient pièce\"@fr .\n"}, - - { "info": "<p>La maison du Professeur Chabalet a pour IRI <span class='uri'>https://w3id.org/cluedo4KG/KG#LaMaisonDuMeurtre</span></p>", - "question": "<p>Combien y a-t-il de pièces dans la maison ?</p>", - "ontology": "@prefix : <https://w3id.org/cluedo4KG/onto#> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owl: <http://www.w3.org/2002/07/owl#> .\n\n:Maison rdf:type owl:Class ;\n rdfs:label \"maison\"@fr , \"house\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Piece rdf:type owl:Class ;\n rdfs:label \"pièce\"@fr , \"room\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:maisonContientPiece rdf:type owl:ObjectProperty ;\n rdfs:domain :Maison ;\n rdfs:range :Piece ;\n owl:inverseOf :pieceDansMaison ;\n rdfs:label \"house contains room\"@en , \"maison contient pièce\"@fr .\n"}, - - { "info": "<p></p>", - "question": "<p>Combien y a-t-il de personnes dans la maison ?</p>", - "ontology": "@prefix : <https://w3id.org/cluedo4KG/onto#> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owl: <http://www.w3.org/2002/07/owl#> .\n\n:Personne rdf:type owl:Class ;\n rdfs:label \"personne\"@fr , \"person\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Piece rdf:type owl:Class ;\n rdfs:label \"pièce\"@fr , \"room\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Maison rdf:type owl:Class ;\n rdfs:label \"maison\"@fr , \"house\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:maisonContientPiece rdf:type owl:ObjectProperty ;\n rdfs:domain :Maison ;\n rdfs:range :Piece ;\n owl:inverseOf :pieceDansMaison ;\n rdfs:label \"house contains room\"@en , \"maison contient pièce\"@fr.\n\n:pieceContientPersonne rdf:type owl:ObjectProperty ;\n rdfs:range :Personne ;\n rdfs:domain :Piece ;\n owl:inverseOf :personneDansPiece ;\n rdfs:label \"room contains person\"@en ,\"pièce contient personne\"@fr .\n"}, - - { "info": "<p></p>", - "question": "<p>Qui est la victime ?</p>", - "ontology": "@prefix : <https://w3id.org/cluedo4KG/onto#> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owl: <http://www.w3.org/2002/07/owl#> .\n\n:Personne rdf:type owl:Class ;\n rdfs:label \"personne\"@fr , \"person\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:estVivant rdf:type owl:DatatypeProperty ;\n rdfs:label \"est vivant\"@fr , \"is alive\"@en ;\n rdfs:comment \"indique si une personne est vivante (True) ou morte (False)\"@fr ;\n rdfs:comment \"indicate if a person is alive (True) ou dead (False)\"@en ;\n rdfs:domain :Personne ;\n rdfs:range xsd:boolean ."}, - - { "info": "<p>Toutes les personnes encore en vie sont considérées suspectes.</p>", - "question": "<p>Donnez la liste des suspects.</p>", - "ontology": "@prefix : <https://w3id.org/cluedo4KG/onto#> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owl: <http://www.w3.org/2002/07/owl#> .\n\n:Personne rdf:type owl:Class ;\n rdfs:label \"personne\"@fr , \"person\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:estVivant rdf:type owl:DatatypeProperty ;\n rdfs:label \"est vivant\"@fr , \"is alive\"@en ;\n rdfs:comment \"indique si une personne est vivante (True) ou morte (False)\"@fr ;\n rdfs:comment \"indicate if a person is alive (True) ou dead (False)\"@en ;\n rdfs:domain :Personne ;\n rdfs:range xsd:boolean ."}, - - { "info": "<p></p>", - "question": "<p>Dans quelle pièce se situe la victime?</p>", - "ontology": "@prefix : <https://w3id.org/cluedo4KG/onto#> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owl: <http://www.w3.org/2002/07/owl#> .\n\n:Personne rdf:type owl:Class ;\n rdfs:label \"personne\"@fr , \"person\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:estVivant rdf:type owl:DatatypeProperty ;\n rdfs:label \"est vivant\"@fr , \"is alive\"@en ;\n rdfs:comment \"indique si une personne est vivante (True) ou morte (False)\"@fr ;\n rdfs:comment \"indicate if a person is alive (True) ou dead (False)\"@en ;\n rdfs:domain :Personne ;\n rdfs:range xsd:boolean .\n\n:pieceContientPersonne rdf:type owl:ObjectProperty ;\n rdfs:range :Objet ;\n rdfs:domain :Piece ;\n owl:inverseOf :personneDansPiece ;\n rdfs:label \"room contains person\"@en ,\"pièce contient personne\"@fr."}, - - { "info": "<p></p>", - "question": "<p>Y a-t-il d'autres personnes dans cette pièce? (tranformez la requête précédante; utilisez ASK)</p>", - "ontology": "@prefix : <https://w3id.org/cluedo4KG/onto#> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owl: <http://www.w3.org/2002/07/owl#> .\n\n:Personne rdf:type owl:Class ;\n rdfs:label \"personne\"@fr , \"person\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:estVivant rdf:type owl:DatatypeProperty ;\n rdfs:label \"est vivant\"@fr , \"is alive\"@en ;\n rdfs:comment \"indique si une personne est vivante (True) ou morte (False)\"@fr ;\n rdfs:comment \"indicate if a person is alive (True) ou dead (False)\"@en ;\n rdfs:domain :Personne ;\n rdfs:range xsd:boolean .\n\n:pieceContientPersonne rdf:type owl:ObjectProperty ;\n rdfs:range :Objet ;\n rdfs:domain :Piece ;\n owl:inverseOf :personneDansPiece ;\n rdfs:label \"room contains person\"@en ,\"pièce contient personne\"@fr ."}, - - { "info": "<p></p>", - "question": "<p>Listez les personnes dans chaque pièce.</p>", - "ontology": "@prefix : <https://w3id.org/cluedo4KG/onto#> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owl: <http://www.w3.org/2002/07/owl#> .\n\n:Personne rdf:type owl:Class ;\n rdfs:label \"personne\"@fr , \"person\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Piece rdf:type owl:Class ;\n rdfs:label \"pièce\"@fr , \"room\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:pieceContientPersonne rdf:type owl:ObjectProperty ;\n rdfs:range :Objet ;\n rdfs:domain :Piece ;\n owl:inverseOf :personneDansPiece ;\n rdfs:label \"room contains person\"@en ,\"pièce contient personne\"@fr."}, - - { "info": "<p></p>", - "question": "<p>Combien y a-t-il de personnes dans chaque pièce (contenant au moins une personne)?</p>", - "ontology": "@prefix : <https://w3id.org/cluedo4KG/onto#> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owl: <http://www.w3.org/2002/07/owl#> .\n\n:Personne rdf:type owl:Class ;\n rdfs:label \"personne\"@fr , \"person\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Piece rdf:type owl:Class ;\n rdfs:label \"pièce\"@fr , \"room\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:pieceContientPersonne rdf:type owl:ObjectProperty ;\n rdfs:range :Objet ;\n rdfs:domain :Piece ;\n owl:inverseOf :personneDansPiece ;\n rdfs:label \"room contains person\"@en ,\"pièce contient personne\"@fr ."}, - - { "info": "<p></p>", - "question": "<p>Quelle(s) pièce(s) contiennent au moins deux personnes? (piste: utilisez la requête précédante comme sous-requête)</p>", - "ontology": "@prefix : <https://w3id.org/cluedo4KG/onto#> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owl: <http://www.w3.org/2002/07/owl#> .\n\n:Personne rdf:type owl:Class ;\n rdfs:label \"personne\"@fr , \"person\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Piece rdf:type owl:Class ;\n rdfs:label \"pièce\"@fr , \"room\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:pieceContientPersonne rdf:type owl:ObjectProperty ;\n rdfs:range :Objet ;\n rdfs:domain :Piece ;\n owl:inverseOf :personneDansPiece ;\n rdfs:label \"room contains person\"@en ,\"pièce contient personne\"@fr ."}, - - { "info": "<p></p>", - "question": "<p>Quelle(s) pièce(s) est/sont vide(s)?</p>", - "ontology": "@prefix : <https://w3id.org/cluedo4KG/onto#> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owl: <http://www.w3.org/2002/07/owl#> .\n\n:Personne rdf:type owl:Class ;\n rdfs:label \"personne\"@fr , \"person\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Piece rdf:type owl:Class ;\n rdfs:label \"pièce\"@fr , \"room\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:pieceContientPersonne rdf:type owl:ObjectProperty ;\n rdfs:range :Objet ;\n rdfs:domain :Piece ;\n owl:inverseOf :personneDansPiece ;\n rdfs:label \"room contains person\"@en ,\"pièce contient personne\"@fr ."}, - - { "info": "<p>La victime a voulu écrire le nom de son assassin sur un cahier avec une plume, mais le pot d'encre s'est renversé et rend le nom du meurtrier en partie illisible.<br /><img src='media/encrier-nom.jpg' /><br />On déchiffre cependant que son nom de famille ou son prénom finit par 'n.'</p>", - "question": "<p>Quels sont les suspects restants? (augmentez la requête listant les suspects)</p>", - "ontology": "..."}, - - { "info": "<p>Le meurtrier n'est pas dans une des pièces voisines à celle où se situe la victime</p>", - "question": "<p>Qui est par conséquent innoscent?</p>", - "ontology": "@prefix : <https://w3id.org/cluedo4KG/onto#> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owl: <http://www.w3.org/2002/07/owl#> .\n\n:Personne rdf:type owl:Class ;\n rdfs:label \"personne\"@fr , \"person\"@en .\n\n:Piece rdf:type owl:Class ;\n rdfs:label \"pièce\"@fr , \"room\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:pieceContientPersonne rdf:type owl:ObjectProperty ;\n rdfs:range :Objet ;\n rdfs:domain :Piece ;\n owl:inverseOf :personneDansPiece ;\n rdfs:label \"room contains person\"@en ,\"pièce contient personne\"@fr .\n\n:aPourPieceVoisine rdf:type owl:ObjectProperty ,\n owl:SymmetricProperty ;\n rdfs:range :Piece ;\n rdfs:domain :Piece ;\n rdfs:label \"a pour pièce voisine\"@fr , \"has as neighbour room\"@en ."}, - - { "info": "<p>Le meurtrier n'est pas dans une des pièces voisines à celle où se situe la victime</p>", - "question": "<p>Quels sont les suspects restants? (augmentez la requête listant les suspects)</p>", - "ontology": "@prefix : <https://w3id.org/cluedo4KG/onto#> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n@prefix owl: <http://www.w3.org/2002/07/owl#> .\n\n:Personne rdf:type owl:Class ;\n rdfs:label \"personne\"@fr , \"person\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Piece rdf:type owl:Class ;\n rdfs:label \"pièce\"@fr , \"room\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:pieceContientPersonne rdf:type owl:ObjectProperty ;\n rdfs:range :Objet ;\n rdfs:domain :Piece ;\n owl:inverseOf :personneDansPiece ;\n rdfs:label \"room contains person\"@en ,\"pièce contient personne\"@fr .\n\n:aPourPieceVoisine rdf:type owl:ObjectProperty ,\n owl:SymmetricProperty ;\n rdfs:range :Piece ;\n rdfs:domain :Piece ;\n rdfs:label \"a pour pièce voisine\"@fr , \"has as neighbour room\"@en."}, - - { "info": "<p>Un certain nombre d'objets suspects ont été identifiés dans la maison. L'un d'entre eux est l'arme du crime.</p>", - "question": "<p>Combien y a-t-il d'objets dans la maison?</p>", - "ontology": ":Maison rdf:type owl:Class ;\n rdfs:label \"maison\"@fr , \"house\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Piece rdf:type owl:Class ;\n rdfs:label \"pièce\"@fr , \"room\"@en;\n rdfs:subClassOf owl:Thing .\n\n:Objet rdf:type owl:Class ;\n rdfs:label \"objet\"@fr , \"object\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:maisonContientPiece rdf:type owl:ObjectProperty ;\n rdfs:domain :Maison ;\n rdfs:range :Piece ;\n owl:inverseOf :pieceDansMaison ;\n rdfs:label \"house contains room\"@en , \"maison contient pièce\"@fr.\n\n:pieceContientObjet rdf:type owl:ObjectProperty ;\n rdfs:range :Objet ;\n rdfs:domain :Piece ;\n owl:inverseOf :objetDansPiece ;\n rdfs:label \"pièce contient objet\"@en ,\"room contains object\"@fr .\n"}, - - { "info": "<p>L'arme du crime ne se trouve pas dans la pièce où se situe la victime</p>", - "question": "<p>Quels objets ne peuvent pas être l'arme du crime?</p>", - "ontology": ":Maison rdf:type owl:Class ;\n rdfs:label \"maison\"@fr , \"house\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Piece rdf:type owl:Class ;\n rdfs:label \"pièce\"@fr , \"room\"@en;\n rdfs:subClassOf owl:Thing .\n\n:Objet rdf:type owl:Class ;\n rdfs:label \"objet\"@fr , \"object\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:maisonContientPiece rdf:type owl:ObjectProperty ;\n rdfs:domain :Maison ;\n rdfs:range :Piece ;\n owl:inverseOf :pieceDansMaison .\n rdfs:label \"house contains room\"@en , \"maison contient pièce\"@fr .\n\n:pieceContientObjet rdf:type owl:ObjectProperty ;\n rdfs:range :Objet ;\n rdfs:domain :Piece ;\n owl:inverseOf :objetDansPiece ;\n rdfs:label \"pièce contient objet\"@en ,\"room contains object\"@fr .\n"}, - - { "info": "<p>Personne ne se situe dans une pièce où a été posée l'arme du crime</p>", - "question": "<p>Quel objet est l'arme du crime?</p>", - "ontology": ":Maison rdf:type owl:Class ;\n rdfs:label \"maison\"@fr , \"house\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Personne rdf:type owl:Class ;\n rdfs:label \"personne\"@fr , \"person\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Piece rdf:type owl:Class ;\n rdfs:label \"pièce\"@fr , \"room\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Objet rdf:type owl:Class ;\n rdfs:label \"objet\"@fr , \"object\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:maisonContientPiece rdf:type owl:ObjectProperty ;\n rdfs:domain :Maison ;\n rdfs:range :Piece ;\n owl:inverseOf :pieceDansMaison ;\n rdfs:label \"house contains room\"@en , \"maison contient pièce\"@fr .\n\n:pieceContientObjet rdf:type owl:ObjectProperty ;\n rdfs:range :Objet ;\n rdfs:domain :Piece ;\n owl:inverseOf :objetDansPiece ; \n rdfs:label \"pièce contient objet\"@fr ,\"room contains object\"@en.\n\n:pieceContientPersonne rdf:type owl:ObjectProperty ;\n rdfs:range :Objet ;\n rdfs:domain :Piece ;\n owl:inverseOf :personneDansPiece ;\n rdfs:label \"room contains person\"@en ,\"pièce contient personne\"@fr ."}, - - { "info": "<p>Le meurtrier se situe dans une pièce sans objet </p>", - "question": "<p>Qui est le meurtrier? (augmentez la requête listant les suspects)</p>", - "ontology": ":Maison rdf:type owl:Class ;\n rdfs:label \"maison\"@fr , \"house\"@en , ;\n rdfs:subClassOf owl:Thing .\n\n:Personne rdf:type owl:Class ;\n rdfs:label \"personne\"@fr , \"person\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:Piece rdf:type owl:Class ;\n rdfs:label \"pièce\"@fr , \"room\"@en;\n rdfs:subClassOf owl:Thing .\n\n:Objet rdf:type owl:Class ;\n rdfs:label \"objet\"@fr , \"object\"@en ;\n rdfs:subClassOf owl:Thing .\n\n:maisonContientPiece rdf:type owl:ObjectProperty ;\n rdfs:domain :Maison ;\n rdfs:range :Piece ;\n owl:inverseOf :pieceDansMaison ;\n rdfs:label \"house contains room\"@en , \"maison contient pièce\"@fr .\n\n:pieceContientObjet rdf:type owl:ObjectProperty ;\n rdfs:range :Objet ;\n rdfs:domain :Piece ;\n owl:inverseOf :objetDansPiece ; \n rdfs:label \"pièce contient objet\"@en ,\"room contains object\"@fr.\n\n:pieceContientPersonne rdf:type owl:ObjectProperty ;\n rdfs:range :Objet ;\n rdfs:domain :Piece ;\n owl:inverseOf :personneDansPiece ;\n rdfs:label \"room contains person\"@en ,\"pièce contient personne\"@fr ."}, - { - "partie":"Requêtes fédérées : DBpedia", - "info":"<p>Vous allez poursuivre l'enquête en utilisant des requêtes fédérées sur le <a href=\"https://dbpedia.org/sparql\" target=\"_blank\">endpoint SPARQL</a> de <a href=\"https://www.dbpedia.org/\" target=\"_blank\">DBpedia</a></p>", - "question":"<p>Notez que:</p><ul><li>L'IRI de l'ontologie que vous devez considérer pour interroger DBpedia est <a href=\"http://dbpedia.org/ontology/\" target=\"_blank\"><span class=\"uri\">http://dbpedia.org/ontology/</span></a></li><li> l'IRI du SPARQL Endpoint Public de DBpedia est <span class=\"uri\"> https://dbpedia.org/sparql.</span></li> <li>vous devez <ol><li>écrire votre requête dans l'interface Web proposée sur le <a href=\"https://dbpedia.org/sparql\" target=\"_blank\">endpoint SPARQL</a> de DBpedia</li><li>intégrer la requête correcte dans l'application via une requête fédérée pour ressoudre l'enquête de notre scène de crime</li></ol></li></ul>" - }, - { - "info":"<p>Le meurtirer avait un <b>complice</b> dans la maison. Les parents de ce complice sont des fans de TBL (le fameux inventeur du web !). </p>", - "question":"Quelle est l'IRI dans DBpedia de la ressource désignée en anglais par l'alias TBL ? (formule tout d'abord ta requête dans l'interface Web proposée sur le <a href=\"https://dbpedia.org/sparql\" target=\"_blank\">endpoint SPARQL</a> de DBpedia.)", - "ontology":"Regarde la documentation de l'ontologie de DBpedia !" - }, - { - "info":"<p>Le complice porte le même prénom que le frère de TBL (augmenter la requête sur TBL posée sur DBpedia). </p>", - "question":" Quel est ce prénom ? (formule tout d'abord ta requête dans l'interface Web proposée sur le <a href=\"https://dbpedia.org/sparql\" target=\"_blank\">endpoint SPARQL</a> de DBpedia.)", - "ontology":"Regarde la documentation de l'ontologie de DBpedia !" - }, - { - "info":"<p>Le complice porte le même prénom que le frère de TBL</p>", - "question":"Quels sont les complices potentiels de notre crime ? (utilise le potentiel d'une requête fédérée pour trouver les complices potentiels)", - "ontology":"..." - }, - { - "partie":"Requêtes fédérées : DBpedia et Wikidata ", - "info":"<p>Vous pouvez poursuivre l'enquête en utilisant des requêtes fédérées sur le SPARQL endpoint de <a href=\"https://www.wikidata.org/wiki/Wikidata:Main_Page\" target=\"_blank\">Wikidata</a></p>", - "question":"<p>Sciemment, aucune information ne vous est donnée sur l'ontologie à considérer.</li><li> l'IRI du SPARQL Endpoint Public de Wikidata est <span class=\"uri\"> https://query.wikidata.org/sparql.</span></li><li>Vous devez <ol><li>écrire votre requête dans <a href=\"https://query.wikidata.org\" target=\"_blank\">l'interface associée au endpoint de wikidata </a></li><li>intégrer la requête correcte dans cette application via une requête fédérée pour ressoudre l'enquête de notre scène de crime.</li></ol></li></ul>" - }, - { - "info":"", - "question":"quelle est l'IRI dans Wikidata de TBL ? (utiliser le nom de la personne trouvé dans DBPedia). Formule tout d'abord ta requête directement dans <a href=\"https://query.wikidata.org\" target=\"_blank\">l'interface associée au endpoint de wikidata </a>.", - "ontology":"à toi de te débrouiller !" - }, - { - "info":"<p>Le complice porte comme nom de famille le titre honorifique de TBL en anglais. </p>", - "question":" Quel est le nom de famille du complice ? (augmenter la requête fédérée précédente à partir de cette nouvelle information de wikidata). Formule tout d'abord ta requête directement dans <a href=\"https://query.wikidata.org\" target=\"_blank\">l'interface associée au endpoint de wikidata </a>.", - "ontology":"à toi de te débrouiller !" - }, - { - "info":"<p></p>", - "question":"Trouvez le complice et la pièce dans laquelle il se cache ! (Utilise la requête précédente dans cette application via une requête fédérée)", - "ontology":"à toi de te débrouiller !" - } - - ] \ No newline at end of file diff --git a/cluedo4KG-sources/cluedo4kg-App/index-fr.html b/cluedo4KG-sources/cluedo4kg-App/index-fr.html deleted file mode 100644 index 35556bf2a17d73d8e1a218ca4e4cc622af733235..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/index-fr.html +++ /dev/null @@ -1,41 +0,0 @@ - <!DOCTYPE html> - <html lang="fr"> - <head> - <meta http-equiv="content-type" content="text/html; charset=utf-8" /> - <title>SPARQLUEDO</title> - <link rel="icon" href="media/ron_blood_038.png" /> - - - - <link rel="stylesheet" type="text/css" href="Sparqluedo/media/base.css" /> - <link rel="stylesheet" type="text/css" href="Sparqluedo/media/style.css" /> - - - </head> - - <body> - <p> <b id="lang">FR</b> | <a href="index.html">EN</a> </p> - <section id="consignes"> - <h1>CLUEDO4KG</h1> - <p>Nous mettons à votre disposition des tutoriels conçus pour découvrir les technologies du web sémantique qui permettent de créer, manipuler et réutiliser des graphes de connaissances.</p> - <h2>SPARQLUEDO</h2> - <p>Dans ce tutoriel, vous devrez résoudre une enquête au moyen de requêtes SPARQL. La scéne du crime est décrite à partir d'un graphe de connaissances rendu accessible via des requêtes SPARQL à écrire dans l'application. L'ontologie sur laquelle repose le graphe de connaissances est téléchargeable ou présentée via des extraits dans l'application.</p> - <p><a href="Sparqluedo/index-fr.html">Je veux trouver le meurtrier avec SPARQL !</a></p> - <h2>OWLUEDO</h2> - <p>Dans ce tutoriel, vous devrez résoudre une enquête en créant une ontologie en OWL et en peuplant un graphe de connaissances.</p> - <p><a href="Owluedo/index-fr.html">Je veux trouver le meurtrier avec OWL !</a></p> - </section> - - - - <section id="qui"> - - <p xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/"><a href="https://w3id.org/cluedo4KG/"><span property="dct:title">Cluedo4KG</span></a> by <span property="cc:attributionName">Camille Pradel, William Charles, <a href="https://www.irit.fr/~Nathalie.Hernandez">Nathalie Hernandez</a></span> is licensed under <a href="https://creativecommons.org/licenses/by-nc/4.0/?ref=chooser-v1" target="_blank" rel="license noopener noreferrer" style="display:inline-block;">CC BY-NC 4.0<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1" alt=""><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1" alt=""><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/nc.svg?ref=chooser-v1" alt=""></a></p> - <p>Don't hesitate to get in touch!</p> - </section> - - - - - </body> -</html> diff --git a/cluedo4KG-sources/cluedo4kg-App/index.html b/cluedo4KG-sources/cluedo4kg-App/index.html deleted file mode 100644 index 2e46dae4fb814687a481b95114e7e7fb405d3a86..0000000000000000000000000000000000000000 --- a/cluedo4KG-sources/cluedo4kg-App/index.html +++ /dev/null @@ -1,41 +0,0 @@ - <!DOCTYPE html> - <html lang="fr"> - <head> - <meta http-equiv="content-type" content="text/html; charset=utf-8" /> - <title>SPARQLUEDO</title> - <link rel="icon" href="Sparqluedo/media/ron_blood_038.png" /> - - - - <link rel="stylesheet" type="text/css" href="Sparqluedo/media/base.css" /> - <link rel="stylesheet" type="text/css" href="Sparqluedo/media/style.css" /> - - - </head> - - <body> - <p> <a href="index-fr.html">FR</a> | <b>EN</b> </p> - <section id="consignes"> - <h1>CLUEDO4KG</h1> - <p>We provide tutorials designed to help you discover the semantic web technologies used to create, manipulate and reuse knowledge graphs.</p> - <h2>SPARQLUEDO</h2> - <p>In this tutorial, you will have to solve an investigation using SPARQL queries. The crime scene is described using a knowledge graph made accessible via SPARQL queries to be written in the application. The ontology on which the knowledge graph is based can be downloaded or presented via extracts in the application.</p> - <p><a href="Sparqluedo/">I want to find the murderer with SPARQL!</a></p> - <h2>OWLUEDO</h2> - <p>In this tutorial, you will solve an investigation by creating an ontology in OWL and populating a knowledge graph.</p> - <p><a href="Owluedo/">I want to find the murderer with OWL!</a></p> - </section> - - - - <section id="qui"> - - <p xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/"><a href="https://w3id.org/cluedo4KG/"><span property="dct:title">Cluedo4KG</span></a> by <span property="cc:attributionName">Camille Pradel, William Charles, <a href="https://www.irit.fr/~Nathalie.Hernandez">Nathalie Hernandez</a></span> is licensed under <a href="https://creativecommons.org/licenses/by-nc/4.0/?ref=chooser-v1" target="_blank" rel="license noopener noreferrer" style="display:inline-block;">CC BY-NC 4.0<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1" alt=""><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1" alt=""><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/nc.svg?ref=chooser-v1" alt=""></a></p> - <p>Don't hesitate to get in touch!</p> - </section> - - - - - </body> -</html> diff --git a/cluedo4KG-sources/index-en.html b/cluedo4KG-sources/index-en.html new file mode 100644 index 0000000000000000000000000000000000000000..c3106eef4b126c7e4d3292117e189c70694da2ae --- /dev/null +++ b/cluedo4KG-sources/index-en.html @@ -0,0 +1,93 @@ +<!DOCTYPE html> +<html> +<head> +<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> + <link rel="stylesheet" href="resources/primer.css" media="screen" /> <link rel="stylesheet" href="resources/rec.css" media="screen" /> <link rel="stylesheet" href="resources/extra.css" media="screen" /> <link rel="stylesheet" href="resources/owl.css" media="screen" /> <title>Ontology Documentation generated by WIDOCO</title> + + +<!-- SCHEMA.ORG METADATA --> +<script type="application/ld+json">{"@context":"https://schema.org","@type":"TechArticle","url":"https://w3id.org/cluedo4KG/onto#","image":"http://vowl.visualdataweb.org/webvowl/#iri=https://w3id.org/cluedo4KG/onto#","name":"https://w3id.org/cluedo4KG/onto#", "headline":"This ontology was created for use in the SPARQLUEDO tutorial, which is part of the CLUEDO4KG resource.", "datePublished":"Fri Oct 04 18:44:33 CEST 2024", "license":"http://creativecommons.org/licenses/by/4.0/", "author":[{"@type":"Person","name":"Camille Pradel"},{"@type":"Person","name":"Nathalie Hernandez"}]}</script> + +<script src="resources/jquery.js"></script> +<script src="resources/marked.min.js"></script> + <script> +function loadHash() { + jQuery(".markdown").each(function(el){jQuery(this).after(marked(jQuery(this).text())).remove()}); + var hash = location.hash; + if($(hash).offset()!=null){ + $('html, body').animate({scrollTop: $(hash).offset().top}, 0); +} + loadTOC(); +} +function loadTOC(){ + //process toc dynamically + var t='<h2>Table of contents</h2><ul>';i = 1;j=0; + jQuery(".list").each(function(){ + if(jQuery(this).is('h2')){ + if(j>0){ + t+='</ul>'; + j=0; + } + t+= '<li>'+i+'. <a href=#'+ jQuery(this).attr('id')+'>'+ jQuery(this).ignore("span").text()+'</a></li>'; + i++; + } + if(jQuery(this).is('h3')){ + if(j==0){ + t+='<ul>'; + } + j++; + t+= '<li>'+(i-1)+'.'+j+'. '+'<a href=#'+ jQuery(this).attr('id')+'>'+ jQuery(this).ignore("span").text()+'</a></li>'; + } + }); + t+='</ul>'; + $("#toc").html(t); +} + $.fn.ignore = function(sel){ + return this.clone().find(sel||">*").remove().end(); + }; $(function(){ + $("#abstract").load("sections/abstract-en.html"); + $("#introduction").load("sections/introduction-en.html"); + $("#crossref").load("sections/crossref-en.html", null, loadHash); + }); + </script> + </head> + +<body> +<div class="container"> +<div class="head"> +<div style="float:right">language <a href="index-en.html"><b>en</b></a> </div> + + +<dl> +<dt>Latest version:</dt> +<dd><a href="https://w3id.org/cluedo4KG/onto#">https://w3id.org/cluedo4KG/onto#</a></dd> +<dt>Issued on: </dt> +<dd>2012-12-01</dd> +<dt>Authors:</dt> +<dd>Camille Pradel</dd><dd>Nathalie Hernandez</dd> + +<dt>Download serialization:</dt><dd><span><a href="ontology.jsonld" target="_blank"><img src="https://img.shields.io/badge/Format-JSON_LD-blue.svg" alt="JSON-LD" /></a> </span><span><a href="ontology.rdf" target="_blank"><img src="https://img.shields.io/badge/Format-RDF/XML-blue.svg" alt="RDF/XML" /></a> </span><span><a href="ontology.nt" target="_blank"><img src="https://img.shields.io/badge/Format-N_Triples-blue.svg" alt="N-Triples" /></a> </span><span><a href="ontology.ttl" target="_blank"><img src="https://img.shields.io/badge/Format-TTL-blue.svg" alt="TTL" /></a> </span></dd><dt>License:</dt><dd><a href="http://creativecommons.org/licenses/by/4.0/" target="_blank"><img src="https://img.shields.io/badge/License-http://creativecommons.org/licenses/by/4.0/-blue.svg" alt="http://creativecommons.org/licenses/by/4.0/" /></a> +</dd><dt>Visualization:</dt><dd><a href="webvowl/index.html#" target="_blank"><img src="https://img.shields.io/badge/Visualize_with-WebVowl-blue.svg" alt="Visualize with WebVowl" /></a></dd> +<!-- <dt>Evaluation:</dt><dd><a href="OOPSEvaluation/oopsEval.html#" target="_blank"><img src="https://img.shields.io/badge/Evaluate_with-OOPS! (OntOlogy Pitfall Scanner!)-blue.svg" alt="Evaluate with OOPS!" /></a></dd> --><dt>Cite as:</dt> +<dd>Camille Pradel, Nathalie Hernandez.</dd> +</dl> + +<hr/> +</div> +<div class="status"> +<div> +<span>Ontology Specification Draft</span> +</div> +</div> <div id="abstract"></div> +<div id="toc"></div> <div id="introduction"></div> + <div id="crossref"></div> +<div id="acknowledgments"> +<h2 id="ack" class="list">Acknowledgments <span class="backlink"> back to <a href="#toc">ToC</a></span></h2> +<p> +The authors would like to thank <a href="http://www.essepuntato.it/">Silvio Peroni</a> for developing <a href="http://www.essepuntato.it/lode">LODE</a>, a Live OWL Documentation Environment, which is used for representing the Cross Referencing Section of this document and <a href="https://w3id.org/people/dgarijo">Daniel Garijo</a> for developing <a href="https://github.com/dgarijo/Widoco">Widoco</a>, the program used to create the template used in this documentation.</p> +</div> + + +</div> +</body> +</html> \ No newline at end of file diff --git a/cluedo4KG-sources/ontology.jsonld b/cluedo4KG-sources/ontology.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..a7e0179d91ff5c32e3d1133232826f81d8760137 --- /dev/null +++ b/cluedo4KG-sources/ontology.jsonld @@ -0,0 +1,223 @@ +[ { + "@id" : "http://creativecommons.org/ns#license", + "@type" : [ "http://www.w3.org/2002/07/owl#AnnotationProperty" ] +}, { + "@id" : "http://purl.org/dc/terms/creator", + "@type" : [ "http://www.w3.org/2002/07/owl#AnnotationProperty" ] +}, { + "@id" : "http://purl.org/dc/terms/issued", + "@type" : [ "http://www.w3.org/2002/07/owl#AnnotationProperty" ] +}, { + "@id" : "http://purl.org/vocab/vann/preferredNamespacePrefix", + "@type" : [ "http://www.w3.org/2002/07/owl#AnnotationProperty" ] +}, { + "@id" : "http://purl.org/vocab/vann/preferredNamespaceUri", + "@type" : [ "http://www.w3.org/2002/07/owl#AnnotationProperty" ] +}, { + "@id" : "http://www.w3.org/2001/XMLSchema#date", + "@type" : [ "http://www.w3.org/2000/01/rdf-schema#Datatype" ] +}, { + "@id" : "https://w3id.org/cluedo4KG/onto", + "@type" : [ "http://www.w3.org/2002/07/owl#Ontology" ], + "http://creativecommons.org/ns#license" : [ { + "@id" : "http://creativecommons.org/licenses/by/4.0/" + } ], + "http://purl.org/dc/terms/creator" : [ { + "@value" : "Camille Pradel" + }, { + "@value" : "Nathalie Hernandez" + } ], + "http://purl.org/dc/terms/issued" : [ { + "@type" : "http://www.w3.org/2001/XMLSchema#date", + "@value" : "2012-12-01" + } ], + "http://purl.org/vocab/vann/preferredNamespacePrefix" : [ { + "@value" : "cluedonto" + } ], + "http://purl.org/vocab/vann/preferredNamespaceUri" : [ { + "@id" : "https://w3id.org/cluedo4KG/onto#" + } ], + "http://www.w3.org/2000/01/rdf-schema#comment" : [ { + "@language" : "fr", + "@value" : "Cette ontologie a été créée pour être utilisée dans le tutoriel SPARQLUEDO faisant partie de la ressource CLUEDO4KG" + }, { + "@language" : "en", + "@value" : "This ontology was created for use in the SPARQLUEDO tutorial, which is part of the CLUEDO4KG resource." + } ] +}, { + "@id" : "https://w3id.org/cluedo4KG/onto#Maison", + "@type" : [ "http://www.w3.org/2002/07/owl#Class" ], + "http://www.w3.org/2000/01/rdf-schema#comment" : [ { + "@language" : "en", + "@value" : "house" + } ], + "http://www.w3.org/2000/01/rdf-schema#label" : [ { + "@language" : "fr", + "@value" : "maison" + } ] +}, { + "@id" : "https://w3id.org/cluedo4KG/onto#Objet", + "@type" : [ "http://www.w3.org/2002/07/owl#Class" ], + "http://www.w3.org/2000/01/rdf-schema#label" : [ { + "@language" : "en", + "@value" : "object" + }, { + "@language" : "fr", + "@value" : "objet" + } ], + "http://www.w3.org/2000/01/rdf-schema#subClassOf" : [ { + "@id" : "http://www.w3.org/2002/07/owl#Thing" + } ] +}, { + "@id" : "https://w3id.org/cluedo4KG/onto#Personne", + "@type" : [ "http://www.w3.org/2002/07/owl#Class" ], + "http://www.w3.org/2000/01/rdf-schema#label" : [ { + "@language" : "en", + "@value" : "person" + }, { + "@language" : "fr", + "@value" : "personne" + } ], + "http://www.w3.org/2000/01/rdf-schema#subClassOf" : [ { + "@id" : "http://www.w3.org/2002/07/owl#Thing" + } ] +}, { + "@id" : "https://w3id.org/cluedo4KG/onto#Piece", + "@type" : [ "http://www.w3.org/2002/07/owl#Class" ], + "http://www.w3.org/2000/01/rdf-schema#label" : [ { + "@language" : "fr", + "@value" : "pièce" + }, { + "@language" : "en", + "@value" : "room" + } ], + "http://www.w3.org/2000/01/rdf-schema#subClassOf" : [ { + "@id" : "http://www.w3.org/2002/07/owl#Thing" + } ] +}, { + "@id" : "https://w3id.org/cluedo4KG/onto#aPourPieceVoisine", + "@type" : [ "http://www.w3.org/2002/07/owl#ObjectProperty", "http://www.w3.org/2002/07/owl#SymmetricProperty" ], + "http://www.w3.org/2000/01/rdf-schema#domain" : [ { + "@id" : "https://w3id.org/cluedo4KG/onto#Piece" + } ], + "http://www.w3.org/2000/01/rdf-schema#label" : [ { + "@language" : "fr", + "@value" : "a pour pièce voisine" + }, { + "@language" : "en", + "@value" : "has as neighbour room" + } ], + "http://www.w3.org/2000/01/rdf-schema#range" : [ { + "@id" : "https://w3id.org/cluedo4KG/onto#Piece" + } ] +}, { + "@id" : "https://w3id.org/cluedo4KG/onto#estVivant", + "@type" : [ "http://www.w3.org/2002/07/owl#DatatypeProperty" ], + "http://www.w3.org/2000/01/rdf-schema#comment" : [ { + "@language" : "en", + "@value" : "indicates whether a person is alive (True) or dead (False)" + }, { + "@language" : "fr", + "@value" : "indique si une personne est vivante (True) ou morte (False)" + } ], + "http://www.w3.org/2000/01/rdf-schema#domain" : [ { + "@id" : "https://w3id.org/cluedo4KG/onto#Personne" + } ], + "http://www.w3.org/2000/01/rdf-schema#label" : [ { + "@language" : "fr", + "@value" : "est vivant" + }, { + "@language" : "en", + "@value" : "is alive" + } ], + "http://www.w3.org/2000/01/rdf-schema#range" : [ { + "@id" : "http://www.w3.org/2001/XMLSchema#boolean" + } ] +}, { + "@id" : "https://w3id.org/cluedo4KG/onto#maisonContientPiece", + "@type" : [ "http://www.w3.org/2002/07/owl#ObjectProperty" ], + "http://www.w3.org/2000/01/rdf-schema#domain" : [ { + "@id" : "https://w3id.org/cluedo4KG/onto#Maison" + } ], + "http://www.w3.org/2000/01/rdf-schema#label" : [ { + "@language" : "en", + "@value" : "house contains room" + }, { + "@language" : "fr", + "@value" : "maison contient pièce" + } ], + "http://www.w3.org/2000/01/rdf-schema#range" : [ { + "@id" : "https://w3id.org/cluedo4KG/onto#Piece" + } ], + "http://www.w3.org/2002/07/owl#inverseOf" : [ { + "@id" : "https://w3id.org/cluedo4KG/onto#pieceDansMaison" + } ] +}, { + "@id" : "https://w3id.org/cluedo4KG/onto#objetDansPiece", + "@type" : [ "http://www.w3.org/2002/07/owl#ObjectProperty" ], + "http://www.w3.org/2000/01/rdf-schema#label" : [ { + "@language" : "en", + "@value" : "object in room" + }, { + "@language" : "fr", + "@value" : "objet dans pièce" + } ], + "http://www.w3.org/2002/07/owl#inverseOf" : [ { + "@id" : "https://w3id.org/cluedo4KG/onto#pieceContientObjet" + } ] +}, { + "@id" : "https://w3id.org/cluedo4KG/onto#personneDansPiece", + "@type" : [ "http://www.w3.org/2002/07/owl#ObjectProperty" ], + "http://www.w3.org/2000/01/rdf-schema#label" : [ { + "@language" : "en", + "@value" : "person in room" + }, { + "@language" : "fr", + "@value" : "personne dans pièce" + } ], + "http://www.w3.org/2002/07/owl#inverseOf" : [ { + "@id" : "https://w3id.org/cluedo4KG/onto#pieceContientPersonne" + } ] +}, { + "@id" : "https://w3id.org/cluedo4KG/onto#pieceContientObjet", + "@type" : [ "http://www.w3.org/2002/07/owl#ObjectProperty" ], + "http://www.w3.org/2000/01/rdf-schema#domain" : [ { + "@id" : "https://w3id.org/cluedo4KG/onto#Piece" + } ], + "http://www.w3.org/2000/01/rdf-schema#label" : [ { + "@language" : "fr", + "@value" : "pièce contient objet" + }, { + "@language" : "en", + "@value" : "room contains object" + } ], + "http://www.w3.org/2000/01/rdf-schema#range" : [ { + "@id" : "https://w3id.org/cluedo4KG/onto#Objet" + } ] +}, { + "@id" : "https://w3id.org/cluedo4KG/onto#pieceContientPersonne", + "@type" : [ "http://www.w3.org/2002/07/owl#ObjectProperty" ], + "http://www.w3.org/2000/01/rdf-schema#domain" : [ { + "@id" : "https://w3id.org/cluedo4KG/onto#Piece" + } ], + "http://www.w3.org/2000/01/rdf-schema#label" : [ { + "@language" : "fr", + "@value" : "pièce contient personne" + }, { + "@language" : "en", + "@value" : "room contains person" + } ], + "http://www.w3.org/2000/01/rdf-schema#range" : [ { + "@id" : "https://w3id.org/cluedo4KG/onto#Personne" + } ] +}, { + "@id" : "https://w3id.org/cluedo4KG/onto#pieceDansMaison", + "@type" : [ "http://www.w3.org/2002/07/owl#ObjectProperty" ], + "http://www.w3.org/2000/01/rdf-schema#label" : [ { + "@language" : "fr", + "@value" : "pièce dans maison" + }, { + "@language" : "en", + "@value" : "room in house" + } ] +} ] \ No newline at end of file diff --git a/cluedo4KG-sources/ontology.nt b/cluedo4KG-sources/ontology.nt new file mode 100644 index 0000000000000000000000000000000000000000..e46730c006ba86b05de64bd83bcd6d97997330a7 --- /dev/null +++ b/cluedo4KG-sources/ontology.nt @@ -0,0 +1,152 @@ +<https://w3id.org/cluedo4KG/onto> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Ontology> . +<https://w3id.org/cluedo4KG/onto> <http://creativecommons.org/ns#license> <http://creativecommons.org/licenses/by/4.0/> . +<https://w3id.org/cluedo4KG/onto> <http://purl.org/dc/terms/creator> "Camille Pradel" . +<https://w3id.org/cluedo4KG/onto> <http://purl.org/dc/terms/creator> "Nathalie Hernandez" . +<https://w3id.org/cluedo4KG/onto> <http://purl.org/dc/terms/issued> "2012-12-01"^^<http://www.w3.org/2001/XMLSchema#date> . +<https://w3id.org/cluedo4KG/onto> <http://purl.org/vocab/vann/preferredNamespacePrefix> "cluedonto" . +<https://w3id.org/cluedo4KG/onto> <http://purl.org/vocab/vann/preferredNamespaceUri> <https://w3id.org/cluedo4KG/onto#> . +<https://w3id.org/cluedo4KG/onto> <http://www.w3.org/2000/01/rdf-schema#comment> "Cette ontologie a été créée pour être utilisée dans le tutoriel SPARQLUEDO faisant partie de la ressource CLUEDO4KG"@fr . +<https://w3id.org/cluedo4KG/onto> <http://www.w3.org/2000/01/rdf-schema#comment> "This ontology was created for use in the SPARQLUEDO tutorial, which is part of the CLUEDO4KG resource."@en . +# +# +# ################################################################# +# # +# # Annotation properties +# # +# ################################################################# +# +# +# http://creativecommons.org/ns#license +<http://creativecommons.org/ns#license> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#AnnotationProperty> . +# +# http://purl.org/dc/terms/creator +<http://purl.org/dc/terms/creator> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#AnnotationProperty> . +# +# http://purl.org/dc/terms/issued +<http://purl.org/dc/terms/issued> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#AnnotationProperty> . +# +# http://purl.org/vocab/vann/preferredNamespacePrefix +<http://purl.org/vocab/vann/preferredNamespacePrefix> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#AnnotationProperty> . +# +# http://purl.org/vocab/vann/preferredNamespaceUri +<http://purl.org/vocab/vann/preferredNamespaceUri> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#AnnotationProperty> . +# +# +# +# ################################################################# +# # +# # Datatypes +# # +# ################################################################# +# +# +# http://www.w3.org/2001/XMLSchema#date +<http://www.w3.org/2001/XMLSchema#date> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2000/01/rdf-schema#Datatype> . +# +# +# +# ################################################################# +# # +# # Object Properties +# # +# ################################################################# +# +# +# https://w3id.org/cluedo4KG/onto#aPourPieceVoisine +<https://w3id.org/cluedo4KG/onto#aPourPieceVoisine> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#ObjectProperty> . +<https://w3id.org/cluedo4KG/onto#aPourPieceVoisine> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#SymmetricProperty> . +<https://w3id.org/cluedo4KG/onto#aPourPieceVoisine> <http://www.w3.org/2000/01/rdf-schema#domain> <https://w3id.org/cluedo4KG/onto#Piece> . +<https://w3id.org/cluedo4KG/onto#aPourPieceVoisine> <http://www.w3.org/2000/01/rdf-schema#range> <https://w3id.org/cluedo4KG/onto#Piece> . +<https://w3id.org/cluedo4KG/onto#aPourPieceVoisine> <http://www.w3.org/2000/01/rdf-schema#label> "a pour pièce voisine"@fr . +<https://w3id.org/cluedo4KG/onto#aPourPieceVoisine> <http://www.w3.org/2000/01/rdf-schema#label> "has as neighbour room"@en . +# +# https://w3id.org/cluedo4KG/onto#maisonContientPiece +<https://w3id.org/cluedo4KG/onto#maisonContientPiece> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#ObjectProperty> . +<https://w3id.org/cluedo4KG/onto#maisonContientPiece> <http://www.w3.org/2002/07/owl#inverseOf> <https://w3id.org/cluedo4KG/onto#pieceDansMaison> . +<https://w3id.org/cluedo4KG/onto#maisonContientPiece> <http://www.w3.org/2000/01/rdf-schema#domain> <https://w3id.org/cluedo4KG/onto#Maison> . +<https://w3id.org/cluedo4KG/onto#maisonContientPiece> <http://www.w3.org/2000/01/rdf-schema#range> <https://w3id.org/cluedo4KG/onto#Piece> . +<https://w3id.org/cluedo4KG/onto#maisonContientPiece> <http://www.w3.org/2000/01/rdf-schema#label> "house contains room"@en . +<https://w3id.org/cluedo4KG/onto#maisonContientPiece> <http://www.w3.org/2000/01/rdf-schema#label> "maison contient pièce"@fr . +# +# https://w3id.org/cluedo4KG/onto#objetDansPiece +<https://w3id.org/cluedo4KG/onto#objetDansPiece> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#ObjectProperty> . +<https://w3id.org/cluedo4KG/onto#objetDansPiece> <http://www.w3.org/2002/07/owl#inverseOf> <https://w3id.org/cluedo4KG/onto#pieceContientObjet> . +<https://w3id.org/cluedo4KG/onto#objetDansPiece> <http://www.w3.org/2000/01/rdf-schema#label> "object in room"@en . +<https://w3id.org/cluedo4KG/onto#objetDansPiece> <http://www.w3.org/2000/01/rdf-schema#label> "objet dans pièce"@fr . +# +# https://w3id.org/cluedo4KG/onto#personneDansPiece +<https://w3id.org/cluedo4KG/onto#personneDansPiece> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#ObjectProperty> . +<https://w3id.org/cluedo4KG/onto#personneDansPiece> <http://www.w3.org/2002/07/owl#inverseOf> <https://w3id.org/cluedo4KG/onto#pieceContientPersonne> . +<https://w3id.org/cluedo4KG/onto#personneDansPiece> <http://www.w3.org/2000/01/rdf-schema#label> "person in room"@en . +<https://w3id.org/cluedo4KG/onto#personneDansPiece> <http://www.w3.org/2000/01/rdf-schema#label> "personne dans pièce"@fr . +# +# https://w3id.org/cluedo4KG/onto#pieceContientObjet +<https://w3id.org/cluedo4KG/onto#pieceContientObjet> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#ObjectProperty> . +<https://w3id.org/cluedo4KG/onto#pieceContientObjet> <http://www.w3.org/2000/01/rdf-schema#domain> <https://w3id.org/cluedo4KG/onto#Piece> . +<https://w3id.org/cluedo4KG/onto#pieceContientObjet> <http://www.w3.org/2000/01/rdf-schema#range> <https://w3id.org/cluedo4KG/onto#Objet> . +<https://w3id.org/cluedo4KG/onto#pieceContientObjet> <http://www.w3.org/2000/01/rdf-schema#label> "pièce contient objet"@fr . +<https://w3id.org/cluedo4KG/onto#pieceContientObjet> <http://www.w3.org/2000/01/rdf-schema#label> "room contains object"@en . +# +# https://w3id.org/cluedo4KG/onto#pieceContientPersonne +<https://w3id.org/cluedo4KG/onto#pieceContientPersonne> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#ObjectProperty> . +<https://w3id.org/cluedo4KG/onto#pieceContientPersonne> <http://www.w3.org/2000/01/rdf-schema#domain> <https://w3id.org/cluedo4KG/onto#Piece> . +<https://w3id.org/cluedo4KG/onto#pieceContientPersonne> <http://www.w3.org/2000/01/rdf-schema#range> <https://w3id.org/cluedo4KG/onto#Personne> . +<https://w3id.org/cluedo4KG/onto#pieceContientPersonne> <http://www.w3.org/2000/01/rdf-schema#label> "pièce contient personne"@fr . +<https://w3id.org/cluedo4KG/onto#pieceContientPersonne> <http://www.w3.org/2000/01/rdf-schema#label> "room contains person"@en . +# +# https://w3id.org/cluedo4KG/onto#pieceDansMaison +<https://w3id.org/cluedo4KG/onto#pieceDansMaison> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#ObjectProperty> . +<https://w3id.org/cluedo4KG/onto#pieceDansMaison> <http://www.w3.org/2000/01/rdf-schema#label> "pièce dans maison"@fr . +<https://w3id.org/cluedo4KG/onto#pieceDansMaison> <http://www.w3.org/2000/01/rdf-schema#label> "room in house"@en . +# +# +# +# ################################################################# +# # +# # Data properties +# # +# ################################################################# +# +# +# https://w3id.org/cluedo4KG/onto#estVivant +<https://w3id.org/cluedo4KG/onto#estVivant> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#DatatypeProperty> . +<https://w3id.org/cluedo4KG/onto#estVivant> <http://www.w3.org/2000/01/rdf-schema#domain> <https://w3id.org/cluedo4KG/onto#Personne> . +<https://w3id.org/cluedo4KG/onto#estVivant> <http://www.w3.org/2000/01/rdf-schema#range> <http://www.w3.org/2001/XMLSchema#boolean> . +<https://w3id.org/cluedo4KG/onto#estVivant> <http://www.w3.org/2000/01/rdf-schema#comment> "indicates whether a person is alive (True) or dead (False)"@en . +<https://w3id.org/cluedo4KG/onto#estVivant> <http://www.w3.org/2000/01/rdf-schema#comment> "indique si une personne est vivante (True) ou morte (False)"@fr . +<https://w3id.org/cluedo4KG/onto#estVivant> <http://www.w3.org/2000/01/rdf-schema#label> "est vivant"@fr . +<https://w3id.org/cluedo4KG/onto#estVivant> <http://www.w3.org/2000/01/rdf-schema#label> "is alive"@en . +# +# +# +# ################################################################# +# # +# # Classes +# # +# ################################################################# +# +# +# https://w3id.org/cluedo4KG/onto#Maison +<https://w3id.org/cluedo4KG/onto#Maison> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> . +<https://w3id.org/cluedo4KG/onto#Maison> <http://www.w3.org/2000/01/rdf-schema#comment> "house"@en . +<https://w3id.org/cluedo4KG/onto#Maison> <http://www.w3.org/2000/01/rdf-schema#label> "maison"@fr . +# +# https://w3id.org/cluedo4KG/onto#Objet +<https://w3id.org/cluedo4KG/onto#Objet> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> . +<https://w3id.org/cluedo4KG/onto#Objet> <http://www.w3.org/2000/01/rdf-schema#subClassOf> <http://www.w3.org/2002/07/owl#Thing> . +<https://w3id.org/cluedo4KG/onto#Objet> <http://www.w3.org/2000/01/rdf-schema#label> "object"@en . +<https://w3id.org/cluedo4KG/onto#Objet> <http://www.w3.org/2000/01/rdf-schema#label> "objet"@fr . +# +# https://w3id.org/cluedo4KG/onto#Personne +<https://w3id.org/cluedo4KG/onto#Personne> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> . +<https://w3id.org/cluedo4KG/onto#Personne> <http://www.w3.org/2000/01/rdf-schema#subClassOf> <http://www.w3.org/2002/07/owl#Thing> . +<https://w3id.org/cluedo4KG/onto#Personne> <http://www.w3.org/2000/01/rdf-schema#label> "person"@en . +<https://w3id.org/cluedo4KG/onto#Personne> <http://www.w3.org/2000/01/rdf-schema#label> "personne"@fr . +# +# https://w3id.org/cluedo4KG/onto#Piece +<https://w3id.org/cluedo4KG/onto#Piece> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> . +<https://w3id.org/cluedo4KG/onto#Piece> <http://www.w3.org/2000/01/rdf-schema#subClassOf> <http://www.w3.org/2002/07/owl#Thing> . +<https://w3id.org/cluedo4KG/onto#Piece> <http://www.w3.org/2000/01/rdf-schema#label> "pièce"@fr . +<https://w3id.org/cluedo4KG/onto#Piece> <http://www.w3.org/2000/01/rdf-schema#label> "room"@en . +# +# Generated by the OWL API (version 5.1.18) https://github.com/owlcs/owlapi/ diff --git a/cluedo4KG-sources/ontology.rdf b/cluedo4KG-sources/ontology.rdf new file mode 100644 index 0000000000000000000000000000000000000000..4772ac967bf7754e23fd7708266c9a625a5e9379 --- /dev/null +++ b/cluedo4KG-sources/ontology.rdf @@ -0,0 +1,269 @@ +<?xml version="1.0"?> +<rdf:RDF xmlns="https://w3id.org/cluedo4KG/onto#" + xml:base="https://w3id.org/cluedo4KG/onto" + xmlns:ns="http://creativecommons.org/ns#" + xmlns:owl="http://www.w3.org/2002/07/owl#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:xml="http://www.w3.org/XML/1998/namespace" + xmlns:xsd="http://www.w3.org/2001/XMLSchema#" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" + xmlns:vann="http://purl.org/vocab/vann/" + xmlns:terms="http://purl.org/dc/terms/"> + <owl:Ontology rdf:about="https://w3id.org/cluedo4KG/onto"> + <ns:license rdf:resource="http://creativecommons.org/licenses/by/4.0/"/> + <terms:creator>Camille Pradel</terms:creator> + <terms:creator>Nathalie Hernandez</terms:creator> + <terms:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2012-12-01</terms:issued> + <vann:preferredNamespacePrefix>cluedonto</vann:preferredNamespacePrefix> + <vann:preferredNamespaceUri rdf:resource="https://w3id.org/cluedo4KG/onto#"/> + <rdfs:comment xml:lang="fr">Cette ontologie a été créée pour être utilisée dans le tutoriel SPARQLUEDO faisant partie de la ressource CLUEDO4KG</rdfs:comment> + <rdfs:comment xml:lang="en">This ontology was created for use in the SPARQLUEDO tutorial, which is part of the CLUEDO4KG resource.</rdfs:comment> + </owl:Ontology> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Annotation properties + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + + <!-- http://creativecommons.org/ns#license --> + + + <owl:AnnotationProperty rdf:about="http://creativecommons.org/ns#license"/> + + + + <!-- http://purl.org/dc/terms/creator --> + + + <owl:AnnotationProperty rdf:about="http://purl.org/dc/terms/creator"/> + + + + <!-- http://purl.org/dc/terms/issued --> + + + <owl:AnnotationProperty rdf:about="http://purl.org/dc/terms/issued"/> + + + + <!-- http://purl.org/vocab/vann/preferredNamespacePrefix --> + + + <owl:AnnotationProperty rdf:about="http://purl.org/vocab/vann/preferredNamespacePrefix"/> + + + + <!-- http://purl.org/vocab/vann/preferredNamespaceUri --> + + + <owl:AnnotationProperty rdf:about="http://purl.org/vocab/vann/preferredNamespaceUri"/> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Datatypes + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + + <!-- http://www.w3.org/2001/XMLSchema#date --> + + + <rdfs:Datatype rdf:about="http://www.w3.org/2001/XMLSchema#date"/> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Object Properties + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + + <!-- https://w3id.org/cluedo4KG/onto#aPourPieceVoisine --> + + + <owl:ObjectProperty rdf:about="https://w3id.org/cluedo4KG/onto#aPourPieceVoisine"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#SymmetricProperty"/> + <rdfs:domain rdf:resource="https://w3id.org/cluedo4KG/onto#Piece"/> + <rdfs:range rdf:resource="https://w3id.org/cluedo4KG/onto#Piece"/> + <rdfs:label xml:lang="fr">a pour pièce voisine</rdfs:label> + <rdfs:label xml:lang="en">has as neighbour room</rdfs:label> + </owl:ObjectProperty> + + + + <!-- https://w3id.org/cluedo4KG/onto#maisonContientPiece --> + + + <owl:ObjectProperty rdf:about="https://w3id.org/cluedo4KG/onto#maisonContientPiece"> + <owl:inverseOf rdf:resource="https://w3id.org/cluedo4KG/onto#pieceDansMaison"/> + <rdfs:domain rdf:resource="https://w3id.org/cluedo4KG/onto#Maison"/> + <rdfs:range rdf:resource="https://w3id.org/cluedo4KG/onto#Piece"/> + <rdfs:label xml:lang="en">house contains room</rdfs:label> + <rdfs:label xml:lang="fr">maison contient pièce</rdfs:label> + </owl:ObjectProperty> + + + + <!-- https://w3id.org/cluedo4KG/onto#objetDansPiece --> + + + <owl:ObjectProperty rdf:about="https://w3id.org/cluedo4KG/onto#objetDansPiece"> + <owl:inverseOf rdf:resource="https://w3id.org/cluedo4KG/onto#pieceContientObjet"/> + <rdfs:label xml:lang="en">object in room</rdfs:label> + <rdfs:label xml:lang="fr">objet dans pièce</rdfs:label> + </owl:ObjectProperty> + + + + <!-- https://w3id.org/cluedo4KG/onto#personneDansPiece --> + + + <owl:ObjectProperty rdf:about="https://w3id.org/cluedo4KG/onto#personneDansPiece"> + <owl:inverseOf rdf:resource="https://w3id.org/cluedo4KG/onto#pieceContientPersonne"/> + <rdfs:label xml:lang="en">person in room</rdfs:label> + <rdfs:label xml:lang="fr">personne dans pièce</rdfs:label> + </owl:ObjectProperty> + + + + <!-- https://w3id.org/cluedo4KG/onto#pieceContientObjet --> + + + <owl:ObjectProperty rdf:about="https://w3id.org/cluedo4KG/onto#pieceContientObjet"> + <rdfs:domain rdf:resource="https://w3id.org/cluedo4KG/onto#Piece"/> + <rdfs:range rdf:resource="https://w3id.org/cluedo4KG/onto#Objet"/> + <rdfs:label xml:lang="fr">pièce contient objet</rdfs:label> + <rdfs:label xml:lang="en">room contains object</rdfs:label> + </owl:ObjectProperty> + + + + <!-- https://w3id.org/cluedo4KG/onto#pieceContientPersonne --> + + + <owl:ObjectProperty rdf:about="https://w3id.org/cluedo4KG/onto#pieceContientPersonne"> + <rdfs:domain rdf:resource="https://w3id.org/cluedo4KG/onto#Piece"/> + <rdfs:range rdf:resource="https://w3id.org/cluedo4KG/onto#Personne"/> + <rdfs:label xml:lang="fr">pièce contient personne</rdfs:label> + <rdfs:label xml:lang="en">room contains person</rdfs:label> + </owl:ObjectProperty> + + + + <!-- https://w3id.org/cluedo4KG/onto#pieceDansMaison --> + + + <owl:ObjectProperty rdf:about="https://w3id.org/cluedo4KG/onto#pieceDansMaison"> + <rdfs:label xml:lang="fr">pièce dans maison</rdfs:label> + <rdfs:label xml:lang="en">room in house</rdfs:label> + </owl:ObjectProperty> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Data properties + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + + <!-- https://w3id.org/cluedo4KG/onto#estVivant --> + + + <owl:DatatypeProperty rdf:about="https://w3id.org/cluedo4KG/onto#estVivant"> + <rdfs:domain rdf:resource="https://w3id.org/cluedo4KG/onto#Personne"/> + <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#boolean"/> + <rdfs:comment xml:lang="en">indicates whether a person is alive (True) or dead (False)</rdfs:comment> + <rdfs:comment xml:lang="fr">indique si une personne est vivante (True) ou morte (False)</rdfs:comment> + <rdfs:label xml:lang="fr">est vivant</rdfs:label> + <rdfs:label xml:lang="en">is alive</rdfs:label> + </owl:DatatypeProperty> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Classes + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + + <!-- https://w3id.org/cluedo4KG/onto#Maison --> + + + <owl:Class rdf:about="https://w3id.org/cluedo4KG/onto#Maison"> + <rdfs:comment xml:lang="en">house</rdfs:comment> + <rdfs:label xml:lang="fr">maison</rdfs:label> + </owl:Class> + + + + <!-- https://w3id.org/cluedo4KG/onto#Objet --> + + + <owl:Class rdf:about="https://w3id.org/cluedo4KG/onto#Objet"> + <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/owl#Thing"/> + <rdfs:label xml:lang="en">object</rdfs:label> + <rdfs:label xml:lang="fr">objet</rdfs:label> + </owl:Class> + + + + <!-- https://w3id.org/cluedo4KG/onto#Personne --> + + + <owl:Class rdf:about="https://w3id.org/cluedo4KG/onto#Personne"> + <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/owl#Thing"/> + <rdfs:label xml:lang="en">person</rdfs:label> + <rdfs:label xml:lang="fr">personne</rdfs:label> + </owl:Class> + + + + <!-- https://w3id.org/cluedo4KG/onto#Piece --> + + + <owl:Class rdf:about="https://w3id.org/cluedo4KG/onto#Piece"> + <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/owl#Thing"/> + <rdfs:label xml:lang="fr">pièce</rdfs:label> + <rdfs:label xml:lang="en">room</rdfs:label> + </owl:Class> +</rdf:RDF> + + + +<!-- Generated by the OWL API (version 5.1.18) https://github.com/owlcs/owlapi/ --> + + diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/cluedo4KG-onto.owl b/cluedo4KG-sources/ontology.ttl similarity index 66% rename from cluedo4KG-sources/cluedo4kg-App/Sparqluedo/cluedo4KG-onto.owl rename to cluedo4KG-sources/ontology.ttl index 5f9ad4095b0564f4ae0daff863e104753399f486..ad00f6304ced43abc75281f98311f319ce27fcd4 100644 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/cluedo4KG-onto.owl +++ b/cluedo4KG-sources/ontology.ttl @@ -4,16 +4,49 @@ @prefix xml: <http://www.w3.org/XML/1998/namespace> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . -@base <https://w3id.org/cluedo4KG/onto> . +@base <https://w3id.org/cluedo4KG/onto#> . <https://w3id.org/cluedo4KG/onto> rdf:type owl:Ontology ; - rdfs:comment "Cette ontologie a été créée pour être utilisée dans le tutoriel SPARQLUEDO faisant partie de la ressource CLUEDO4KG"@fr, "This ontology was created for use in the SPARQLUEDO tutorial, which is part of the CLUEDO4KG resource."@en; - <http://creativecommons.org/ns#license> <http://creativecommons.org/licenses/by/4.0/> ; - <http://purl.org/dc/terms/creator> "Camille Pradel" , - "Nathalie Hernandez"; - <http://purl.org/dc/terms/issued> "2012-12-01"^^xsd:date ; - <http://purl.org/vocab/vann/preferredNamespacePrefix> "cluedonto"; - <http://purl.org/vocab/vann/preferredNamespaceUri> : ; . + <http://creativecommons.org/ns#license> <http://creativecommons.org/licenses/by/4.0/> ; + <http://purl.org/dc/terms/creator> "Camille Pradel" , + "Nathalie Hernandez" ; + <http://purl.org/dc/terms/issued> "2012-12-01"^^xsd:date ; + <http://purl.org/vocab/vann/preferredNamespacePrefix> "cluedonto" ; + <http://purl.org/vocab/vann/preferredNamespaceUri> : ; + rdfs:comment "Cette ontologie a été créée pour être utilisée dans le tutoriel SPARQLUEDO faisant partie de la ressource CLUEDO4KG"@fr , + "This ontology was created for use in the SPARQLUEDO tutorial, which is part of the CLUEDO4KG resource."@en . + +################################################################# +# Annotation properties +################################################################# + +### http://creativecommons.org/ns#license +<http://creativecommons.org/ns#license> rdf:type owl:AnnotationProperty . + + +### http://purl.org/dc/terms/creator +<http://purl.org/dc/terms/creator> rdf:type owl:AnnotationProperty . + + +### http://purl.org/dc/terms/issued +<http://purl.org/dc/terms/issued> rdf:type owl:AnnotationProperty . + + +### http://purl.org/vocab/vann/preferredNamespacePrefix +<http://purl.org/vocab/vann/preferredNamespacePrefix> rdf:type owl:AnnotationProperty . + + +### http://purl.org/vocab/vann/preferredNamespaceUri +<http://purl.org/vocab/vann/preferredNamespaceUri> rdf:type owl:AnnotationProperty . + + +################################################################# +# Datatypes +################################################################# + +### http://www.w3.org/2001/XMLSchema#date +xsd:date rdf:type rdfs:Datatype . + ################################################################# # Object Properties @@ -118,4 +151,4 @@ "room"@en . -### Generated by the OWL API (version 4.2.5.20160517-0735) https://github.com/owlcs/owlapi +### Generated by the OWL API (version 5.1.18) https://github.com/owlcs/owlapi/ diff --git a/cluedo4KG-sources/resources/extra.css b/cluedo4KG-sources/resources/extra.css new file mode 100644 index 0000000000000000000000000000000000000000..16689d3f8d25671fee0c8a398d575b24893844ad --- /dev/null +++ b/cluedo4KG-sources/resources/extra.css @@ -0,0 +1,124 @@ +body { + text-align: justify; +} + +h1 { + line-height: 110%; +} + +.hlist { + border: 1px solid navy; + padding:5px; + background-color: #F4FFFF; +} + +.hlist li { + display: inline; + display: inline-table; + list-style-type: none; + padding-right: 20px; + +} + +.entity { + border: 1px solid navy; + margin:5px 0px 5px 0px; + padding: 5px; +} + +.type-c { + cursor:help; + color:orange; +} + +.type-op { + cursor:help; + color:navy; +} + +.type-dp { + cursor:help; + color:green; +} + +.type-ap { + cursor:help; + color:maroon; +} + +.type-ni { + cursor:help; + color:brown; +} + +.logic { + color:purple; + font-weight:bold; +} + +h3 { + margin-top: 3px; + padding-bottom: 5px; + border-bottom: 1px solid navy; +} + +h2 { + margin-top:40px; +} + +.dotted { + border-bottom: 1px dotted gray; +} + +dt { + margin-top:5px; +} + +.description { + border-top: 1px dashed gray; + border-bottom: 1px dashed gray; + background-color: rgb(242, 243, 244); + margin-top:5px; + padding-bottom:5px; +} + +.description dl { + background-color: rgb(242, 243, 244); +} + +.description ul { + padding-left: 12px; + margin-top: 0px; +} + +.backlink { + font-size:10pt; + text-align:right; + float:right; + color:black; + padding: 2px; + border: 1px dotted navy; + background-color: #F4FFFF; +} + +.imageblock { + text-align: center; +} + +.imageblock img { + border:1px solid gray; +} + +.endnote { + margin-top: 40px; + border-top: 1px solid gray; + padding-top: 10px; + text-align: center; + color:gray; + font-size:70%; +} + +.literal { + color:green; + font-style:italic; +} \ No newline at end of file diff --git a/cluedo4KG-sources/resources/jquery.js b/cluedo4KG-sources/resources/jquery.js new file mode 100644 index 0000000000000000000000000000000000000000..48590ecb96a74f5987d125e7fbc5a26c1392543a --- /dev/null +++ b/cluedo4KG-sources/resources/jquery.js @@ -0,0 +1,18 @@ +/*! + * jQuery JavaScript Library v1.6.2 + * http://jquery.com/ + * + * Copyright 2011, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Thu Jun 30 14:16:56 2011 -0400 + */ +(function(a,b){function cv(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cs(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cr(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cq(){cn=b}function cp(){setTimeout(cq,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function bZ(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function bY(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bC.test(a)?d(a,e):bY(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)bY(a+"["+e+"]",b[e],c,d);else d(a,b)}function bX(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bR,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bX(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bX(a,c,d,e,"*",g));return l}function bW(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bN),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bA(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bv:bw;if(d>0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bx(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bm(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(be,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bl(a){f.nodeName(a,"input")?bk(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bk)}function bk(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bj(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bi(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bh(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)f.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function bg(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function W(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(R.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function V(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function N(a,b){return(a&&a!=="*"?a+".":"")+b.replace(z,"`").replace(A,"&")}function M(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;i<s.length;i++)g=s[i],g.origType.replace(x,"")===a.type?q.push(g.selector):s.splice(i--,1);e=f(a.target).closest(q,a.currentTarget);for(j=0,k=e.length;j<k;j++){m=e[j];for(i=0;i<s.length;i++){g=s[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,d=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,d=f(a.relatedTarget).closest(g.selector)[0],d&&f.contains(h,d)&&(d=h);(!d||d!==h)&&p.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=p.length;j<k;j++){e=p[j];if(c&&e.level>c)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function K(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function E(){return!0}function D(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z])/ig,x=function(a,b){return b.toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!A){A=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||D.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b){if(H)return H.call(b,a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=s.exec(a)||t.exec(a)||u.exec(a)||a.indexOf("compatible")<0&&v.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g="done fail isResolved isRejected promise then always pipe".split(" "),h=[].slice;f.extend({_Deferred:function(){var a=[],b,c,d,e={done:function(){if(!d){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=f.type(i),j==="array"?e.done.apply(e,i):j==="function"&&a.push(i);k&&e.resolveWith(k[0],k[1])}return this},resolveWith:function(e,f){if(!d&&!b&&!c){f=f||[],c=1;try{while(a[0])a.shift().apply(e,f)}finally{b=[e,f],c=0}}return this},resolve:function(){e.resolveWith(this,arguments);return this},isResolved:function(){return!!c||!!b},cancel:function(){d=1,a=[];return this}};return e},Deferred:function(a){var b=f._Deferred(),c=f._Deferred(),d;f.extend(b,{then:function(a,c){b.done(a).fail(c);return this},always:function(){return b.done.apply(b,arguments).fail.apply(this,arguments)},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,pipe:function(a,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[c,"reject"]},function(a,c){var e=c[0],g=c[1],h;f.isFunction(e)?b[a](function(){h=e.apply(this,arguments),h&&f.isFunction(h.promise)?h.promise().then(d.resolve,d.reject):d[g](h)}):b[a](d[g])})}).promise()},promise:function(a){if(a==null){if(d)return d;d=a={}}var c=g.length;while(c--)a[g[c]]=b[g[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c<d;c++)b[c]&&f.isFunction(b[c].promise)?b[c].promise().then(i(c),g.reject):--e;e||g.resolveWith(g,b)}else g!==a&&g.resolveWith(g,d?[a]:[]);return g.promise()}}),f.support=function(){var a=c.createElement("div"),b=c.documentElement,d,e,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;a.setAttribute("className","t"),a.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0},m&&f.extend(p,{position:"absolute",left:-1e3,top:-1e3});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]||i[c]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h<i;h++)g=e[h].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),k(this[0],g,d[g]))}}return d}if(typeof a=="object")return this.each(function(){f.data(this,a)});var j=a.split(".");j[1]=j[1]?"."+j[1]:"";if(c===b){d=this.triggerHandler("getData"+j[1]+"!",[j[0]]),d===b&&this.length&&(d=f.data(this[0],a),d=k(this[0],a,d));return d===b&&j[1]?this.data(j[0]):d}return this.each(function(){var b=f(this),d=[j[0],c];b.triggerHandler("setData"+j[1]+"!",d),f.data(this,a,c),b.triggerHandler("changeData"+j[1]+"!",d)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,c){a&&(c=(c||"fx")+"mark",f.data(a,c,(f.data(a,c,b,!0)||0)+1,!0))},_unmark:function(a,c,d){a!==!0&&(d=c,c=a,a=!1);if(c){d=d||"fx";var e=d+"mark",g=a?0:(f.data(c,e,b,!0)||1)-1;g?f.data(c,e,g,!0):(f.removeData(c,e,!0),m(c,d,"mark"))}},queue:function(a,c,d){if(a){c=(c||"fx")+"queue";var e=f.data(a,c,b,!0);d&&(!e||f.isArray(d)?e=f.data(a,c,f.makeArray(d),!0):e.push(d));return e||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e;d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),d.call(a,function(){f.dequeue(a,b)})),c.length||(f.removeData(a,b+"queue",!0),m(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){f.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f._Deferred(),!0))h++,l.done(m);m();return d.promise()}});var n=/[\n\t\r]/g,o=/\s+/,p=/\r/g,q=/^(?:button|input)$/i,r=/^(?:button|input|object|select|textarea)$/i,s=/^a(?:rea)?$/i,t=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,u=/\:|^on/,v,w;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(o);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(o);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(n," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(o);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if((" "+this[c].className+" ").replace(n," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h<i;h++){var j=e[h];if(j.selected&&(f.support.optDisabled?!j.disabled:j.getAttribute("disabled")===null)&&(!j.parentNode.disabled||!f.nodeName(j.parentNode,"optgroup"))){b=f(j).val();if(g)return b;d.push(b)}}if(g&&!d.length&&e.length)return f(e[c]).val();return d},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=w:v&&c!=="className"&&(f.nodeName(a,"form")||u.test(c))&&(i=v)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}},value:{get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return f.prop(a,c)?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.attrHooks.title=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var x=/\.(.*)$/,y=/^(?:textarea|input|select)$/i,z=/\./g,A=/ /g,B=/[^\w\s.|`]/g,C=function(a){return a.replace(B,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=D;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=D);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),C).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))f.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=f.event.special[h]||{};for(j=e||0;j<p.length;j++){q=p[j];if(d.guid===q.guid){if(l||n.test(q.namespace))e==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(e!=null)break}}if(p.length===0||e!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&f.removeEvent(a,h,s.handle),g=null,delete t[h]}if(f.isEmptyObject(t)){var u=s.handle;u&&(u.elem=null),delete s.events,delete s.handle,f.isEmptyObject(s)&&f.removeData(a,b,!0)}}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){var h=c.type||c,i=[],j;h.indexOf("!")>=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i. +shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h<i;h++){var j=d[h];if(e||c.namespace_re.test(j.namespace)){c.handler=j.handler,c.data=j.data,c.handleObj=j;var k=j.handler.apply(this,g);k!==b&&(c.result=k,k===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[f.expando])return a;var d=a;a=f.Event(d);for(var e=this.props.length,g;e;)g=this.props[--e],a[g]=d[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=a.target.ownerDocument||c,i=h.documentElement,j=h.body;a.pageX=a.clientX+(i&&i.scrollLeft||j&&j.scrollLeft||0)-(i&&i.clientLeft||j&&j.clientLeft||0),a.pageY=a.clientY+(i&&i.scrollTop||j&&j.scrollTop||0)-(i&&i.clientTop||j&&j.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:f.proxy,special:{ready:{setup:f.bindReady,teardown:f.noop},live:{add:function(a){f.event.add(this,N(a.origType,a.selector),f.extend({},a,{handler:M,guid:a.handler.guid}))},remove:function(a){f.event.remove(this,N(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!this.preventDefault)return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?E:D):this.type=a,b&&f.extend(this,b),this.timeStamp=f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=E;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=E;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=E,this.stopPropagation()},isDefaultPrevented:D,isPropagationStopped:D,isImmediatePropagationStopped:D};var F=function(a){var b=a.relatedTarget,c=!1,d=a.type;a.type=a.data,b!==this&&(b&&(c=f.contains(this,b)),c||(f.event.handle.apply(this,arguments),a.type=d))},G=function(a){a.type=a.data,f.event.handle.apply(this,arguments)};f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={setup:function(c){f.event.add(this,b,c&&c.selector?G:F,a)},teardown:function(a){f.event.remove(this,b,a&&a.selector?G:F)}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(a,b){if(!f.nodeName(this,"form"))f.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&f(b).closest("form").length&&K("submit",this,arguments)}),f.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&f(b).closest("form").length&&a.keyCode===13&&K("submit",this,arguments)});else return!1},teardown:function(a){f.event.remove(this,".specialSubmit")}});if(!f.support.changeBubbles){var H,I=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},J=function(c){var d=c.target,e,g;if(!!y.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=I(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:J,beforedeactivate:J,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&J.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&J.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",I(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in H)f.event.add(this,c+".specialChange",H[c]);return y.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return y.test(this.nodeName)}},H=f.event.special.change.filters,H.focus=H.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i<j;i++)f.event.add(this[i],a,g,d);return this}}),f.fn.extend({unbind:function(a,b){if(typeof a=="object"&&!a.preventDefault)for(var c in a)this.unbind(c,a[c]);else for(var d=0,e=this.length;d<e;d++)f.event.remove(this[d],a,b);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f.data(this,"lastToggle"+a.guid)||0)%d;f.data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var L={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};f.each(["live","die"],function(a,c){f.fn[c]=function(a,d,e,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:f(this.context);if(typeof a=="object"&&!a.preventDefault){for(var o in a)n[c](o,d,a[o],m);return this}if(c==="die"&&!a&&g&&g.charAt(0)==="."){n.unbind(g);return this}if(d===!1||f.isFunction(d))e=d||D,d=b;a=(a||"").split(" ");while((h=a[i++])!=null){j=x.exec(h),k="",j&&(k=j[0],h=h.replace(x,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,L[h]?(a.push(L[h]+k),h=h+k):h=(L[h]||h)+k;if(c==="live")for(var p=0,q=n.length;p<q;p++)f.event.add(n[p],"live."+N(h,m),{data:d,selector:m,handler:e,origType:h,origHandler:e,preType:l});else n.unbind("live."+N(h,m),e)}return this}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(!f)g=o=!0;else if(f===!0)continue}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("parentNode",b,f,a,e,c)},"~":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("previousSibling",b,f,a,e,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c<f;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){if(a===b){g=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};f.find=k,f.expr=k.selectors,f.expr[":"]=f.expr.filters,f.unique=k.uniqueSort,f.text=k.getText,f.isXMLDoc=k.isXML,f.contains=k.contains}();var O=/Until$/,P=/^(?:parents|prevUntil|prevAll)/,Q=/,/,R=/^.[^:#\[\.,]*$/,S=Array.prototype.slice,T=f.expr.match.POS,U={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(W(this,a,!1),"not",a)},filter:function(a){return this.pushStack(W(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d<e;d++)i=a[d],j[i]||(j[i]=T.test(i)?f(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=T.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(l?l.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(V(c[0])||V(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=S.call(arguments);O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var X=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,Z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,$=/<([\w:]+)/,_=/<tbody/i,ba=/<|&#?\w+;/,bb=/<(?:script|object|embed|option|style)/i,bc=/checked\s*(?:[^=]|=\s*.checked.)/i,bd=/\/(java|ecma)script/i,be=/^\s*<!(?:\[CDATA\[|\-\-)/,bf={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};bf.optgroup=bf.option,bf.tbody=bf.tfoot=bf.colgroup=bf.caption=bf.thead,bf.th=bf.td,f.support.htmlSerialize||(bf._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(X,""):null;if(typeof a=="string"&&!bb.test(a)&&(f.support.leadingWhitespace||!Y.test(a))&&!bf[($.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Z,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bc.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bg(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bm)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i;b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof a[0]=="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!bb.test(a[0])&&(f.support.checkClone||!bc.test(a[0]))&&(g=!0,h=f.fragments[a[0]],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[a[0]]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j +)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bi(a,d),e=bj(a),g=bj(d);for(h=0;e[h];++h)bi(e[h],g[h])}if(b){bh(a,d);if(c){e=bj(a),g=bj(d);for(h=0;e[h];++h)bh(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!ba.test(k))k=b.createTextNode(k);else{k=k.replace(Z,"<$1></$2>");var l=($.exec(k)||["",""])[1].toLowerCase(),m=bf[l]||bf._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=_.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Y.test(k)&&o.insertBefore(b.createTextNode(Y.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bl(k[i]);else bl(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||bd.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.expando,g=f.event.special,h=f.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&f.noData[j.nodeName.toLowerCase()])continue;c=j[f.expando];if(c){b=d[c]&&d[c][e];if(b&&b.events){for(var k in b.events)g[k]?f.event.remove(j,k):f.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[f.expando]:j.removeAttribute&&j.removeAttribute(f.expando),delete d[c]}}}});var bn=/alpha\([^)]*\)/i,bo=/opacity=([^)]*)/,bp=/([A-Z]|^ms)/g,bq=/^-?\d+(?:px)?$/i,br=/^-?\d/,bs=/^[+\-]=/,bt=/[^+\-\.\de]+/g,bu={position:"absolute",visibility:"hidden",display:"block"},bv=["Left","Right"],bw=["Top","Bottom"],bx,by,bz;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bx(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d;if(h==="number"&&isNaN(d)||d==null)return;h==="string"&&bs.test(d)&&(d=+d.replace(bt,"")+parseFloat(f.css(a,c)),h="number"),h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bx)return bx(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return bA(a,b,d);f.swap(a,bu,function(){e=bA(a,b,d)});return e}},set:function(a,b){if(!bq.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bo.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bn.test(g)?g.replace(bn,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bx(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(by=function(a,c){var d,e,g;c=c.replace(bp,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bz=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bq.test(d)&&br.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bx=by||bz,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bB=/%20/g,bC=/\[\]$/,bD=/\r?\n/g,bE=/#.*$/,bF=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bG=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bH=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bI=/^(?:GET|HEAD)$/,bJ=/^\/\//,bK=/\?/,bL=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bM=/^(?:select|textarea)/i,bN=/\s+/,bO=/([?&])_=[^&]*/,bP=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bQ=f.fn.load,bR={},bS={},bT,bU;try{bT=e.href}catch(bV){bT=c.createElement("a"),bT.href="",bT=bT.href}bU=bP.exec(bT.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bQ)return bQ.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bL,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bM.test(this.nodeName)||bG.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bD,"\r\n")}}):{name:b.name,value:c.replace(bD,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bT,isLocal:bH.test(bU[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bW(bR),ajaxTransport:bW(bS),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?bZ(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=b$(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bF.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bE,"").replace(bJ,bU[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bN),d.crossDomain==null&&(r=bP.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bU[1]&&r[2]==bU[2]&&(r[3]||(r[1]==="http:"?80:443))==(bU[3]||(bU[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bX(bR,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bI.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bK.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bO,"$1_="+x);d.url=y+(y===d.url?(bK.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bX(bS,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){status<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bB,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn,co=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cr("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cs(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cr("hide",3),a,b,c);for(var d=0,e=this.length;d<e;d++)if(this[d].style){var g=f.css(this[d],"display");g!=="none"&&!f._data(this[d],"olddisplay")&&f._data(this[d],"olddisplay",g)}for(d=0;d<e;d++)this[d].style&&(this[d].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cr("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return this[e.queue===!1?"each":"queue"](function(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(f.support.inlineBlockNeedsLayout?(j=cs(this.nodeName),j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)):this.style.display="inline-block"))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)k=new f.fx(this,b,i),h=a[i],cj.test(h)?k[h==="toggle"?d?"show":"hide":h]():(l=ck.exec(h),m=k.cur(),l?(n=parseFloat(l[2]),o=l[3]||(f.cssNumber[i]?"":"px"),o!=="px"&&(f.style(this,i,(n||1)+o),m=(n||1)/k.cur()*m,f.style(this,i,m+o)),l[1]&&(n=(l[1]==="-="?-1:1)*n+m),k.custom(m,n,o)):k.custom(m,h,""));return!0})},stop:function(a,b){a&&this.queue([]),this.each(function(){var a=f.timers,c=a.length;b||f._unmark(!0,this);while(c--)a[c].elem===this&&(b&&a[c](!0),a.splice(c,1))}),b||this.dequeue();return this}}),f.each({slideDown:cr("show",1),slideUp:cr("hide",1),slideToggle:cr("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default,d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue!==!1?f.dequeue(this):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function h(a){return d.step(a)}var d=this,e=f.fx,g;this.startTime=cn||cp(),this.start=a,this.end=b,this.unit=c||this.unit||(f.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,h.elem=this.elem,h()&&f.timers.push(h)&&!cl&&(co?(cl=!0,g=function(){cl&&(co(g),e.tick())},co(g)):cl=setInterval(e.tick,e.interval))},show:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=cn||cp(),c=!0,d=this.elem,e=this.options,g,h;if(a||b>=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b<a.length;++b)a[b]()||a.splice(b--,1);a.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cl),cl=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var ct=/^t(?:able|d|h)$/i,cu=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cv(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);f.offset.initialize();var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.offset.doesNotAddBorder&&(!f.offset.doesAddBorderForTableAndCells||!ct.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={initialize:function(){var a=c.body,b=c.createElement("div"),d,e,g,h,i=parseFloat(f.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cu.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cu.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cv(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cv(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file diff --git a/cluedo4KG-sources/resources/marked.min.js b/cluedo4KG-sources/resources/marked.min.js new file mode 100644 index 0000000000000000000000000000000000000000..17021ae985c189eafb16c367a450b531696f4d90 --- /dev/null +++ b/cluedo4KG-sources/resources/marked.min.js @@ -0,0 +1,6 @@ +/** + * marked - a markdown parser + * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) + * https://github.com/chjj/marked + */ +(function(){var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=replace(block.item,"gm")(/bull/g,block.bullet)();block.list=replace(block.list)(/bull/g,block.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+block.def.source+")")();block.blockquote=replace(block.blockquote)("def",block.def)();block._tag="(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code"+"|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo"+"|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b";block.html=replace(block.html)("comment",/<!--[\s\S]*?-->/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,block._tag)();block.paragraph=replace(block.paragraph)("hr",block.hr)("heading",block.heading)("lheading",block.lheading)("blockquote",block.blockquote)("tag","<"+block._tag)("def",block.def)();block.normal=merge({},block);block.gfm=merge({},block.normal,{fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/});block.gfm.paragraph=replace(block.paragraph)("(?!","(?!"+block.gfm.fences.source.replace("\\1","\\2")+"|"+block.list.source.replace("\\1","\\3")+"|")();block.tables=merge({},block.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});function Lexer(options){this.tokens=[];this.tokens.links={};this.options=options||marked.defaults;this.rules=block.normal;if(this.options.gfm){if(this.options.tables){this.rules=block.tables}else{this.rules=block.gfm}}}Lexer.rules=block;Lexer.lex=function(src,options){var lexer=new Lexer(options);return lexer.lex(src)};Lexer.prototype.lex=function(src){src=src.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(src,true)};Lexer.prototype.token=function(src,top,bq){var src=src.replace(/^ +$/gm,""),next,loose,cap,bull,b,item,space,i,l;while(src){if(cap=this.rules.newline.exec(src)){src=src.substring(cap[0].length);if(cap[0].length>1){this.tokens.push({type:"space"})}}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);cap=cap[0].replace(/^ {4}/gm,"");this.tokens.push({type:"code",text:!this.options.pedantic?cap.replace(/\n+$/,""):cap});continue}if(cap=this.rules.fences.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"code",lang:cap[2],text:cap[3]});continue}if(cap=this.rules.heading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[1].length,text:cap[2]});continue}if(top&&(cap=this.rules.nptable.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/\n$/,"").split("\n")};for(i=0;i<item.align.length;i++){if(/^ *-+: *$/.test(item.align[i])){item.align[i]="right"}else if(/^ *:-+: *$/.test(item.align[i])){item.align[i]="center"}else if(/^ *:-+ *$/.test(item.align[i])){item.align[i]="left"}else{item.align[i]=null}}for(i=0;i<item.cells.length;i++){item.cells[i]=item.cells[i].split(/ *\| */)}this.tokens.push(item);continue}if(cap=this.rules.lheading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[2]==="="?1:2,text:cap[1]});continue}if(cap=this.rules.hr.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"hr"});continue}if(cap=this.rules.blockquote.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"blockquote_start"});cap=cap[0].replace(/^ *> ?/gm,"");this.token(cap,top,true);this.tokens.push({type:"blockquote_end"});continue}if(cap=this.rules.list.exec(src)){src=src.substring(cap[0].length);bull=cap[2];this.tokens.push({type:"list_start",ordered:bull.length>1});cap=cap[0].match(this.rules.item);next=false;l=cap.length;i=0;for(;i<l;i++){item=cap[i];space=item.length;item=item.replace(/^ *([*+-]|\d+\.) +/,"");if(~item.indexOf("\n ")){space-=item.length;item=!this.options.pedantic?item.replace(new RegExp("^ {1,"+space+"}","gm"),""):item.replace(/^ {1,4}/gm,"")}if(this.options.smartLists&&i!==l-1){b=block.bullet.exec(cap[i+1])[0];if(bull!==b&&!(bull.length>1&&b.length>1)){src=cap.slice(i+1).join("\n")+src;i=l-1}}loose=next||/\n\n(?!\s*$)/.test(item);if(i!==l-1){next=item.charAt(item.length-1)==="\n";if(!loose)loose=next}this.tokens.push({type:loose?"loose_item_start":"list_item_start"});this.token(item,false,bq);this.tokens.push({type:"list_item_end"})}this.tokens.push({type:"list_end"});continue}if(cap=this.rules.html.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:cap[1]==="pre"||cap[1]==="script"||cap[1]==="style",text:cap[0]});continue}if(!bq&&top&&(cap=this.rules.def.exec(src))){src=src.substring(cap[0].length);this.tokens.links[cap[1].toLowerCase()]={href:cap[2],title:cap[3]};continue}if(top&&(cap=this.rules.table.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(i=0;i<item.align.length;i++){if(/^ *-+: *$/.test(item.align[i])){item.align[i]="right"}else if(/^ *:-+: *$/.test(item.align[i])){item.align[i]="center"}else if(/^ *:-+ *$/.test(item.align[i])){item.align[i]="left"}else{item.align[i]=null}}for(i=0;i<item.cells.length;i++){item.cells[i]=item.cells[i].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */)}this.tokens.push(item);continue}if(top&&(cap=this.rules.paragraph.exec(src))){src=src.substring(cap[0].length);this.tokens.push({type:"paragraph",text:cap[1].charAt(cap[1].length-1)==="\n"?cap[1].slice(0,-1):cap[1]});continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"text",text:cap[0]});continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return this.tokens};var inline={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/};inline._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/;inline._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;inline.link=replace(inline.link)("inside",inline._inside)("href",inline._href)();inline.reflink=replace(inline.reflink)("inside",inline._inside)();inline.normal=merge({},inline);inline.pedantic=merge({},inline.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});inline.gfm=merge({},inline.normal,{escape:replace(inline.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(inline.text)("]|","~]|")("|","|https?://|")()});inline.breaks=merge({},inline.gfm,{br:replace(inline.br)("{2,}","*")(),text:replace(inline.gfm.text)("{2,}","*")()});function InlineLexer(links,options){this.options=options||marked.defaults;this.links=links;this.rules=inline.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;if(!this.links){throw new Error("Tokens array requires a `links` property.")}if(this.options.gfm){if(this.options.breaks){this.rules=inline.breaks}else{this.rules=inline.gfm}}else if(this.options.pedantic){this.rules=inline.pedantic}}InlineLexer.rules=inline;InlineLexer.output=function(src,links,options){var inline=new InlineLexer(links,options);return inline.output(src)};InlineLexer.prototype.output=function(src){var out="",link,text,href,cap;while(src){if(cap=this.rules.escape.exec(src)){src=src.substring(cap[0].length);out+=cap[1];continue}if(cap=this.rules.autolink.exec(src)){src=src.substring(cap[0].length);if(cap[2]==="@"){text=cap[1].charAt(6)===":"?this.mangle(cap[1].substring(7)):this.mangle(cap[1]);href=this.mangle("mailto:")+text}else{text=escape(cap[1]);href=text}out+=this.renderer.link(href,null,text);continue}if(!this.inLink&&(cap=this.rules.url.exec(src))){src=src.substring(cap[0].length);text=escape(cap[1]);href=text;out+=this.renderer.link(href,null,text);continue}if(cap=this.rules.tag.exec(src)){if(!this.inLink&&/^<a /i.test(cap[0])){this.inLink=true}else if(this.inLink&&/^<\/a>/i.test(cap[0])){this.inLink=false}src=src.substring(cap[0].length);out+=this.options.sanitize?escape(cap[0]):cap[0];continue}if(cap=this.rules.link.exec(src)){src=src.substring(cap[0].length);this.inLink=true;out+=this.outputLink(cap,{href:cap[2],title:cap[3]});this.inLink=false;continue}if((cap=this.rules.reflink.exec(src))||(cap=this.rules.nolink.exec(src))){src=src.substring(cap[0].length);link=(cap[2]||cap[1]).replace(/\s+/g," ");link=this.links[link.toLowerCase()];if(!link||!link.href){out+=cap[0].charAt(0);src=cap[0].substring(1)+src;continue}this.inLink=true;out+=this.outputLink(cap,link);this.inLink=false;continue}if(cap=this.rules.strong.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.strong(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.em.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.em(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.codespan(escape(cap[2],true));continue}if(cap=this.rules.br.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.br();continue}if(cap=this.rules.del.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.del(this.output(cap[1]));continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);out+=escape(this.smartypants(cap[0]));continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return out};InlineLexer.prototype.outputLink=function(cap,link){var href=escape(link.href),title=link.title?escape(link.title):null;return cap[0].charAt(0)!=="!"?this.renderer.link(href,title,this.output(cap[1])):this.renderer.image(href,title,escape(cap[1]))};InlineLexer.prototype.smartypants=function(text){if(!this.options.smartypants)return text;return text.replace(/--/g,"�").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1�").replace(/'/g,"�").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1�").replace(/"/g,"�").replace(/\.{3}/g,"�")};InlineLexer.prototype.mangle=function(text){var out="",l=text.length,i=0,ch;for(;i<l;i++){ch=text.charCodeAt(i);if(Math.random()>.5){ch="x"+ch.toString(16)}out+="&#"+ch+";"}return out};function Renderer(options){this.options=options||{}}Renderer.prototype.code=function(code,lang,escaped){if(this.options.highlight){var out=this.options.highlight(code,lang);if(out!=null&&out!==code){escaped=true;code=out}}if(!lang){return"<pre><code>"+(escaped?code:escape(code,true))+"\n</code></pre>"}return'<pre><code class="'+this.options.langPrefix+escape(lang,true)+'">'+(escaped?code:escape(code,true))+"\n</code></pre>\n"};Renderer.prototype.blockquote=function(quote){return"<blockquote>\n"+quote+"</blockquote>\n"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return"<h"+level+' id="'+this.options.headerPrefix+raw.toLowerCase().replace(/[^\w]+/g,"-")+'">'+text+"</h"+level+">\n"};Renderer.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"};Renderer.prototype.list=function(body,ordered){var type=ordered?"ol":"ul";return"<"+type+">\n"+body+"</"+type+">\n"};Renderer.prototype.listitem=function(text){return"<li>"+text+"</li>\n"};Renderer.prototype.paragraph=function(text){return"<p>"+text+"</p>\n"};Renderer.prototype.table=function(header,body){return"<table>\n"+"<thead>\n"+header+"</thead>\n"+"<tbody>\n"+body+"</tbody>\n"+"</table>\n"};Renderer.prototype.tablerow=function(content){return"<tr>\n"+content+"</tr>\n"};Renderer.prototype.tablecell=function(content,flags){var type=flags.header?"th":"td";var tag=flags.align?"<"+type+' style="text-align:'+flags.align+'">':"<"+type+">";return tag+content+"</"+type+">\n"};Renderer.prototype.strong=function(text){return"<strong>"+text+"</strong>"};Renderer.prototype.em=function(text){return"<em>"+text+"</em>"};Renderer.prototype.codespan=function(text){return"<code>"+text+"</code>"};Renderer.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"};Renderer.prototype.del=function(text){return"<del>"+text+"</del>"};Renderer.prototype.link=function(href,title,text){if(this.options.sanitize){try{var prot=decodeURIComponent(unescape(href)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(prot.indexOf("javascript:")===0){return""}}var out='<a href="'+href+'"';if(title){out+=' title="'+title+'"'}out+=">"+text+"</a>";return out};Renderer.prototype.image=function(href,title,text){var out='<img src="'+href+'" alt="'+text+'"';if(title){out+=' title="'+title+'"'}out+=this.options.xhtml?"/>":">";return out};function Parser(options){this.tokens=[];this.token=null;this.options=options||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options}Parser.parse=function(src,options,renderer){var parser=new Parser(options,renderer);return parser.parse(src)};Parser.prototype.parse=function(src){this.inline=new InlineLexer(src.links,this.options,this.renderer);this.tokens=src.reverse();var out="";while(this.next()){out+=this.tok()}return out};Parser.prototype.next=function(){return this.token=this.tokens.pop()};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};Parser.prototype.parseText=function(){var body=this.token.text;while(this.peek().type==="text"){body+="\n"+this.next().text}return this.inline.output(body)};Parser.prototype.tok=function(){switch(this.token.type){case"space":{return""}case"hr":{return this.renderer.hr()}case"heading":{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text)}case"code":{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped)}case"table":{var header="",body="",i,row,cell,flags,j;cell="";for(i=0;i<this.token.header.length;i++){flags={header:true,align:this.token.align[i]};cell+=this.renderer.tablecell(this.inline.output(this.token.header[i]),{header:true,align:this.token.align[i]})}header+=this.renderer.tablerow(cell);for(i=0;i<this.token.cells.length;i++){row=this.token.cells[i];cell="";for(j=0;j<row.length;j++){cell+=this.renderer.tablecell(this.inline.output(row[j]),{header:false,align:this.token.align[j]})}body+=this.renderer.tablerow(cell)}return this.renderer.table(header,body)}case"blockquote_start":{var body="";while(this.next().type!=="blockquote_end"){body+=this.tok()}return this.renderer.blockquote(body)}case"list_start":{var body="",ordered=this.token.ordered;while(this.next().type!=="list_end"){body+=this.tok()}return this.renderer.list(body,ordered)}case"list_item_start":{var body="";while(this.next().type!=="list_item_end"){body+=this.token.type==="text"?this.parseText():this.tok()}return this.renderer.listitem(body)}case"loose_item_start":{var body="";while(this.next().type!=="list_item_end"){body+=this.tok()}return this.renderer.listitem(body)}case"html":{var html=!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;return this.renderer.html(html)}case"paragraph":{return this.renderer.paragraph(this.inline.output(this.token.text))}case"text":{return this.renderer.paragraph(this.parseText())}}};function escape(html,encode){return html.replace(!encode?/&(?!#?\w+;)/g:/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function unescape(html){return html.replace(/&([#\w]+);/g,function(_,n){n=n.toLowerCase();if(n==="colon")return":";if(n.charAt(0)==="#"){return n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1))}return""})}function replace(regex,opt){regex=regex.source;opt=opt||"";return function self(name,val){if(!name)return new RegExp(regex,opt);val=val.source||val;val=val.replace(/(^|[^\[])\^/g,"$1");regex=regex.replace(name,val);return self}}function noop(){}noop.exec=noop;function merge(obj){var i=1,target,key;for(;i<arguments.length;i++){target=arguments[i];for(key in target){if(Object.prototype.hasOwnProperty.call(target,key)){obj[key]=target[key]}}}return obj}function marked(src,opt,callback){if(callback||typeof opt==="function"){if(!callback){callback=opt;opt=null}opt=merge({},marked.defaults,opt||{});var highlight=opt.highlight,tokens,pending,i=0;try{tokens=Lexer.lex(src,opt)}catch(e){return callback(e)}pending=tokens.length;var done=function(err){if(err){opt.highlight=highlight;return callback(err)}var out;try{out=Parser.parse(tokens,opt)}catch(e){err=e}opt.highlight=highlight;return err?callback(err):callback(null,out)};if(!highlight||highlight.length<3){return done()}delete opt.highlight;if(!pending)return done();for(;i<tokens.length;i++){(function(token){if(token.type!=="code"){return--pending||done()}return highlight(token.text,token.lang,function(err,code){if(err)return done(err);if(code==null||code===token.text){return--pending||done()}token.text=code;token.escaped=true;--pending||done()})})(tokens[i])}return}try{if(opt)opt=merge({},marked.defaults,opt);return Parser.parse(Lexer.lex(src,opt),opt)}catch(e){e.message+="\nPlease report this to https://github.com/chjj/marked.";if((opt||marked.defaults).silent){return"<p>An error occured:</p><pre>"+escape(e.message+"",true)+"</pre>"}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof module!=="undefined"&&typeof exports==="object"){module.exports=marked}else if(typeof define==="function"&&define.amd){define(function(){return marked})}else{this.marked=marked}}).call(function(){return this||(typeof window!=="undefined"?window:global)}()); \ No newline at end of file diff --git a/cluedo4KG-sources/resources/owl.css b/cluedo4KG-sources/resources/owl.css new file mode 100644 index 0000000000000000000000000000000000000000..9c008760600a9d5a742a106377526e56738e11dd --- /dev/null +++ b/cluedo4KG-sources/resources/owl.css @@ -0,0 +1,248 @@ +.RFC2119 { + text-transform: lowercase; + font-style: italic; +} +.nonterminal { + font-weight: bold; + font-family: sans-serif; + font-size: 95%; +} +#abstract br { + /* doesn't work right SOMETIMES + margin-bottom: 1em; */ +} +.name { + font-family: monospace; +} +.buttonpanel { + margin-top: 1ex; + margin-bottom: 1ex; + padding-left: 1ex; + padding-right: 1ex; + padding-top: 1ex; + padding-bottom: 0.6ex; + border: 1px dotted black; +} +.grammar { + margin-top: 1ex; + margin-bottom: 1ex; + padding-left: 1ex; + padding-right: 1ex; + padding-top: 1ex; + padding-bottom: 0.6ex; + border: 1px dashed #2f6fab; + font-family: monospace; +} +.image { + text-align: center; +} +.centered { + text-align: center; + padding-top: 4ex; + padding-bottom: 4ex; +} +.centered table { + margin: 0 auto; + text-align: left; +} +.caption { + font-weight: bold; +} +.indent { + margin-left: 20px; +} +.atrisknote { + padding: 5px; + margin-top: 10px; + margin-bottom: 10px; + border: solid 2px blue; + background-color: #FFA; +} +.atrisknotehead { + font-style: italic; +} + +/* Stying the examples. */ + +.anexample:before { + content: "Example:"; + font-family: sans-serif; + font-size: 1.6ex; + font-weight: bold; +} +.anexample { + margin-top: 1ex; + margin-bottom: 1ex; + padding-left: 1ex; + padding-right: 1ex; + padding-top: 1ex; + padding-bottom: 0.6ex; + border: 1px dashed #2f6fab; + background-color: #f9f9f9; +} +.anexample table { + background-color: #f9f9f9; +} + +/* Styling the parts in the functional-style syntax. */ + +div.fss { + margin-top: 10px; + margin-bottom: 10px; + margin-left: 20px; + margin-right: 20px; + font-family: monospace; +} +table.fss { + margin: 0px 0px 0px 0px; + padding: 0px 0px 0px 0px; + width: 100%; +} +table.fss caption.fss { + font-size: 1.5ex; + font-weight: bold; + text-align: left; + padding-left: 10px; +} +table.fss td:first-child { + font-family: monospace; + padding-left: 20px; + padding-right: 20px; + width: 60%; +} +table{ + background-color: #f4ffff; + border: 1px solid navy; + margin: 20px; + vertical-align: middle; +} +table td { + padding: 5px 15px; + text-align: left; +} + +/* Styling the parts in the RDF syntax. */ + +div.rdf{ + margin-top: 10px; + margin-bottom: 10px; + margin-left: 20px; + margin-right: 20px; + font-family: monospace; +} +table.rdf { + margin: 0px 0px 0px 0px; + padding: 0px 0px 0px 0px; + width: 100%; +} +table.rdf caption.rdf { + font-size: 1.5ex; + font-weight: bold; + text-align: left; + padding-left: 10px; +} +table.rdf td:first-child { + font-family: monospace; + padding-left: 20px; + padding-right: 20px; + width: 60%; +} + +/* Styling the XML syntax. */ + +div.xmlsyn { + margin-top: 10px; + margin-bottom: 10px; + margin-left: 20px; + margin-right: 20px; + font-family: monospace; +} +div.axioms { + margin-top: 10px; + margin-bottom: 10px; + margin-left: 20px; + margin-right: 20px; +} + +/* Other styles. */ + +table.complexity td { + text-align: center; +} +table.allname td { + font-family: monospace; +} +table.canonicalparsing { + margin-left: 20px; + border-style: none; +} +table.canonicalparsing td { + vertical-align: top; + padding: 2px 2px 2px 2px; +} +table.canonicalparsing td.two { + padding-left: 30px; +} + +/* The following are classes for templates used in the editing process. */ + +.review { + padding: 5px; + border: solid 1px black; + margin-left: 10%; + margin-top: 10px; + margin-bottom: 10px; + background-color: #FFA; + font-size: smaller; +} +.reviewauthor { + font-size: smaller; + font-style: italic; +} +.ednote { + padding: 5px; + border: solid 1px black; + margin-top: 10px; + margin-bottom: 10px; +} +.ednotehead { + font-weight: bold; +} + +/* override mediawiki's beautiful DL styling... */ +dl { + background: white; + width: 100%; + border: none; + margin-top: 0; + margin-bottom: 0; + padding-top: 0; + padding-bottom: 0; +} + +div { + margin-top: 0; + margin-bottom: 0; +} +#fulltitle { + font-size: 140%; + font-weight: bold; +} + +.xml { + color: red +} + +.rdbms{ +color: red +} + +/* just copying from wiki, so it stays through TR. Currently + affects Primer, at least */ +pre { + background-color:#F9F9F9; + border:1px dashed #2F6FAB; + color:black; + line-height:1.1em; + padding:1em; +} \ No newline at end of file diff --git a/cluedo4KG-sources/resources/primer.css b/cluedo4KG-sources/resources/primer.css new file mode 100644 index 0000000000000000000000000000000000000000..3136dac0008cf0e5dfd10b5ac4c3df3d7bd80933 --- /dev/null +++ b/cluedo4KG-sources/resources/primer.css @@ -0,0 +1,103 @@ +/* define a class "noprint" for sections which don't get printed */ +.noprint { display: none; } + +/* our syntax menu for switching */ +div.syntaxmenu { + border: 1px dotted black; + padding:0.5em; + margin: 1em; +} + +.container { + margin-right: auto; + margin-left: auto; + padding-left: 15px; + padding-right: 15px; +} + +@media print { + div.syntaxmenu { display:none; } +} + +/* use tab-like headers for syntax examples */ +div.exampleheader { + font-size: 90%; + float: left; + background: #F9F9F9; + color: #2F6FAB; + border: 1px dashed #2F6FAB; + border-bottom: 0px; + padding-top: 2px; +} + +div.exampleheader span.exampleheader { + background: #F9F9F9; + padding-top: 0px; + padding-right: 10px; + padding-left: 10px; + padding-bottom: 3px; + padding-top: 0px; +} + +/* Also copy MediaWiki style here, so it will not look different when exported */ +div.fssyntax pre, div.rdfxml pre, div.owlxml pre, div.turtle pre, div.manchester pre { + background-color: #F9F9F9; + border: 1px dashed #2F6FAB; + color: black; + line-height: 1.1em; + padding: 1em; + clear: both; + margin-left: 0em; +} +/* Expansion to add the status*/ +.status { + position: fixed; + left: 0em; + top: 0em; + text-align: right; + vertical-align: middle; + /* Square version of the inside span. Slightly larger */ + width: 26em; + height: 26em; + z-index: -1; + opacity: 0.8; + + /** From http://stackoverflow.com/questions/1080792/how-to-draw-vertical-text-with-css-cross-browser */ + + -webkit-transform: rotate(-90deg); + -moz-transform: rotate(-90deg); + -ms-transform: rotate(-90deg); + -o-transform: rotate(-90deg); + transform: rotate(-90deg); + /* also accepts left, right, top, bottom coordinates; not + * required, but a good idea for styling */ + -webkit-transform-origin: 50% 50%; + -moz-transform-origin: 50% 50%; + -ms-transform-origin: 50% 50%; + -o-transform-origin: 50% 50%; + transform-origin: 50% 50%; + + /* Should be unset in IE9+ I think. */ + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); +} + +/* The actual status box */ + .status div { + display: block; + background: rgb(0, 90, 156); + color: white; + width: 24em; + padding-top: 0.3em; + padding-left: 0em; + padding-right: 5em; + padding-bottom: 0.3em; + /* Enable for debugging + border: red thin solid; + */ +} + +/* And text inside, don't confuse fonts as it breaks em above */ +.status div span { + font-family: "Tauri"; + font-size: larger; +} \ No newline at end of file diff --git a/cluedo4KG-sources/resources/rec.css b/cluedo4KG-sources/resources/rec.css new file mode 100644 index 0000000000000000000000000000000000000000..d8a1ff2dbe5b6b06a0f19db0edf436aa64ddb249 --- /dev/null +++ b/cluedo4KG-sources/resources/rec.css @@ -0,0 +1,88 @@ +/* Style for a "Recommendation" */ + +/* + Copyright 1997-2003 W3C (MIT, ERCIM, Keio). All Rights Reserved. + The following software licensing rules apply: + http://www.w3.org/Consortium/Legal/copyright-software */ + +/* $Id: base.css,v 1.25 2006/04/18 08:42:53 bbos Exp $ */ + +body { + padding: 2em 1em 2em 70px; + margin: 0; + font-family: sans-serif; + color: black; + background: white; + background-position: top left; + background-attachment: fixed; + background-repeat: no-repeat; + counter-reset:section; +} +:link { color: #00C; background: transparent } +:visited { color: #609; background: transparent } +a:active { color: #C00; background: transparent } + +a:link img, a:visited img { border-style: none } /* no border on img links */ + +a img { color: white; } /* trick to hide the border in Netscape 4 */ +@media all { /* hide the next rule from Netscape 4 */ + a img { color: inherit; } /* undo the color change above */ +} + +th, td { /* ns 4 */ + font-family: sans-serif; +} + +h1, h2, h3, h4, h5, h6 { text-align: left } +h2.list{counter-reset:subsection } +h2.list:before{counter-increment:section;content: counter(section) ". ";} +h3.list:before{counter-increment:subsection;content: counter(section) "." counter(subsection) ". "; + } +h3.list{margin-top: 20px; + border-bottom: 0px; } +/* background should be transparent, but WebTV has a bug */ +h1, h2, h3 { color: #005A9C; background: white } +h1 { font: 170% sans-serif } +h2 { font: 140% sans-serif } +h3 { font: 120% sans-serif } +h4 { font: bold 100% sans-serif } +h5 { font: italic 100% sans-serif } +h6 { font: small-caps 100% sans-serif } + +.hide { display: none } + +div.head { margin-bottom: 1em } +div.head h1 { margin-top: 2em; clear: both } +div.head table { margin-left: 2em; margin-top: 2em } + +p.copyright { font-size: small } +p.copyright small { font-size: small } + +@media screen { /* hide from IE3 */ +a[href]:hover { background: #ffa } +} + +pre { margin-left: 2em } +/* +p { + margin-top: 0.6em; + margin-bottom: 0.6em; +} +*/ +dt, dd { margin-top: 0; margin-bottom: 0 } /* opera 3.50 */ +dt { font-weight: bold } + +pre, code { font-family: monospace } /* navigator 4 requires this */ + +ul.toc, ol.toc { + list-style: disc; /* Mac NS has problem with 'none' */ + list-style: none; +} + +@media aural { + h1, h2, h3 { stress: 20; richness: 90 } + .hide { speak: none } + p.copyright { volume: x-soft; speech-rate: x-fast } + dt { pause-before: 20% } + pre { speak-punctuation: code } +} diff --git a/cluedo4KG-sources/sections/abstract-en.html b/cluedo4KG-sources/sections/abstract-en.html new file mode 100644 index 0000000000000000000000000000000000000000..74f08577a3e0035d7d4055a2a403147417a48fcd --- /dev/null +++ b/cluedo4KG-sources/sections/abstract-en.html @@ -0,0 +1,2 @@ +<h2>Abstract</h2><span class="markdown"> +This ontology was created for use in the SPARQLUEDO tutorial, which is part of the CLUEDO4KG resource.</span> diff --git a/cluedo4KG-sources/sections/crossref-en.html b/cluedo4KG-sources/sections/crossref-en.html new file mode 100644 index 0000000000000000000000000000000000000000..28cb42b58c0fffcad3888c7a07b0c7a4def929d6 --- /dev/null +++ b/cluedo4KG-sources/sections/crossref-en.html @@ -0,0 +1,352 @@ +<h2 id="crossreference" class="list">Cross-reference for [Ontology Name] classes, object properties and data properties <span class="backlink"> back to <a href="#toc">ToC</a></span></h2> +This section provides details for each class and property defined by [Ontology Name]. +<div xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="classes"> + <h3 id="classes-headline" class="list">Classes</h3> + <ul class="hlist"> + <li> + <a href="#Maison" title="https://w3id.org/cluedo4KG/onto#Maison">maison</a> + </li> + <li> + <a href="#Objet" title="https://w3id.org/cluedo4KG/onto#Objet">object</a> + </li> + <li> + <a href="#Personne" title="https://w3id.org/cluedo4KG/onto#Personne">person</a> + </li> + <li> + <a href="#Piece" title="https://w3id.org/cluedo4KG/onto#Piece">room</a> + </li> + </ul> + <div class="entity" id="Maison"> + <h3>maison<sup class="type-c" title="class">c</sup> + <span class="backlink"> back to <a href="#toc">ToC</a> or <a href="#classes">Class ToC</a> + </span> + </h3> + <p> + <strong>IRI:</strong> https://w3id.org/cluedo4KG/onto#Maison</p> + <div class="comment"> + <span class="markdown">house</span> + </div> + <dl class="description"> + <dt>is in domain of</dt> + <dd> + <a href="#maisonContientPiece" + title="https://w3id.org/cluedo4KG/onto#maisonContientPiece">house contains room</a> + <sup class="type-op" title="object property">op</sup> + </dd> + </dl> + </div> + <div class="entity" id="Objet"> + <h3>object<sup class="type-c" title="class">c</sup> + <span class="backlink"> back to <a href="#toc">ToC</a> or <a href="#classes">Class ToC</a> + </span> + </h3> + <p> + <strong>IRI:</strong> https://w3id.org/cluedo4KG/onto#Objet</p> + <dl class="description"> + <dt>has super-classes</dt> + <dd> + <a href="http://www.w3.org/2002/07/owl#Thing" + target="_blank" + title="http://www.w3.org/2002/07/owl#Thing">thing</a> + <sup class="type-c" title="class">c</sup> + </dd> + <dt>is in range of</dt> + <dd> + <a href="#pieceContientObjet" + title="https://w3id.org/cluedo4KG/onto#pieceContientObjet">room contains object</a> + <sup class="type-op" title="object property">op</sup> + </dd> + </dl> + </div> + <div class="entity" id="Personne"> + <h3>person<sup class="type-c" title="class">c</sup> + <span class="backlink"> back to <a href="#toc">ToC</a> or <a href="#classes">Class ToC</a> + </span> + </h3> + <p> + <strong>IRI:</strong> https://w3id.org/cluedo4KG/onto#Personne</p> + <dl class="description"> + <dt>has super-classes</dt> + <dd> + <a href="http://www.w3.org/2002/07/owl#Thing" + target="_blank" + title="http://www.w3.org/2002/07/owl#Thing">thing</a> + <sup class="type-c" title="class">c</sup> + </dd> + <dt>is in domain of</dt> + <dd> + <a href="#estVivant" title="https://w3id.org/cluedo4KG/onto#estVivant">is alive</a> + <sup class="type-dp" title="data property">dp</sup> + </dd> + <dt>is in range of</dt> + <dd> + <a href="#pieceContientPersonne" + title="https://w3id.org/cluedo4KG/onto#pieceContientPersonne">room contains person</a> + <sup class="type-op" title="object property">op</sup> + </dd> + </dl> + </div> + <div class="entity" id="Piece"> + <h3>room<sup class="type-c" title="class">c</sup> + <span class="backlink"> back to <a href="#toc">ToC</a> or <a href="#classes">Class ToC</a> + </span> + </h3> + <p> + <strong>IRI:</strong> https://w3id.org/cluedo4KG/onto#Piece</p> + <dl class="description"> + <dt>has super-classes</dt> + <dd> + <a href="http://www.w3.org/2002/07/owl#Thing" + target="_blank" + title="http://www.w3.org/2002/07/owl#Thing">thing</a> + <sup class="type-c" title="class">c</sup> + </dd> + <dt>is in domain of</dt> + <dd> + <a href="#aPourPieceVoisine" title="https://w3id.org/cluedo4KG/onto#aPourPieceVoisine">has as neighbour room</a> + <sup class="type-op" title="object property">op</sup>, <a href="#pieceContientObjet" + title="https://w3id.org/cluedo4KG/onto#pieceContientObjet">room contains object</a> + <sup class="type-op" title="object property">op</sup>, <a href="#pieceContientPersonne" + title="https://w3id.org/cluedo4KG/onto#pieceContientPersonne">room contains person</a> + <sup class="type-op" title="object property">op</sup> + </dd> + <dt>is in range of</dt> + <dd> + <a href="#aPourPieceVoisine" title="https://w3id.org/cluedo4KG/onto#aPourPieceVoisine">has as neighbour room</a> + <sup class="type-op" title="object property">op</sup>, <a href="#maisonContientPiece" + title="https://w3id.org/cluedo4KG/onto#maisonContientPiece">house contains room</a> + <sup class="type-op" title="object property">op</sup> + </dd> + </dl> + </div> +</div><div xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="objectproperties"> + <h3 id="properties" class="list">Object Properties</h3> + <ul class="hlist"> + <li> + <a href="#aPourPieceVoisine" title="https://w3id.org/cluedo4KG/onto#aPourPieceVoisine">has as neighbour room</a> + </li> + <li> + <a href="#maisonContientPiece" + title="https://w3id.org/cluedo4KG/onto#maisonContientPiece">house contains room</a> + </li> + <li> + <a href="#objetDansPiece" title="https://w3id.org/cluedo4KG/onto#objetDansPiece">object in room</a> + </li> + <li> + <a href="#personneDansPiece" + title="https://w3id.org/cluedo4KG/onto#personneDansPiece">person in room</a> + </li> + <li> + <a href="#pieceContientObjet" + title="https://w3id.org/cluedo4KG/onto#pieceContientObjet">room contains object</a> + </li> + <li> + <a href="#pieceContientPersonne" + title="https://w3id.org/cluedo4KG/onto#pieceContientPersonne">room contains person</a> + </li> + <li> + <a href="#pieceDansMaison" title="https://w3id.org/cluedo4KG/onto#pieceDansMaison">room in house</a> + </li> + </ul> + <div class="entity" id="aPourPieceVoisine"> + <h3>has as neighbour room<sup class="type-op" title="object property">op</sup> + <span class="backlink"> back to <a href="#toc">ToC</a> or <a href="#objectproperties">Object Property ToC</a> + </span> + </h3> + <p> + <strong>IRI:</strong> https://w3id.org/cluedo4KG/onto#aPourPieceVoisine</p> + <div class="description"> + <p> + <strong>has characteristics: + </strong> symmetric</p> + <dl> + <dt>has domain</dt> + <dd> + <a href="#Piece" title="https://w3id.org/cluedo4KG/onto#Piece">room</a> + <sup class="type-c" title="class">c</sup> + </dd> + <dt>has range</dt> + <dd> + <a href="#Piece" title="https://w3id.org/cluedo4KG/onto#Piece">room</a> + <sup class="type-c" title="class">c</sup> + </dd> + </dl> + </div> + </div> + <div class="entity" id="maisonContientPiece"> + <h3>house contains room<sup class="type-op" title="object property">op</sup> + <span class="backlink"> back to <a href="#toc">ToC</a> or <a href="#objectproperties">Object Property ToC</a> + </span> + </h3> + <p> + <strong>IRI:</strong> https://w3id.org/cluedo4KG/onto#maisonContientPiece</p> + <div class="description"> + <dl> + <dt>has domain</dt> + <dd> + <a href="#Maison" title="https://w3id.org/cluedo4KG/onto#Maison">maison</a> + <sup class="type-c" title="class">c</sup> + </dd> + <dt>has range</dt> + <dd> + <a href="#Piece" title="https://w3id.org/cluedo4KG/onto#Piece">room</a> + <sup class="type-c" title="class">c</sup> + </dd> + <dt>is inverse of</dt> + <dd> + <a href="#pieceDansMaison" title="https://w3id.org/cluedo4KG/onto#pieceDansMaison">room in house</a> + <sup class="type-op" title="object property">op</sup> + </dd> + </dl> + </div> + </div> + <div class="entity" id="objetDansPiece"> + <h3>object in room<sup class="type-op" title="object property">op</sup> + <span class="backlink"> back to <a href="#toc">ToC</a> or <a href="#objectproperties">Object Property ToC</a> + </span> + </h3> + <p> + <strong>IRI:</strong> https://w3id.org/cluedo4KG/onto#objetDansPiece</p> + <div class="description"> + <dl> + <dt>is inverse of</dt> + <dd> + <a href="#pieceContientObjet" + title="https://w3id.org/cluedo4KG/onto#pieceContientObjet">room contains object</a> + <sup class="type-op" title="object property">op</sup> + </dd> + </dl> + </div> + </div> + <div class="entity" id="personneDansPiece"> + <h3>person in room<sup class="type-op" title="object property">op</sup> + <span class="backlink"> back to <a href="#toc">ToC</a> or <a href="#objectproperties">Object Property ToC</a> + </span> + </h3> + <p> + <strong>IRI:</strong> https://w3id.org/cluedo4KG/onto#personneDansPiece</p> + <div class="description"> + <dl> + <dt>is inverse of</dt> + <dd> + <a href="#pieceContientPersonne" + title="https://w3id.org/cluedo4KG/onto#pieceContientPersonne">room contains person</a> + <sup class="type-op" title="object property">op</sup> + </dd> + </dl> + </div> + </div> + <div class="entity" id="pieceContientObjet"> + <h3>room contains object<sup class="type-op" title="object property">op</sup> + <span class="backlink"> back to <a href="#toc">ToC</a> or <a href="#objectproperties">Object Property ToC</a> + </span> + </h3> + <p> + <strong>IRI:</strong> https://w3id.org/cluedo4KG/onto#pieceContientObjet</p> + <div class="description"> + <dl> + <dt>has domain</dt> + <dd> + <a href="#Piece" title="https://w3id.org/cluedo4KG/onto#Piece">room</a> + <sup class="type-c" title="class">c</sup> + </dd> + <dt>has range</dt> + <dd> + <a href="#Objet" title="https://w3id.org/cluedo4KG/onto#Objet">object</a> + <sup class="type-c" title="class">c</sup> + </dd> + <dt>is inverse of</dt> + <dd> + <a href="#objetDansPiece" title="https://w3id.org/cluedo4KG/onto#objetDansPiece">object in room</a> + <sup class="type-op" title="object property">op</sup> + </dd> + </dl> + </div> + </div> + <div class="entity" id="pieceContientPersonne"> + <h3>room contains person<sup class="type-op" title="object property">op</sup> + <span class="backlink"> back to <a href="#toc">ToC</a> or <a href="#objectproperties">Object Property ToC</a> + </span> + </h3> + <p> + <strong>IRI:</strong> https://w3id.org/cluedo4KG/onto#pieceContientPersonne</p> + <div class="description"> + <dl> + <dt>has domain</dt> + <dd> + <a href="#Piece" title="https://w3id.org/cluedo4KG/onto#Piece">room</a> + <sup class="type-c" title="class">c</sup> + </dd> + <dt>has range</dt> + <dd> + <a href="#Personne" title="https://w3id.org/cluedo4KG/onto#Personne">person</a> + <sup class="type-c" title="class">c</sup> + </dd> + <dt>is inverse of</dt> + <dd> + <a href="#personneDansPiece" + title="https://w3id.org/cluedo4KG/onto#personneDansPiece">person in room</a> + <sup class="type-op" title="object property">op</sup> + </dd> + </dl> + </div> + </div> + <div class="entity" id="pieceDansMaison"> + <h3>room in house<sup class="type-op" title="object property">op</sup> + <span class="backlink"> back to <a href="#toc">ToC</a> or <a href="#objectproperties">Object Property ToC</a> + </span> + </h3> + <p> + <strong>IRI:</strong> https://w3id.org/cluedo4KG/onto#pieceDansMaison</p> + <div class="description"> + <dl> + <dt>is inverse of</dt> + <dd> + <a href="#maisonContientPiece" + title="https://w3id.org/cluedo4KG/onto#maisonContientPiece">house contains room</a> + <sup class="type-op" title="object property">op</sup> + </dd> + </dl> + </div> + </div> +</div><div xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="dataproperties"> + <h3 id="dataproperties-headline" class="list">Data Properties</h3> + <ul class="hlist"> + <li> + <a href="#estVivant" title="https://w3id.org/cluedo4KG/onto#estVivant">is alive</a> + </li> + </ul> + <div class="entity" id="estVivant"> + <h3>is alive<sup class="type-dp" title="data property">dp</sup> + <span class="backlink"> back to <a href="#toc">ToC</a> or <a href="#dataproperties">Data Property ToC</a> + </span> + </h3> + <p> + <strong>IRI:</strong> https://w3id.org/cluedo4KG/onto#estVivant</p> + <div class="comment"> + <span class="markdown">indicates whether a person is alive (True) or dead (False)</span> + </div> + <div class="description"> + <dl> + <dt>has domain</dt> + <dd> + <a href="#Personne" title="https://w3id.org/cluedo4KG/onto#Personne">person</a> + <sup class="type-c" title="class">c</sup> + </dd> + <dt>has range</dt> + <dd> + <a href="http://www.w3.org/2001/XMLSchema#boolean" + target="_blank" + title="http://www.w3.org/2001/XMLSchema#boolean">boolean</a> + </dd> + </dl> + </div> + </div> +</div><div id="legend"> +<h2>Legend <span class="backlink"> back to <a href="#toc">ToC</a></span></h2> +<div class="entity"> +<sup class="type-c" title="Classes">c</sup>: Classes <br/> +<sup class="type-op" title="Object Properties">op</sup>: Object Properties <br/> +<sup class="type-dp" title="Data Properties">dp</sup>: Data Properties <br/> +</div> +</div> diff --git a/cluedo4KG-sources/sections/introduction-en.html b/cluedo4KG-sources/sections/introduction-en.html new file mode 100644 index 0000000000000000000000000000000000000000..82093e72fb7c3cd6ab918c48064fe22fd739caa9 --- /dev/null +++ b/cluedo4KG-sources/sections/introduction-en.html @@ -0,0 +1,23 @@ +<h2 id="intro" class="list">Introduction <span class="backlink"> back to <a href="#toc">ToC</a></span></h2> +<span class="markdown"> +This is a place holder text for the introduction. The introduction should briefly describe the ontology, its motivation, state of the art and goals.</span> +<div id="namespacedeclarations"> +<h3 id="ns" class="list">Namespace declarations</h3> +<div id="ns" align="center"> +<table> +<caption> <a href="#ns"> Table 1</a>: Namespaces used in the document </caption> +<tbody> +<tr><td><b>cluedonto</b></td><td><https://w3id.org/cluedo4KG/onto#></td></tr> +<tr><td></td><td></td></tr> +<tr><td><b>ns</b></td><td><http://creativecommons.org/ns></td></tr> +<tr><td><b>owl</b></td><td><http://www.w3.org/2002/07/owl></td></tr> +<tr><td><b>rdf</b></td><td><http://www.w3.org/1999/02/22-rdf-syntax-ns></td></tr> +<tr><td><b>terms</b></td><td><http://purl.org/dc/terms></td></tr> +<tr><td><b>xml</b></td><td><http://www.w3.org/XML/1998/namespace></td></tr> +<tr><td><b>xsd</b></td><td><http://www.w3.org/2001/XMLSchema></td></tr> +<tr><td><b>rdfs</b></td><td><http://www.w3.org/2000/01/rdf-schema></td></tr> +<tr><td><b>vann</b></td><td><http://purl.org/vocab/vann></td></tr> +</tbody> +</table> +</div> +</div> diff --git a/cluedo4KG-sources/webvowl/css/webvowl.app.css b/cluedo4KG-sources/webvowl/css/webvowl.app.css new file mode 100644 index 0000000000000000000000000000000000000000..45526ce37aaae9131abdcedb3220489018ab4424 --- /dev/null +++ b/cluedo4KG-sources/webvowl/css/webvowl.app.css @@ -0,0 +1,2477 @@ +@import url(http://fonts.googleapis.com/css?family=Open+Sans);/*---------------------------------------------- + WebVOWL page +----------------------------------------------*/ +html { + -ms-content-zooming: none; +} + + + +#loading-progress { + width: 50%; + margin: 10px 0; +} + +#drag_dropOverlay{ + width: 100%; + height:100%; + position:absolute; + top:0; + opacity: 0.5; + background-color: #3071a9; + pointer-events: none; + +} + +#dragDropContainer{ + width: 100%; + height:100%; + position:absolute; + top:0; + pointer-events: none; +} +#drag_icon_group{ + + +} + +#drag_msg{ + width: 50%; + background-color: #fefefe; + height: 50%; + border: black 2px solid; + border-radius: 20px; + left: 25%; + position: absolute; + top: 25%; + vertical-align: middle; + line-height: 10px; + text-align: center; + pointer-events: none; + padding: 10px; + font-size: 1.5em; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + + +#layoutLoadingProgressBarContainer { + height: 50px; + text-align: left; + line-height: 1.5; +} + +#FPS_Statistics { + /*position : absolute;*/ + /*top : 10px;*/ + /*right: 50px;*/ + padding-left: 60px; + padding-top: 60px; +} + +#reloadCachedOntology { + /*position : absolute;*/ + /*top : 10px;*/ + /*right: 50px;*/ +} + +#additionalInformationContainer { + position: absolute; + top: 10px; + right: 50px; +} + +#modeOfOperationString { + /*position: absolute;*/ + /*right: 50px;*/ + /*top : 60px;*/ + padding-left: 34px; +} + +#direct-text-input { + border: 1px solid #34495e; + width: 100%; + margin-top: 5px; + cursor: pointer; +} + +#directUploadBtn, #close_directUploadBtn { + border: 1px solid #34495e; + width: 100%; + margin-top: 5px; + cursor: pointer +} + +#di_controls { + +} + +#di_controls > ul { + list-style: none; + margin: 0; + padding: 5px 0 0 5px; + +} + +#progressBarContext { + border-radius: 10px; + background-color: #bdc3c7; + height: 25px; + border: solid 1px black; + + margin: auto; + +} + +#progressBarValue { + border-radius: 9px; + width: 0%; + background-color: #2980b9; + height: 25px; + line-height: 1.5; + text-align: center; +} + +/** adding searching Styles **/ +.dbEntry { + background-color: #ffffff; + color: #2980b9; + padding: 10px; + font-size: 14px; + border: none; + cursor: pointer; +} + +.debugOption { + +} + +.dbEntrySelected { + background-color: #bdc3c7; + color: #2980b9; + padding: 10px; + font-size: 14px; + border: none; + cursor: pointer; +} + +.dbEntry:hover, .dbEntry:focus { + background-color: #bdc3c7; +} + +.searchMenuEntry { + background-color: #ffffff; + bottom: 0; + font-size: 14px; + min-width: 50px; + margin: 0; + padding: 0; + z-index: 99; + border-radius: 4px 4px 0 0; + border: 1px solid rgba(0, 0, 0, 0.15); + -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); + box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); + box-sizing: border-box; + border-bottom: none; + display: none; + position: absolute; + list-style: none; +} + +.searchInputText { + background-color: #ffffff; + color: black; + border: black; + text-decoration: none; + max-width: 150px; + overflow: hidden; + text-overflow: ellipsis; + /*height: 20px;*/ + margin: 0; +} + +img, iframe { + border: none; +} + +.hidden { + display: none !important; +} + +.clear { + clear: both; +} + +a { + color: #69c; + text-decoration: none; +} + +a:hover { + color: #3498db; +} + +#optionsArea a { + color: #2980b9; +} + +#optionsArea a.highlighted { + background-color: #d90; +} + +.toolTipMenu li.highlighted { + background-color: #feb; +} + +#browserCheck { + /* checking for IE where WebVOWL is not working */ + background-color: #f00; + padding: 5px 0; + position: absolute; + text-align: center; + width: 100%; +} + +#browserCheck a { + color: #fff; +} + +#browserCheck a:hover { + text-decoration: underline; +} + +/*---------------------------------------------- + SideBar Animation Class; +----------------------------------------------- */ +@-webkit-keyframes sbExpandAnimation { + 0% { + width: 78%; + } + 100% { + width: 100%; + } +} + +@-moz-keyframes sbExpandAnimation { + 0% { + width: 78%; + } + 100% { + width: 100%; + } +} + +@-o-keyframes sbExpandAnimation { + 0% { + width: 78%; + } + 100% { + width: 100%; + } +} + +@keyframes sbExpandAnimation { + 0% { + width: 78%; + } + 100% { + width: 100%; + } +} + +/*Collapse Animation*/ +@-webkit-keyframes sbCollapseAnimation { + 0% { + width: 100%; + } + 100% { + width: 78%; + } +} + +@-moz-keyframes sbCollapseAnimation { + 0% { + width: 100%; + } + 100% { + width: 78%; + } +} + +@-o-keyframes sbCollapseAnimation { + 0% { + width: 100%; + } + 100% { + width: 78%; + } +} + +@keyframes sbCollapseAnimation { + 0% { + width: 100%; + } + 100% { + width: 78%; + } +} + +/*---------------------------------------------- + SideBar Animation Class; +----------------------------------------------- */ +@-webkit-keyframes l_sbExpandAnimation { + 0% { + width: 0px; + } + 100% { + width: 200px; + } +} + +@-moz-keyframes l_sbExpandAnimation { + 0% { + width: 0px; + } + 100% { + width: 200px; + } +} + +@-o-keyframes l_sbExpandAnimation { + 0% { + width: 0px; + } + 100% { + width: 200px; + } +} + +@keyframes l_sbExpandAnimation { + 0% { + width: 0px; + } + 100% { + width: 200px; + } +} + +/*Collapse Animation*/ +@-webkit-keyframes l_sbCollapseAnimation { + 0% { + width: 200px; + } + 100% { + width: 0px; + } +} + +@-moz-keyframes l_sbCollapseAnimation { + 0% { + width: 200px; + } + 100% { + width: 0px; + } +} + +@-o-keyframes l_sbCollapseAnimation { + 0% { + width: 200px; + } + 100% { + width: 0px; + } +} + +@keyframes l_sbCollapseAnimation { + 0% { + width: 200px; + } + 100% { + width: 0px; + } +} + +/*----------------- WARNING ANIMATIONS-------------*/ + +/*---------------------------------------------- + SideBar Animation Class; +----------------------------------------------- */ +@-webkit-keyframes warn_ExpandAnimation { + 0% { + top: -500px; + } + 100% { + top: 0; + } +} + +@-moz-keyframes warn_ExpandAnimation { + 0% { + top: -500px; + } + 100% { + top: 0; + } +} + +@-o-keyframes warn_ExpandAnimation { + 0% { + top: -500px; + } + 100% { + top: 0; + } +} + +@keyframes warn_ExpandAnimation { + 0% { + top: -500px; + } + 100% { + top: 0; + } +} + +/*Collapse Animation*/ +@-webkit-keyframes warn_CollapseAnimation { + 0% { + top: 0; + } + 100% { + top: -400px; + } +} + +@-moz-keyframes warn_CollapseAnimation { + 0% { + top: 0; + } + 100% { + top: -400px; + } +} + +@-o-keyframes warn_CollapseAnimation { + 0% { + top: 0; + } + 100% { + top: -400px; + } +} + +@keyframes warn_CollapseAnimation { + 0% { + top: 0; + } + 100% { + top: -400px; + } +} + +@keyframes msg_CollapseAnimation { + 0% { + top: 0; + } + 100% { + top: -400px; + } +} + +/*// add expand and collaps width for the warn module*/ +@-webkit-keyframes warn_ExpandLeftBarAnimation { + 0% { + left: 0; + } + 100% { + left: 100px; + } +} + +@-moz-keyframes warn_ExpandLeftBarAnimation { + 0% { + left: 0; + } + 100% { + left: 100px; + } +} + +@-o-keyframes warn_ExpandLeftBarAnimation { + 0% { + left: 0; + } + 100% { + left: 100px; + } +} + +@keyframes warn_ExpandLeftBarAnimation { + 0% { + left: 0; + } + 100% { + left: 100px; + } +} + +/*Collapse Animation*/ +@-webkit-keyframes warn_CollapseLeftBarAnimation { + 0% { + left: 100px; + } + 100% { + left: 0; + } +} + +@-moz-keyframes warn_CollapseLeftBarAnimation { + 0% { + left: 100px; + } + 100% { + left: 0; + } +} + +@-o-keyframes warn_CollapseLeftBarAnimation { + 0% { + left: 100px; + } + 100% { + left: 0; + } +} + +@keyframes warn_CollapseLeftBarAnimation { + 0% { + left: 100px; + } + 100% { + left: 0; + } +} + +/*// same for the right side expansion*/ + +/*// add expand and collaps width for the warn module*/ +@-webkit-keyframes warn_ExpandRightBarAnimation { + 0% { + width: 100%; + } + 100% { + width: 78%; + } +} + +@-moz-keyframes warn_ExpandRightBarAnimation { + 0% { + width: 100%; + } + 100% { + width: 78%; + } +} + +@-o-keyframes warn_ExpandRightBarAnimation { + 0% { + width: 100%; + } + 100% { + width: 78%; + } +} + +@keyframes warn_ExpandRightBarAnimation { + 0% { + width: 100%; + } + 100% { + width: 78%; + } + +} + +/*Collapse Animation*/ +@-webkit-keyframes warn_CollapseRightBarAnimation { + 0% { + width: 78%; + } + 100% { + width: 100%; + } +} + +@-moz-keyframes warn_CollapseRightBarAnimation { + 0% { + width: 78%; + } + 100% { + width: 100%; + } +} + +@-o-keyframes warn_CollapseRightBarAnimation { + 0% { + width: 78%; + } + 100% { + width: 100%; + } +} + +@keyframes warn_CollapseRightBarAnimation { + 0% { + width: 78%; + } + 100% { + width: 100%; + } +} + +/*---------------------------------------------- + LAYOUT +----------------------------------------------*/ +body { + background: rgb(24, 32, 42); + height: 100%; + font-size: 14px; + font-family: 'Open Sans', Helvetica, Arial, sans-serif; + line-height: 1; + margin: 0; + overflow: hidden; + padding: 0; + position: fixed; + width: 100%; +} + +main { + height: 100%; + margin: 0; + padding: 0; + position: relative; + width: 100%; +} + +#canvasArea { + position: relative; + margin: 0; + padding: 0; + width: 78%; +} + +#canvasArea #graph { + box-sizing: border-box; + margin: 0 0 2px 0; + background-color: #ecf0f1; + overflow: hidden; + padding: 0; + width: 100%; +} + +#canvasArea svg { + box-sizing: border-box; + margin: 0; + overflow: hidden; + padding: 0; +} + +#logo { + position: fixed; + /*padding: 10px;*/ + pointer-events: none; + /*border: solid 1px red;*/ +} + +#logo h2 { + color: #3498db; + margin: 0; + line-height: 0.7; + text-align: center; + font-size: 24px; +} + +#logo h2 span { + color: #34495E; + /*font-size: min(2vmin, 24px);*/ + font-size: 16px; +} + +@media screen and (max-device-height: 800px) { + #logo h2 { + font-size: calc(8px + 1.0vmin); + } + + #logo h2 span { + font-size: calc(3px + 1.0vmin); + } +} + +@media screen and (max-height: 800px) { + #logo h2 { + font-size: calc(8px + 1.0vmin); + } + + #logo h2 span { + font-size: calc(3px + 1.0vmin); + } +} + +@media screen and (max-device-width: 1200px) { + #logo h2 { + font-size: calc(8px + 1.0vmin); + } + + #logo h2 span { + font-size: calc(3px + 1.0vmin); + } +} + +@media screen and (max-width: 1200px) { + #logo h2 { + font-size: calc(8px + 1.0vmin); + } + + #logo h2 span { + font-size: calc(3px + 1.0vmin); + } +} + +.checkboxContainer input, .checkboxContainer label { + vertical-align: middle; +} + +.selected-ontology { + background-color: #eee; +} + +#credits { + border-top: solid 1px #bdc3c7; + font-size: 0.9em; +} + +.slideOption { + position: relative; + padding: 8px 5px; + outline: none; +} + +.slideOption .value { + float: right; + outline: none; +} + +.slideOption input[type="range"] { + box-sizing: border-box; + margin: 0; + outline: none; + -webkit-appearance: none; + -moz-appearance: none; + border-radius: 3px; + height: 12px; + width: 100%; + box-shadow: none; + left: 0; + position: relative; + transition: all 0.5s ease; + background-color: #eee; +} + +/*TRACK*/ +.slideOption input[type=range]::-webkit-slider-runnable-track { + -webkit-appearance: none; + background-color: #3071a9; + height: 3px; +} + +.slideOption input[type=range]::-moz-range-track { + -webkit-appearance: none; + background-color: #3071a9; + height: 3px; +} + +.slideOption input[type="range"]:hover { + outline: none; +} + +/*THUMB*/ +.slideOption input[type="range"]::-webkit-slider-thumb { + -webkit-appearance: none; + background-color: white; + border-radius: 3px; + border: solid 1px black; + transition: all 0.5s ease; + height: 10px; + width: 30px; + outline: none; + margin-top: -3px; +} + +.slideOption input[type="range"]::-moz-range-thumb { + -webkit-appearance: none; + background-color: white; + border-radius: 3px; + border: solid 1px black; + transition: all 0.5s ease; + height: 10px; + width: 30px; + outline: none; +} + +.slideOption input[type="range"]::-moz-range-thumb:hover { + background-color: #d90; + outline: none; +} + +.slideOption input[type="range"]::-webkit-slider-thumb:hover { + background-color: #d90; + /*color: #d90;*/ + outline: none; +} + +/*focus : remove border*/ +.slideOption input[type="range"]:focus { + outline: none; +} + +.slideOption input[type="range"]:active { + outline: none; +} + +.slideOption input[type="range"]::-moz-range-thumb:focus { + outline: none; +} + +.slideOption input[type="range"]::-moz-range-thumb:active { + outline: none; +} + +.slideOption input[type="range"]::-webkit-slider-thumb:focus { + outline: none; +} + +.slideOption input[type="range"]::-webkit-slider-thumb:active { + outline: none; +} + +.slideOption input[type="range"]:disabled { + box-sizing: border-box; + margin: 0; + outline: none; + -webkit-appearance: none; + -moz-appearance: none; + border-radius: 3px; + height: 12px; + width: 100%; + box-shadow: none; + left: 0; + position: relative; + transition: all 0.5s ease; + background-color: #787878; +} + +/*TRACK*/ +.slideOption input[type=range]:disabled::-webkit-slider-runnable-track { + -webkit-appearance: none; + background-color: #373737; + height: 3px; +} + +.slideOption input[type=range]:disabled::-moz-range-track { + -webkit-appearance: none; + background-color: #373737; + height: 3px; +} + +.slideOption input[type="range"]:disabled { + outline: none; +} + +/*THUMB*/ +.slideOption input[type="range"]:disabled::-webkit-slider-thumb { + -webkit-appearance: none; + background-color: #363636; + border-radius: 3px; + border: solid 1px #aaaaaa; + transition: all 0.5s ease; + height: 10px; + width: 30px; + outline: none; + margin-top: -3px; +} + +.slideOption input[type="range"]:disabled::-moz-range-thumb { + -webkit-appearance: none; + background-color: #aaaaaa; + border-radius: 3px; + border: solid 1px black; + transition: all 0.5s ease; + height: 10px; + width: 30px; + outline: none; +} + +.slideOption input[type="range"]:disabled::-moz-range-thumb { + background-color: #aaaaaa; + outline: none; +} + +.slideOption input[type="range"]:disabled::-webkit-slider-thumb { + background-color: #aaaaaa; + /*color: #d90;*/ + outline: none; +} + +.slideOption input[type="range"]:disabled:hover::-moz-range-thumb { + background-color: #404040; + outline: none; +} + +.slideOption input[type="range"]:disabled:hover::-webkit-slider-thumb { + background-color: #404040; + /*color: #d90;*/ + outline: none; +} + +#detailsArea { + top: 0; + right: 0; + bottom: 0; + color: #bdc3c7; + height: 100%; + width: 22%; + overflow-y: auto; + overflow-x: hidden; + position: fixed; + border-left: 1px solid #34495E; +} + +#detailsArea h1 { + border-bottom: solid 1px #34495e; + color: #ecf0f1; + display: block; + font-weight: 100; + font-size: 1.5em; + margin: 0; + padding: 10px 0; + text-align: center; +} + +#generalDetails { + width: auto; + box-sizing: border-box; + height: 100%; +} + +#generalDetails span #about { + border-bottom: solid 1px #34495e; + display: block; + padding: 10px; + text-align: center; + word-wrap: break-word; + color: #69c; +} + +#generalDetails h4 { + background: rgb(27, 37, 46); + color: #ecf0f1; + display: block; + font-size: 1.1em; + font-weight: 100; + margin: 0; + padding: 10px 0; + text-align: center; +} + +#detailsArea #generalDetails h5 { + border-bottom: solid 1px #34495e; + font-size: 0.9em; + font-weight: 100; + margin: 0; + padding: 5px; + text-align: center; +} + +#description { + text-align: justify; +} + +.accordion-container p { + font-size: 0.9em; + line-height: 1.3; + margin: 5px 10px; +} + +.statisticDetails span { + font-weight: 100; + font-style: italic; + margin: 10px 0; + padding: 10px; +} + +.statisticDetails div { + font-weight: 100; + font-style: italic; + margin: 10px 0; + padding: 0 10px; + display: inline; +} + +#selection-details .propDetails a { + color: #69c; +} + +#selection-details .propDetails > span { + font-weight: 100; + font-style: italic; + padding: 0 10px; +} + +#selection-details #classEquivUri span, #selection-details #disjointNodes span { + padding: 0; +} + +#selection-details .propDetails div { + font-weight: 100; + font-style: italic; + margin: 10px 0; + padding: 0 10px; + display: inline; +} + +#selection-details .propDetails div span { + padding: 0; +} + +/* give subclass property the same background color as the canvas */ +.subclass { + fill: #ecf0f1; +} + +.accordion-trigger { + background: #24323e; + cursor: pointer; + padding: .5em; +} + +.accordion-trigger.accordion-trigger-active:before { + padding-right: 4px; + content: "\25BC" +} + +.accordion-trigger:not(.accordion-trigger-active):before { + padding-right: 4px; + content: "\25BA" +} + +.accordion-container.scrollable { + max-height: 40%; + overflow: auto; +} + +.small-whitespace-separator { + height: 3px; +} + +#language { + background: transparent; + border: 1px solid #34495E; + color: #ecf0f1; +} + +#language option { + background-color: #24323e; +} + +.converter-form:not(:first-child) { + margin-top: 5px; +} + +.converter-form label { + display: inline-block; + line-height: normal; +} + +.converter-form input { + box-sizing: border-box; + height: 20px; + width: 74%; + border: 1px solid #34495E; +} + +.converter-form button { + cursor: pointer; + float: right; + height: 20px; + padding: 0; + width: 25%; + border: 1px solid #34495E; + background-color: #ecf0f1; +} + +#file-converter-label { + border: 1px solid #34495E; + box-sizing: border-box; + cursor: pointer; + height: 20px; + width: 74%; +} + +#killWarning { + cursor: pointer; + color: #ffffff; + font-weight: bold; +} + +/*#copyBt{*/ +/*box-sizing: border-box;*/ +/*color: #000000;*/ +/*float:right;*/ +/*position:absolute;*/ +/*right:2px;*/ +/*padding: 2px 7px 3px 7px;*/ +/*border: 1px solid #000000;*/ +/*background-color: #ecf0f1;*/ +/*cursor: pointer;*/ +/*}*/ + +#copyBt { + box-sizing: border-box; + height: 20px; + width: 31%; + border: 1px solid #34495E; +} + +#sidebarExpandButton { + height: 24px; + width: 24px; + /*background-color: white;*/ + /*box-shadow: 0px 1px 1px grey;*/ + box-sizing: border-box; + top: 10px; + color: #000000; + float: right; + position: absolute; + right: 0; + border: 1px solid #000000; + + text-align: center; + font-size: 1.5em; + cursor: pointer; +} + +.dropdownMenuClass { + height: 20px; + /*width: 69%;*/ + float: right; + border: 1px solid #34495E; + background-color: #34495E; + color: white; + /*border-bottom: 1px solid #d90;*/ + text-align: left; + width: auto; +} + +#typeEditForm_datatype { + padding-top: 5px; +} + +#typeEditor { + width: 165px; +} + +#typeEditor_datatype { + width: 165px; +} + +#leftSideBarCollapseButton { + box-sizing: border-box; + top: 50px; + /*padding:5px;*/ + color: #000000; + position: absolute; + left: 200px; + border: 1px solid #000000; + /*background-color: #ecf0f1;*/ + cursor: pointer; + width: 24px; + height: 24px; + font-size: 1.5em; + text-align: center; +} + +#leftSideBarCollapseButton:hover { + background-color: #d90; +} + +#sidebarExpandButton:hover { + background-color: #d90; +} + +.spanForCharSelection { + padding-left: 25px; +} + +.nodeEditSpan { + color: #000; + background-color: #fff; + text-align: center; + /*overflow: auto;*/ + border: none; + padding-top: 6px; +} + +.nodeEditSpan:focus { + outline: none; + border: none; +} + +.foreignelements { + /*width: 80px;*/ + /*height: 3px;*/ + border: none; +} + +.foreignelements:focus { + outline: none; + border: none; +} + +#leftSideBarContent { + color: #000000; + float: left; + position: absolute; + left: 0; + /*border: 1px solid #000000;*/ + background-color: rgb(24, 32, 42); + width: 100%; + height: 100%; +} + +#leftSideBarContent > h3 { + color: #ecf0f1; + display: block; + font-size: 1.1em; + font-weight: 100; + margin: 0 0 5px 0; + padding: 10px 0; + text-align: left; +} + +#generalDetailsEdit { + /*color: #ecf0f1;*/ + color: #ecf0f1; +} + +#generalDetailsEdit > div { + padding: 5px; +} + +#generalDetailsEdit > h3 { + color: #ecf0f1; + display: block; + font-size: 1.1em; + font-weight: 100; + margin: 0 0 5px 0; + padding: 10px 0; + text-align: left; +} + +.subAccordion { + color: #ecf0f1; + display: block; + font-size: 0.8em; + font-weight: 100; + margin: 0; + padding: 5px; + text-align: left; +} + +.subAccordionDescription { + padding: 0 5px; +} + +.boxed { + padding: 0 5px; +} + +.separatorLineRight { + border-right: 1px solid #f00; +} + +.editPrefixButton:hover { + color: #ff972d; + cursor: pointer; +} + +.editPrefixIcon:hover { + stroke: #ff972d; + stroke-width: 1px; + cursor: pointer; +} + +.editPrefixIcon { + stroke: #fffff; + stroke-width: 1px; + cursor: pointer; +} + +.deletePrefixButton:hover { + color: #ff972d; + cursor: pointer; +} + +.deletePrefixButton { + color: #ff0000; + cursor: pointer; +} + +.invisiblePrefixButton { + cursor: default; + color: rgb(24, 32, 42); +} + +#containerForAddPrefixButton { + width: 100%; + margin-top: 5px; +} + +.roundedButton { + border: 1px solid #000000; + border-radius: 20px; + padding: 0 5px; + background: #fff; + cursor: pointer; + color: black; + outline: none; +} + +.roundedButton:hover { + background: #318638; + cursor: pointer; + color: #fff; + outline: none; +} + +#prefixURL_Description { + padding: 5px 0 0 0; +} + +.prefixIRIElements { + display: inline-block; + padding: 3px; + border-bottom: 1px solid #34495E; + width: 100% +} + +.prefixInput { + width: 30px; + display: inline-block; + margin-right: 5px; +} + +.prefixURL { + width: 100px; + display: inline-block; + paddig-left: 5px; +} + +.selectedDefaultElement { + text-align: left; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + display: inline-block; + max-width: 200px; +} + +#editHeader { + color: #ecf0f1; + background-color: #394f5a; + display: block; + font-size: 1.1em; + font-weight: 100; + text-align: center; +} + +#leftHeader { + color: #ecf0f1; + background-color: #394f5a; + display: block; + font-size: 1.1em; + font-weight: 100; + text-align: center; + padding: 10px 0; + margin: 0; +} + +.containerForDefaultSelection { + color: #ecf0f1; + display: block; + font-size: 1.1em; + font-weight: 100; + margin: 0; + padding: 10px 20px; + text-align: left; +} + +.defaultSelected { + color: #a15d05; + background-color: #283943; +} + +.containerForDefaultSelection:hover { + color: #f19505; + background-color: #394f5a; + display: block; + cursor: pointer; +} + +#containerForLeftSideBar { + top: 50px; + float: left; + position: absolute; + background-color: #1b252e; + left: 0; + width: 200px; + height: 200px; + overflow-y: auto; + overflow-x: hidden; +} + +#leftSideBar { + width: 100%; + background-color: rgb(24, 32, 42); +} + +#loading-info { + box-sizing: border-box; + position: absolute; + text-align: center; + + width: 100%; + height: 80%; + top: 0; +} + +#loading-info > div { + display: inline-block; + color: #ffffff; + background-color: #18202A; + border-bottom-left-radius: 2px; + border-bottom-right-radius: 2px; +} + +#loading-info > * > * { + padding: 5px; +} + +#loading-info { + pointer-events: none; +} + +#loading-progress { + pointer-events: auto; + min-width: 220px; + border-radius: 10px; +} + +#show-loadingInfo-button { + font-size: 12px; + color: #fff; + cursor: pointer; + text-align: center; +} + +#loadingIndicator_closeButton:hover { + color: #ff972d; + cursor: pointer; + +} + +#loadingIndicator_closeButton { + color: #ffe30f; + cursor: pointer; + padding-bottom: 5px; + float: right; +} + +.busyProgressBar { + background-color: #000; + height: 25px; + position: relative; + animation: busy 2s linear infinite; +} + +@-webkit-keyframes busy { + 0% { + left: 0%; + } + 50% { + left: 80%; + } + 100% { + left: 0%; + } +} + +#bulletPoint_container { + padding-left: 15px; + margin-top: 0px; + margin-bottom: 0px; +} + +#bulletPoint_container > div { + margin-left: -15px; +} + +#loadingInfo-container { + box-sizing: border-box; + text-align: left; + line-height: 1.2; + padding-top: 5px; + overflow: auto; + /*white-space: nowrap;*/ + /*min-width: 250px;*/ + height: 120px; + min-height: 40px; + background-color: #3c3c3c; + +} + +#error-description-button { + margin: 5px 0 0 0; + font-size: 12px; + color: #69c; + cursor: pointer; + text-align: center; +} + +#error-description-container { + box-sizing: border-box; + text-align: left; +} + +#error-description-container pre { + background-color: #34495E; + padding: 2px; + margin: 0; + white-space: pre-wrap; + max-height: calc(100vh - 125px); + max-width: 75vw; + overflow: auto; +} + +.spin { + display: inline-block; + -webkit-animation: spin 2s infinite linear; + animation: spin 2s infinite linear; +} + +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} + +@keyframes spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} + +.truncate { + max-width: 250px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.color-mode-switch { + float: right; + width: 90px; + cursor: pointer; + height: 20px; + padding: 0; + border: 0; + color: #555; + background-color: #ECEEEF; + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2), inset 0 0 3px rgba(0, 0, 0, 0.1); +} + +.color-mode-switch:focus { + outline-width: 0; +} + +.color-mode-switch.active { + color: #FFF; + background-color: #32CD32; + box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.2), inset 0 0 3px rgba(0, 0, 0, 0.1); +} + +/* adding button pulse animation*/ +.filterMenuButtonHighlight { + background-color: #d90; +} + +@-webkit-keyframes buttonAnimation { + 0% { + background-color: unset; + } + 100% { + background-color: #d90; + } +} + +@-moz-keyframes buttonAnimation { + 0% { + background-color: unset; + } + 100% { + background-color: #d90; + } +} + +@-o-keyframes buttonAnimation { + 0% { + background-color: unset; + } + 100% { + background-color: #d90; + } +} + +@keyframes buttonAnimation { + 0% { + background-color: unset; + } + 100% { + background-color: #d90; + } +} + +.buttonPulse { + -webkit-animation-name: buttonAnimation; + -moz-animation-name: buttonAnimation; + -o-animation-name: buttonAnimation; + animation-name: buttonAnimation; + + -webkit-animation-duration: 0.5s; + -moz-animation-duration: 0.5s; + -o-animation-duration: 0.5s; + animation-duration: 0.5s; + + -webkit-animation-iteration-count: 3; + -moz-animation-iteration-count: 3; + -o-animation-iteration-count: 3; + animation-iteration-count: 3; + + -webkit-animation-timing-function: linear; + -moz-animation-timing-function: linear; + -o-animation-timing-function: linear; + animation-timing-function: linear; + + +} + +/*swipe bar definition*/ + +/*Overwriting individual menu widths*/ +#m_about { + max-width: 200px; + width: 200px; + position: absolute; + +} + +#m_modes { + max-width: 160px; + width: 160px; + position: absolute; +} + +#m_filter { + max-width: 170px; + width: 170px; + position: absolute; +} + +#m_gravity { + max-width: 180px; + width: 180px; + position: absolute; +} + +#m_export { + max-width: 160px; + width: 160px; + position: absolute; + +} + +#exportedUrl { + width: 100px; +} + +#m_select { + max-width: 300px; + width: 300px; + position: absolute; +} + +#m_config { + max-width: 240px; + width: 240px; + position: absolute; +} + +#m_search { + max-width: 250px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +/***************** REWRITING MENU ELEMENT CONTAINERS ***********************/ +/*Container which holds the swipeBar*/ +#swipeBarContainer { + position: fixed; + width: 77.8%; + height: 40px; + margin: 0; + padding: 0; + bottom: 0; +} + +/*Scroll-able container for the menu entries */ +#menuElementContainer { + margin: 0; + padding: 0; + overflow-x: auto; + overflow-y: hidden; + white-space: nowrap; + text-align: right; + list-style-type: none; +} + +/*Style for the individual menu entries*/ +#menuElementContainer > li { + display: inline-block; + box-sizing: border-box; + text-align: left; + position: relative; + height: 40px; + font-size: 14px; + color: #ffffff; + padding: 12px 0 0; + margin-left: -4px; +} + +/*Font-color Style for menu entries */ +#menuElementContainer > li > a { + color: #fff; + padding: 9px 12px 12px 30px; +} + +.menuElementSvgElement { + height: 20px; + width: 20px; + display: block; + position: absolute; + top: 10px; + left: 8px; +} + +.btn_shadowed { + background-color: #fefefe; + box-shadow: 1px 1px 1px gray; +} + +.reloadCachedOntologyIcon { + height: 20px; + width: 108px; + display: block; + position: absolute; + top: 20px; + left: 3px; + /*background: #ecf0f1;;*/ + border: solid 1px black; + border-radius: 10px; + cursor: pointer; +} + +.reloadCachedOntologyIcon:disabled { + background: #f4f4f4; + cursor: auto; + border: solid 1px darkgray; + +} + +.reloadCachedOntologyIcon:hover { + background: #d90; + cursor: pointer; +} + +.disabledReloadElement { + cursor: auto; + background: #F4F4F4; + pointer-events: auto; + border: solid 1px darkgray; + color: #bbbbbb; +} + +.disabledReloadElement:hover { + cursor: auto; + background: #EEEEEE; + pointer-events: auto; +} + +#menuElementContainer > li > input { + color: #000; + /*padding : 0 0.3em 0 1.5em;*/ + padding: 0.1em .3em 0.1em 1.5em; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + width: 120px; +} + +/*Hovered behavior for the menu entries*/ +#menuElementContainer > li > a:hover { + box-sizing: border-box; + background: #1B252E; + /*background : #d90;*/ + color: #bdc3c7; + +} + +#empty:hover { + box-sizing: border-box; + background: #e1e1e1; + /*background : #d90;*/ + color: #2980b9; +} + +#empty.disabled { + pointer-events: none; + cursor: default; + color: #979797; +} + +.disabled { + pointer-events: none; + cursor: default; + color: #979797; +} + +/*ToolTip Menu Definition*/ +.toolTipMenu { + -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); + box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); + box-sizing: border-box; + background-color: #ffffff; + border: 1px solid rgba(0, 0, 0, 0.15); + border-bottom: none; + border-radius: 4px 4px 0 0; + bottom: 0; + display: none; + font-size: 14px; + list-style: none; + /*max-width: 300px;*/ + margin: 0; + padding: 0; + white-space: normal; + position: absolute; + z-index: 99; +} + +.toolTipMenu > li:first-of-type { + border: none; +} + +.toolTipMenu a { + color: #2980b9; +} + +.toolTipMenu > li { + border-top: solid 1px #bdc3c7; +} + +.toolTipMenu li { + color: #2980b9; + display: block; +} + +/*MenuElement hovering enables the toolTip of the corresponding menu*/ +#menuElementContainer > li:hover .toolTipMenu { + display: block; +} + +#menuElementContainer li > ul.toolTipMenu li a:hover { + background: #e1e1e1; +} + +/****************************************************************************/ +/*ScrollButton behavior*/ +#scrollLeftButton { + height: 30px; + width: 30px; + padding: 5px 0 5px 10px; + color: #fff; + cursor: pointer; + position: absolute; + margin-top: -2px; + font-size: 2em; + background-color: #24323e; + left: 0; +} + +#scrollLeftButton:focus { + outline: none; +} + +#scrollLeftButton:before { + content: "<"; +} + +/*Right Scroll Button*/ +#scrollRightButton { + height: 30px; + width: 30px; + padding: 5px 0 5px 10px; + color: #fff; + cursor: pointer; + position: absolute; + margin-top: -2px; + font-size: 2em; + background-color: #24323e; + right: 0; +} + +#scrollRightButton:focus { + outline: none; +} + +#scrollRightButton:hover { + color: #bdc3c7; +} + +#scrollLeftButton:hover { + color: #bdc3c7; +} + +#scrollRightButton:before { + content: ">"; +} + +#centerGraphButton, #zoomInButton, #zoomOutButton { + border: 1px solid #000000; + text-align: center; + margin: -1px 0 0 0; + font-size: 1.5em; + padding: 0; + height: 28px; +} + +.noselect { + -webkit-touch-callout: none; /* iOS Safari */ + -webkit-user-select: none; /* Safari */ + -khtml-user-select: none; /* Konqueror HTML */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* Internet Explorer/Edge */ + user-select: none; + /* Non-prefixed version, currently + supported by Chrome and Opera */ +} + +#zoomOutButton { + line-height: 22px; +} + +#centerGraphButton { + line-height: 25px; +} + +#zoomInButton { + line-height: 25px; +} + +#zoomSlider > p:hover { + background-color: #d90; +} + +#zoomSliderParagraph { + color: #000000; + padding-top: 5px; + margin: -1px 0 0 0; + border: 1px solid #000000; + /*background-color: #ecf0f1;*/ + /*width: 28px;*/ + height: 150px; +} + +p#zoomSliderParagraph:hover { + background-color: #fff; +} + +/*todo put this in a proper position*/ +#zoomSlider { + width: 28px; + margin-top: -2px; + padding: 0; + font-size: 1.5em; + cursor: pointer; + position: absolute; + right: 20px; + bottom: 20px; + color: #000; + /*background-color: #ecf0f1;*/ + box-sizing: border-box; +} + +/****************************************************************************/ +/*Definition for the Icons before*/ +#menuElementContainer > li > a::before { + font-size: 1em; + margin: 0; + padding: 0 6px 0 0; +} + +#menuElementContainer a.highlighted { + background-color: #d90; +} + +/*#search-input-text.searchInputText {*/ +/*!*padding: 0 0.2em;*!*/ +/*color: black;*/ +/*}*/ + +.inner-addon { + position: relative; +} + +.searchIcon { + position: absolute; + /*padding: 0.15em 0;*/ + width: 17px; + height: 17px; + + pointer-events: none; +} + +.gearIcon { + position: absolute; + width: 17px; + height: 17px; + pointer-events: none; + left: -5px; +} + +/*#search-input-text::before {*/ +/*!*padding: 0 0.2em;*!*/ +/*!*color: black;*!*/ +/*font-size: 1.4em; !* todo : test this *!*/ +/*!*content: "\2315";*!*/ +/*content: "⚲";*/ +/*color: white;*/ +/*padding: 0;*/ +/*-webkit-transform: rotate(-45deg);*/ +/*!*content: "\2315" or "\1F50D"*!;*/ +/*display: inline-block;*/ +/*position: relative;*/ +/*top: 2px;*/ +/*left:-5px;*/ +/*}*/ + +li#c_search { + padding: 0 5px; + margin-left: 5px; + height: 20px; +} + +/*Menu icons before the links selection */ +/*#c_select > a::before { content: "\2263"; }*/ +/*#c_export > a::before { content: "\21E4"; }*/ +/*#c_gravity > a::before { content: "\2299"; }*/ +/*#c_filter > a::before { content: "\25BD"; }*/ +/*#c_modes > a::before { content: "\2606"; }*/ +/*#c_reset > a::before { content: "\21BB"; }*/ +/*#c_about > a::before { content: "\00A9"; }*/ + +li#c_locate { + padding: 0; +} + +#c_locate > a { + font-size: 2em; + padding: 0; +} + +a#pause-button { + padding: 12px 12px; +} + +/*Pause Button has a different behavior*/ +a#pause-button.paused::before { + content: "\25BA"; +} + +a#pause-button.paused:hover { + background-color: #d90; + color: #fff; +} + +a#pause-button:not(.paused)::before { + content: "II"; +} + +.toolTipMenu li:hover { + background-color: #e1e1e1; +} + +#emptyLiHover { + background-color: #FFFFFF; +} + +#emptyLiHover:hover { + background-color: #FFFFFF; +} + +.toggleOption li:hover { + background-color: #e1e1e1; +} + +.toggleOption { + padding: 8px 5px; +} + +#converter-option:hover { + background-color: #ffffff; +} + +.toolTipMenu li a:only-child, .option { + display: block; + float: none; + padding: 8px 5px; +} + +.customLocate { + padding: 0; + background-color: #32CD32; +} + +a#locateSearchResult { + padding-bottom: 0; + padding-top: 50px; + position: relative; + top: 5px; +} + +/*#sliderRange{*/ +/*padding: 0;*/ +/*margin: 7px 0 0 0;*/ +/*width:100%;*/ +/*height:5px;*/ +/*-webkit-appearance: none;*/ +/*outline: none;*/ +/*}*/ + +#zoomSliderElement { + color: #000; + position: relative; + padding-top: 0; + width: 155px; + height: 24px; + background-color: transparent; + -webkit-transform-origin-x: 73px; + -webkit-transform-origin-y: 73px; + -webkit-transform: rotate(-90deg); + -moz-transform-origin: 73px 73px; + transform: rotate(-90deg); + transform-origin: 73px 73px; + -webkit-appearance: none; + outline: none; + margin: 4px 0; +} + +/* ------------------ Zoom Slider styles --------------------------*/ +#zoomSliderElement::-webkit-scrollbar { + height: 0; +} + +#zoomSliderElement:hover { + cursor: crosshair; +} + +/*TRACK*/ +#zoomSliderElement::-webkit-slider-runnable-track { + width: 100%; + height: 5px; + cursor: pointer; + background: #3071a9; +} + +#zoomSliderElement::-moz-range-track { + width: 100%; + height: 5px; + cursor: pointer; + background: #3071a9; +} + +/*Thumb*/ +#zoomSliderElement::-webkit-slider-thumb { + -webkit-appearance: none; + border: 1px solid #000000; + height: 10px; + width: 30px; + margin-right: 50px; + border-radius: 3px; + background: #fff; + cursor: pointer; + outline: none; + margin-top: -3px; +} + +#zoomSliderElement::-ms-thumb { + -webkit-appearance: none; + border: 1px solid #000000; + height: 10px; + width: 30px; + margin-right: 50px; + border-radius: 3px; + background: #fff; + cursor: pointer; + outline: none; + margin-top: -3px; +} + +#zoomSliderElement::-ms-thumb:hover { + -webkit-appearance: none; + border: 1px solid #000000; + height: 10px; + width: 30px; + margin-right: 50px; + border-radius: 3px; + background: #d90; + cursor: pointer; + outline: none; + margin-top: -3px; +} + +#zoomSliderElement::-webkit-slider-thumb:hover { + -webkit-appearance: none; + border: 1px solid #000000; + height: 10px; + width: 30px; + margin-right: 50px; + border-radius: 3px; + background: #d90; + cursor: pointer; + outline: none; + margin-top: -3px; +} + +#zoomSliderElement::-moz-range-thumb { + border: 1px solid #000000; + height: 10px; + width: 30px; + border-radius: 3px; + /*background: #ffffff;*/ + cursor: pointer; + outline: none; +} + +#zoomSliderElement::-moz-range-thumb:hover { + border: 1px solid #000000; + height: 10px; + width: 30px; + border-radius: 3px; + background: #d90; + cursor: pointer; + outline: none; +} + +#zoomSliderElement::-moz-focus-outer { + border: 0; +} + +#locateSearchResult:focus { + outline: none; + +} + +a#locateSearchResult.highlighted:hover { + background-color: #d90; + color: red; +} + +a#locateSearchResult { + outline: none; + padding-bottom: 0; + padding-top: 0; + position: relative; + top: 5px; +} + +/*Editor hints*/ +#editorHint { + padding: 5px 5px; + position: absolute; + text-align: center; + width: 100%; + pointer-events: none; +} + +#editorHint label { + pointer-events: auto; + float: right; + padding: 5px 5px; + color: #ffdd00; +} + +#editorHint label:hover { + text-decoration: underline; + cursor: pointer; +} + +#editorHint > div { + pointer-events: auto; + text-align: left; + display: inline-block; + color: #ffffff; + font-size: 0.8em; + background-color: #18202A; + padding: 5px 5px; + border-radius: 5px; + +} + +#WarningErrorMessagesContainer { + position: absolute; + text-align: center; + top: 0; + pointer-events: none; +} + +/*Editor hints*/ +#WarningErrorMessages { + position: relative; + /*text-align: center;*/ + width: 50%; + pointer-events: auto; + margin: 10px 0; + padding-right: 12px; + overflow-y: auto; + overflow-x: hidden; +} + +#WarningErrorMessages label { + pointer-events: auto; + float: right; + padding: 5px 5px; + color: #ffdd00; +} + +#WarningErrorMessages span { + pointer-events: auto; + float: right; + padding: 5px 5px; +} + +#WarningErrorMessages label:hover { + text-decoration: underline; + cursor: pointer; +} + +#WarningErrorMessages > div { + pointer-events: auto; + text-align: left; + display: inline-block; + color: #ffffff; + font-size: 0.8em; + background-color: #18202A; + padding: 5px 5px; + border-radius: 10px; + border: solid 1px #ecf0f1; + width: 70%; + +} + +#WarningErrorMessagesContent > ul { + -webkit-padding-start: 20px; + padding: 0 16px; + +} + +#WarningErrorMessagesContent > ul > li { + padding: 5px; +} + +.converter-form-Editor { + /*display: inline-block;*/ +} + +.textLineEditWithLabel { + display: inline-block; + width: 100%; + border-bottom: 1px solid #34495E; + padding: 2px 0; + +} + +.converter-form-Editor label { + /*//display: inline-block;*/ + line-height: normal; +} + +.descriptionTextClass { + background-color: #34495E; + color: white; +} + +.prefixIRIElements input { + border: 1px solid #34495E; + background-color: #34495E; + color: white; +} + +.prefixIRIElements input:disabled { + background-color: rgb(24, 32, 42); + border: 1px solid rgb(24, 32, 42); + color: white; +} + +.converter-form-Editor input { + /*box-sizing: border-box;*/ + /*height: 18px;*/ + /*width: 69%;*/ + float: right; + border: 1px solid #34495E; + background-color: #34495E; + color: white; + /*border-bottom: 1px solid #d90;*/ + /*text-align: center;*/ + /*display: inline-block;*/ +} + +.converter-form-Editor input:disabled { + background-color: #545350; + border: 1px solid #34495E; + color: #939798; +} + +.disabledLabelForSlider { + color: #808080; +} diff --git a/cluedo4KG-sources/webvowl/css/webvowl.css b/cluedo4KG-sources/webvowl/css/webvowl.css new file mode 100644 index 0000000000000000000000000000000000000000..bd066236a27a7e89b55a97911f012dfef58f2dea --- /dev/null +++ b/cluedo4KG-sources/webvowl/css/webvowl.css @@ -0,0 +1,296 @@ +/*----------------------------------------------------------------- + VOWL graphical elements (part of spec) - mixed CSS and SVG styles +-----------------------------------------------------------------*/ + +/*-------- Text --------*/ +.text { + font-family: Helvetica, Arial, sans-serif; + font-size: 12px; +} + +.subtext { + font-size: 9px; +} + +.text.instance-count { + fill: #666; +} + +.external + text .instance-count { + fill: #aaa; +} + +.cardinality { + font-size: 10px; +} + +.text, .embedded { + pointer-events: none; +} + +/*------- Colors ------*/ +.class, .object, .disjoint, .objectproperty, .disjointwith, .equivalentproperty, .transitiveproperty, .functionalproperty, .inversefunctionalproperty, .symmetricproperty, .allvaluesfromproperty, .somevaluesfromproperty { + fill: #acf; +} + +.label .datatype, .datatypeproperty { + fill: #9c6; +} + +.rdf, .rdfproperty { + fill: #c9c; +} + +.literal, .node .datatype { + fill: #fc3; +} + +.deprecated, .deprecatedproperty { + fill: #ccc; +} + +.external, .externalproperty { + /*fill: #36c;*/ +} + +path, .nofill { + fill: none; +} + +marker path { + fill: #000; +} + +.class, path, line, .fineline { + stroke: #000; +} + +.white, .subclass, .subclassproperty, .external + text { + fill: #fff; +} + +.class.hovered, .property.hovered, .cardinality.hovered, .cardinality.focused, .filled.hovered, .filled.focused, .values-from.filled.hovered { + fill: #f00 !important; + cursor: pointer; +} + +.hoveredForEditing { + fill: #f00 !important; + cursor: pointer; +} + +.feature { + fill: #f00; + cursor: pointer; +} + +@-webkit-keyframes pulseAnimation { + 0% { + -webkit-transform: scale(1.5); + stroke-width: 3.33; + } + 50% { + stroke-width: 4; + } + 100% { + -webkit-transform: scale(1.0); + stroke-width: 5; + } +} + +@-moz-keyframes pulseAnimation { + 0% { + -webkit-transform: scale(1.5); + stroke-width: 3.33; + } + 50% { + stroke-width: 4; + } + 100% { + -webkit-transform: scale(1.0); + stroke-width: 5; + } +} + +@-o-keyframes pulseAnimation { + 0% { + -webkit-transform: scale(1.5); + stroke-width: 3.33; + } + 50% { + stroke-width: 4; + } + 100% { + -webkit-transform: scale(1.0); + stroke-width: 5; + } +} + +@keyframes pulseAnimation { + 0% { + -webkit-transform: scale(1.5); + stroke-width: 3.33; + } + 50% { + stroke-width: 4; + } + 100% { + -webkit-transform: scale(1.0); + stroke-width: 5; + } +} + +.searchResultA { + fill: none; + stroke-width: 5; + stroke: #f00; + -webkit-animation-name: pulseAnimation; + -moz-animation-name: pulseAnimation; + -o-animation-name: pulseAnimation; + animation-name: pulseAnimation; + + -webkit-animation-duration: 0.8s; + -moz-animation-duration: 0.8s; + -o-animation-duration: 0.8s; + animation-duration: 0.8s; + + -webkit-transform: translateZ(0); + -o-transform: translateZ(0); + -webkit-animation-iteration-count: 3; + -moz-animation-iteration-count: 3; + -o-animation-iteration-count: 3; + animation-iteration-count: 3; + + -webkit-animation-timing-function: linear; + -moz-animation-timing-function: linear; + -o-animation-timing-function: linear; + animation-timing-function: linear; + +} + +/* a class for not animated search results (hovered over node)*/ +.searchResultB { + fill: none; + stroke-width: 5; + stroke: #f00; +} + +.hovered-MathSymbol { + fill: none; + stroke: #f00 !important; +} + +.focused, path.hovered { + stroke: #f00 !important; +} + +.indirect-highlighting, .feature:hover { + fill: #f90; + cursor: pointer; +} + +.feature_hover { + fill: #f90; + cursor: pointer; +} + +.values-from { + stroke: #69c; +} + +.symbol, .values-from.filled { + fill: #69c; +} + +/*------- Strokes ------*/ +.class, path, line { + stroke-width: 2; +} + +.fineline { + stroke-width: 1; +} + +.dashed, .anonymous { + stroke-dasharray: 8; +} + +.dotted { + stroke-dasharray: 3; +} + +rect.focused, circle.focused { + stroke-width: 4px; +} + +.nostroke { + stroke: none; +} + +/*----------------------------------------------------------------- + Additional elements for the WebVOWL demo (NOT part of spec) +-----------------------------------------------------------------*/ + +.addDataPropertyElement { + fill: #9c6 !important; + cursor: pointer; + stroke-width: 2; + stroke: black; +} + +.addDataPropertyElement:hover { + fill: #f90 !important; + cursor: pointer; + stroke-width: 2; + stroke: black; +} + +.superHiddenElement { + fill: rgba(255, 153, 0, 0.4); + cursor: pointer; + stroke-width: 0; + stroke: black; + /*opacity:0;*/ +} + +.superOpacityElement { + opacity: 0; +} + +.deleteParentElement:hover { + fill: #f90; + cursor: pointer; + stroke-width: 2; + stroke: black; +} + +.deleteParentElement { + fill: #f00; + cursor: pointer; + stroke-width: 2; + stroke: black; +} + +.classNodeDragPath { + stroke: black; + stroke-width: 2px; +} + +.classDraggerNodeHovered { + fill: #f90; + stroke: black; + stroke-width: 2px; + cursor: pointer; +} + +.classDraggerNode { + fill: #acf; + stroke: black; + stroke-width: 2px; +} + +marker path { + /* Safari and Chrome workaround for inheriting the style of its link. + Use any value that is larger than the length of the marker path. */ + stroke-dasharray: 100; +} diff --git a/cluedo4KG-sources/webvowl/data/foaf.json b/cluedo4KG-sources/webvowl/data/foaf.json new file mode 100644 index 0000000000000000000000000000000000000000..4897985b2d37d445506cee362414c683a4997db9 --- /dev/null +++ b/cluedo4KG-sources/webvowl/data/foaf.json @@ -0,0 +1,2894 @@ +{ + "_comment" : "Created with OWL2VOWL (version 0.3.7), http://vowl.visualdataweb.org", + "header" : { + "languages" : [ "undefined" ], + "baseIris" : [ "http://schema.org", "http://www.w3.org/2000/01/rdf-schema", "http://www.w3.org/2003/01/geo/wgs84_pos", "http://purl.org/dc/terms", "http://www.w3.org/2001/XMLSchema", "http://xmlns.com/foaf/0.1", "http://www.w3.org/2000/10/swap/pim/contact", "http://www.w3.org/2004/02/skos/core" ], + "prefixList" : { + "owl" : "http://www.w3.org/2002/07/owl#", + "rdf" : "http://www.w3.org/1999/02/22-rdf-syntax-ns#", + "wot" : "http://xmlns.com/wot/0.1/", + "xsd" : "http://www.w3.org/2001/XMLSchema#", + "dc" : "http://purl.org/dc/elements/1.1/", + "xml" : "http://www.w3.org/XML/1998/namespace", + "vs" : "http://www.w3.org/2003/06/sw-vocab-status/ns#", + "foaf" : "http://xmlns.com/foaf/0.1/", + "rdfs" : "http://www.w3.org/2000/01/rdf-schema#" + }, + "title" : { + "undefined" : "Friend of a Friend (FOAF) vocabulary" + }, + "iri" : "http://xmlns.com/foaf/0.1/", + "description" : { + "undefined" : "The Friend of a Friend (FOAF) RDF vocabulary, described using W3C RDF Schema and the Web Ontology Language." + }, + "other" : { + "title" : [ { + "identifier" : "title", + "language" : "undefined", + "value" : "Friend of a Friend (FOAF) vocabulary", + "type" : "label" + } ] + } + }, + "namespace" : [ ], + "class" : [ { + "id" : "3", + "type" : "owl:Thing" + }, { + "id" : "9", + "type" : "owl:Class" + }, { + "id" : "1", + "type" : "owl:equivalentClass" + }, { + "id" : "18", + "type" : "owl:Thing" + }, { + "id" : "19", + "type" : "owl:Thing" + }, { + "id" : "5", + "type" : "owl:Thing" + }, { + "id" : "20", + "type" : "rdfs:Literal" + }, { + "id" : "8", + "type" : "rdfs:Literal" + }, { + "id" : "11", + "type" : "owl:Class" + }, { + "id" : "21", + "type" : "owl:Thing" + }, { + "id" : "22", + "type" : "rdfs:Literal" + }, { + "id" : "24", + "type" : "rdfs:Literal" + }, { + "id" : "26", + "type" : "rdfs:Literal" + }, { + "id" : "27", + "type" : "rdfs:Literal" + }, { + "id" : "37", + "type" : "owl:equivalentClass" + }, { + "id" : "45", + "type" : "rdfs:Literal" + }, { + "id" : "46", + "type" : "rdfs:Literal" + }, { + "id" : "53", + "type" : "rdfs:Literal" + }, { + "id" : "56", + "type" : "rdfs:Literal" + }, { + "id" : "59", + "type" : "rdfs:Literal" + }, { + "id" : "60", + "type" : "owl:Class" + }, { + "id" : "61", + "type" : "rdfs:Literal" + }, { + "id" : "6", + "type" : "rdfs:Literal" + }, { + "id" : "62", + "type" : "rdfs:Literal" + }, { + "id" : "12", + "type" : "owl:equivalentClass" + }, { + "id" : "55", + "type" : "rdfs:Literal" + }, { + "id" : "69", + "type" : "rdfs:Literal" + }, { + "id" : "71", + "type" : "owl:Class" + }, { + "id" : "36", + "type" : "owl:Class" + }, { + "id" : "86", + "type" : "owl:Class" + }, { + "id" : "83", + "type" : "owl:Class" + }, { + "id" : "94", + "type" : "owl:Class" + }, { + "id" : "73", + "type" : "rdfs:Literal" + }, { + "id" : "68", + "type" : "rdfs:Literal" + }, { + "id" : "93", + "type" : "rdfs:Literal" + }, { + "id" : "33", + "type" : "owl:Thing" + }, { + "id" : "49", + "type" : "rdfs:Literal" + }, { + "id" : "29", + "type" : "owl:Thing" + }, { + "id" : "101", + "type" : "rdfs:Literal" + }, { + "id" : "39", + "type" : "owl:Thing" + }, { + "id" : "63", + "type" : "owl:equivalentClass" + }, { + "id" : "64", + "type" : "owl:equivalentClass" + }, { + "id" : "102", + "type" : "owl:equivalentClass" + }, { + "id" : "78", + "type" : "owl:Class" + }, { + "id" : "77", + "type" : "owl:Class" + }, { + "id" : "13", + "type" : "owl:equivalentClass" + }, { + "id" : "58", + "type" : "rdfs:Literal" + }, { + "id" : "100", + "type" : "rdfs:Literal" + }, { + "id" : "106", + "type" : "rdfs:Literal" + }, { + "id" : "52", + "type" : "rdfs:Literal" + }, { + "id" : "88", + "type" : "rdfs:Literal" + }, { + "id" : "118", + "type" : "rdfs:Literal" + }, { + "id" : "126", + "type" : "owl:Class" + }, { + "id" : "2", + "type" : "owl:equivalentClass" + }, { + "id" : "32", + "type" : "owl:equivalentClass" + }, { + "id" : "10", + "type" : "owl:Class" + } ], + "classAttribute" : [ { + "iri" : "http://www.w3.org/2002/07/owl#Thing", + "baseIri" : "http://owl2vowl.de", + "id" : "3", + "label" : { + "undefined" : "Thing" + } + }, { + "iri" : "http://www.w3.org/2004/02/skos/core#Concept", + "baseIri" : "http://www.w3.org/2004/02/skos/core", + "instances" : 0, + "label" : { + "IRI-based" : "Concept", + "undefined" : "Concept" + }, + "attributes" : [ "external" ], + "id" : "9" + }, { + "iri" : "http://xmlns.com/foaf/0.1/Agent", + "equivalent" : [ "13" ], + "baseIri" : "http://xmlns.com/foaf/0.1", + "instances" : 0, + "annotations" : { + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "stable", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "Agent", + "undefined" : "Agent" + }, + "subClasses" : [ "10", "11", "12" ], + "comment" : { + "undefined" : "An agent (eg. person, group, software or physical artifact)." + }, + "attributes" : [ "equivalent" ], + "id" : "1" + }, { + "iri" : "http://www.w3.org/2002/07/owl#Thing", + "baseIri" : "http://owl2vowl.de", + "id" : "18", + "label" : { + "undefined" : "Thing" + } + }, { + "iri" : "http://www.w3.org/2002/07/owl#Thing", + "baseIri" : "http://owl2vowl.de", + "id" : "19", + "label" : { + "undefined" : "Thing" + } + }, { + "iri" : "http://www.w3.org/2002/07/owl#Thing", + "baseIri" : "http://owl2vowl.de", + "id" : "5", + "label" : { + "undefined" : "Thing" + } + }, { + "iri" : "http://www.w3.org/2000/01/rdf-schema#Literal", + "baseIri" : "http://www.w3.org/2000/01/rdf-schema", + "id" : "20", + "label" : { + "IRI-based" : "Literal", + "undefined" : "Literal" + } + }, { + "iri" : "http://www.w3.org/2000/01/rdf-schema#Literal", + "id" : "8", + "label" : { + "IRI-based" : "Literal", + "undefined" : "Literal" + } + }, { + "iri" : "http://xmlns.com/foaf/0.1/Organization", + "baseIri" : "http://xmlns.com/foaf/0.1", + "instances" : 0, + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "stable", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "Organization", + "undefined" : "Organization" + }, + "comment" : { + "undefined" : "An organization." + }, + "id" : "11", + "superClasses" : [ "1" ] + }, { + "iri" : "http://www.w3.org/2002/07/owl#Thing", + "baseIri" : "http://owl2vowl.de", + "id" : "21", + "label" : { + "undefined" : "Thing" + } + }, { + "iri" : "http://www.w3.org/2000/01/rdf-schema#Literal", + "baseIri" : "http://www.w3.org/2000/01/rdf-schema", + "id" : "22", + "label" : { + "IRI-based" : "Literal", + "undefined" : "Literal" + } + }, { + "iri" : "http://www.w3.org/2000/01/rdf-schema#Literal", + "baseIri" : "http://www.w3.org/2000/01/rdf-schema", + "id" : "24", + "label" : { + "IRI-based" : "Literal", + "undefined" : "Literal" + } + }, { + "iri" : "http://www.w3.org/2000/01/rdf-schema#Literal", + "baseIri" : "http://www.w3.org/2000/01/rdf-schema", + "id" : "26", + "label" : { + "IRI-based" : "Literal", + "undefined" : "Literal" + } + }, { + "iri" : "http://www.w3.org/2000/01/rdf-schema#Literal", + "baseIri" : "http://www.w3.org/2000/01/rdf-schema", + "id" : "27", + "label" : { + "IRI-based" : "Literal", + "undefined" : "Literal" + } + }, { + "iri" : "http://schema.org/CreativeWork", + "baseIri" : "http://schema.org", + "instances" : 0, + "label" : { + "IRI-based" : "CreativeWork" + }, + "attributes" : [ "external", "equivalent" ], + "id" : "37" + }, { + "iri" : "http://www.w3.org/2000/01/rdf-schema#Literal", + "baseIri" : "http://www.w3.org/2000/01/rdf-schema", + "id" : "45", + "label" : { + "IRI-based" : "Literal", + "undefined" : "Literal" + } + }, { + "iri" : "http://www.w3.org/2000/01/rdf-schema#Literal", + "baseIri" : "http://www.w3.org/2000/01/rdf-schema", + "id" : "46", + "label" : { + "IRI-based" : "Literal", + "undefined" : "Literal" + } + }, { + "iri" : "http://www.w3.org/2000/01/rdf-schema#Literal", + "baseIri" : "http://www.w3.org/2000/01/rdf-schema", + "id" : "53", + "label" : { + "IRI-based" : "Literal", + "undefined" : "Literal" + } + }, { + "iri" : "http://www.w3.org/2000/01/rdf-schema#Literal", + "baseIri" : "http://www.w3.org/2000/01/rdf-schema", + "id" : "56", + "label" : { + "IRI-based" : "Literal", + "undefined" : "Literal" + } + }, { + "iri" : "http://www.w3.org/2000/01/rdf-schema#Literal", + "baseIri" : "http://www.w3.org/2000/01/rdf-schema", + "id" : "59", + "label" : { + "IRI-based" : "Literal", + "undefined" : "Literal" + } + }, { + "iri" : "http://xmlns.com/foaf/0.1/Project", + "baseIri" : "http://xmlns.com/foaf/0.1", + "instances" : 0, + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "Project", + "undefined" : "Project" + }, + "comment" : { + "undefined" : "A project (a collective endeavour of some kind)." + }, + "id" : "60" + }, { + "iri" : "http://www.w3.org/2000/01/rdf-schema#Literal", + "baseIri" : "http://www.w3.org/2000/01/rdf-schema", + "id" : "61", + "label" : { + "IRI-based" : "Literal", + "undefined" : "Literal" + } + }, { + "iri" : "http://www.w3.org/2000/01/rdf-schema#Literal", + "baseIri" : "http://www.w3.org/2000/01/rdf-schema", + "id" : "6", + "label" : { + "IRI-based" : "Literal", + "undefined" : "Literal" + } + }, { + "iri" : "http://www.w3.org/2000/01/rdf-schema#Literal", + "baseIri" : "http://www.w3.org/2000/01/rdf-schema", + "id" : "62", + "label" : { + "IRI-based" : "Literal", + "undefined" : "Literal" + } + }, { + "iri" : "http://xmlns.com/foaf/0.1/Person", + "equivalent" : [ "63", "64" ], + "baseIri" : "http://xmlns.com/foaf/0.1", + "instances" : 0, + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "stable", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "Person", + "undefined" : "Person" + }, + "comment" : { + "undefined" : "A person." + }, + "attributes" : [ "equivalent" ], + "id" : "12", + "superClasses" : [ "1", "36" ] + }, { + "iri" : "http://www.w3.org/2000/01/rdf-schema#Literal", + "baseIri" : "http://www.w3.org/2000/01/rdf-schema", + "id" : "55", + "label" : { + "IRI-based" : "Literal", + "undefined" : "Literal" + } + }, { + "iri" : "http://www.w3.org/2000/01/rdf-schema#Literal", + "baseIri" : "http://www.w3.org/2000/01/rdf-schema", + "id" : "69", + "label" : { + "IRI-based" : "Literal", + "undefined" : "Literal" + } + }, { + "iri" : "http://xmlns.com/foaf/0.1/PersonalProfileDocument", + "baseIri" : "http://xmlns.com/foaf/0.1", + "instances" : 0, + "annotations" : { + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "PersonalProfileDocument", + "undefined" : "PersonalProfileDocument" + }, + "comment" : { + "undefined" : "A personal profile RDF document." + }, + "id" : "71", + "superClasses" : [ "2" ] + }, { + "iri" : "http://www.w3.org/2003/01/geo/wgs84_pos#SpatialThing", + "baseIri" : "http://www.w3.org/2003/01/geo/wgs84_pos", + "instances" : 0, + "label" : { + "IRI-based" : "SpatialThing", + "undefined" : "Spatial Thing" + }, + "subClasses" : [ "12" ], + "attributes" : [ "external" ], + "id" : "36" + }, { + "iri" : "http://xmlns.com/foaf/0.1/OnlineChatAccount", + "baseIri" : "http://xmlns.com/foaf/0.1", + "instances" : 0, + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "unstable", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "OnlineChatAccount", + "undefined" : "Online Chat Account" + }, + "comment" : { + "undefined" : "An online chat account." + }, + "id" : "86", + "superClasses" : [ "78" ] + }, { + "iri" : "http://xmlns.com/foaf/0.1/OnlineGamingAccount", + "baseIri" : "http://xmlns.com/foaf/0.1", + "instances" : 0, + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "unstable", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "OnlineGamingAccount", + "undefined" : "Online Gaming Account" + }, + "comment" : { + "undefined" : "An online gaming account." + }, + "id" : "83", + "superClasses" : [ "78" ] + }, { + "iri" : "http://xmlns.com/foaf/0.1/LabelProperty", + "baseIri" : "http://xmlns.com/foaf/0.1", + "instances" : 0, + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "unstable", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "LabelProperty", + "undefined" : "Label Property" + }, + "comment" : { + "undefined" : "A foaf:LabelProperty is any RDF property with texual values that serve as labels." + }, + "id" : "94" + }, { + "iri" : "http://www.w3.org/2000/01/rdf-schema#Literal", + "id" : "73", + "label" : { + "IRI-based" : "Literal", + "undefined" : "Literal" + } + }, { + "iri" : "http://www.w3.org/2000/01/rdf-schema#Literal", + "id" : "68", + "label" : { + "IRI-based" : "Literal", + "undefined" : "Literal" + } + }, { + "iri" : "http://www.w3.org/2000/01/rdf-schema#Literal", + "id" : "93", + "label" : { + "IRI-based" : "Literal", + "undefined" : "Literal" + } + }, { + "iri" : "http://www.w3.org/2002/07/owl#Thing", + "baseIri" : "http://owl2vowl.de", + "id" : "33", + "label" : { + "undefined" : "Thing" + } + }, { + "iri" : "http://www.w3.org/2000/01/rdf-schema#Literal", + "id" : "49", + "label" : { + "IRI-based" : "Literal", + "undefined" : "Literal" + } + }, { + "iri" : "http://www.w3.org/2002/07/owl#Thing", + "baseIri" : "http://owl2vowl.de", + "id" : "29", + "label" : { + "undefined" : "Thing" + } + }, { + "iri" : "http://www.w3.org/2000/01/rdf-schema#Literal", + "id" : "101", + "label" : { + "IRI-based" : "Literal", + "undefined" : "Literal" + } + }, { + "iri" : "http://www.w3.org/2002/07/owl#Thing", + "baseIri" : "http://owl2vowl.de", + "id" : "39", + "label" : { + "undefined" : "Thing" + } + }, { + "iri" : "http://www.w3.org/2000/10/swap/pim/contact#Person", + "baseIri" : "http://www.w3.org/2000/10/swap/pim/contact", + "instances" : 0, + "label" : { + "IRI-based" : "Person" + }, + "attributes" : [ "external", "equivalent" ], + "id" : "63" + }, { + "iri" : "http://schema.org/Person", + "baseIri" : "http://schema.org", + "instances" : 0, + "label" : { + "IRI-based" : "Person" + }, + "attributes" : [ "external", "equivalent" ], + "id" : "64" + }, { + "iri" : "http://schema.org/ImageObject", + "baseIri" : "http://schema.org", + "instances" : 0, + "label" : { + "IRI-based" : "ImageObject" + }, + "attributes" : [ "external", "equivalent" ], + "id" : "102" + }, { + "iri" : "http://xmlns.com/foaf/0.1/OnlineAccount", + "baseIri" : "http://xmlns.com/foaf/0.1", + "instances" : 0, + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "OnlineAccount", + "undefined" : "Online Account" + }, + "subClasses" : [ "77", "86", "83" ], + "comment" : { + "undefined" : "An online account." + }, + "id" : "78" + }, { + "iri" : "http://xmlns.com/foaf/0.1/OnlineEcommerceAccount", + "baseIri" : "http://xmlns.com/foaf/0.1", + "instances" : 0, + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "unstable", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "OnlineEcommerceAccount", + "undefined" : "Online E-commerce Account" + }, + "comment" : { + "undefined" : "An online e-commerce account." + }, + "id" : "77", + "superClasses" : [ "78" ] + }, { + "iri" : "http://purl.org/dc/terms/Agent", + "baseIri" : "http://purl.org/dc/terms", + "instances" : 0, + "label" : { + "IRI-based" : "Agent" + }, + "attributes" : [ "external", "equivalent" ], + "id" : "13" + }, { + "iri" : "http://www.w3.org/2000/01/rdf-schema#Literal", + "baseIri" : "http://www.w3.org/2000/01/rdf-schema", + "id" : "58", + "label" : { + "IRI-based" : "Literal", + "undefined" : "Literal" + } + }, { + "iri" : "http://www.w3.org/2000/01/rdf-schema#Literal", + "baseIri" : "http://www.w3.org/2000/01/rdf-schema", + "id" : "100", + "label" : { + "IRI-based" : "Literal", + "undefined" : "Literal" + } + }, { + "iri" : "http://www.w3.org/2000/01/rdf-schema#Literal", + "baseIri" : "http://www.w3.org/2000/01/rdf-schema", + "id" : "106", + "label" : { + "IRI-based" : "Literal", + "undefined" : "Literal" + } + }, { + "iri" : "http://www.w3.org/2000/01/rdf-schema#Literal", + "baseIri" : "http://www.w3.org/2000/01/rdf-schema", + "id" : "52", + "label" : { + "IRI-based" : "Literal", + "undefined" : "Literal" + } + }, { + "iri" : "http://www.w3.org/2000/01/rdf-schema#Literal", + "baseIri" : "http://www.w3.org/2000/01/rdf-schema", + "id" : "88", + "label" : { + "IRI-based" : "Literal", + "undefined" : "Literal" + } + }, { + "iri" : "http://www.w3.org/2000/01/rdf-schema#Literal", + "baseIri" : "http://www.w3.org/2000/01/rdf-schema", + "id" : "118", + "label" : { + "IRI-based" : "Literal", + "undefined" : "Literal" + } + }, { + "iri" : "http://www.w3.org/2000/01/rdf-schema#Class", + "baseIri" : "http://www.w3.org/2000/01/rdf-schema", + "instances" : 0, + "label" : { + "IRI-based" : "Class" + }, + "attributes" : [ "external" ], + "id" : "126" + }, { + "iri" : "http://xmlns.com/foaf/0.1/Document", + "equivalent" : [ "37" ], + "baseIri" : "http://xmlns.com/foaf/0.1", + "instances" : 0, + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "stable", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "Document", + "undefined" : "Document" + }, + "subClasses" : [ "71", "32" ], + "comment" : { + "undefined" : "A document." + }, + "attributes" : [ "equivalent" ], + "id" : "2" + }, { + "iri" : "http://xmlns.com/foaf/0.1/Image", + "equivalent" : [ "102" ], + "baseIri" : "http://xmlns.com/foaf/0.1", + "instances" : 0, + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "stable", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "Image", + "undefined" : "Image" + }, + "comment" : { + "undefined" : "An image." + }, + "attributes" : [ "equivalent" ], + "id" : "32", + "superClasses" : [ "2" ] + }, { + "iri" : "http://xmlns.com/foaf/0.1/Group", + "baseIri" : "http://xmlns.com/foaf/0.1", + "instances" : 0, + "annotations" : { + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "stable", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "Group", + "undefined" : "Group" + }, + "comment" : { + "undefined" : "A class of Agents." + }, + "id" : "10", + "superClasses" : [ "1" ] + } ], + "property" : [ { + "id" : "0", + "type" : "owl:objectProperty" + }, { + "id" : "4", + "type" : "owl:datatypeProperty" + }, { + "id" : "7", + "type" : "owl:datatypeProperty" + }, { + "id" : "14", + "type" : "owl:objectProperty" + }, { + "id" : "16", + "type" : "owl:objectProperty" + }, { + "id" : "17", + "type" : "owl:objectProperty" + }, { + "id" : "23", + "type" : "owl:objectProperty" + }, { + "id" : "25", + "type" : "owl:objectProperty" + }, { + "id" : "28", + "type" : "owl:objectProperty" + }, { + "id" : "30", + "type" : "owl:objectProperty" + }, { + "id" : "31", + "type" : "owl:objectProperty" + }, { + "id" : "35", + "type" : "owl:objectProperty" + }, { + "id" : "38", + "type" : "owl:objectProperty" + }, { + "id" : "44", + "type" : "owl:datatypeProperty" + }, { + "id" : "47", + "type" : "owl:objectProperty" + }, { + "id" : "48", + "type" : "owl:datatypeProperty" + }, { + "id" : "50", + "type" : "owl:objectProperty" + }, { + "id" : "51", + "type" : "owl:datatypeProperty" + }, { + "id" : "54", + "type" : "owl:datatypeProperty" + }, { + "id" : "57", + "type" : "owl:datatypeProperty" + }, { + "id" : "65", + "type" : "owl:datatypeProperty" + }, { + "id" : "66", + "type" : "owl:datatypeProperty" + }, { + "id" : "67", + "type" : "owl:datatypeProperty" + }, { + "id" : "70", + "type" : "owl:datatypeProperty" + }, { + "id" : "72", + "type" : "owl:datatypeProperty" + }, { + "id" : "15", + "type" : "owl:objectProperty" + }, { + "id" : "74", + "type" : "rdfs:SubClassOf" + }, { + "id" : "75", + "type" : "rdfs:SubClassOf" + }, { + "id" : "76", + "type" : "rdfs:SubClassOf" + }, { + "id" : "79", + "type" : "rdfs:SubClassOf" + }, { + "id" : "80", + "type" : "owl:objectProperty" + }, { + "id" : "81", + "type" : "owl:objectProperty" + }, { + "id" : "82", + "type" : "rdfs:SubClassOf" + }, { + "id" : "34", + "type" : "owl:objectProperty" + }, { + "id" : "85", + "type" : "rdfs:SubClassOf" + }, { + "id" : "87", + "type" : "owl:datatypeProperty" + }, { + "id" : "89", + "type" : "rdfs:SubClassOf" + }, { + "id" : "90", + "type" : "rdfs:SubClassOf" + }, { + "id" : "91", + "type" : "owl:objectProperty" + }, { + "id" : "92", + "type" : "owl:datatypeProperty" + }, { + "id" : "95", + "type" : "owl:datatypeProperty" + }, { + "id" : "96", + "type" : "owl:objectProperty" + }, { + "id" : "97", + "type" : "owl:datatypeProperty" + }, { + "id" : "98", + "type" : "rdfs:SubClassOf" + }, { + "id" : "99", + "type" : "owl:datatypeProperty" + }, { + "id" : "43", + "type" : "owl:objectProperty" + }, { + "id" : "42", + "type" : "owl:objectProperty" + }, { + "id" : "103", + "type" : "owl:datatypeProperty" + }, { + "id" : "104", + "type" : "owl:objectProperty" + }, { + "id" : "105", + "type" : "owl:datatypeProperty" + }, { + "id" : "107", + "type" : "owl:objectProperty" + }, { + "id" : "108", + "type" : "owl:datatypeProperty" + }, { + "id" : "109", + "type" : "owl:objectProperty" + }, { + "id" : "110", + "type" : "owl:objectProperty" + }, { + "id" : "40", + "type" : "owl:objectProperty" + }, { + "id" : "41", + "type" : "owl:objectProperty" + }, { + "id" : "84", + "type" : "owl:objectProperty" + }, { + "id" : "111", + "type" : "owl:datatypeProperty" + }, { + "id" : "112", + "type" : "owl:datatypeProperty" + }, { + "id" : "113", + "type" : "owl:datatypeProperty" + }, { + "id" : "114", + "type" : "owl:objectProperty" + }, { + "id" : "116", + "type" : "owl:disjointWith" + }, { + "id" : "117", + "type" : "owl:disjointWith" + }, { + "id" : "119", + "type" : "owl:datatypeProperty" + }, { + "id" : "120", + "type" : "owl:disjointWith" + }, { + "id" : "121", + "type" : "owl:disjointWith" + }, { + "id" : "122", + "type" : "owl:objectProperty" + }, { + "id" : "123", + "type" : "owl:datatypeProperty" + }, { + "id" : "124", + "type" : "owl:objectProperty" + }, { + "id" : "125", + "type" : "owl:datatypeProperty" + }, { + "id" : "127", + "type" : "owl:datatypeProperty" + }, { + "id" : "115", + "type" : "owl:objectProperty" + }, { + "id" : "128", + "type" : "owl:objectProperty" + }, { + "id" : "129", + "type" : "owl:objectProperty" + } ], + "propertyAttribute" : [ { + "iri" : "http://xmlns.com/foaf/0.1/interest", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "2", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "interest", + "undefined" : "interest" + }, + "domain" : "1", + "comment" : { + "undefined" : "A page about a topic of interest to this person." + }, + "attributes" : [ "object" ], + "id" : "0" + }, { + "iri" : "http://xmlns.com/foaf/0.1/mbox_sha1sum", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "6", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "mbox_sha1sum", + "undefined" : "sha1sum of a personal mailbox URI name" + }, + "domain" : "5", + "comment" : { + "undefined" : "The sha1sum of the URI of an Internet mailbox associated with exactly one owner, the first owner of the mailbox." + }, + "attributes" : [ "datatype" ], + "id" : "4" + }, { + "iri" : "http://xmlns.com/foaf/0.1/nick", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "8", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "nick", + "undefined" : "nickname" + }, + "domain" : "5", + "comment" : { + "undefined" : "A short informal nickname characterising an agent (includes login identifiers, IRC and other chat nicknames)." + }, + "attributes" : [ "datatype" ], + "id" : "7" + }, { + "iri" : "http://xmlns.com/foaf/0.1/openid", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "2", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "openid", + "undefined" : "openid" + }, + "superproperty" : [ "15" ], + "domain" : "1", + "comment" : { + "undefined" : "An OpenID for an Agent." + }, + "attributes" : [ "inverse functional", "object" ], + "id" : "14" + }, { + "iri" : "http://xmlns.com/foaf/0.1/workInfoHomepage", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "2", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "workInfoHomepage", + "undefined" : "work info homepage" + }, + "domain" : "12", + "comment" : { + "undefined" : "A work info homepage of some person; a page about their work for some organization." + }, + "attributes" : [ "object" ], + "id" : "16" + }, { + "iri" : "http://xmlns.com/foaf/0.1/pastProject", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "3", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "pastProject", + "undefined" : "past project" + }, + "domain" : "12", + "comment" : { + "undefined" : "A project this person has previously worked on." + }, + "attributes" : [ "object" ], + "id" : "17" + }, { + "iri" : "http://xmlns.com/foaf/0.1/theme", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "19", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "archaic", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "theme", + "undefined" : "theme" + }, + "domain" : "19", + "comment" : { + "undefined" : "A theme." + }, + "attributes" : [ "object" ], + "id" : "23" + }, { + "iri" : "http://xmlns.com/foaf/0.1/knows", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "12", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "stable", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "knows", + "undefined" : "knows" + }, + "domain" : "12", + "comment" : { + "undefined" : "A person known by this person (indicating some level of reciprocated interaction between the parties)." + }, + "attributes" : [ "object" ], + "id" : "25" + }, { + "iri" : "http://xmlns.com/foaf/0.1/focus", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "29", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "focus", + "undefined" : "focus" + }, + "domain" : "9", + "comment" : { + "undefined" : "The underlying or 'focal' entity associated with some SKOS-described concept." + }, + "attributes" : [ "object" ], + "id" : "28" + }, { + "iri" : "http://xmlns.com/foaf/0.1/phone", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "19", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "phone", + "undefined" : "phone" + }, + "domain" : "19", + "comment" : { + "undefined" : "A phone, specified using fully qualified tel: URI scheme (refs: http://www.w3.org/Addressing/schemes.html#tel)." + }, + "attributes" : [ "object" ], + "id" : "30" + }, { + "iri" : "http://xmlns.com/foaf/0.1/depicts", + "inverse" : "34", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "33", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "depicts", + "undefined" : "depicts" + }, + "domain" : "32", + "comment" : { + "undefined" : "A thing depicted in this representation." + }, + "attributes" : [ "object" ], + "id" : "31" + }, { + "iri" : "http://xmlns.com/foaf/0.1/based_near", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "36", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "based_near", + "undefined" : "based near" + }, + "domain" : "36", + "comment" : { + "undefined" : "A location that something is based near, for some broadly human notion of near." + }, + "attributes" : [ "object" ], + "id" : "35" + }, { + "iri" : "http://xmlns.com/foaf/0.1/page", + "inverse" : "40", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "2", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "stable", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "page", + "undefined" : "page" + }, + "domain" : "39", + "subproperty" : [ "15", "41", "42", "43" ], + "comment" : { + "undefined" : "A page or document about this thing." + }, + "attributes" : [ "object" ], + "id" : "38" + }, { + "iri" : "http://xmlns.com/foaf/0.1/geekcode", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "26", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "archaic", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "geekcode", + "undefined" : "geekcode" + }, + "domain" : "12", + "comment" : { + "undefined" : "A textual geekcode for this person, see http://www.geekcode.com/geek.html" + }, + "attributes" : [ "datatype" ], + "id" : "44" + }, { + "iri" : "http://xmlns.com/foaf/0.1/primaryTopic", + "inverse" : "15", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "39", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "stable", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "primaryTopic", + "undefined" : "primary topic" + }, + "domain" : "2", + "comment" : { + "undefined" : "The primary topic of some page or document." + }, + "attributes" : [ "object", "functional" ], + "id" : "47" + }, { + "iri" : "http://xmlns.com/foaf/0.1/givenName", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "49", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "givenName", + "undefined" : "Given name" + }, + "domain" : "19", + "comment" : { + "undefined" : "The given name of some person." + }, + "attributes" : [ "datatype" ], + "id" : "48" + }, { + "iri" : "http://xmlns.com/foaf/0.1/schoolHomepage", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "2", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "schoolHomepage", + "undefined" : "schoolHomepage" + }, + "domain" : "12", + "comment" : { + "undefined" : "A homepage of a school attended by the person." + }, + "attributes" : [ "object" ], + "id" : "50" + }, { + "iri" : "http://xmlns.com/foaf/0.1/gender", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "52", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "gender", + "undefined" : "gender" + }, + "domain" : "1", + "comment" : { + "undefined" : "The gender of this Agent (typically but not necessarily 'male' or 'female')." + }, + "attributes" : [ "datatype", "functional" ], + "id" : "51" + }, { + "iri" : "http://xmlns.com/foaf/0.1/dnaChecksum", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "55", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "archaic", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "dnaChecksum", + "undefined" : "DNA checksum" + }, + "domain" : "19", + "comment" : { + "undefined" : "A checksum for the DNA of some thing. Joke." + }, + "attributes" : [ "datatype" ], + "id" : "54" + }, { + "iri" : "http://xmlns.com/foaf/0.1/lastName", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "58", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "lastName", + "undefined" : "lastName" + }, + "domain" : "12", + "comment" : { + "undefined" : "The last name of a person." + }, + "attributes" : [ "datatype" ], + "id" : "57" + }, { + "iri" : "http://xmlns.com/foaf/0.1/status", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "45", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "unstable", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "status", + "undefined" : "status" + }, + "domain" : "1", + "comment" : { + "undefined" : "A string expressing what the user is happy for the general public (normally) to know about their current activity." + }, + "attributes" : [ "datatype" ], + "id" : "65" + }, { + "iri" : "http://xmlns.com/foaf/0.1/yahooChatID", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "46", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "yahooChatID", + "undefined" : "Yahoo chat ID" + }, + "domain" : "19", + "comment" : { + "undefined" : "A Yahoo chat ID" + }, + "attributes" : [ "datatype" ], + "id" : "66" + }, { + "iri" : "http://xmlns.com/foaf/0.1/name", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "68", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "name", + "undefined" : "name" + }, + "domain" : "19", + "comment" : { + "undefined" : "A name for some thing." + }, + "attributes" : [ "datatype" ], + "id" : "67" + }, { + "iri" : "http://xmlns.com/foaf/0.1/icqChatID", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "53", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "icqChatID", + "undefined" : "ICQ chat ID" + }, + "domain" : "19", + "comment" : { + "undefined" : "An ICQ chat ID" + }, + "attributes" : [ "datatype" ], + "id" : "70" + }, { + "iri" : "http://xmlns.com/foaf/0.1/givenname", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "73", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "archaic", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "givenname", + "undefined" : "Given name" + }, + "domain" : "19", + "comment" : { + "undefined" : "The given name of some person." + }, + "attributes" : [ "datatype" ], + "id" : "72" + }, { + "iri" : "http://xmlns.com/foaf/0.1/isPrimaryTopicOf", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "2", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "stable", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "isPrimaryTopicOf", + "undefined" : "is primary topic of" + }, + "superproperty" : [ "38" ], + "domain" : "39", + "subproperty" : [ "14", "43" ], + "comment" : { + "undefined" : "A document that this thing is the primary topic of." + }, + "attributes" : [ "inverse functional", "object" ], + "id" : "15" + }, { + "range" : "2", + "domain" : "32", + "attributes" : [ "anonymous", "object" ], + "id" : "74" + }, { + "range" : "2", + "domain" : "71", + "attributes" : [ "anonymous", "object" ], + "id" : "75" + }, { + "range" : "78", + "domain" : "77", + "attributes" : [ "anonymous", "object" ], + "id" : "76" + }, { + "range" : "36", + "domain" : "12", + "attributes" : [ "anonymous", "object" ], + "id" : "79" + }, { + "iri" : "http://xmlns.com/foaf/0.1/accountServiceHomepage", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "2", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "accountServiceHomepage", + "undefined" : "account service homepage" + }, + "domain" : "78", + "comment" : { + "undefined" : "Indicates a homepage of the service provide for this online account." + }, + "attributes" : [ "object" ], + "id" : "80" + }, { + "iri" : "http://xmlns.com/foaf/0.1/logo", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "19", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "logo", + "undefined" : "logo" + }, + "domain" : "19", + "comment" : { + "undefined" : "A logo representing some thing." + }, + "attributes" : [ "inverse functional", "object" ], + "id" : "81" + }, { + "range" : "78", + "domain" : "83", + "attributes" : [ "anonymous", "object" ], + "id" : "82" + }, { + "iri" : "http://xmlns.com/foaf/0.1/depiction", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "32", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "depiction", + "undefined" : "depiction" + }, + "domain" : "33", + "subproperty" : [ "84" ], + "comment" : { + "undefined" : "A depiction of some thing." + }, + "attributes" : [ "object" ], + "id" : "34" + }, { + "range" : "78", + "domain" : "86", + "attributes" : [ "anonymous", "object" ], + "id" : "85" + }, { + "iri" : "http://xmlns.com/foaf/0.1/family_name", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "88", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "archaic", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "family_name", + "undefined" : "family_name" + }, + "domain" : "12", + "comment" : { + "undefined" : "The family name of some person." + }, + "attributes" : [ "datatype" ], + "id" : "87" + }, { + "range" : "1", + "domain" : "12", + "attributes" : [ "anonymous", "object" ], + "id" : "89" + }, { + "range" : "1", + "domain" : "11", + "attributes" : [ "anonymous", "object" ], + "id" : "90" + }, { + "iri" : "http://xmlns.com/foaf/0.1/fundedBy", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "19", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "archaic", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "fundedBy", + "undefined" : "funded by" + }, + "domain" : "19", + "comment" : { + "undefined" : "An organization funding a project or person." + }, + "attributes" : [ "object" ], + "id" : "91" + }, { + "iri" : "http://xmlns.com/foaf/0.1/title", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "93", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "title", + "undefined" : "title" + }, + "domain" : "19", + "comment" : { + "undefined" : "Title (Mr, Mrs, Ms, Dr. etc)" + }, + "attributes" : [ "datatype" ], + "id" : "92" + }, { + "iri" : "http://xmlns.com/foaf/0.1/accountName", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "59", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "accountName", + "undefined" : "account name" + }, + "domain" : "78", + "comment" : { + "undefined" : "Indicates the name (identifier) associated with this online account." + }, + "attributes" : [ "datatype" ], + "id" : "95" + }, { + "iri" : "http://xmlns.com/foaf/0.1/account", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "78", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "account", + "undefined" : "account" + }, + "domain" : "1", + "comment" : { + "undefined" : "Indicates an account held by this agent." + }, + "attributes" : [ "object" ], + "id" : "96" + }, { + "iri" : "http://xmlns.com/foaf/0.1/jabberID", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "69", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "jabberID", + "undefined" : "jabber ID" + }, + "domain" : "19", + "comment" : { + "undefined" : "A jabber ID for something." + }, + "attributes" : [ "datatype" ], + "id" : "97" + }, { + "range" : "1", + "domain" : "10", + "attributes" : [ "anonymous", "object" ], + "id" : "98" + }, { + "iri" : "http://xmlns.com/foaf/0.1/age", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "100", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "unstable", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "age", + "undefined" : "age" + }, + "domain" : "1", + "comment" : { + "undefined" : "The age in years of some agent." + }, + "attributes" : [ "datatype", "functional" ], + "id" : "99" + }, { + "iri" : "http://xmlns.com/foaf/0.1/homepage", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "2", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "stable", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "homepage", + "undefined" : "homepage" + }, + "superproperty" : [ "15", "38" ], + "domain" : "39", + "comment" : { + "undefined" : "A homepage for some thing." + }, + "attributes" : [ "inverse functional", "object" ], + "id" : "43" + }, { + "iri" : "http://xmlns.com/foaf/0.1/tipjar", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "2", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "tipjar", + "undefined" : "tipjar" + }, + "superproperty" : [ "38" ], + "domain" : "1", + "comment" : { + "undefined" : "A tipjar document for this agent, describing means for payment and reward." + }, + "attributes" : [ "object" ], + "id" : "42" + }, { + "iri" : "http://xmlns.com/foaf/0.1/msnChatID", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "61", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "msnChatID", + "undefined" : "MSN chat ID" + }, + "domain" : "5", + "comment" : { + "undefined" : "An MSN chat ID" + }, + "attributes" : [ "datatype" ], + "id" : "103" + }, { + "iri" : "http://xmlns.com/foaf/0.1/topic_interest", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "18", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "topic_interest", + "undefined" : "topic_interest" + }, + "domain" : "1", + "comment" : { + "undefined" : "A thing of interest to this person." + }, + "attributes" : [ "object" ], + "id" : "104" + }, { + "iri" : "http://xmlns.com/foaf/0.1/aimChatID", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "106", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "aimChatID", + "undefined" : "AIM chat ID" + }, + "domain" : "19", + "comment" : { + "undefined" : "An AIM chat ID" + }, + "attributes" : [ "datatype" ], + "id" : "105" + }, { + "iri" : "http://xmlns.com/foaf/0.1/currentProject", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "3", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "currentProject", + "undefined" : "current project" + }, + "domain" : "12", + "comment" : { + "undefined" : "A current project this person works on." + }, + "attributes" : [ "object" ], + "id" : "107" + }, { + "iri" : "http://xmlns.com/foaf/0.1/skypeID", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "20", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "skypeID", + "undefined" : "Skype ID" + }, + "domain" : "1", + "comment" : { + "undefined" : "A Skype ID" + }, + "attributes" : [ "datatype" ], + "id" : "108" + }, { + "iri" : "http://xmlns.com/foaf/0.1/holdsAccount", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "78", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "archaic", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "holdsAccount", + "undefined" : "account" + }, + "domain" : "1", + "comment" : { + "undefined" : "Indicates an account held by this agent." + }, + "attributes" : [ "object" ], + "id" : "109" + }, { + "iri" : "http://xmlns.com/foaf/0.1/thumbnail", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "32", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "thumbnail", + "undefined" : "thumbnail" + }, + "domain" : "32", + "comment" : { + "undefined" : "A derived thumbnail image." + }, + "attributes" : [ "object" ], + "id" : "110" + }, { + "iri" : "http://xmlns.com/foaf/0.1/topic", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "39", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "topic", + "undefined" : "topic" + }, + "domain" : "2", + "comment" : { + "undefined" : "A topic of some page or document." + }, + "attributes" : [ "object" ], + "id" : "40" + }, { + "iri" : "http://xmlns.com/foaf/0.1/weblog", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "2", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "stable", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "weblog", + "undefined" : "weblog" + }, + "superproperty" : [ "38" ], + "domain" : "1", + "comment" : { + "undefined" : "A weblog of some thing (whether person, group, company etc.)." + }, + "attributes" : [ "inverse functional", "object" ], + "id" : "41" + }, { + "iri" : "http://xmlns.com/foaf/0.1/img", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "32", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "img", + "undefined" : "image" + }, + "superproperty" : [ "34" ], + "domain" : "12", + "comment" : { + "undefined" : "An image that can be used to represent some thing (ie. those depictions which are particularly representative of something, eg. one's photo on a homepage)." + }, + "attributes" : [ "object" ], + "id" : "84" + }, { + "iri" : "http://xmlns.com/foaf/0.1/birthday", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "56", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "unstable", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "birthday", + "undefined" : "birthday" + }, + "domain" : "1", + "comment" : { + "undefined" : "The birthday of this Agent, represented in mm-dd string form, eg. '12-31'." + }, + "attributes" : [ "datatype", "functional" ], + "id" : "111" + }, { + "iri" : "http://xmlns.com/foaf/0.1/sha1", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "101", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "unstable", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "sha1", + "undefined" : "sha1sum (hex)" + }, + "domain" : "2", + "comment" : { + "undefined" : "A sha1sum hash, in hex." + }, + "attributes" : [ "datatype" ], + "id" : "112" + }, { + "iri" : "http://xmlns.com/foaf/0.1/firstName", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "24", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "firstName", + "undefined" : "firstName" + }, + "domain" : "12", + "comment" : { + "undefined" : "The first name of a person." + }, + "attributes" : [ "datatype" ], + "id" : "113" + }, { + "iri" : "http://xmlns.com/foaf/0.1/made", + "inverse" : "115", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "18", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "stable", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "made", + "undefined" : "made" + }, + "domain" : "1", + "comment" : { + "undefined" : "Something that was made by this agent." + }, + "attributes" : [ "object" ], + "id" : "114" + }, { + "range" : "60", + "domain" : "2", + "attributes" : [ "anonymous", "object" ], + "id" : "116" + }, { + "range" : "12", + "domain" : "60", + "attributes" : [ "anonymous", "object" ], + "id" : "117" + }, { + "iri" : "http://xmlns.com/foaf/0.1/familyName", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "62", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "familyName", + "undefined" : "familyName" + }, + "domain" : "12", + "comment" : { + "undefined" : "The family name of some person." + }, + "attributes" : [ "datatype" ], + "id" : "119" + }, { + "range" : "2", + "domain" : "11", + "attributes" : [ "anonymous", "object" ], + "id" : "120" + }, { + "range" : "12", + "domain" : "11", + "attributes" : [ "anonymous", "object" ], + "id" : "121" + }, { + "iri" : "http://xmlns.com/foaf/0.1/member", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "1", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "stable", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "member", + "undefined" : "member" + }, + "domain" : "10", + "comment" : { + "undefined" : "Indicates a member of a Group" + }, + "attributes" : [ "object" ], + "id" : "122" + }, { + "iri" : "http://xmlns.com/foaf/0.1/plan", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "27", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "plan", + "undefined" : "plan" + }, + "domain" : "12", + "comment" : { + "undefined" : "A .plan comment, in the tradition of finger and '.plan' files." + }, + "attributes" : [ "datatype" ], + "id" : "123" + }, { + "iri" : "http://xmlns.com/foaf/0.1/mbox", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "18", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "stable", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "mbox", + "undefined" : "personal mailbox" + }, + "domain" : "1", + "comment" : { + "undefined" : "A personal mailbox, ie. an Internet mailbox associated with exactly one owner, the first owner of this mailbox. This is a 'static inverse functional property', in that there is (across time and change) at most one individual that ever has any particular value for foaf:mbox." + }, + "attributes" : [ "inverse functional", "object" ], + "id" : "124" + }, { + "iri" : "http://xmlns.com/foaf/0.1/surname", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "118", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "archaic", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "surname", + "undefined" : "Surname" + }, + "domain" : "12", + "comment" : { + "undefined" : "The surname of some person." + }, + "attributes" : [ "datatype" ], + "id" : "125" + }, { + "iri" : "http://xmlns.com/foaf/0.1/myersBriggs", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "22", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "myersBriggs", + "undefined" : "myersBriggs" + }, + "domain" : "12", + "comment" : { + "undefined" : "A Myers Briggs (MBTI) personality classification." + }, + "attributes" : [ "datatype" ], + "id" : "127" + }, { + "iri" : "http://xmlns.com/foaf/0.1/maker", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "1", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "stable", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "maker", + "undefined" : "maker" + }, + "domain" : "18", + "comment" : { + "undefined" : "An agent that made this thing." + }, + "attributes" : [ "object" ], + "id" : "115" + }, { + "iri" : "http://xmlns.com/foaf/0.1/publications", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "2", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "publications", + "undefined" : "publications" + }, + "domain" : "12", + "comment" : { + "undefined" : "A link to the publications of this person." + }, + "attributes" : [ "object" ], + "id" : "128" + }, { + "iri" : "http://xmlns.com/foaf/0.1/workplaceHomepage", + "baseIri" : "http://xmlns.com/foaf/0.1", + "range" : "2", + "annotations" : { + "isDefinedBy" : [ { + "identifier" : "isDefinedBy", + "language" : "undefined", + "value" : "http://xmlns.com/foaf/0.1/", + "type" : "iri" + } ], + "term_status" : [ { + "identifier" : "term_status", + "language" : "undefined", + "value" : "testing", + "type" : "label" + } ] + }, + "label" : { + "IRI-based" : "workplaceHomepage", + "undefined" : "workplace homepage" + }, + "domain" : "12", + "comment" : { + "undefined" : "A workplace homepage of some person; the homepage of an organization they work for." + }, + "attributes" : [ "object" ], + "id" : "129" + } ] +} \ No newline at end of file diff --git a/cluedo4KG-sources/webvowl/data/ontology.json b/cluedo4KG-sources/webvowl/data/ontology.json new file mode 100644 index 0000000000000000000000000000000000000000..499d582a5cccb60656dbcf22f5f259153becc548 --- /dev/null +++ b/cluedo4KG-sources/webvowl/data/ontology.json @@ -0,0 +1,256 @@ +{ + "_comment" : "Created with OWL2VOWL (version 0.3.5), http://vowl.visualdataweb.org", + "header" : { + "languages" : [ "en", "fr", "undefined" ], + "baseIris" : [ "http://www.w3.org/1999/02/22-rdf-syntax-ns", "http://www.w3.org/2000/01/rdf-schema", "http://www.w3.org/2001/XMLSchema", "https://w3id.org/cluedo4KG/onto" ], + "iri" : "https://w3id.org/cluedo4KG/onto", + "author" : [ "Camille Pradel", "Nathalie Hernandez" ], + "comments" : { + "en" : "This ontology was created for use in the SPARQLUEDO tutorial, which is part of the CLUEDO4KG resource.", + "fr" : "Cette ontologie a �t� cr��e pour �tre utilis�e dans le tutoriel SPARQLUEDO faisant partie de la ressource CLUEDO4KG" + }, + "other" : { + "license" : [ { + "identifier" : "license", + "language" : "undefined", + "value" : "http://creativecommons.org/licenses/by/4.0/", + "type" : "iri" + } ], + "creator" : [ { + "identifier" : "creator", + "language" : "undefined", + "value" : "Nathalie Hernandez", + "type" : "label" + }, { + "identifier" : "creator", + "language" : "undefined", + "value" : "Camille Pradel", + "type" : "label" + } ], + "preferredNamespacePrefix" : [ { + "identifier" : "preferredNamespacePrefix", + "language" : "undefined", + "value" : "cluedonto", + "type" : "label" + } ], + "preferredNamespaceUri" : [ { + "identifier" : "preferredNamespaceUri", + "language" : "undefined", + "value" : "https://w3id.org/cluedo4KG/onto#", + "type" : "iri" + } ], + "issued" : [ { + "identifier" : "issued", + "language" : "undefined", + "value" : "2012-12-01", + "type" : "label" + } ] + } + }, + "namespace" : [ ], + "class" : [ { + "id" : "2", + "type" : "owl:Class" + }, { + "id" : "5", + "type" : "rdfs:Datatype" + }, { + "id" : "6", + "type" : "owl:Thing" + }, { + "id" : "10", + "type" : "owl:Class" + }, { + "id" : "8", + "type" : "owl:Class" + }, { + "id" : "1", + "type" : "owl:Class" + } ], + "classAttribute" : [ { + "iri" : "https://w3id.org/cluedo4KG/onto#Piece", + "baseIri" : "https://w3id.org/cluedo4KG/onto", + "instances" : 0, + "label" : { + "IRI-based" : "Piece", + "en" : "room", + "fr" : "pi�ce" + }, + "id" : "2" + }, { + "iri" : "http://www.w3.org/2001/XMLSchema#boolean", + "baseIri" : "http://www.w3.org/2001/XMLSchema", + "id" : "5", + "label" : { + "IRI-based" : "boolean" + } + }, { + "iri" : "http://www.w3.org/2002/07/owl#Thing", + "baseIri" : "http://owl2vowl.de", + "id" : "6", + "label" : { + "undefined" : "Thing" + } + }, { + "iri" : "https://w3id.org/cluedo4KG/onto#Maison", + "baseIri" : "https://w3id.org/cluedo4KG/onto", + "instances" : 0, + "label" : { + "IRI-based" : "Maison", + "fr" : "maison" + }, + "comment" : { + "en" : "house" + }, + "id" : "10" + }, { + "iri" : "https://w3id.org/cluedo4KG/onto#Objet", + "baseIri" : "https://w3id.org/cluedo4KG/onto", + "instances" : 0, + "label" : { + "IRI-based" : "Objet", + "en" : "object", + "fr" : "objet" + }, + "id" : "8" + }, { + "iri" : "https://w3id.org/cluedo4KG/onto#Personne", + "baseIri" : "https://w3id.org/cluedo4KG/onto", + "instances" : 0, + "label" : { + "IRI-based" : "Personne", + "en" : "person", + "fr" : "personne" + }, + "id" : "1" + } ], + "property" : [ { + "id" : "0", + "type" : "owl:objectProperty" + }, { + "id" : "4", + "type" : "owl:datatypeProperty" + }, { + "id" : "3", + "type" : "owl:objectProperty" + }, { + "id" : "7", + "type" : "owl:objectProperty" + }, { + "id" : "9", + "type" : "owl:objectProperty" + }, { + "id" : "11", + "type" : "owl:objectProperty" + }, { + "id" : "12", + "type" : "owl:objectProperty" + }, { + "id" : "13", + "type" : "owl:objectProperty" + } ], + "propertyAttribute" : [ { + "iri" : "https://w3id.org/cluedo4KG/onto#personneDansPiece", + "inverse" : "3", + "baseIri" : "https://w3id.org/cluedo4KG/onto", + "range" : "2", + "label" : { + "IRI-based" : "personneDansPiece", + "en" : "person in room", + "fr" : "personne dans pi�ce" + }, + "domain" : "1", + "attributes" : [ "object" ], + "id" : "0" + }, { + "iri" : "https://w3id.org/cluedo4KG/onto#estVivant", + "baseIri" : "https://w3id.org/cluedo4KG/onto", + "range" : "5", + "label" : { + "IRI-based" : "estVivant", + "en" : "is alive", + "fr" : "est vivant" + }, + "domain" : "1", + "comment" : { + "en" : "indicates whether a person is alive (True) or dead (False)", + "fr" : "indique si une personne est vivante (True) ou morte (False)" + }, + "attributes" : [ "datatype" ], + "id" : "4" + }, { + "iri" : "https://w3id.org/cluedo4KG/onto#pieceContientPersonne", + "baseIri" : "https://w3id.org/cluedo4KG/onto", + "range" : "1", + "label" : { + "IRI-based" : "pieceContientPersonne", + "en" : "room contains person", + "fr" : "pi�ce contient personne" + }, + "domain" : "2", + "attributes" : [ "object" ], + "id" : "3" + }, { + "iri" : "https://w3id.org/cluedo4KG/onto#pieceContientObjet", + "baseIri" : "https://w3id.org/cluedo4KG/onto", + "range" : "8", + "label" : { + "IRI-based" : "pieceContientObjet", + "en" : "room contains object", + "fr" : "pi�ce contient objet" + }, + "domain" : "2", + "attributes" : [ "object" ], + "id" : "7" + }, { + "iri" : "https://w3id.org/cluedo4KG/onto#objetDansPiece", + "inverse" : "7", + "baseIri" : "https://w3id.org/cluedo4KG/onto", + "range" : "2", + "label" : { + "IRI-based" : "objetDansPiece", + "en" : "object in room", + "fr" : "objet dans pi�ce" + }, + "domain" : "8", + "attributes" : [ "object" ], + "id" : "9" + }, { + "iri" : "https://w3id.org/cluedo4KG/onto#pieceDansMaison", + "baseIri" : "https://w3id.org/cluedo4KG/onto", + "range" : "6", + "label" : { + "IRI-based" : "pieceDansMaison", + "en" : "room in house", + "fr" : "pi�ce dans maison" + }, + "domain" : "6", + "attributes" : [ "object" ], + "id" : "11" + }, { + "iri" : "https://w3id.org/cluedo4KG/onto#aPourPieceVoisine", + "baseIri" : "https://w3id.org/cluedo4KG/onto", + "range" : "2", + "label" : { + "IRI-based" : "aPourPieceVoisine", + "en" : "has as neighbour room", + "fr" : "a pour pi�ce voisine" + }, + "domain" : "2", + "attributes" : [ "symmetric", "object" ], + "id" : "12" + }, { + "iri" : "https://w3id.org/cluedo4KG/onto#maisonContientPiece", + "inverse" : "11", + "baseIri" : "https://w3id.org/cluedo4KG/onto", + "range" : "2", + "label" : { + "IRI-based" : "maisonContientPiece", + "en" : "house contains room", + "fr" : "maison contient pi�ce" + }, + "domain" : "10", + "attributes" : [ "object" ], + "id" : "13" + } ] +} \ No newline at end of file diff --git a/cluedo4KG-sources/webvowl/data/template.json b/cluedo4KG-sources/webvowl/data/template.json new file mode 100644 index 0000000000000000000000000000000000000000..003d011fec70c189180146bd205436100a76720d --- /dev/null +++ b/cluedo4KG-sources/webvowl/data/template.json @@ -0,0 +1,163 @@ +{ + "namespace": [ + { + "name": "", + "iri": "" + } + ], + "header": { + "languages": [ + "all", + "occurring", + "languages" + ], + "title": { + "language": "label" + }, + "iri": "", + "version": "", + "author": [ + "Author One", + "Author Two" + ], + "description": { + "language": "label" + }, + "other": { + "someIdentifier": [ + { + "identifier": "someIdentifier", + "language": "undefined", + "value": "http://an.iri/", + "type": "iri" + } + ], + "someOtherIdentifier": [ + { + "identifier": "someOtherIdentifier", + "language": "undefined", + "value": "Some person", + "type": "label" + } + ] + } + }, + "metrics": { + "classCount": 40, + "datatypeCount": 13, + "objectPropertyCount": 23, + "datatypePropertyCount": 13, + "propertyCount": 36, + "nodeCount": 53, + "axiomCount": 216, + "individualCount": 8 + }, + "class": [ + { + "id": "", + "type": "" + } + ], + "classAttribute": [ + { + "id": "", + "label": "", + "iri": "", + "individuals": [ + { + "iri": "", + "labels": { + "language": "label" + }, + "annotations": {} + } + ], + "comment": "", + "equivalent": [ + "" + ], + "union": [ + "" + ], + "intersection": [ + "" + ], + "complement": [ + "" + ], + "attributes": [ + "deprecated", + "external", + "datatype", + "object", + "rdf" + ] + } + ], + "datatype": [ + { + "id": "", + "type": "" + } + ], + "datatypeAttribute": [ + { + "id": "", + "label": { + "language": "label" + }, + "iri": "", + "individuals": [ + { + "iri": "", + "labels": { + "language": "label" + }, + "annotations": {} + } + ], + "comment": "", + "equivalent": [ + "" + ] + } + ], + "property": [ + { + "id": "" + } + ], + "propertyAttribute": [ + { + "id": "", + "domain": "", + "range": "", + "inverse": "", + "label": { + "language": "label" + }, + "type": "", + "comment": "", + "cardinality": "", + "minCardinality": "", + "maxCardinality": "", + "subproperty": [ + "" + ], + "equivalent": [ + "" + ], + "attributes": [ + "deprecated", + "external", + "datatype", + "object", + "rdf", + "transitive", + "functional", + "inverse functional", + "symmetric" + ] + } + ] +} diff --git a/cluedo4KG-sources/webvowl/favicon.ico b/cluedo4KG-sources/webvowl/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..a857d51f1c78d8be8fe2103fde3a10b9a72b041b Binary files /dev/null and b/cluedo4KG-sources/webvowl/favicon.ico differ diff --git a/cluedo4KG-sources/webvowl/index.html b/cluedo4KG-sources/webvowl/index.html new file mode 100644 index 0000000000000000000000000000000000000000..7dc5c9f3ed5c0d1397eb59d80e6a6a3d84e08a15 --- /dev/null +++ b/cluedo4KG-sources/webvowl/index.html @@ -0,0 +1,514 @@ +<!DOCTYPE html> +<html lang="en-us"> + +<head> + <meta charset="utf-8" /> + <meta name="author" content="Vincent Link, Steffen Lohmann, Eduard Marbach, Stefan Negru, Vitalis Wiens" /> + <meta name="keywords" content="webvowl, vowl, visual notation, web ontology language, owl, rdf, ontology visualization, ontologies, semantic web" /> + <meta name="description" content="WebVOWL - Web-based Visualization of Ontologies" /> + <meta name="robots" content="noindex,nofollow" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> + <meta name="apple-mobile-web-app-capable" content="yes"> + <link rel="stylesheet" type="text/css" href="css/webvowl.css" /> + <link rel="stylesheet" type="text/css" href="css/webvowl.app.css" /> + <link rel="icon" href="favicon.ico" type="image/x-icon" /> + <title>WebVOWL</title> +</head> + +<body> + <main> + <section id="canvasArea"> + <div id="browserCheck" class="hidden"> + WebVOWL does not work properly in Internet Explorer and Microsoft Edge. + Please use another browser, such as + <a href="http://www.mozilla.org/firefox/">Mozilla Firefox</a> + or + <a href="https://www.google.com/chrome/">Google Chrome</a>, + to run WebVOWL. + <label id="killWarning">Hide warning</label> + </div> + + <div id="logo" class="noselect"> + <h2>WebVOWL + <br> <span>1.1.7</span> + </h2> + </div> + + + <div id="loading-info" class="hidden"> + <div id="loading-progress" style="border-radius: 10px;"> + <div class="hidden">Loading ontology...</div> + <div id="layoutLoadingProgressBarContainer" style="padding-bottom: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"> + <h4 id="currentLoadingStep" style="margin: 0;font-style: italic; padding-bottom:0 ; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"> + Layout optimization</h4> + <div id="progressBarContext"> + <div id="progressBarValue" class="busyProgressBar"></div> + </div> + </div> + <div id="loadingInfo_msgBox" style="padding-bottom: 0;padding-top:0"> + <div id="show-loadingInfo-button" class="accordion-trigger noselect">Details</div> + <div id="loadingInfo-container"> + <ul id="bulletPoint_container"></ul> + </div> + </div> + <div> + <span id="loadingIndicator_closeButton" class="">Close Warning</span> + </div> + </div> + </div> + + <div id="additionalInformationContainer"> + <div id="reloadCachedOntology" class="hidden" title=""> + + <svg viewBox="38 -12.5 18 18" class="reloadCachedOntologyIcon btn_shadowed" id="reloadSvgIcon"> + <g> + <text id="svgStringText" dx="5px" dy="-1px" style="font-size:9px;">Reload ontology</text> + <path style="fill : #444; stroke-width:0;" d="m 42.277542,5.1367119 c -5.405,0 -10.444,1.577 -14.699,4.282 l -5.75,-5.75 0,16.1100001 16.11,0 -6.395,-6.395 c 3.18,-1.787 6.834,-2.82 10.734,-2.82 12.171,0 22.073,9.902 22.073,22.074 0,2.899 -0.577,5.664 -1.599,8.202 l 4.738,2.762 c 1.47,-3.363 2.288,-7.068 2.288,-10.964 0,-15.164 -12.337,-27.5010001 -27.5,-27.5010001 m 11.5,46.7460001 c -3.179,1.786 -6.826,2.827 -10.726,2.827 -12.171,0 -22.073,-9.902 -22.073,-22.073 0,-2.739 0.524,-5.35 1.439,-7.771 l -4.731,-2.851 c -1.375,3.271 -2.136,6.858 -2.136,10.622 0,15.164 12.336,27.5 27.5,27.5 5.406,0 10.434,-1.584 14.691,-4.289 l 5.758,5.759 0,-16.112 -16.111,0 6.389,6.388 z" transform="matrix(0.20,0,0,0.20,75,-10)"> + </path> + </g> + </svg> + <span id="reloadCachedOntologyString" class="noselect" style="font-style: italic;font-size: 10px">Loaded cached ontology</span> + </div> + + <div id="FPS_Statistics" class="hidden debugOption">FPS: 0<br>Nodes: 0<br>Links: 0</div> + <span class="hidden debugOption" id="modeOfOperationString">mode of operation</span> + + </div> + + <div id="graph"></div> + + <div id="dragDropContainer" class="hidden"> + <div id="drag_dropOverlay"></div> + + <div id="drag_msg"> + <svg id="drag_svg" style="position: absolute; left:25%;top:25%;width:50%; height:50%"> + <g id="drag_icon_group"> + <path id="drag_icon" style="fill : #444; stroke-width:0;" d="m 9.0000002,-8.9899999 -18.0000001,0 c -1.1000001,0 -1.9999991,0.9 -1.9999991,2 l 0,3.99 1.9999991,0 0,-4.01 18.0000001,0 0,14.0299996 -18.0000001,0 0,-4.02 -1.9999991,0 0,4.01 c 0,1.1 0.899999,1.98 1.9999991,1.98 l 18.0000001,0 c 1.1000008,0 2.0000008,-0.88 2.0000008,-1.98 l 0,-13.9999996 c 0,-1.11 -0.9,-2 -2.0000008,-2 z M -1,3.9999997 3.0000001,-3.3898305e-7 -1,-3.9999999 l 0,2.9999996 -9.999999,0 0,1.99999996 9.999999,0 0,3.00000004 z" transform="matrix(5.0,0,0,5.0,0,0)"> + </path> + <path id="drag_icon_drop" class="hidden" style="fill : #444; stroke-width:0;" d="m 8.9900008,8.9999991 0,-18.0000001 c 0,-1.1 -0.9,-1.999999 -2,-1.999999 l -3.99,0 0,1.999999 4.01,0 0,18.0000001 -14.0299996,0 0,-18.0000001 4.02,0 0,-1.999999 -4.01,0 c -1.1,0 -1.98,0.899999 -1.98,1.999999 l 0,18.0000001 c 0,1.1000009 0.88,2.0000009 1.98,2.0000009 l 13.9999996,0 c 1.11,0 2,-0.9 2,-2.0000009 z M -3.9999988,-1.0000011 1.2389831e-6,2.999999 4.0000008,-1.0000011 l -2.9999996,0 0,-9.9999989 -1.99999996,0 0,9.9999989 -3.00000004,0 z" transform="matrix(5.0,0,0,5.0,0,0)"> + </path> + </g> + </svg> + <span id="drag_msg_text" style="font-size:14px">Drag ontology file here.</span> + </div> + </div> + <div class="noselect"> + <span id="leftSideBarCollapseButton" class="btn_shadowed hidden"> > </span> + </div> + <div class="noselect"><span id="sidebarExpandButton" class="btn_shadowed"> > </span></div> + + <div id="containerForLeftSideBar"> + <div id="leftSideBar"> + <div id="leftSideBarContent" class="hidden"> + <h2 id="leftHeader">Default Element</h2> + <h3 class=" selectedDefaultElement accordion-trigger noselect accordion-trigger-active" id="defaultClass" title="owl:Class">Class: owl:Class + </h3> + <div id="classContainer" class="accordion-container "> + </div> + <h3 class="selectedDefaultElement accordion-trigger noselect accordion-trigger-active" title="owl:objectProperty" id="defaultProperty">Property: owl:objectProperty + </h3> + <div id="propertyContainer" class="accordion-container "> + </div> + <h3 class="selectedDefaultElement accordion-trigger noselect accordion-trigger-active" title="rdfs:Literal" id="defaultDatatype">Datatype: rdfs:Literal + </h3> + <div id="datatypeContainer" class="accordion-container "> + </div> + </div> + </div> + </div> + <div id="menuContainer"> + <!--Ontology Menu--> + <ul id="m_select" class="toolTipMenu noselect"> + <li><a href="#foaf" id="foaf">Friend of a Friend (FOAF) vocabulary</a></li> + <li><a href="#goodrelations" id="goodrelations">GoodRelations Vocabulary for E-Commerce</a></li> + <li><a href="#muto" id="muto">Modular and Unified Tagging Ontology (MUTO)</a></li> + <li><a href="#ontovibe" id="ontovibe">Ontology Visualization Benchmark (OntoViBe)</a></li> + <li><a href="#personasonto" id="personasonto">Personas Ontology (PersonasOnto)</a></li> + <li><a href="#sioc" id="sioc">SIOC (Semantically-Interlinked Online Communities) Core Ontology</a></li> + + + <li class="option" id="converter-option"> + <form class="converter-form" id="iri-converter-form"> + <label for="iri-converter-input">Custom Ontology:</label> + + <input type="text" id="iri-converter-input" placeholder="Enter ontology IRI"> + <button type="submit" id="iri-converter-button" disabled>Visualize</button> + </form> + <div class="converter-form"> + <input class="hidden" type="file" id="file-converter-input" autocomplete="off"> + <label class="truncate" id="file-converter-label" for="file-converter-input">Select ontology + file</label> + <button type="submit" id="file-converter-button" disabled> + Upload + </button> + + </div> + <div id="emptyContainer"> + <a href="#opts=editorMode=true;#new_ontology1" id="empty" style="pointer-events:none; padding-left:0">Create new ontology</a> + </div> + <div> + <!--<button class="debugOption" type="submit" id="direct-text-input">--> + <!--Direct input--> + <!--</button>--> + </div> + </li> + + </ul> + <!--Export Menu--> + <ul id="m_export" class="toolTipMenu noselect"> + <li><a href="#" download id="exportJson">Export as JSON</a></li> + <li><a href="#" download id="exportSvg">Export as SVG</a></li> + <li><a href="#" download id="exportTex">Export as TeX <label style="font-size: 10px">(alpha)</label></a> + </li> + <li><a href="#" download id="exportTurtle">Export as TTL <label style="font-size: 10px">(alpha)</label></a> + </li> + + <li class="option" id="emptyLiHover"> + <div> + <form class="converter-form" id="url-copy-form"> + <label for="exportedUrl">Export as URL:</label> + <input type="text" id="exportedUrl" placeholder="#"> + <button id="copyBt" title="Copy to clipboard">Copy</button> + </form> + </div> + </li> + </ul> + <!--Filter Menu--> + <ul id="m_filter" class="toolTipMenu noselect"> + <li class="toggleOption" id="datatypeFilteringOption"></li> + <li class="toggleOption" id="objectPropertyFilteringOption"></li> + <li class="toggleOption" id="subclassFilteringOption"></li> + <li class="toggleOption" id="disjointFilteringOption"></li> + <li class="toggleOption" id="setOperatorFilteringOption"></li> + <li class="slideOption" id="nodeDegreeFilteringOption"></li> + </ul> + <!--Options Menu --> + <ul id="m_config" class="toolTipMenu noselect"> + <li class="toggleOption" id="zoomSliderOption"></li> + + <li class="slideOption" id="classSliderOption"></li> + <li class="slideOption" id="datatypeSliderOption"></li> + <li class="toggleOption" id="dynamicLabelWidth"></li> + <li class="slideOption" id="maxLabelWidthSliderOption"></li> + <li class="toggleOption" id="nodeScalingOption"></li> + <li class="toggleOption" id="compactNotationOption"></li> + <li class="toggleOption" id="colorExternalsOption"></li> + </ul> + <!--Modes Menu --> + <ul id="m_modes" class="toolTipMenu noselect"> + <li class="toggleOption" id="editMode"></li> + <li class="toggleOption" id="pickAndPinOption"></li> + </ul> + + <!--Debug Menu --> + <ul id="m_debug" class="toolTipMenu noselect"> + <li class=" toggleOption" id="useAccuracyHelper"></li> + <li class=" toggleOption" id="showDraggerObject"></li> + <li class=" toggleOption" id="showFPS_Statistics"></li> + <li class=" toggleOption" id="showModeOfOperation"></li> + </ul> + + + <!--About Menu--> + <ul id="m_about" class="toolTipMenu"> + <li><a href="license.txt" target="_blank">MIT License © 2014-2019</a></li> + <li id="credits" class="option">WebVOWL Developers:<br /> + Vincent Link, Steffen Lohmann, Eduard Marbach, Stefan Negru, Vitalis Wiens + </li> + <li id="credits" class="option">WIDOCO integration:<br /> Daniel Garijo, Jacobus Geluk + </li> + + <li><a href="http://vowl.visualdataweb.org/webvowl.html#releases" target="_blank">Version: <%= version + %><br />(release history)</a></li> + + <li><a href="http://purl.org/vowl/" target="_blank">VOWL Specification »</a></li> + </ul> + <ul id="m_search" class="toolTipMenu"></ul> + </div> + <div class="noselect" id="swipeBarContainer"> + <ul id="menuElementContainer"> + <li id="c_search" class="inner-addon left-addon"> + <i class="searchIcon"> + <svg viewBox="0 0 24 24" height="100%" width="100%" style="pointer-events: none; display: block;"> + <g> + <path id="magnifyingGlass" style="fill : #666; stroke-width:0;" d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"> + </path> + </g> + </svg> + </i> + <input class="searchInputText" type="text" id="search-input-text" placeholder="Search"> + </li> + <li id="c_locate"> + <a style="padding: 0 8px 5px 8px;" draggable="false" title="Nothing to locate, enter search term." href="#" id="locateSearchResult">⌖ + </a> + </li> + <!-- + <li id="c_select"> + <a draggable="false" href="#"> + <i> + <svg viewBox="0 0 24 24" class="menuElementSvgElement"> + <g> + <path style="fill : #fff; stroke-width:0;" d="M3 15h18v-2H3v2zm0 4h18v-2H3v2zm0-8h18V9H3v2zm0-6v2h18V5H3z" transform="matrix(0.75,0,0,0.75,3.5,2.5)"> + </path> + </g> + </svg> + </i> Ontology</a> + </li>--> + <li id="c_export"><a draggable="false" href="#"> + <i> + <svg viewBox="0 0 24 24" class="menuElementSvgElement"> + <g> + <path style="fill : #fff; stroke-width:0;" d="M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.41L5.83 13H21V7z" transform="matrix(0.75,0,0,0.75,3.5,2.5)"> + </path> + </g> + </svg> + </i> Export</a></li> + <li id="c_filter"><a draggable="false" href="#"> + <i> + <svg viewBox="0 0 24 24" class="menuElementSvgElement"> + <g> + <path style="fill : #fff; stroke-width:0;" d="M3 4l9 16 9-16H3zm3.38 2h11.25L12 16 6.38 6z" transform="matrix(0.75,0,0,0.75,3.5,2.5)"> + </path> + </g> + </svg> + </i>Filter</a></li> + <li id="c_config"><a draggable="false" href="#"> + <i> + <svg viewBox="0 0 24 24" class="menuElementSvgElement"> + <g> + <path style="fill : #fff; stroke-width:0;" d="m 21.163138,13.127428 0,-2.356764 -2.546629,-0.424622 C 18.439272,9.5807939 18.137791,8.8661419 17.733863,8.218291 L 19.2356,6.116978 17.569296,4.450673 15.466841,5.951269 C 14.818953,5.548483 14.104338,5.24586 13.33909,5.067482 l -0.424622,-2.545488 -2.356764,0 -0.424622,2.545488 C 9.3689769,5.24586 8.6531829,5.548519 8.0053319,5.951269 l -2.102455,-1.500596 -1.666304,1.666305 1.501737,2.101313 c -0.403928,0.6467469 -0.705409,1.3625029 -0.882646,2.127751 l -2.546629,0.424622 0,2.356764 2.546629,0.424622 c 0.177237,0.765248 0.478718,1.4799 0.882646,2.127751 l -1.501737,2.102455 1.666304,1.666304 2.103596,-1.501737 c 0.646747,0.403928 1.362504,0.705409 2.1266091,0.882646 l 0.424622,2.546629 2.356764,0 0.424622,-2.546629 c 0.764106,-0.177237 1.4799,-0.478718 2.127751,-0.882646 l 2.102455,1.501737 1.666304,-1.666304 -1.501737,-2.102455 c 0.403928,-0.647888 0.705409,-1.363645 0.882646,-2.127751 l 2.546629,-0.424622 z m -9.427053,3.535144 c -2.6030431,0 -4.7135241,-2.110517 -4.7135241,-4.713527 0,-2.6030071 2.110518,-4.713525 4.7135241,-4.713525 2.60301,0 4.713527,2.1105179 4.713527,4.713525 0,2.60301 -2.110481,4.713527 -4.713527,4.713527 z" transform="matrix(0.75,0,0,0.75,3.5,2.5)"> + </path> + </g> + </svg> + </i>Options</a> + </li> + <li id="c_modes"><a draggable="false" href="#"> + <i> + <svg viewBox="0 0 24 24" class="menuElementSvgElement"> + <g> + <path style="fill : #fff; stroke-width:0;" d="M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z" transform="matrix(0.75,0,0,0.75,3.5,2.5)"> + </path> + </g> + </svg> + </i>Modes</a></li> + <li id="c_reset"><a draggable="false" id="reset-button" href="#" type="reset"> + <i> + <svg viewBox="0 0 24 24" class="menuElementSvgElement"> + <g> + <path style="fill : #fff; stroke-width:0;" d="m 12,5 0,-4 5,5 -5,5 0,-4 c -3.31,0 -6,2.69 -6,6 0,3.31 2.69,6 6,6 3.31,0 6,-2.69 6,-6 l 2,0 c 0,4.42 -3.58,8 -8,8 C 7.58,21 4,17.42 4,13 4,8.58 7.58,5 12,5 Z" transform="matrix(0.75,0,0,0.75,3.5,2.5)"> + </path> + </g> + </svg> + </i>Reset</a></li> + <li id="c_pause"><a draggable="false" id="pause-button" href="#" style="padding: 9px 8px 12px 8px;">Pause</a> + </li> + <li id="c_debug" class="debugOption"><a id="debugMenuHref" draggable="false" href="#"> + <i> + <svg viewBox="0 0 24 24" class="menuElementSvgElement"> + <g> + <path style="fill : #fff; stroke-width:0;" d="M 20,8 17.19,8 C 16.74,7.22 16.12,6.55 15.37,6.04 L 17,4.41 15.59,3 13.42,5.17 C 12.96,5.06 12.49,5 12,5 11.51,5 11.04,5.06 10.59,5.17 L 8.41,3 7,4.41 8.62,6.04 C 7.88,6.55 7.26,7.22 6.81,8 L 4,8 4,10 6.09,10 C 6.04,10.33 6,10.66 6,11 l 0,1 -2,0 0,2 2,0 0,1 c 0,0.34 0.04,0.67 0.09,1 L 4,16 l 0,2 2.81,0 c 1.04,1.79 2.97,3 5.19,3 2.22,0 4.15,-1.21 5.19,-3 l 2.81,0 0,-2 -2.09,0 C 17.96,15.67 18,15.34 18,15 l 0,-1 2,0 0,-2 -2,0 0,-1 c 0,-0.34 -0.04,-0.67 -0.09,-1 L 20,10 Z m -4,4 0,3 c 0,0.22 -0.03,0.47 -0.07,0.7 L 15.83,16.35 15.46,17 C 14.74,18.24 13.42,19 12,19 10.58,19 9.26,18.23 8.54,17 L 8.17,16.36 8.07,15.71 C 8.03,15.47 8,15.22 8,15 L 8,11 C 8,10.78 8.03,10.53 8.07,10.3 L 8.17,9.65 8.54,9 C 8.84,8.48 9.26,8.03 9.75,7.69 L 10.32,7.3 11.06,7.12 C 11.37,7.04 11.69,7 12,7 c 0.32,0 0.63,0.04 0.95,0.12 l 0.68,0.16 0.61,0.42 c 0.5,0.34 0.91,0.78 1.21,1.31 l 0.38,0.65 0.1,0.65 C 15.97,10.53 16,10.78 16,11 Z" transform="matrix(0.75,0,0,0.75,3.5,2.5)"> + </path> + </g> + </svg> + </i> + Debug</a></li> + <li id="c_about"><a draggable="false" href="#"> + <i> + <svg viewBox="0 0 24 24" class="menuElementSvgElement"> + <g> + <path style="fill : #fff; stroke-width:0;" d="m 10.08,10.86 c 0.05,-0.33 0.16,-0.62 0.3,-0.87 0.14,-0.25 0.34,-0.46 0.59,-0.62 0.24,-0.15 0.54,-0.22 0.91,-0.23 0.23,0.01 0.44,0.05 0.63,0.13 0.2,0.09 0.38,0.21 0.52,0.36 0.14,0.15 0.25,0.33 0.34,0.53 0.09,0.2 0.13,0.42 0.14,0.64 l 1.79,0 C 15.28,10.33 15.19,9.9 15.02,9.51 14.85,9.12 14.62,8.78 14.32,8.5 14.02,8.22 13.66,8 13.24,7.84 12.82,7.68 12.36,7.61 11.85,7.61 11.2,7.61 10.63,7.72 10.15,7.95 9.67,8.18 9.27,8.48 8.95,8.87 8.63,9.26 8.39,9.71 8.24,10.23 8.09,10.75 8,11.29 8,11.87 l 0,0.27 c 0,0.58 0.08,1.12 0.23,1.64 0.15,0.52 0.39,0.97 0.71,1.35 0.32,0.38 0.72,0.69 1.2,0.91 0.48,0.22 1.05,0.34 1.7,0.34 0.47,0 0.91,-0.08 1.32,-0.23 0.41,-0.15 0.77,-0.36 1.08,-0.63 0.31,-0.27 0.56,-0.58 0.74,-0.94 0.18,-0.36 0.29,-0.74 0.3,-1.15 l -1.79,0 c -0.01,0.21 -0.06,0.4 -0.15,0.58 -0.09,0.18 -0.21,0.33 -0.36,0.46 -0.15,0.13 -0.32,0.23 -0.52,0.3 -0.19,0.07 -0.39,0.09 -0.6,0.1 C 11.5,14.86 11.2,14.79 10.97,14.64 10.72,14.48 10.52,14.27 10.38,14.02 10.24,13.77 10.13,13.47 10.08,13.14 10.03,12.81 10,12.47 10,12.14 l 0,-0.27 c 0,-0.35 0.03,-0.68 0.08,-1.01 z M 12,2 C 6.48,2 2,6.48 2,12 2,17.52 6.48,22 12,22 17.52,22 22,17.52 22,12 22,6.48 17.52,2 12,2 Z m 0,18 C 7.59,20 4,16.41 4,12 4,7.59 7.59,4 12,4 c 4.41,0 8,3.59 8,8 0,4.41 -3.59,8 -8,8 z" transform="matrix(0.75,0,0,0.75,3.5,2.5)"> + </path> + </g> + </svg> + </i> + About</a></li> + </ul> + </div> + <div class="noselect" id="scrollRightButton"></div> + <div class="noselect" id="scrollLeftButton"></div> + <div id="zoomSlider" class="btn_shadowed"> + <p class="noselect" id="centerGraphButton">⌖</p> + <p class="noselect" id="zoomInButton">+</p> + <p class="noselect" id="zoomSliderParagraph"></p> + <p class="noselect" id="zoomOutButton">-</p> + </div> + </section> + <aside id="detailsArea" style="background-color: #18202A;"> + <section id="generalDetailsEdit" class="hidden"> + <h1 id="editHeader" style="font-size: 1.1em;">Editing Options</h1> + <h3 class="accordion-trigger noselect accordion-trigger-active">Ontology</h3> + <div> + <!--begin of ontology metaData --> + <div class="textLineEditWithLabel"> + <form class="converter-form-Editor " id="titleEditForm"> + <label class="EditLabelForInput" id="titleEditor-label" for="titleEditor" title="Ontology title as dc:title">Title:</label> + <input class="modifiedInputStyle" type="text" id="titleEditor" autocomplete="off" value=""> + </form> + </div> + <div class="textLineEditWithLabel"> + <form class="converter-form-Editor " id="iriEditForm"> + <label class="EditLabelForInput" id="iriEditor-label" for="iriEditor">IRI:</label> + <input type="text" id="iriEditor" autocomplete="off" value=""> + </form> + </div> + <div class="textLineEditWithLabel"> + <form class="converter-form-Editor " id="versionEditForm"> + <label class="EditLabelForInput" id="versionEditor-label" for="versionEditor" title="Ontology version number as owl:versionInfo">Version:</label> + <input type="text" id="versionEditor" value="" autocomplete="off"> + </form> + </div> + <div class="textLineEditWithLabel"> + <form class="converter-form-Editor " id="authorsEditForm"> + <label class="EditLabelForInput" id="authorsEditor-label" for="authorsEditor" title="Ontology authors as dc:creator">Authors:</label> + <input type="text" id="authorsEditor" value="" autocomplete="off"> + </form> + </div> + <h4 class="subAccordion accordion-trigger noselect">Prefix</h4> + <div class="subAccordionDescription" id="containerForPrefixURL"> + <div id="prefixURL_Description"> + <span class="boxed ">Prefix</span> + <span class="boxed">IRI</span> + </div> + <div id="prefixURL_Container"></div> + <div align="center" id="containerForAddPrefixButton"> + <button id="addPrefixButton">Add Prefix</button> + </div> + </div> + </div> + <!--end of ontology metaData --> + + <h3 class="accordion-trigger noselect">Description</h3> + <div> + <textarea rows="4" cols="25" title="Ontology description as dc:description" class="descriptionTextClass" id="descriptionEditor"></textarea> + </div> + <h3 class="accordion-trigger noselect accordion-trigger-active">Selected Element</h3> + <div> + <div id="selectedElementProperties" class="hidden"> + <div class="textLineEditWithLabel"> + <form class="converter-form-Editor " id="element_iriEditForm"> + <label class="EditLabelForInput" id="element_iriEditor-label" for="element_iriEditor">IRI:</label> + <input type="text" id="element_iriEditor" autocomplete="off" value=""> + </form> + </div> + <div class="textLineEditWithLabel"> + <form class="converter-form-Editor " id="element_labelEditForm"> + <label class="EditLabelForInput" id="element_labelEditor-label" for="element_labelEditor">Label:</label> + <input type="text" id="element_labelEditor" autocomplete="off" value=""> + </form> + </div> + <div class="textLineEditWithLabel"> + <form class="converter-form-Editor" id="typeEditForm"> + <label class="EditLabelForInput" id="typeEditor-label" for="typeEditor">Type:</label> + <select id="typeEditor" class="dropdownMenuClass"></select> + </form> + <form class="converter-form-Editor" id="typeEditForm_datatype"> + <label class="EditLabelForInput" id="typeEditor_datatype-label" for="typeEditor_datatype">Datatype:</label> + <select id="typeEditor_datatype" class="dropdownMenuClass"></select> + </form> + </div> + <div class="textLineEditWithLabel" id="property_characteristics_Container"> Characteristics: + <div id="property_characteristics_Selection" style="padding-top:2px;"></div> + </div> + + </div> + <div id="selectedElementPropertiesEmptyHint"> + Select an element in the visualization. + </div> + </div> + + </section> + <section id="generalDetails" class="hidden"> + <h1 id="title"></h1> + <span><a id="about" href=""></a></span> + <h5>Version: <span id="version"></span></h5> + <h5>Author(s): <span id="authors"></span></h5> + <h5> + <label>Language: <select id="language" name="language" size="1"></select></label> + </h5> + <h3 class="accordion-trigger noselect accordion-trigger-active">Description</h3> + <div class="accordion-container scrollable"> + <p id="description"></p> + </div> + <h3 class="accordion-trigger noselect">Metadata</h3> + <div id="ontology-metadata" class="accordion-container"></div> + <h3 class="accordion-trigger noselect">Statistics</h3> + <div class="accordion-container"> + <p class="statisticDetails">Classes: <span id="classCount"></span></p> + <p class="statisticDetails">Object prop.: <span id="objectPropertyCount"></span></p> + <p class="statisticDetails">Datatype prop.: <span id="datatypePropertyCount"></span></p> + <div class="small-whitespace-separator"></div> + <p class="statisticDetails">Individuals: <span id="individualCount"></span></p> + <div class="small-whitespace-separator"></div> + <p class="statisticDetails">Nodes: <span id="nodeCount"></span></p> + <p class="statisticDetails">Edges: <span id="edgeCount"></span></p> + </div> + <h3 class="accordion-trigger noselect" id="selection-details-trigger">Selection Details</h3> + <div class="accordion-container" id="selection-details"> + <div id="classSelectionInformation" class="hidden"> + <p class="propDetails">Name: <span id="name"></span></p> + <p class="propDetails">Type: <span id="typeNode"></span></p> + <p class="propDetails">Equiv.: <span id="classEquivUri"></span></p> + <p class="propDetails">Disjoint: <span id="disjointNodes"></span></p> + <p class="propDetails">Charac.: <span id="classAttributes"></span></p> + <p class="propDetails">Individuals: <span id="individuals"></span></p> + <p class="propDetails">Description: <span id="nodeDescription"></span></p> + <p class="propDetails">Comment: <span id="nodeComment"></span></p> + </div> + <div id="propertySelectionInformation" class="hidden"> + <p class="propDetails">Name: <span id="propname"></span></p> + <p class="propDetails">Type: <span id="typeProp"></span></p> + <p id="inverse" class="propDetails">Inverse: <span></span></p> + <p class="propDetails">Domain: <span id="domain"></span></p> + <p class="propDetails">Range: <span id="range"></span></p> + <p class="propDetails">Subprop.: <span id="subproperties"></span></p> + <p class="propDetails">Superprop.: <span id="superproperties"></span></p> + <p class="propDetails">Equiv.: <span id="propEquivUri"></span></p> + <p id="infoCardinality" class="propDetails">Cardinality: <span></span></p> + <p id="minCardinality" class="propDetails">Min. cardinality: <span></span></p> + <p id="maxCardinality" class="propDetails">Max. cardinality: <span></span></p> + <p class="propDetails">Charac.: <span id="propAttributes"></span></p> + <p class="propDetails">Description: <span id="propDescription"></span></p> + <p class="propDetails">Comment: <span id="propComment"></span></p> + </div> + <div id="noSelectionInformation"> + <p><span>Select an element in the visualization.</span></p> + </div> + </div> + </section> + </aside> + <div id="blockGraphInteractions" class="hidden"></div> + <div id="WarningErrorMessagesContainer" class=""> + <div id="WarningErrorMessages" class=""> + </div> + </div> + + <div id="DirectInputContent" class="hidden"> + <div id="direct-text-input-container"> + <textarea rows="4" cols="25" title="Direct Text input as JSON(experimental)" class="directTextInputStyle" id="directInputTextArea"></textarea> + <div id="di_controls"> + <ul> + <li> + <button id="directUploadBtn">Upload</button> + </li> + <li> + <button id="close_directUploadBtn">Close</button> + </li> + <li id="Error_onLoad" class="hidden">Some text if ERROR</li> + </ul> + </div> + </div> + + + </div> + + + </main> + <script src="js/d3.min.js"></script> + <script src="js/webvowl.js"></script> + <script src="js/webvowl.app.js"></script> + <script> + window.onload = webvowl.app().initialize; + </script> +</body> + +</html> diff --git a/cluedo4KG-sources/webvowl/js/d3.min.js b/cluedo4KG-sources/webvowl/js/d3.min.js new file mode 100644 index 0000000000000000000000000000000000000000..166487309a774a196d29b52ad29f14d8a16f9509 --- /dev/null +++ b/cluedo4KG-sources/webvowl/js/d3.min.js @@ -0,0 +1,5 @@ +!function(){function n(n){return n&&(n.ownerDocument||n.document||n).documentElement}function t(n){return n&&(n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView)}function e(n,t){return t>n?-1:n>t?1:n>=t?0:NaN}function r(n){return null===n?NaN:+n}function i(n){return!isNaN(n)}function u(n){return{left:function(t,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);i>r;){var u=r+i>>>1;n(t[u],e)<0?r=u+1:i=u}return r},right:function(t,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);i>r;){var u=r+i>>>1;n(t[u],e)>0?i=u:r=u+1}return r}}}function o(n){return n.length}function a(n){for(var t=1;n*t%1;)t*=10;return t}function l(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function c(){this._=Object.create(null)}function f(n){return(n+="")===bo||n[0]===_o?_o+n:n}function s(n){return(n+="")[0]===_o?n.slice(1):n}function h(n){return f(n)in this._}function p(n){return(n=f(n))in this._&&delete this._[n]}function g(){var n=[];for(var t in this._)n.push(s(t));return n}function v(){var n=0;for(var t in this._)++n;return n}function d(){for(var n in this._)return!1;return!0}function y(){this._=Object.create(null)}function m(n){return n}function M(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function x(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e=0,r=wo.length;r>e;++e){var i=wo[e]+t;if(i in n)return i}}function b(){}function _(){}function w(n){function t(){for(var t,r=e,i=-1,u=r.length;++i<u;)(t=r[i].on)&&t.apply(this,arguments);return n}var e=[],r=new c;return t.on=function(t,i){var u,o=r.get(t);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,u=e.indexOf(o)).concat(e.slice(u+1)),r.remove(t)),i&&e.push(r.set(t,{on:i})),n)},t}function S(){ao.event.preventDefault()}function k(){for(var n,t=ao.event;n=t.sourceEvent;)t=n;return t}function N(n){for(var t=new _,e=0,r=arguments.length;++e<r;)t[arguments[e]]=w(t);return t.of=function(e,r){return function(i){try{var u=i.sourceEvent=ao.event;i.target=n,ao.event=i,t[i.type].apply(e,r)}finally{ao.event=u}}},t}function E(n){return ko(n,Co),n}function A(n){return"function"==typeof n?n:function(){return No(n,this)}}function C(n){return"function"==typeof n?n:function(){return Eo(n,this)}}function z(n,t){function e(){this.removeAttribute(n)}function r(){this.removeAttributeNS(n.space,n.local)}function i(){this.setAttribute(n,t)}function u(){this.setAttributeNS(n.space,n.local,t)}function o(){var e=t.apply(this,arguments);null==e?this.removeAttribute(n):this.setAttribute(n,e)}function a(){var e=t.apply(this,arguments);null==e?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,e)}return n=ao.ns.qualify(n),null==t?n.local?r:e:"function"==typeof t?n.local?a:o:n.local?u:i}function L(n){return n.trim().replace(/\s+/g," ")}function q(n){return new RegExp("(?:^|\\s+)"+ao.requote(n)+"(?:\\s+|$)","g")}function T(n){return(n+"").trim().split(/^|\s+/)}function R(n,t){function e(){for(var e=-1;++e<i;)n[e](this,t)}function r(){for(var e=-1,r=t.apply(this,arguments);++e<i;)n[e](this,r)}n=T(n).map(D);var i=n.length;return"function"==typeof t?r:e}function D(n){var t=q(n);return function(e,r){if(i=e.classList)return r?i.add(n):i.remove(n);var i=e.getAttribute("class")||"";r?(t.lastIndex=0,t.test(i)||e.setAttribute("class",L(i+" "+n))):e.setAttribute("class",L(i.replace(t," ")))}}function P(n,t,e){function r(){this.style.removeProperty(n)}function i(){this.style.setProperty(n,t,e)}function u(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(n):this.style.setProperty(n,r,e)}return null==t?r:"function"==typeof t?u:i}function U(n,t){function e(){delete this[n]}function r(){this[n]=t}function i(){var e=t.apply(this,arguments);null==e?delete this[n]:this[n]=e}return null==t?e:"function"==typeof t?i:r}function j(n){function t(){var t=this.ownerDocument,e=this.namespaceURI;return e===zo&&t.documentElement.namespaceURI===zo?t.createElement(n):t.createElementNS(e,n)}function e(){return this.ownerDocument.createElementNS(n.space,n.local)}return"function"==typeof n?n:(n=ao.ns.qualify(n)).local?e:t}function F(){var n=this.parentNode;n&&n.removeChild(this)}function H(n){return{__data__:n}}function O(n){return function(){return Ao(this,n)}}function I(n){return arguments.length||(n=e),function(t,e){return t&&e?n(t.__data__,e.__data__):!t-!e}}function Y(n,t){for(var e=0,r=n.length;r>e;e++)for(var i,u=n[e],o=0,a=u.length;a>o;o++)(i=u[o])&&t(i,o,e);return n}function Z(n){return ko(n,qo),n}function V(n){var t,e;return function(r,i,u){var o,a=n[u].update,l=a.length;for(u!=e&&(e=u,t=0),i>=t&&(t=i+1);!(o=a[t])&&++t<l;);return o}}function X(n,t,e){function r(){var t=this[o];t&&(this.removeEventListener(n,t,t.$),delete this[o])}function i(){var i=l(t,co(arguments));r.call(this),this.addEventListener(n,this[o]=i,i.$=e),i._=t}function u(){var t,e=new RegExp("^__on([^.]+)"+ao.requote(n)+"$");for(var r in this)if(t=r.match(e)){var i=this[r];this.removeEventListener(t[1],i,i.$),delete this[r]}}var o="__on"+n,a=n.indexOf("."),l=$;a>0&&(n=n.slice(0,a));var c=To.get(n);return c&&(n=c,l=B),a?t?i:r:t?b:u}function $(n,t){return function(e){var r=ao.event;ao.event=e,t[0]=this.__data__;try{n.apply(this,t)}finally{ao.event=r}}}function B(n,t){var e=$(n,t);return function(n){var t=this,r=n.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||e.call(t,n)}}function W(e){var r=".dragsuppress-"+ ++Do,i="click"+r,u=ao.select(t(e)).on("touchmove"+r,S).on("dragstart"+r,S).on("selectstart"+r,S);if(null==Ro&&(Ro="onselectstart"in e?!1:x(e.style,"userSelect")),Ro){var o=n(e).style,a=o[Ro];o[Ro]="none"}return function(n){if(u.on(r,null),Ro&&(o[Ro]=a),n){var t=function(){u.on(i,null)};u.on(i,function(){S(),t()},!0),setTimeout(t,0)}}}function J(n,e){e.changedTouches&&(e=e.changedTouches[0]);var r=n.ownerSVGElement||n;if(r.createSVGPoint){var i=r.createSVGPoint();if(0>Po){var u=t(n);if(u.scrollX||u.scrollY){r=ao.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var o=r[0][0].getScreenCTM();Po=!(o.f||o.e),r.remove()}}return Po?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(n.getScreenCTM().inverse()),[i.x,i.y]}var a=n.getBoundingClientRect();return[e.clientX-a.left-n.clientLeft,e.clientY-a.top-n.clientTop]}function G(){return ao.event.changedTouches[0].identifier}function K(n){return n>0?1:0>n?-1:0}function Q(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function nn(n){return n>1?0:-1>n?Fo:Math.acos(n)}function tn(n){return n>1?Io:-1>n?-Io:Math.asin(n)}function en(n){return((n=Math.exp(n))-1/n)/2}function rn(n){return((n=Math.exp(n))+1/n)/2}function un(n){return((n=Math.exp(2*n))-1)/(n+1)}function on(n){return(n=Math.sin(n/2))*n}function an(){}function ln(n,t,e){return this instanceof ln?(this.h=+n,this.s=+t,void(this.l=+e)):arguments.length<2?n instanceof ln?new ln(n.h,n.s,n.l):_n(""+n,wn,ln):new ln(n,t,e)}function cn(n,t,e){function r(n){return n>360?n-=360:0>n&&(n+=360),60>n?u+(o-u)*n/60:180>n?o:240>n?u+(o-u)*(240-n)/60:u}function i(n){return Math.round(255*r(n))}var u,o;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,e=0>e?0:e>1?1:e,o=.5>=e?e*(1+t):e+t-e*t,u=2*e-o,new mn(i(n+120),i(n),i(n-120))}function fn(n,t,e){return this instanceof fn?(this.h=+n,this.c=+t,void(this.l=+e)):arguments.length<2?n instanceof fn?new fn(n.h,n.c,n.l):n instanceof hn?gn(n.l,n.a,n.b):gn((n=Sn((n=ao.rgb(n)).r,n.g,n.b)).l,n.a,n.b):new fn(n,t,e)}function sn(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new hn(e,Math.cos(n*=Yo)*t,Math.sin(n)*t)}function hn(n,t,e){return this instanceof hn?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof hn?new hn(n.l,n.a,n.b):n instanceof fn?sn(n.h,n.c,n.l):Sn((n=mn(n)).r,n.g,n.b):new hn(n,t,e)}function pn(n,t,e){var r=(n+16)/116,i=r+t/500,u=r-e/200;return i=vn(i)*na,r=vn(r)*ta,u=vn(u)*ea,new mn(yn(3.2404542*i-1.5371385*r-.4985314*u),yn(-.969266*i+1.8760108*r+.041556*u),yn(.0556434*i-.2040259*r+1.0572252*u))}function gn(n,t,e){return n>0?new fn(Math.atan2(e,t)*Zo,Math.sqrt(t*t+e*e),n):new fn(NaN,NaN,n)}function vn(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function dn(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function yn(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function mn(n,t,e){return this instanceof mn?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof mn?new mn(n.r,n.g,n.b):_n(""+n,mn,cn):new mn(n,t,e)}function Mn(n){return new mn(n>>16,n>>8&255,255&n)}function xn(n){return Mn(n)+""}function bn(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function _n(n,t,e){var r,i,u,o=0,a=0,l=0;if(r=/([a-z]+)\((.*)\)/.exec(n=n.toLowerCase()))switch(i=r[2].split(","),r[1]){case"hsl":return e(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return t(Nn(i[0]),Nn(i[1]),Nn(i[2]))}return(u=ua.get(n))?t(u.r,u.g,u.b):(null==n||"#"!==n.charAt(0)||isNaN(u=parseInt(n.slice(1),16))||(4===n.length?(o=(3840&u)>>4,o=o>>4|o,a=240&u,a=a>>4|a,l=15&u,l=l<<4|l):7===n.length&&(o=(16711680&u)>>16,a=(65280&u)>>8,l=255&u)),t(o,a,l))}function wn(n,t,e){var r,i,u=Math.min(n/=255,t/=255,e/=255),o=Math.max(n,t,e),a=o-u,l=(o+u)/2;return a?(i=.5>l?a/(o+u):a/(2-o-u),r=n==o?(t-e)/a+(e>t?6:0):t==o?(e-n)/a+2:(n-t)/a+4,r*=60):(r=NaN,i=l>0&&1>l?0:r),new ln(r,i,l)}function Sn(n,t,e){n=kn(n),t=kn(t),e=kn(e);var r=dn((.4124564*n+.3575761*t+.1804375*e)/na),i=dn((.2126729*n+.7151522*t+.072175*e)/ta),u=dn((.0193339*n+.119192*t+.9503041*e)/ea);return hn(116*i-16,500*(r-i),200*(i-u))}function kn(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function Nn(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}function En(n){return"function"==typeof n?n:function(){return n}}function An(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),Cn(t,e,n,r)}}function Cn(n,t,e,r){function i(){var n,t=l.status;if(!t&&Ln(l)||t>=200&&300>t||304===t){try{n=e.call(u,l)}catch(r){return void o.error.call(u,r)}o.load.call(u,n)}else o.error.call(u,l)}var u={},o=ao.dispatch("beforesend","progress","load","error"),a={},l=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(n)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()},l.onprogress=function(n){var t=ao.event;ao.event=n;try{o.progress.call(u,l)}finally{ao.event=t}},u.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?a[n]:(null==t?delete a[n]:a[n]=t+"",u)},u.mimeType=function(n){return arguments.length?(t=null==n?null:n+"",u):t},u.responseType=function(n){return arguments.length?(c=n,u):c},u.response=function(n){return e=n,u},["get","post"].forEach(function(n){u[n]=function(){return u.send.apply(u,[n].concat(co(arguments)))}}),u.send=function(e,r,i){if(2===arguments.length&&"function"==typeof r&&(i=r,r=null),l.open(e,n,!0),null==t||"accept"in a||(a.accept=t+",*/*"),l.setRequestHeader)for(var f in a)l.setRequestHeader(f,a[f]);return null!=t&&l.overrideMimeType&&l.overrideMimeType(t),null!=c&&(l.responseType=c),null!=i&&u.on("error",i).on("load",function(n){i(null,n)}),o.beforesend.call(u,l),l.send(null==r?null:r),u},u.abort=function(){return l.abort(),u},ao.rebind(u,o,"on"),null==r?u:u.get(zn(r))}function zn(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}function Ln(n){var t=n.responseType;return t&&"text"!==t?n.response:n.responseText}function qn(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now());var i=e+t,u={c:n,t:i,n:null};return aa?aa.n=u:oa=u,aa=u,la||(ca=clearTimeout(ca),la=1,fa(Tn)),u}function Tn(){var n=Rn(),t=Dn()-n;t>24?(isFinite(t)&&(clearTimeout(ca),ca=setTimeout(Tn,t)),la=0):(la=1,fa(Tn))}function Rn(){for(var n=Date.now(),t=oa;t;)n>=t.t&&t.c(n-t.t)&&(t.c=null),t=t.n;return n}function Dn(){for(var n,t=oa,e=1/0;t;)t.c?(t.t<e&&(e=t.t),t=(n=t).n):t=n?n.n=t.n:oa=t.n;return aa=n,e}function Pn(n,t){return t-(n?Math.ceil(Math.log(n)/Math.LN10):1)}function Un(n,t){var e=Math.pow(10,3*xo(8-t));return{scale:t>8?function(n){return n/e}:function(n){return n*e},symbol:n}}function jn(n){var t=n.decimal,e=n.thousands,r=n.grouping,i=n.currency,u=r&&e?function(n,t){for(var i=n.length,u=[],o=0,a=r[0],l=0;i>0&&a>0&&(l+a+1>t&&(a=Math.max(1,t-l)),u.push(n.substring(i-=a,i+a)),!((l+=a+1)>t));)a=r[o=(o+1)%r.length];return u.reverse().join(e)}:m;return function(n){var e=ha.exec(n),r=e[1]||" ",o=e[2]||">",a=e[3]||"-",l=e[4]||"",c=e[5],f=+e[6],s=e[7],h=e[8],p=e[9],g=1,v="",d="",y=!1,m=!0;switch(h&&(h=+h.substring(1)),(c||"0"===r&&"="===o)&&(c=r="0",o="="),p){case"n":s=!0,p="g";break;case"%":g=100,d="%",p="f";break;case"p":g=100,d="%",p="r";break;case"b":case"o":case"x":case"X":"#"===l&&(v="0"+p.toLowerCase());case"c":m=!1;case"d":y=!0,h=0;break;case"s":g=-1,p="r"}"$"===l&&(v=i[0],d=i[1]),"r"!=p||h||(p="g"),null!=h&&("g"==p?h=Math.max(1,Math.min(21,h)):"e"!=p&&"f"!=p||(h=Math.max(0,Math.min(20,h)))),p=pa.get(p)||Fn;var M=c&&s;return function(n){var e=d;if(y&&n%1)return"";var i=0>n||0===n&&0>1/n?(n=-n,"-"):"-"===a?"":a;if(0>g){var l=ao.formatPrefix(n,h);n=l.scale(n),e=l.symbol+d}else n*=g;n=p(n,h);var x,b,_=n.lastIndexOf(".");if(0>_){var w=m?n.lastIndexOf("e"):-1;0>w?(x=n,b=""):(x=n.substring(0,w),b=n.substring(w))}else x=n.substring(0,_),b=t+n.substring(_+1);!c&&s&&(x=u(x,1/0));var S=v.length+x.length+b.length+(M?0:i.length),k=f>S?new Array(S=f-S+1).join(r):"";return M&&(x=u(k+x,k.length?f-b.length:1/0)),i+=v,n=x+b,("<"===o?i+n+k:">"===o?k+i+n:"^"===o?k.substring(0,S>>=1)+i+n+k.substring(S):i+(M?n:k+n))+e}}}function Fn(n){return n+""}function Hn(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function On(n,t,e){function r(t){var e=n(t),r=u(e,1);return r-t>t-e?e:r}function i(e){return t(e=n(new va(e-1)),1),e}function u(n,e){return t(n=new va(+n),e),n}function o(n,r,u){var o=i(n),a=[];if(u>1)for(;r>o;)e(o)%u||a.push(new Date(+o)),t(o,1);else for(;r>o;)a.push(new Date(+o)),t(o,1);return a}function a(n,t,e){try{va=Hn;var r=new Hn;return r._=n,o(r,t,e)}finally{va=Date}}n.floor=n,n.round=r,n.ceil=i,n.offset=u,n.range=o;var l=n.utc=In(n);return l.floor=l,l.round=In(r),l.ceil=In(i),l.offset=In(u),l.range=a,n}function In(n){return function(t,e){try{va=Hn;var r=new Hn;return r._=t,n(r,e)._}finally{va=Date}}}function Yn(n){function t(n){function t(t){for(var e,i,u,o=[],a=-1,l=0;++a<r;)37===n.charCodeAt(a)&&(o.push(n.slice(l,a)),null!=(i=ya[e=n.charAt(++a)])&&(e=n.charAt(++a)),(u=A[e])&&(e=u(t,null==i?"e"===e?" ":"0":i)),o.push(e),l=a+1);return o.push(n.slice(l,a)),o.join("")}var r=n.length;return t.parse=function(t){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},i=e(r,n,t,0);if(i!=t.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var u=null!=r.Z&&va!==Hn,o=new(u?Hn:va);return"j"in r?o.setFullYear(r.y,0,r.j):"W"in r||"U"in r?("w"in r||(r.w="W"in r?1:0),o.setFullYear(r.y,0,1),o.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(o.getDay()+5)%7:r.w+7*r.U-(o.getDay()+6)%7)):o.setFullYear(r.y,r.m,r.d),o.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L),u?o._:o},t.toString=function(){return n},t}function e(n,t,e,r){for(var i,u,o,a=0,l=t.length,c=e.length;l>a;){if(r>=c)return-1;if(i=t.charCodeAt(a++),37===i){if(o=t.charAt(a++),u=C[o in ya?t.charAt(a++):o],!u||(r=u(n,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function r(n,t,e){_.lastIndex=0;var r=_.exec(t.slice(e));return r?(n.w=w.get(r[0].toLowerCase()),e+r[0].length):-1}function i(n,t,e){x.lastIndex=0;var r=x.exec(t.slice(e));return r?(n.w=b.get(r[0].toLowerCase()),e+r[0].length):-1}function u(n,t,e){N.lastIndex=0;var r=N.exec(t.slice(e));return r?(n.m=E.get(r[0].toLowerCase()),e+r[0].length):-1}function o(n,t,e){S.lastIndex=0;var r=S.exec(t.slice(e));return r?(n.m=k.get(r[0].toLowerCase()),e+r[0].length):-1}function a(n,t,r){return e(n,A.c.toString(),t,r)}function l(n,t,r){return e(n,A.x.toString(),t,r)}function c(n,t,r){return e(n,A.X.toString(),t,r)}function f(n,t,e){var r=M.get(t.slice(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)}var s=n.dateTime,h=n.date,p=n.time,g=n.periods,v=n.days,d=n.shortDays,y=n.months,m=n.shortMonths;t.utc=function(n){function e(n){try{va=Hn;var t=new va;return t._=n,r(t)}finally{va=Date}}var r=t(n);return e.parse=function(n){try{va=Hn;var t=r.parse(n);return t&&t._}finally{va=Date}},e.toString=r.toString,e},t.multi=t.utc.multi=ct;var M=ao.map(),x=Vn(v),b=Xn(v),_=Vn(d),w=Xn(d),S=Vn(y),k=Xn(y),N=Vn(m),E=Xn(m);g.forEach(function(n,t){M.set(n.toLowerCase(),t)});var A={a:function(n){return d[n.getDay()]},A:function(n){return v[n.getDay()]},b:function(n){return m[n.getMonth()]},B:function(n){return y[n.getMonth()]},c:t(s),d:function(n,t){return Zn(n.getDate(),t,2)},e:function(n,t){return Zn(n.getDate(),t,2)},H:function(n,t){return Zn(n.getHours(),t,2)},I:function(n,t){return Zn(n.getHours()%12||12,t,2)},j:function(n,t){return Zn(1+ga.dayOfYear(n),t,3)},L:function(n,t){return Zn(n.getMilliseconds(),t,3)},m:function(n,t){return Zn(n.getMonth()+1,t,2)},M:function(n,t){return Zn(n.getMinutes(),t,2)},p:function(n){return g[+(n.getHours()>=12)]},S:function(n,t){return Zn(n.getSeconds(),t,2)},U:function(n,t){return Zn(ga.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return Zn(ga.mondayOfYear(n),t,2)},x:t(h),X:t(p),y:function(n,t){return Zn(n.getFullYear()%100,t,2)},Y:function(n,t){return Zn(n.getFullYear()%1e4,t,4)},Z:at,"%":function(){return"%"}},C={a:r,A:i,b:u,B:o,c:a,d:tt,e:tt,H:rt,I:rt,j:et,L:ot,m:nt,M:it,p:f,S:ut,U:Bn,w:$n,W:Wn,x:l,X:c,y:Gn,Y:Jn,Z:Kn,"%":lt};return t}function Zn(n,t,e){var r=0>n?"-":"",i=(r?-n:n)+"",u=i.length;return r+(e>u?new Array(e-u+1).join(t)+i:i)}function Vn(n){return new RegExp("^(?:"+n.map(ao.requote).join("|")+")","i")}function Xn(n){for(var t=new c,e=-1,r=n.length;++e<r;)t.set(n[e].toLowerCase(),e);return t}function $n(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+1));return r?(n.w=+r[0],e+r[0].length):-1}function Bn(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e));return r?(n.U=+r[0],e+r[0].length):-1}function Wn(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e));return r?(n.W=+r[0],e+r[0].length):-1}function Jn(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+4));return r?(n.y=+r[0],e+r[0].length):-1}function Gn(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.y=Qn(+r[0]),e+r[0].length):-1}function Kn(n,t,e){return/^[+-]\d{4}$/.test(t=t.slice(e,e+5))?(n.Z=-t,e+5):-1}function Qn(n){return n+(n>68?1900:2e3)}function nt(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function tt(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function et(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function rt(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function it(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function ut(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function ot(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function at(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=xo(t)/60|0,i=xo(t)%60;return e+Zn(r,"0",2)+Zn(i,"0",2)}function lt(n,t,e){Ma.lastIndex=0;var r=Ma.exec(t.slice(e,e+1));return r?e+r[0].length:-1}function ct(n){for(var t=n.length,e=-1;++e<t;)n[e][0]=this(n[e][0]);return function(t){for(var e=0,r=n[e];!r[1](t);)r=n[++e];return r[0](t)}}function ft(){}function st(n,t,e){var r=e.s=n+t,i=r-n,u=r-i;e.t=n-u+(t-i)}function ht(n,t){n&&wa.hasOwnProperty(n.type)&&wa[n.type](n,t)}function pt(n,t,e){var r,i=-1,u=n.length-e;for(t.lineStart();++i<u;)r=n[i],t.point(r[0],r[1],r[2]);t.lineEnd()}function gt(n,t){var e=-1,r=n.length;for(t.polygonStart();++e<r;)pt(n[e],t,1);t.polygonEnd()}function vt(){function n(n,t){n*=Yo,t=t*Yo/2+Fo/4;var e=n-r,o=e>=0?1:-1,a=o*e,l=Math.cos(t),c=Math.sin(t),f=u*c,s=i*l+f*Math.cos(a),h=f*o*Math.sin(a);ka.add(Math.atan2(h,s)),r=n,i=l,u=c}var t,e,r,i,u;Na.point=function(o,a){Na.point=n,r=(t=o)*Yo,i=Math.cos(a=(e=a)*Yo/2+Fo/4),u=Math.sin(a)},Na.lineEnd=function(){n(t,e)}}function dt(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function yt(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function mt(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function Mt(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function xt(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function bt(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function _t(n){return[Math.atan2(n[1],n[0]),tn(n[2])]}function wt(n,t){return xo(n[0]-t[0])<Uo&&xo(n[1]-t[1])<Uo}function St(n,t){n*=Yo;var e=Math.cos(t*=Yo);kt(e*Math.cos(n),e*Math.sin(n),Math.sin(t))}function kt(n,t,e){++Ea,Ca+=(n-Ca)/Ea,za+=(t-za)/Ea,La+=(e-La)/Ea}function Nt(){function n(n,i){n*=Yo;var u=Math.cos(i*=Yo),o=u*Math.cos(n),a=u*Math.sin(n),l=Math.sin(i),c=Math.atan2(Math.sqrt((c=e*l-r*a)*c+(c=r*o-t*l)*c+(c=t*a-e*o)*c),t*o+e*a+r*l);Aa+=c,qa+=c*(t+(t=o)),Ta+=c*(e+(e=a)),Ra+=c*(r+(r=l)),kt(t,e,r)}var t,e,r;ja.point=function(i,u){i*=Yo;var o=Math.cos(u*=Yo);t=o*Math.cos(i),e=o*Math.sin(i),r=Math.sin(u),ja.point=n,kt(t,e,r)}}function Et(){ja.point=St}function At(){function n(n,t){n*=Yo;var e=Math.cos(t*=Yo),o=e*Math.cos(n),a=e*Math.sin(n),l=Math.sin(t),c=i*l-u*a,f=u*o-r*l,s=r*a-i*o,h=Math.sqrt(c*c+f*f+s*s),p=r*o+i*a+u*l,g=h&&-nn(p)/h,v=Math.atan2(h,p);Da+=g*c,Pa+=g*f,Ua+=g*s,Aa+=v,qa+=v*(r+(r=o)),Ta+=v*(i+(i=a)),Ra+=v*(u+(u=l)),kt(r,i,u)}var t,e,r,i,u;ja.point=function(o,a){t=o,e=a,ja.point=n,o*=Yo;var l=Math.cos(a*=Yo);r=l*Math.cos(o),i=l*Math.sin(o),u=Math.sin(a),kt(r,i,u)},ja.lineEnd=function(){n(t,e),ja.lineEnd=Et,ja.point=St}}function Ct(n,t){function e(e,r){return e=n(e,r),t(e[0],e[1])}return n.invert&&t.invert&&(e.invert=function(e,r){return e=t.invert(e,r),e&&n.invert(e[0],e[1])}),e}function zt(){return!0}function Lt(n,t,e,r,i){var u=[],o=[];if(n.forEach(function(n){if(!((t=n.length-1)<=0)){var t,e=n[0],r=n[t];if(wt(e,r)){i.lineStart();for(var a=0;t>a;++a)i.point((e=n[a])[0],e[1]);return void i.lineEnd()}var l=new Tt(e,n,null,!0),c=new Tt(e,null,l,!1);l.o=c,u.push(l),o.push(c),l=new Tt(r,n,null,!1),c=new Tt(r,null,l,!0),l.o=c,u.push(l),o.push(c)}}),o.sort(t),qt(u),qt(o),u.length){for(var a=0,l=e,c=o.length;c>a;++a)o[a].e=l=!l;for(var f,s,h=u[0];;){for(var p=h,g=!0;p.v;)if((p=p.n)===h)return;f=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(g)for(var a=0,c=f.length;c>a;++a)i.point((s=f[a])[0],s[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(g){f=p.p.z;for(var a=f.length-1;a>=0;--a)i.point((s=f[a])[0],s[1])}else r(p.x,p.p.x,-1,i);p=p.p}p=p.o,f=p.z,g=!g}while(!p.v);i.lineEnd()}}}function qt(n){if(t=n.length){for(var t,e,r=0,i=n[0];++r<t;)i.n=e=n[r],e.p=i,i=e;i.n=e=n[0],e.p=i}}function Tt(n,t,e,r){this.x=n,this.z=t,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function Rt(n,t,e,r){return function(i,u){function o(t,e){var r=i(t,e);n(t=r[0],e=r[1])&&u.point(t,e)}function a(n,t){var e=i(n,t);d.point(e[0],e[1])}function l(){m.point=a,d.lineStart()}function c(){m.point=o,d.lineEnd()}function f(n,t){v.push([n,t]);var e=i(n,t);x.point(e[0],e[1])}function s(){x.lineStart(),v=[]}function h(){f(v[0][0],v[0][1]),x.lineEnd();var n,t=x.clean(),e=M.buffer(),r=e.length;if(v.pop(),g.push(v),v=null,r)if(1&t){n=e[0];var i,r=n.length-1,o=-1;if(r>0){for(b||(u.polygonStart(),b=!0),u.lineStart();++o<r;)u.point((i=n[o])[0],i[1]);u.lineEnd()}}else r>1&&2&t&&e.push(e.pop().concat(e.shift())),p.push(e.filter(Dt))}var p,g,v,d=t(u),y=i.invert(r[0],r[1]),m={point:o,lineStart:l,lineEnd:c,polygonStart:function(){m.point=f,m.lineStart=s,m.lineEnd=h,p=[],g=[]},polygonEnd:function(){m.point=o,m.lineStart=l,m.lineEnd=c,p=ao.merge(p);var n=Ot(y,g);p.length?(b||(u.polygonStart(),b=!0),Lt(p,Ut,n,e,u)):n&&(b||(u.polygonStart(),b=!0),u.lineStart(),e(null,null,1,u),u.lineEnd()),b&&(u.polygonEnd(),b=!1),p=g=null},sphere:function(){u.polygonStart(),u.lineStart(),e(null,null,1,u),u.lineEnd(),u.polygonEnd()}},M=Pt(),x=t(M),b=!1;return m}}function Dt(n){return n.length>1}function Pt(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:b,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function Ut(n,t){return((n=n.x)[0]<0?n[1]-Io-Uo:Io-n[1])-((t=t.x)[0]<0?t[1]-Io-Uo:Io-t[1])}function jt(n){var t,e=NaN,r=NaN,i=NaN;return{lineStart:function(){n.lineStart(),t=1},point:function(u,o){var a=u>0?Fo:-Fo,l=xo(u-e);xo(l-Fo)<Uo?(n.point(e,r=(r+o)/2>0?Io:-Io),n.point(i,r),n.lineEnd(),n.lineStart(),n.point(a,r),n.point(u,r),t=0):i!==a&&l>=Fo&&(xo(e-i)<Uo&&(e-=i*Uo),xo(u-a)<Uo&&(u-=a*Uo),r=Ft(e,r,u,o),n.point(i,r),n.lineEnd(),n.lineStart(),n.point(a,r),t=0),n.point(e=u,r=o),i=a},lineEnd:function(){n.lineEnd(),e=r=NaN},clean:function(){return 2-t}}}function Ft(n,t,e,r){var i,u,o=Math.sin(n-e);return xo(o)>Uo?Math.atan((Math.sin(t)*(u=Math.cos(r))*Math.sin(e)-Math.sin(r)*(i=Math.cos(t))*Math.sin(n))/(i*u*o)):(t+r)/2}function Ht(n,t,e,r){var i;if(null==n)i=e*Io,r.point(-Fo,i),r.point(0,i),r.point(Fo,i),r.point(Fo,0),r.point(Fo,-i),r.point(0,-i),r.point(-Fo,-i),r.point(-Fo,0),r.point(-Fo,i);else if(xo(n[0]-t[0])>Uo){var u=n[0]<t[0]?Fo:-Fo;i=e*u/2,r.point(-u,i),r.point(0,i),r.point(u,i)}else r.point(t[0],t[1])}function Ot(n,t){var e=n[0],r=n[1],i=[Math.sin(e),-Math.cos(e),0],u=0,o=0;ka.reset();for(var a=0,l=t.length;l>a;++a){var c=t[a],f=c.length;if(f)for(var s=c[0],h=s[0],p=s[1]/2+Fo/4,g=Math.sin(p),v=Math.cos(p),d=1;;){d===f&&(d=0),n=c[d];var y=n[0],m=n[1]/2+Fo/4,M=Math.sin(m),x=Math.cos(m),b=y-h,_=b>=0?1:-1,w=_*b,S=w>Fo,k=g*M;if(ka.add(Math.atan2(k*_*Math.sin(w),v*x+k*Math.cos(w))),u+=S?b+_*Ho:b,S^h>=e^y>=e){var N=mt(dt(s),dt(n));bt(N);var E=mt(i,N);bt(E);var A=(S^b>=0?-1:1)*tn(E[2]);(r>A||r===A&&(N[0]||N[1]))&&(o+=S^b>=0?1:-1)}if(!d++)break;h=y,g=M,v=x,s=n}}return(-Uo>u||Uo>u&&-Uo>ka)^1&o}function It(n){function t(n,t){return Math.cos(n)*Math.cos(t)>u}function e(n){var e,u,l,c,f;return{lineStart:function(){c=l=!1,f=1},point:function(s,h){var p,g=[s,h],v=t(s,h),d=o?v?0:i(s,h):v?i(s+(0>s?Fo:-Fo),h):0;if(!e&&(c=l=v)&&n.lineStart(),v!==l&&(p=r(e,g),(wt(e,p)||wt(g,p))&&(g[0]+=Uo,g[1]+=Uo,v=t(g[0],g[1]))),v!==l)f=0,v?(n.lineStart(),p=r(g,e),n.point(p[0],p[1])):(p=r(e,g),n.point(p[0],p[1]),n.lineEnd()),e=p;else if(a&&e&&o^v){var y;d&u||!(y=r(g,e,!0))||(f=0,o?(n.lineStart(),n.point(y[0][0],y[0][1]),n.point(y[1][0],y[1][1]),n.lineEnd()):(n.point(y[1][0],y[1][1]),n.lineEnd(),n.lineStart(),n.point(y[0][0],y[0][1])))}!v||e&&wt(e,g)||n.point(g[0],g[1]),e=g,l=v,u=d},lineEnd:function(){l&&n.lineEnd(),e=null},clean:function(){return f|(c&&l)<<1}}}function r(n,t,e){var r=dt(n),i=dt(t),o=[1,0,0],a=mt(r,i),l=yt(a,a),c=a[0],f=l-c*c;if(!f)return!e&&n;var s=u*l/f,h=-u*c/f,p=mt(o,a),g=xt(o,s),v=xt(a,h);Mt(g,v);var d=p,y=yt(g,d),m=yt(d,d),M=y*y-m*(yt(g,g)-1);if(!(0>M)){var x=Math.sqrt(M),b=xt(d,(-y-x)/m);if(Mt(b,g),b=_t(b),!e)return b;var _,w=n[0],S=t[0],k=n[1],N=t[1];w>S&&(_=w,w=S,S=_);var E=S-w,A=xo(E-Fo)<Uo,C=A||Uo>E;if(!A&&k>N&&(_=k,k=N,N=_),C?A?k+N>0^b[1]<(xo(b[0]-w)<Uo?k:N):k<=b[1]&&b[1]<=N:E>Fo^(w<=b[0]&&b[0]<=S)){var z=xt(d,(-y+x)/m);return Mt(z,g),[b,_t(z)]}}}function i(t,e){var r=o?n:Fo-n,i=0;return-r>t?i|=1:t>r&&(i|=2),-r>e?i|=4:e>r&&(i|=8),i}var u=Math.cos(n),o=u>0,a=xo(u)>Uo,l=ve(n,6*Yo);return Rt(t,e,l,o?[0,-n]:[-Fo,n-Fo])}function Yt(n,t,e,r){return function(i){var u,o=i.a,a=i.b,l=o.x,c=o.y,f=a.x,s=a.y,h=0,p=1,g=f-l,v=s-c;if(u=n-l,g||!(u>0)){if(u/=g,0>g){if(h>u)return;p>u&&(p=u)}else if(g>0){if(u>p)return;u>h&&(h=u)}if(u=e-l,g||!(0>u)){if(u/=g,0>g){if(u>p)return;u>h&&(h=u)}else if(g>0){if(h>u)return;p>u&&(p=u)}if(u=t-c,v||!(u>0)){if(u/=v,0>v){if(h>u)return;p>u&&(p=u)}else if(v>0){if(u>p)return;u>h&&(h=u)}if(u=r-c,v||!(0>u)){if(u/=v,0>v){if(u>p)return;u>h&&(h=u)}else if(v>0){if(h>u)return;p>u&&(p=u)}return h>0&&(i.a={x:l+h*g,y:c+h*v}),1>p&&(i.b={x:l+p*g,y:c+p*v}),i}}}}}}function Zt(n,t,e,r){function i(r,i){return xo(r[0]-n)<Uo?i>0?0:3:xo(r[0]-e)<Uo?i>0?2:1:xo(r[1]-t)<Uo?i>0?1:0:i>0?3:2}function u(n,t){return o(n.x,t.x)}function o(n,t){var e=i(n,1),r=i(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}return function(a){function l(n){for(var t=0,e=d.length,r=n[1],i=0;e>i;++i)for(var u,o=1,a=d[i],l=a.length,c=a[0];l>o;++o)u=a[o],c[1]<=r?u[1]>r&&Q(c,u,n)>0&&++t:u[1]<=r&&Q(c,u,n)<0&&--t,c=u;return 0!==t}function c(u,a,l,c){var f=0,s=0;if(null==u||(f=i(u,l))!==(s=i(a,l))||o(u,a)<0^l>0){do c.point(0===f||3===f?n:e,f>1?r:t);while((f=(f+l+4)%4)!==s)}else c.point(a[0],a[1])}function f(i,u){return i>=n&&e>=i&&u>=t&&r>=u}function s(n,t){f(n,t)&&a.point(n,t)}function h(){C.point=g,d&&d.push(y=[]),S=!0,w=!1,b=_=NaN}function p(){v&&(g(m,M),x&&w&&E.rejoin(),v.push(E.buffer())),C.point=s,w&&a.lineEnd()}function g(n,t){n=Math.max(-Ha,Math.min(Ha,n)),t=Math.max(-Ha,Math.min(Ha,t));var e=f(n,t);if(d&&y.push([n,t]),S)m=n,M=t,x=e,S=!1,e&&(a.lineStart(),a.point(n,t));else if(e&&w)a.point(n,t);else{var r={a:{x:b,y:_},b:{x:n,y:t}};A(r)?(w||(a.lineStart(),a.point(r.a.x,r.a.y)),a.point(r.b.x,r.b.y),e||a.lineEnd(),k=!1):e&&(a.lineStart(),a.point(n,t),k=!1)}b=n,_=t,w=e}var v,d,y,m,M,x,b,_,w,S,k,N=a,E=Pt(),A=Yt(n,t,e,r),C={point:s,lineStart:h,lineEnd:p,polygonStart:function(){a=E,v=[],d=[],k=!0},polygonEnd:function(){a=N,v=ao.merge(v);var t=l([n,r]),e=k&&t,i=v.length;(e||i)&&(a.polygonStart(),e&&(a.lineStart(),c(null,null,1,a),a.lineEnd()),i&&Lt(v,u,t,c,a),a.polygonEnd()),v=d=y=null}};return C}}function Vt(n){var t=0,e=Fo/3,r=ae(n),i=r(t,e);return i.parallels=function(n){return arguments.length?r(t=n[0]*Fo/180,e=n[1]*Fo/180):[t/Fo*180,e/Fo*180]},i}function Xt(n,t){function e(n,t){var e=Math.sqrt(u-2*i*Math.sin(t))/i;return[e*Math.sin(n*=i),o-e*Math.cos(n)]}var r=Math.sin(n),i=(r+Math.sin(t))/2,u=1+r*(2*i-r),o=Math.sqrt(u)/i;return e.invert=function(n,t){var e=o-t;return[Math.atan2(n,e)/i,tn((u-(n*n+e*e)*i*i)/(2*i))]},e}function $t(){function n(n,t){Ia+=i*n-r*t,r=n,i=t}var t,e,r,i;$a.point=function(u,o){$a.point=n,t=r=u,e=i=o},$a.lineEnd=function(){n(t,e)}}function Bt(n,t){Ya>n&&(Ya=n),n>Va&&(Va=n),Za>t&&(Za=t),t>Xa&&(Xa=t)}function Wt(){function n(n,t){o.push("M",n,",",t,u)}function t(n,t){o.push("M",n,",",t),a.point=e}function e(n,t){o.push("L",n,",",t)}function r(){a.point=n}function i(){o.push("Z")}var u=Jt(4.5),o=[],a={point:n,lineStart:function(){a.point=t},lineEnd:r,polygonStart:function(){a.lineEnd=i},polygonEnd:function(){a.lineEnd=r,a.point=n},pointRadius:function(n){return u=Jt(n),a},result:function(){if(o.length){var n=o.join("");return o=[],n}}};return a}function Jt(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function Gt(n,t){Ca+=n,za+=t,++La}function Kt(){function n(n,r){var i=n-t,u=r-e,o=Math.sqrt(i*i+u*u);qa+=o*(t+n)/2,Ta+=o*(e+r)/2,Ra+=o,Gt(t=n,e=r)}var t,e;Wa.point=function(r,i){Wa.point=n,Gt(t=r,e=i)}}function Qt(){Wa.point=Gt}function ne(){function n(n,t){var e=n-r,u=t-i,o=Math.sqrt(e*e+u*u);qa+=o*(r+n)/2,Ta+=o*(i+t)/2,Ra+=o,o=i*n-r*t,Da+=o*(r+n),Pa+=o*(i+t),Ua+=3*o,Gt(r=n,i=t)}var t,e,r,i;Wa.point=function(u,o){Wa.point=n,Gt(t=r=u,e=i=o)},Wa.lineEnd=function(){n(t,e)}}function te(n){function t(t,e){n.moveTo(t+o,e),n.arc(t,e,o,0,Ho)}function e(t,e){n.moveTo(t,e),a.point=r}function r(t,e){n.lineTo(t,e)}function i(){a.point=t}function u(){n.closePath()}var o=4.5,a={point:t,lineStart:function(){a.point=e},lineEnd:i,polygonStart:function(){a.lineEnd=u},polygonEnd:function(){a.lineEnd=i,a.point=t},pointRadius:function(n){return o=n,a},result:b};return a}function ee(n){function t(n){return(a?r:e)(n)}function e(t){return ue(t,function(e,r){e=n(e,r),t.point(e[0],e[1])})}function r(t){function e(e,r){e=n(e,r),t.point(e[0],e[1])}function r(){M=NaN,S.point=u,t.lineStart()}function u(e,r){var u=dt([e,r]),o=n(e,r);i(M,x,m,b,_,w,M=o[0],x=o[1],m=e,b=u[0],_=u[1],w=u[2],a,t),t.point(M,x)}function o(){S.point=e,t.lineEnd()}function l(){ +r(),S.point=c,S.lineEnd=f}function c(n,t){u(s=n,h=t),p=M,g=x,v=b,d=_,y=w,S.point=u}function f(){i(M,x,m,b,_,w,p,g,s,v,d,y,a,t),S.lineEnd=o,o()}var s,h,p,g,v,d,y,m,M,x,b,_,w,S={point:e,lineStart:r,lineEnd:o,polygonStart:function(){t.polygonStart(),S.lineStart=l},polygonEnd:function(){t.polygonEnd(),S.lineStart=r}};return S}function i(t,e,r,a,l,c,f,s,h,p,g,v,d,y){var m=f-t,M=s-e,x=m*m+M*M;if(x>4*u&&d--){var b=a+p,_=l+g,w=c+v,S=Math.sqrt(b*b+_*_+w*w),k=Math.asin(w/=S),N=xo(xo(w)-1)<Uo||xo(r-h)<Uo?(r+h)/2:Math.atan2(_,b),E=n(N,k),A=E[0],C=E[1],z=A-t,L=C-e,q=M*z-m*L;(q*q/x>u||xo((m*z+M*L)/x-.5)>.3||o>a*p+l*g+c*v)&&(i(t,e,r,a,l,c,A,C,N,b/=S,_/=S,w,d,y),y.point(A,C),i(A,C,N,b,_,w,f,s,h,p,g,v,d,y))}}var u=.5,o=Math.cos(30*Yo),a=16;return t.precision=function(n){return arguments.length?(a=(u=n*n)>0&&16,t):Math.sqrt(u)},t}function re(n){var t=ee(function(t,e){return n([t*Zo,e*Zo])});return function(n){return le(t(n))}}function ie(n){this.stream=n}function ue(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function oe(n){return ae(function(){return n})()}function ae(n){function t(n){return n=a(n[0]*Yo,n[1]*Yo),[n[0]*h+l,c-n[1]*h]}function e(n){return n=a.invert((n[0]-l)/h,(c-n[1])/h),n&&[n[0]*Zo,n[1]*Zo]}function r(){a=Ct(o=se(y,M,x),u);var n=u(v,d);return l=p-n[0]*h,c=g+n[1]*h,i()}function i(){return f&&(f.valid=!1,f=null),t}var u,o,a,l,c,f,s=ee(function(n,t){return n=u(n,t),[n[0]*h+l,c-n[1]*h]}),h=150,p=480,g=250,v=0,d=0,y=0,M=0,x=0,b=Fa,_=m,w=null,S=null;return t.stream=function(n){return f&&(f.valid=!1),f=le(b(o,s(_(n)))),f.valid=!0,f},t.clipAngle=function(n){return arguments.length?(b=null==n?(w=n,Fa):It((w=+n)*Yo),i()):w},t.clipExtent=function(n){return arguments.length?(S=n,_=n?Zt(n[0][0],n[0][1],n[1][0],n[1][1]):m,i()):S},t.scale=function(n){return arguments.length?(h=+n,r()):h},t.translate=function(n){return arguments.length?(p=+n[0],g=+n[1],r()):[p,g]},t.center=function(n){return arguments.length?(v=n[0]%360*Yo,d=n[1]%360*Yo,r()):[v*Zo,d*Zo]},t.rotate=function(n){return arguments.length?(y=n[0]%360*Yo,M=n[1]%360*Yo,x=n.length>2?n[2]%360*Yo:0,r()):[y*Zo,M*Zo,x*Zo]},ao.rebind(t,s,"precision"),function(){return u=n.apply(this,arguments),t.invert=u.invert&&e,r()}}function le(n){return ue(n,function(t,e){n.point(t*Yo,e*Yo)})}function ce(n,t){return[n,t]}function fe(n,t){return[n>Fo?n-Ho:-Fo>n?n+Ho:n,t]}function se(n,t,e){return n?t||e?Ct(pe(n),ge(t,e)):pe(n):t||e?ge(t,e):fe}function he(n){return function(t,e){return t+=n,[t>Fo?t-Ho:-Fo>t?t+Ho:t,e]}}function pe(n){var t=he(n);return t.invert=he(-n),t}function ge(n,t){function e(n,t){var e=Math.cos(t),a=Math.cos(n)*e,l=Math.sin(n)*e,c=Math.sin(t),f=c*r+a*i;return[Math.atan2(l*u-f*o,a*r-c*i),tn(f*u+l*o)]}var r=Math.cos(n),i=Math.sin(n),u=Math.cos(t),o=Math.sin(t);return e.invert=function(n,t){var e=Math.cos(t),a=Math.cos(n)*e,l=Math.sin(n)*e,c=Math.sin(t),f=c*u-l*o;return[Math.atan2(l*u+c*o,a*r+f*i),tn(f*r-a*i)]},e}function ve(n,t){var e=Math.cos(n),r=Math.sin(n);return function(i,u,o,a){var l=o*t;null!=i?(i=de(e,i),u=de(e,u),(o>0?u>i:i>u)&&(i+=o*Ho)):(i=n+o*Ho,u=n-.5*l);for(var c,f=i;o>0?f>u:u>f;f-=l)a.point((c=_t([e,-r*Math.cos(f),-r*Math.sin(f)]))[0],c[1])}}function de(n,t){var e=dt(t);e[0]-=n,bt(e);var r=nn(-e[1]);return((-e[2]<0?-r:r)+2*Math.PI-Uo)%(2*Math.PI)}function ye(n,t,e){var r=ao.range(n,t-Uo,e).concat(t);return function(n){return r.map(function(t){return[n,t]})}}function me(n,t,e){var r=ao.range(n,t-Uo,e).concat(t);return function(n){return r.map(function(t){return[t,n]})}}function Me(n){return n.source}function xe(n){return n.target}function be(n,t,e,r){var i=Math.cos(t),u=Math.sin(t),o=Math.cos(r),a=Math.sin(r),l=i*Math.cos(n),c=i*Math.sin(n),f=o*Math.cos(e),s=o*Math.sin(e),h=2*Math.asin(Math.sqrt(on(r-t)+i*o*on(e-n))),p=1/Math.sin(h),g=h?function(n){var t=Math.sin(n*=h)*p,e=Math.sin(h-n)*p,r=e*l+t*f,i=e*c+t*s,o=e*u+t*a;return[Math.atan2(i,r)*Zo,Math.atan2(o,Math.sqrt(r*r+i*i))*Zo]}:function(){return[n*Zo,t*Zo]};return g.distance=h,g}function _e(){function n(n,i){var u=Math.sin(i*=Yo),o=Math.cos(i),a=xo((n*=Yo)-t),l=Math.cos(a);Ja+=Math.atan2(Math.sqrt((a=o*Math.sin(a))*a+(a=r*u-e*o*l)*a),e*u+r*o*l),t=n,e=u,r=o}var t,e,r;Ga.point=function(i,u){t=i*Yo,e=Math.sin(u*=Yo),r=Math.cos(u),Ga.point=n},Ga.lineEnd=function(){Ga.point=Ga.lineEnd=b}}function we(n,t){function e(t,e){var r=Math.cos(t),i=Math.cos(e),u=n(r*i);return[u*i*Math.sin(t),u*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),i=t(r),u=Math.sin(i),o=Math.cos(i);return[Math.atan2(n*u,r*o),Math.asin(r&&e*u/r)]},e}function Se(n,t){function e(n,t){o>0?-Io+Uo>t&&(t=-Io+Uo):t>Io-Uo&&(t=Io-Uo);var e=o/Math.pow(i(t),u);return[e*Math.sin(u*n),o-e*Math.cos(u*n)]}var r=Math.cos(n),i=function(n){return Math.tan(Fo/4+n/2)},u=n===t?Math.sin(n):Math.log(r/Math.cos(t))/Math.log(i(t)/i(n)),o=r*Math.pow(i(n),u)/u;return u?(e.invert=function(n,t){var e=o-t,r=K(u)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/u,2*Math.atan(Math.pow(o/r,1/u))-Io]},e):Ne}function ke(n,t){function e(n,t){var e=u-t;return[e*Math.sin(i*n),u-e*Math.cos(i*n)]}var r=Math.cos(n),i=n===t?Math.sin(n):(r-Math.cos(t))/(t-n),u=r/i+n;return xo(i)<Uo?ce:(e.invert=function(n,t){var e=u-t;return[Math.atan2(n,e)/i,u-K(i)*Math.sqrt(n*n+e*e)]},e)}function Ne(n,t){return[n,Math.log(Math.tan(Fo/4+t/2))]}function Ee(n){var t,e=oe(n),r=e.scale,i=e.translate,u=e.clipExtent;return e.scale=function(){var n=r.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.translate=function(){var n=i.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.clipExtent=function(n){var o=u.apply(e,arguments);if(o===e){if(t=null==n){var a=Fo*r(),l=i();u([[l[0]-a,l[1]-a],[l[0]+a,l[1]+a]])}}else t&&(o=null);return o},e.clipExtent(null)}function Ae(n,t){return[Math.log(Math.tan(Fo/4+t/2)),-n]}function Ce(n){return n[0]}function ze(n){return n[1]}function Le(n){for(var t=n.length,e=[0,1],r=2,i=2;t>i;i++){for(;r>1&&Q(n[e[r-2]],n[e[r-1]],n[i])<=0;)--r;e[r++]=i}return e.slice(0,r)}function qe(n,t){return n[0]-t[0]||n[1]-t[1]}function Te(n,t,e){return(e[0]-t[0])*(n[1]-t[1])<(e[1]-t[1])*(n[0]-t[0])}function Re(n,t,e,r){var i=n[0],u=e[0],o=t[0]-i,a=r[0]-u,l=n[1],c=e[1],f=t[1]-l,s=r[1]-c,h=(a*(l-c)-s*(i-u))/(s*o-a*f);return[i+h*o,l+h*f]}function De(n){var t=n[0],e=n[n.length-1];return!(t[0]-e[0]||t[1]-e[1])}function Pe(){rr(this),this.edge=this.site=this.circle=null}function Ue(n){var t=cl.pop()||new Pe;return t.site=n,t}function je(n){Be(n),ol.remove(n),cl.push(n),rr(n)}function Fe(n){var t=n.circle,e=t.x,r=t.cy,i={x:e,y:r},u=n.P,o=n.N,a=[n];je(n);for(var l=u;l.circle&&xo(e-l.circle.x)<Uo&&xo(r-l.circle.cy)<Uo;)u=l.P,a.unshift(l),je(l),l=u;a.unshift(l),Be(l);for(var c=o;c.circle&&xo(e-c.circle.x)<Uo&&xo(r-c.circle.cy)<Uo;)o=c.N,a.push(c),je(c),c=o;a.push(c),Be(c);var f,s=a.length;for(f=1;s>f;++f)c=a[f],l=a[f-1],nr(c.edge,l.site,c.site,i);l=a[0],c=a[s-1],c.edge=Ke(l.site,c.site,null,i),$e(l),$e(c)}function He(n){for(var t,e,r,i,u=n.x,o=n.y,a=ol._;a;)if(r=Oe(a,o)-u,r>Uo)a=a.L;else{if(i=u-Ie(a,o),!(i>Uo)){r>-Uo?(t=a.P,e=a):i>-Uo?(t=a,e=a.N):t=e=a;break}if(!a.R){t=a;break}a=a.R}var l=Ue(n);if(ol.insert(t,l),t||e){if(t===e)return Be(t),e=Ue(t.site),ol.insert(l,e),l.edge=e.edge=Ke(t.site,l.site),$e(t),void $e(e);if(!e)return void(l.edge=Ke(t.site,l.site));Be(t),Be(e);var c=t.site,f=c.x,s=c.y,h=n.x-f,p=n.y-s,g=e.site,v=g.x-f,d=g.y-s,y=2*(h*d-p*v),m=h*h+p*p,M=v*v+d*d,x={x:(d*m-p*M)/y+f,y:(h*M-v*m)/y+s};nr(e.edge,c,g,x),l.edge=Ke(c,n,null,x),e.edge=Ke(n,g,null,x),$e(t),$e(e)}}function Oe(n,t){var e=n.site,r=e.x,i=e.y,u=i-t;if(!u)return r;var o=n.P;if(!o)return-(1/0);e=o.site;var a=e.x,l=e.y,c=l-t;if(!c)return a;var f=a-r,s=1/u-1/c,h=f/c;return s?(-h+Math.sqrt(h*h-2*s*(f*f/(-2*c)-l+c/2+i-u/2)))/s+r:(r+a)/2}function Ie(n,t){var e=n.N;if(e)return Oe(e,t);var r=n.site;return r.y===t?r.x:1/0}function Ye(n){this.site=n,this.edges=[]}function Ze(n){for(var t,e,r,i,u,o,a,l,c,f,s=n[0][0],h=n[1][0],p=n[0][1],g=n[1][1],v=ul,d=v.length;d--;)if(u=v[d],u&&u.prepare())for(a=u.edges,l=a.length,o=0;l>o;)f=a[o].end(),r=f.x,i=f.y,c=a[++o%l].start(),t=c.x,e=c.y,(xo(r-t)>Uo||xo(i-e)>Uo)&&(a.splice(o,0,new tr(Qe(u.site,f,xo(r-s)<Uo&&g-i>Uo?{x:s,y:xo(t-s)<Uo?e:g}:xo(i-g)<Uo&&h-r>Uo?{x:xo(e-g)<Uo?t:h,y:g}:xo(r-h)<Uo&&i-p>Uo?{x:h,y:xo(t-h)<Uo?e:p}:xo(i-p)<Uo&&r-s>Uo?{x:xo(e-p)<Uo?t:s,y:p}:null),u.site,null)),++l)}function Ve(n,t){return t.angle-n.angle}function Xe(){rr(this),this.x=this.y=this.arc=this.site=this.cy=null}function $e(n){var t=n.P,e=n.N;if(t&&e){var r=t.site,i=n.site,u=e.site;if(r!==u){var o=i.x,a=i.y,l=r.x-o,c=r.y-a,f=u.x-o,s=u.y-a,h=2*(l*s-c*f);if(!(h>=-jo)){var p=l*l+c*c,g=f*f+s*s,v=(s*p-c*g)/h,d=(l*g-f*p)/h,s=d+a,y=fl.pop()||new Xe;y.arc=n,y.site=i,y.x=v+o,y.y=s+Math.sqrt(v*v+d*d),y.cy=s,n.circle=y;for(var m=null,M=ll._;M;)if(y.y<M.y||y.y===M.y&&y.x<=M.x){if(!M.L){m=M.P;break}M=M.L}else{if(!M.R){m=M;break}M=M.R}ll.insert(m,y),m||(al=y)}}}}function Be(n){var t=n.circle;t&&(t.P||(al=t.N),ll.remove(t),fl.push(t),rr(t),n.circle=null)}function We(n){for(var t,e=il,r=Yt(n[0][0],n[0][1],n[1][0],n[1][1]),i=e.length;i--;)t=e[i],(!Je(t,n)||!r(t)||xo(t.a.x-t.b.x)<Uo&&xo(t.a.y-t.b.y)<Uo)&&(t.a=t.b=null,e.splice(i,1))}function Je(n,t){var e=n.b;if(e)return!0;var r,i,u=n.a,o=t[0][0],a=t[1][0],l=t[0][1],c=t[1][1],f=n.l,s=n.r,h=f.x,p=f.y,g=s.x,v=s.y,d=(h+g)/2,y=(p+v)/2;if(v===p){if(o>d||d>=a)return;if(h>g){if(u){if(u.y>=c)return}else u={x:d,y:l};e={x:d,y:c}}else{if(u){if(u.y<l)return}else u={x:d,y:c};e={x:d,y:l}}}else if(r=(h-g)/(v-p),i=y-r*d,-1>r||r>1)if(h>g){if(u){if(u.y>=c)return}else u={x:(l-i)/r,y:l};e={x:(c-i)/r,y:c}}else{if(u){if(u.y<l)return}else u={x:(c-i)/r,y:c};e={x:(l-i)/r,y:l}}else if(v>p){if(u){if(u.x>=a)return}else u={x:o,y:r*o+i};e={x:a,y:r*a+i}}else{if(u){if(u.x<o)return}else u={x:a,y:r*a+i};e={x:o,y:r*o+i}}return n.a=u,n.b=e,!0}function Ge(n,t){this.l=n,this.r=t,this.a=this.b=null}function Ke(n,t,e,r){var i=new Ge(n,t);return il.push(i),e&&nr(i,n,t,e),r&&nr(i,t,n,r),ul[n.i].edges.push(new tr(i,n,t)),ul[t.i].edges.push(new tr(i,t,n)),i}function Qe(n,t,e){var r=new Ge(n,null);return r.a=t,r.b=e,il.push(r),r}function nr(n,t,e,r){n.a||n.b?n.l===e?n.b=r:n.a=r:(n.a=r,n.l=t,n.r=e)}function tr(n,t,e){var r=n.a,i=n.b;this.edge=n,this.site=t,this.angle=e?Math.atan2(e.y-t.y,e.x-t.x):n.l===t?Math.atan2(i.x-r.x,r.y-i.y):Math.atan2(r.x-i.x,i.y-r.y)}function er(){this._=null}function rr(n){n.U=n.C=n.L=n.R=n.P=n.N=null}function ir(n,t){var e=t,r=t.R,i=e.U;i?i.L===e?i.L=r:i.R=r:n._=r,r.U=i,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function ur(n,t){var e=t,r=t.L,i=e.U;i?i.L===e?i.L=r:i.R=r:n._=r,r.U=i,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function or(n){for(;n.L;)n=n.L;return n}function ar(n,t){var e,r,i,u=n.sort(lr).pop();for(il=[],ul=new Array(n.length),ol=new er,ll=new er;;)if(i=al,u&&(!i||u.y<i.y||u.y===i.y&&u.x<i.x))u.x===e&&u.y===r||(ul[u.i]=new Ye(u),He(u),e=u.x,r=u.y),u=n.pop();else{if(!i)break;Fe(i.arc)}t&&(We(t),Ze(t));var o={cells:ul,edges:il};return ol=ll=il=ul=null,o}function lr(n,t){return t.y-n.y||t.x-n.x}function cr(n,t,e){return(n.x-e.x)*(t.y-n.y)-(n.x-t.x)*(e.y-n.y)}function fr(n){return n.x}function sr(n){return n.y}function hr(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function pr(n,t,e,r,i,u){if(!n(t,e,r,i,u)){var o=.5*(e+i),a=.5*(r+u),l=t.nodes;l[0]&&pr(n,l[0],e,r,o,a),l[1]&&pr(n,l[1],o,r,i,a),l[2]&&pr(n,l[2],e,a,o,u),l[3]&&pr(n,l[3],o,a,i,u)}}function gr(n,t,e,r,i,u,o){var a,l=1/0;return function c(n,f,s,h,p){if(!(f>u||s>o||r>h||i>p)){if(g=n.point){var g,v=t-n.x,d=e-n.y,y=v*v+d*d;if(l>y){var m=Math.sqrt(l=y);r=t-m,i=e-m,u=t+m,o=e+m,a=g}}for(var M=n.nodes,x=.5*(f+h),b=.5*(s+p),_=t>=x,w=e>=b,S=w<<1|_,k=S+4;k>S;++S)if(n=M[3&S])switch(3&S){case 0:c(n,f,s,x,b);break;case 1:c(n,x,s,h,b);break;case 2:c(n,f,b,x,p);break;case 3:c(n,x,b,h,p)}}}(n,r,i,u,o),a}function vr(n,t){n=ao.rgb(n),t=ao.rgb(t);var e=n.r,r=n.g,i=n.b,u=t.r-e,o=t.g-r,a=t.b-i;return function(n){return"#"+bn(Math.round(e+u*n))+bn(Math.round(r+o*n))+bn(Math.round(i+a*n))}}function dr(n,t){var e,r={},i={};for(e in n)e in t?r[e]=Mr(n[e],t[e]):i[e]=n[e];for(e in t)e in n||(i[e]=t[e]);return function(n){for(e in r)i[e]=r[e](n);return i}}function yr(n,t){return n=+n,t=+t,function(e){return n*(1-e)+t*e}}function mr(n,t){var e,r,i,u=hl.lastIndex=pl.lastIndex=0,o=-1,a=[],l=[];for(n+="",t+="";(e=hl.exec(n))&&(r=pl.exec(t));)(i=r.index)>u&&(i=t.slice(u,i),a[o]?a[o]+=i:a[++o]=i),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,l.push({i:o,x:yr(e,r)})),u=pl.lastIndex;return u<t.length&&(i=t.slice(u),a[o]?a[o]+=i:a[++o]=i),a.length<2?l[0]?(t=l[0].x,function(n){return t(n)+""}):function(){return t}:(t=l.length,function(n){for(var e,r=0;t>r;++r)a[(e=l[r]).i]=e.x(n);return a.join("")})}function Mr(n,t){for(var e,r=ao.interpolators.length;--r>=0&&!(e=ao.interpolators[r](n,t)););return e}function xr(n,t){var e,r=[],i=[],u=n.length,o=t.length,a=Math.min(n.length,t.length);for(e=0;a>e;++e)r.push(Mr(n[e],t[e]));for(;u>e;++e)i[e]=n[e];for(;o>e;++e)i[e]=t[e];return function(n){for(e=0;a>e;++e)i[e]=r[e](n);return i}}function br(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}function _r(n){return function(t){return 1-n(1-t)}}function wr(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}function Sr(n){return n*n}function kr(n){return n*n*n}function Nr(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,e=t*n;return 4*(.5>n?e:3*(n-t)+e-.75)}function Er(n){return function(t){return Math.pow(t,n)}}function Ar(n){return 1-Math.cos(n*Io)}function Cr(n){return Math.pow(2,10*(n-1))}function zr(n){return 1-Math.sqrt(1-n*n)}function Lr(n,t){var e;return arguments.length<2&&(t=.45),arguments.length?e=t/Ho*Math.asin(1/n):(n=1,e=t/4),function(r){return 1+n*Math.pow(2,-10*r)*Math.sin((r-e)*Ho/t)}}function qr(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function Tr(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function Rr(n,t){n=ao.hcl(n),t=ao.hcl(t);var e=n.h,r=n.c,i=n.l,u=t.h-e,o=t.c-r,a=t.l-i;return isNaN(o)&&(o=0,r=isNaN(r)?t.c:r),isNaN(u)?(u=0,e=isNaN(e)?t.h:e):u>180?u-=360:-180>u&&(u+=360),function(n){return sn(e+u*n,r+o*n,i+a*n)+""}}function Dr(n,t){n=ao.hsl(n),t=ao.hsl(t);var e=n.h,r=n.s,i=n.l,u=t.h-e,o=t.s-r,a=t.l-i;return isNaN(o)&&(o=0,r=isNaN(r)?t.s:r),isNaN(u)?(u=0,e=isNaN(e)?t.h:e):u>180?u-=360:-180>u&&(u+=360),function(n){return cn(e+u*n,r+o*n,i+a*n)+""}}function Pr(n,t){n=ao.lab(n),t=ao.lab(t);var e=n.l,r=n.a,i=n.b,u=t.l-e,o=t.a-r,a=t.b-i;return function(n){return pn(e+u*n,r+o*n,i+a*n)+""}}function Ur(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function jr(n){var t=[n.a,n.b],e=[n.c,n.d],r=Hr(t),i=Fr(t,e),u=Hr(Or(e,t,-i))||0;t[0]*e[1]<e[0]*t[1]&&(t[0]*=-1,t[1]*=-1,r*=-1,i*=-1),this.rotate=(r?Math.atan2(t[1],t[0]):Math.atan2(-e[0],e[1]))*Zo,this.translate=[n.e,n.f],this.scale=[r,u],this.skew=u?Math.atan2(i,u)*Zo:0}function Fr(n,t){return n[0]*t[0]+n[1]*t[1]}function Hr(n){var t=Math.sqrt(Fr(n,n));return t&&(n[0]/=t,n[1]/=t),t}function Or(n,t,e){return n[0]+=e*t[0],n[1]+=e*t[1],n}function Ir(n){return n.length?n.pop()+",":""}function Yr(n,t,e,r){if(n[0]!==t[0]||n[1]!==t[1]){var i=e.push("translate(",null,",",null,")");r.push({i:i-4,x:yr(n[0],t[0])},{i:i-2,x:yr(n[1],t[1])})}else(t[0]||t[1])&&e.push("translate("+t+")")}function Zr(n,t,e,r){n!==t?(n-t>180?t+=360:t-n>180&&(n+=360),r.push({i:e.push(Ir(e)+"rotate(",null,")")-2,x:yr(n,t)})):t&&e.push(Ir(e)+"rotate("+t+")")}function Vr(n,t,e,r){n!==t?r.push({i:e.push(Ir(e)+"skewX(",null,")")-2,x:yr(n,t)}):t&&e.push(Ir(e)+"skewX("+t+")")}function Xr(n,t,e,r){if(n[0]!==t[0]||n[1]!==t[1]){var i=e.push(Ir(e)+"scale(",null,",",null,")");r.push({i:i-4,x:yr(n[0],t[0])},{i:i-2,x:yr(n[1],t[1])})}else 1===t[0]&&1===t[1]||e.push(Ir(e)+"scale("+t+")")}function $r(n,t){var e=[],r=[];return n=ao.transform(n),t=ao.transform(t),Yr(n.translate,t.translate,e,r),Zr(n.rotate,t.rotate,e,r),Vr(n.skew,t.skew,e,r),Xr(n.scale,t.scale,e,r),n=t=null,function(n){for(var t,i=-1,u=r.length;++i<u;)e[(t=r[i]).i]=t.x(n);return e.join("")}}function Br(n,t){return t=(t-=n=+n)||1/t,function(e){return(e-n)/t}}function Wr(n,t){return t=(t-=n=+n)||1/t,function(e){return Math.max(0,Math.min(1,(e-n)/t))}}function Jr(n){for(var t=n.source,e=n.target,r=Kr(t,e),i=[t];t!==r;)t=t.parent,i.push(t);for(var u=i.length;e!==r;)i.splice(u,0,e),e=e.parent;return i}function Gr(n){for(var t=[],e=n.parent;null!=e;)t.push(n),n=e,e=e.parent;return t.push(n),t}function Kr(n,t){if(n===t)return n;for(var e=Gr(n),r=Gr(t),i=e.pop(),u=r.pop(),o=null;i===u;)o=i,i=e.pop(),u=r.pop();return o}function Qr(n){n.fixed|=2}function ni(n){n.fixed&=-7}function ti(n){n.fixed|=4,n.px=n.x,n.py=n.y}function ei(n){n.fixed&=-5}function ri(n,t,e){var r=0,i=0;if(n.charge=0,!n.leaf)for(var u,o=n.nodes,a=o.length,l=-1;++l<a;)u=o[l],null!=u&&(ri(u,t,e),n.charge+=u.charge,r+=u.charge*u.cx,i+=u.charge*u.cy);if(n.point){n.leaf||(n.point.x+=Math.random()-.5,n.point.y+=Math.random()-.5);var c=t*e[n.point.index];n.charge+=n.pointCharge=c,r+=c*n.point.x,i+=c*n.point.y}n.cx=r/n.charge,n.cy=i/n.charge}function ii(n,t){return ao.rebind(n,t,"sort","children","value"),n.nodes=n,n.links=fi,n}function ui(n,t){for(var e=[n];null!=(n=e.pop());)if(t(n),(i=n.children)&&(r=i.length))for(var r,i;--r>=0;)e.push(i[r])}function oi(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(u=n.children)&&(i=u.length))for(var i,u,o=-1;++o<i;)e.push(u[o]);for(;null!=(n=r.pop());)t(n)}function ai(n){return n.children}function li(n){return n.value}function ci(n,t){return t.value-n.value}function fi(n){return ao.merge(n.map(function(n){return(n.children||[]).map(function(t){return{source:n,target:t}})}))}function si(n){return n.x}function hi(n){return n.y}function pi(n,t,e){n.y0=t,n.y=e}function gi(n){return ao.range(n.length)}function vi(n){for(var t=-1,e=n[0].length,r=[];++t<e;)r[t]=0;return r}function di(n){for(var t,e=1,r=0,i=n[0][1],u=n.length;u>e;++e)(t=n[e][1])>i&&(r=e,i=t);return r}function yi(n){return n.reduce(mi,0)}function mi(n,t){return n+t[1]}function Mi(n,t){return xi(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function xi(n,t){for(var e=-1,r=+n[0],i=(n[1]-r)/t,u=[];++e<=t;)u[e]=i*e+r;return u}function bi(n){return[ao.min(n),ao.max(n)]}function _i(n,t){return n.value-t.value}function wi(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function Si(n,t){n._pack_next=t,t._pack_prev=n}function ki(n,t){var e=t.x-n.x,r=t.y-n.y,i=n.r+t.r;return.999*i*i>e*e+r*r}function Ni(n){function t(n){f=Math.min(n.x-n.r,f),s=Math.max(n.x+n.r,s),h=Math.min(n.y-n.r,h),p=Math.max(n.y+n.r,p)}if((e=n.children)&&(c=e.length)){var e,r,i,u,o,a,l,c,f=1/0,s=-(1/0),h=1/0,p=-(1/0);if(e.forEach(Ei),r=e[0],r.x=-r.r,r.y=0,t(r),c>1&&(i=e[1],i.x=i.r,i.y=0,t(i),c>2))for(u=e[2],zi(r,i,u),t(u),wi(r,u),r._pack_prev=u,wi(u,i),i=r._pack_next,o=3;c>o;o++){zi(r,i,u=e[o]);var g=0,v=1,d=1;for(a=i._pack_next;a!==i;a=a._pack_next,v++)if(ki(a,u)){g=1;break}if(1==g)for(l=r._pack_prev;l!==a._pack_prev&&!ki(l,u);l=l._pack_prev,d++);g?(d>v||v==d&&i.r<r.r?Si(r,i=a):Si(r=l,i),o--):(wi(r,u),i=u,t(u))}var y=(f+s)/2,m=(h+p)/2,M=0;for(o=0;c>o;o++)u=e[o],u.x-=y,u.y-=m,M=Math.max(M,u.r+Math.sqrt(u.x*u.x+u.y*u.y));n.r=M,e.forEach(Ai)}}function Ei(n){n._pack_next=n._pack_prev=n}function Ai(n){delete n._pack_next,delete n._pack_prev}function Ci(n,t,e,r){var i=n.children;if(n.x=t+=r*n.x,n.y=e+=r*n.y,n.r*=r,i)for(var u=-1,o=i.length;++u<o;)Ci(i[u],t,e,r)}function zi(n,t,e){var r=n.r+e.r,i=t.x-n.x,u=t.y-n.y;if(r&&(i||u)){var o=t.r+e.r,a=i*i+u*u;o*=o,r*=r;var l=.5+(r-o)/(2*a),c=Math.sqrt(Math.max(0,2*o*(r+a)-(r-=a)*r-o*o))/(2*a);e.x=n.x+l*i+c*u,e.y=n.y+l*u-c*i}else e.x=n.x+r,e.y=n.y}function Li(n,t){return n.parent==t.parent?1:2}function qi(n){var t=n.children;return t.length?t[0]:n.t}function Ti(n){var t,e=n.children;return(t=e.length)?e[t-1]:n.t}function Ri(n,t,e){var r=e/(t.i-n.i);t.c-=r,t.s+=e,n.c+=r,t.z+=e,t.m+=e}function Di(n){for(var t,e=0,r=0,i=n.children,u=i.length;--u>=0;)t=i[u],t.z+=e,t.m+=e,e+=t.s+(r+=t.c)}function Pi(n,t,e){return n.a.parent===t.parent?n.a:e}function Ui(n){return 1+ao.max(n,function(n){return n.y})}function ji(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function Fi(n){var t=n.children;return t&&t.length?Fi(t[0]):n}function Hi(n){var t,e=n.children;return e&&(t=e.length)?Hi(e[t-1]):n}function Oi(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function Ii(n,t){var e=n.x+t[3],r=n.y+t[0],i=n.dx-t[1]-t[3],u=n.dy-t[0]-t[2];return 0>i&&(e+=i/2,i=0),0>u&&(r+=u/2,u=0),{x:e,y:r,dx:i,dy:u}}function Yi(n){var t=n[0],e=n[n.length-1];return e>t?[t,e]:[e,t]}function Zi(n){return n.rangeExtent?n.rangeExtent():Yi(n.range())}function Vi(n,t,e,r){var i=e(n[0],n[1]),u=r(t[0],t[1]);return function(n){return u(i(n))}}function Xi(n,t){var e,r=0,i=n.length-1,u=n[r],o=n[i];return u>o&&(e=r,r=i,i=e,e=u,u=o,o=e),n[r]=t.floor(u),n[i]=t.ceil(o),n}function $i(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:Sl}function Bi(n,t,e,r){var i=[],u=[],o=0,a=Math.min(n.length,t.length)-1;for(n[a]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse());++o<=a;)i.push(e(n[o-1],n[o])),u.push(r(t[o-1],t[o]));return function(t){var e=ao.bisect(n,t,1,a)-1;return u[e](i[e](t))}}function Wi(n,t,e,r){function i(){var i=Math.min(n.length,t.length)>2?Bi:Vi,l=r?Wr:Br;return o=i(n,t,l,e),a=i(t,n,l,Mr),u}function u(n){return o(n)}var o,a;return u.invert=function(n){return a(n)},u.domain=function(t){return arguments.length?(n=t.map(Number),i()):n},u.range=function(n){return arguments.length?(t=n,i()):t},u.rangeRound=function(n){return u.range(n).interpolate(Ur)},u.clamp=function(n){return arguments.length?(r=n,i()):r},u.interpolate=function(n){return arguments.length?(e=n,i()):e},u.ticks=function(t){return Qi(n,t)},u.tickFormat=function(t,e){return nu(n,t,e)},u.nice=function(t){return Gi(n,t),i()},u.copy=function(){return Wi(n,t,e,r)},i()}function Ji(n,t){return ao.rebind(n,t,"range","rangeRound","interpolate","clamp")}function Gi(n,t){return Xi(n,$i(Ki(n,t)[2])),Xi(n,$i(Ki(n,t)[2])),n}function Ki(n,t){null==t&&(t=10);var e=Yi(n),r=e[1]-e[0],i=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),u=t/r*i;return.15>=u?i*=10:.35>=u?i*=5:.75>=u&&(i*=2),e[0]=Math.ceil(e[0]/i)*i,e[1]=Math.floor(e[1]/i)*i+.5*i,e[2]=i,e}function Qi(n,t){return ao.range.apply(ao,Ki(n,t))}function nu(n,t,e){var r=Ki(n,t);if(e){var i=ha.exec(e);if(i.shift(),"s"===i[8]){var u=ao.formatPrefix(Math.max(xo(r[0]),xo(r[1])));return i[7]||(i[7]="."+tu(u.scale(r[2]))),i[8]="f",e=ao.format(i.join("")),function(n){return e(u.scale(n))+u.symbol}}i[7]||(i[7]="."+eu(i[8],r)),e=i.join("")}else e=",."+tu(r[2])+"f";return ao.format(e)}function tu(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}function eu(n,t){var e=tu(t[2]);return n in kl?Math.abs(e-tu(Math.max(xo(t[0]),xo(t[1]))))+ +("e"!==n):e-2*("%"===n)}function ru(n,t,e,r){function i(n){return(e?Math.log(0>n?0:n):-Math.log(n>0?0:-n))/Math.log(t)}function u(n){return e?Math.pow(t,n):-Math.pow(t,-n)}function o(t){return n(i(t))}return o.invert=function(t){return u(n.invert(t))},o.domain=function(t){return arguments.length?(e=t[0]>=0,n.domain((r=t.map(Number)).map(i)),o):r},o.base=function(e){return arguments.length?(t=+e,n.domain(r.map(i)),o):t},o.nice=function(){var t=Xi(r.map(i),e?Math:El);return n.domain(t),r=t.map(u),o},o.ticks=function(){var n=Yi(r),o=[],a=n[0],l=n[1],c=Math.floor(i(a)),f=Math.ceil(i(l)),s=t%1?2:t;if(isFinite(f-c)){if(e){for(;f>c;c++)for(var h=1;s>h;h++)o.push(u(c)*h);o.push(u(c))}else for(o.push(u(c));c++<f;)for(var h=s-1;h>0;h--)o.push(u(c)*h);for(c=0;o[c]<a;c++);for(f=o.length;o[f-1]>l;f--);o=o.slice(c,f)}return o},o.tickFormat=function(n,e){if(!arguments.length)return Nl;arguments.length<2?e=Nl:"function"!=typeof e&&(e=ao.format(e));var r=Math.max(1,t*n/o.ticks().length);return function(n){var o=n/u(Math.round(i(n)));return t-.5>o*t&&(o*=t),r>=o?e(n):""}},o.copy=function(){return ru(n.copy(),t,e,r)},Ji(o,n)}function iu(n,t,e){function r(t){return n(i(t))}var i=uu(t),u=uu(1/t);return r.invert=function(t){return u(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain((e=t.map(Number)).map(i)),r):e},r.ticks=function(n){return Qi(e,n)},r.tickFormat=function(n,t){return nu(e,n,t)},r.nice=function(n){return r.domain(Gi(e,n))},r.exponent=function(o){return arguments.length?(i=uu(t=o),u=uu(1/t),n.domain(e.map(i)),r):t},r.copy=function(){return iu(n.copy(),t,e)},Ji(r,n)}function uu(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}}function ou(n,t){function e(e){return u[((i.get(e)||("range"===t.t?i.set(e,n.push(e)):NaN))-1)%u.length]}function r(t,e){return ao.range(n.length).map(function(n){return t+e*n})}var i,u,o;return e.domain=function(r){if(!arguments.length)return n;n=[],i=new c;for(var u,o=-1,a=r.length;++o<a;)i.has(u=r[o])||i.set(u,n.push(u));return e[t.t].apply(e,t.a)},e.range=function(n){return arguments.length?(u=n,o=0,t={t:"range",a:arguments},e):u},e.rangePoints=function(i,a){arguments.length<2&&(a=0);var l=i[0],c=i[1],f=n.length<2?(l=(l+c)/2,0):(c-l)/(n.length-1+a);return u=r(l+f*a/2,f),o=0,t={t:"rangePoints",a:arguments},e},e.rangeRoundPoints=function(i,a){arguments.length<2&&(a=0);var l=i[0],c=i[1],f=n.length<2?(l=c=Math.round((l+c)/2),0):(c-l)/(n.length-1+a)|0;return u=r(l+Math.round(f*a/2+(c-l-(n.length-1+a)*f)/2),f),o=0,t={t:"rangeRoundPoints",a:arguments},e},e.rangeBands=function(i,a,l){arguments.length<2&&(a=0),arguments.length<3&&(l=a);var c=i[1]<i[0],f=i[c-0],s=i[1-c],h=(s-f)/(n.length-a+2*l);return u=r(f+h*l,h),c&&u.reverse(),o=h*(1-a),t={t:"rangeBands",a:arguments},e},e.rangeRoundBands=function(i,a,l){arguments.length<2&&(a=0),arguments.length<3&&(l=a);var c=i[1]<i[0],f=i[c-0],s=i[1-c],h=Math.floor((s-f)/(n.length-a+2*l));return u=r(f+Math.round((s-f-(n.length-a)*h)/2),h),c&&u.reverse(),o=Math.round(h*(1-a)),t={t:"rangeRoundBands",a:arguments},e},e.rangeBand=function(){return o},e.rangeExtent=function(){return Yi(t.a[0])},e.copy=function(){return ou(n,t)},e.domain(n)}function au(n,t){function u(){var e=0,r=t.length;for(a=[];++e<r;)a[e-1]=ao.quantile(n,e/r);return o}function o(n){return isNaN(n=+n)?void 0:t[ao.bisect(a,n)]}var a;return o.domain=function(t){return arguments.length?(n=t.map(r).filter(i).sort(e),u()):n},o.range=function(n){return arguments.length?(t=n,u()):t},o.quantiles=function(){return a},o.invertExtent=function(e){return e=t.indexOf(e),0>e?[NaN,NaN]:[e>0?a[e-1]:n[0],e<a.length?a[e]:n[n.length-1]]},o.copy=function(){return au(n,t)},u()}function lu(n,t,e){function r(t){return e[Math.max(0,Math.min(o,Math.floor(u*(t-n))))]}function i(){return u=e.length/(t-n),o=e.length-1,r}var u,o;return r.domain=function(e){return arguments.length?(n=+e[0],t=+e[e.length-1],i()):[n,t]},r.range=function(n){return arguments.length?(e=n,i()):e},r.invertExtent=function(t){return t=e.indexOf(t),t=0>t?NaN:t/u+n,[t,t+1/u]},r.copy=function(){return lu(n,t,e)},i()}function cu(n,t){function e(e){return e>=e?t[ao.bisect(n,e)]:void 0}return e.domain=function(t){return arguments.length?(n=t,e):n},e.range=function(n){return arguments.length?(t=n,e):t},e.invertExtent=function(e){return e=t.indexOf(e),[n[e-1],n[e]]},e.copy=function(){return cu(n,t)},e}function fu(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=e.map(t),t):n},t.ticks=function(t){return Qi(n,t)},t.tickFormat=function(t,e){return nu(n,t,e)},t.copy=function(){return fu(n)},t}function su(){return 0}function hu(n){return n.innerRadius}function pu(n){return n.outerRadius}function gu(n){return n.startAngle}function vu(n){return n.endAngle}function du(n){return n&&n.padAngle}function yu(n,t,e,r){return(n-e)*t-(t-r)*n>0?0:1}function mu(n,t,e,r,i){var u=n[0]-t[0],o=n[1]-t[1],a=(i?r:-r)/Math.sqrt(u*u+o*o),l=a*o,c=-a*u,f=n[0]+l,s=n[1]+c,h=t[0]+l,p=t[1]+c,g=(f+h)/2,v=(s+p)/2,d=h-f,y=p-s,m=d*d+y*y,M=e-r,x=f*p-h*s,b=(0>y?-1:1)*Math.sqrt(Math.max(0,M*M*m-x*x)),_=(x*y-d*b)/m,w=(-x*d-y*b)/m,S=(x*y+d*b)/m,k=(-x*d+y*b)/m,N=_-g,E=w-v,A=S-g,C=k-v;return N*N+E*E>A*A+C*C&&(_=S,w=k),[[_-l,w-c],[_*e/M,w*e/M]]}function Mu(n){function t(t){function o(){c.push("M",u(n(f),a))}for(var l,c=[],f=[],s=-1,h=t.length,p=En(e),g=En(r);++s<h;)i.call(this,l=t[s],s)?f.push([+p.call(this,l,s),+g.call(this,l,s)]):f.length&&(o(),f=[]);return f.length&&o(),c.length?c.join(""):null}var e=Ce,r=ze,i=zt,u=xu,o=u.key,a=.7;return t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t.defined=function(n){return arguments.length?(i=n,t):i},t.interpolate=function(n){return arguments.length?(o="function"==typeof n?u=n:(u=Tl.get(n)||xu).key,t):o},t.tension=function(n){return arguments.length?(a=n,t):a},t}function xu(n){return n.length>1?n.join("L"):n+"Z"}function bu(n){return n.join("L")+"Z"}function _u(n){for(var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];++t<e;)i.push("H",(r[0]+(r=n[t])[0])/2,"V",r[1]);return e>1&&i.push("H",r[0]),i.join("")}function wu(n){for(var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];++t<e;)i.push("V",(r=n[t])[1],"H",r[0]);return i.join("")}function Su(n){for(var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];++t<e;)i.push("H",(r=n[t])[0],"V",r[1]);return i.join("")}function ku(n,t){return n.length<4?xu(n):n[1]+Au(n.slice(1,-1),Cu(n,t))}function Nu(n,t){return n.length<3?bu(n):n[0]+Au((n.push(n[0]),n),Cu([n[n.length-2]].concat(n,[n[1]]),t))}function Eu(n,t){return n.length<3?xu(n):n[0]+Au(n,Cu(n,t))}function Au(n,t){if(t.length<1||n.length!=t.length&&n.length!=t.length+2)return xu(n);var e=n.length!=t.length,r="",i=n[0],u=n[1],o=t[0],a=o,l=1;if(e&&(r+="Q"+(u[0]-2*o[0]/3)+","+(u[1]-2*o[1]/3)+","+u[0]+","+u[1],i=n[1],l=2),t.length>1){a=t[1],u=n[l],l++,r+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(u[0]-a[0])+","+(u[1]-a[1])+","+u[0]+","+u[1];for(var c=2;c<t.length;c++,l++)u=n[l],a=t[c],r+="S"+(u[0]-a[0])+","+(u[1]-a[1])+","+u[0]+","+u[1]}if(e){var f=n[l];r+="Q"+(u[0]+2*a[0]/3)+","+(u[1]+2*a[1]/3)+","+f[0]+","+f[1]}return r}function Cu(n,t){for(var e,r=[],i=(1-t)/2,u=n[0],o=n[1],a=1,l=n.length;++a<l;)e=u,u=o,o=n[a],r.push([i*(o[0]-e[0]),i*(o[1]-e[1])]);return r}function zu(n){if(n.length<3)return xu(n);var t=1,e=n.length,r=n[0],i=r[0],u=r[1],o=[i,i,i,(r=n[1])[0]],a=[u,u,u,r[1]],l=[i,",",u,"L",Ru(Pl,o),",",Ru(Pl,a)];for(n.push(n[e-1]);++t<=e;)r=n[t],o.shift(),o.push(r[0]),a.shift(),a.push(r[1]),Du(l,o,a);return n.pop(),l.push("L",r),l.join("")}function Lu(n){if(n.length<4)return xu(n);for(var t,e=[],r=-1,i=n.length,u=[0],o=[0];++r<3;)t=n[r],u.push(t[0]),o.push(t[1]);for(e.push(Ru(Pl,u)+","+Ru(Pl,o)),--r;++r<i;)t=n[r],u.shift(),u.push(t[0]),o.shift(),o.push(t[1]),Du(e,u,o);return e.join("")}function qu(n){for(var t,e,r=-1,i=n.length,u=i+4,o=[],a=[];++r<4;)e=n[r%i],o.push(e[0]),a.push(e[1]);for(t=[Ru(Pl,o),",",Ru(Pl,a)],--r;++r<u;)e=n[r%i],o.shift(),o.push(e[0]),a.shift(),a.push(e[1]),Du(t,o,a);return t.join("")}function Tu(n,t){var e=n.length-1;if(e)for(var r,i,u=n[0][0],o=n[0][1],a=n[e][0]-u,l=n[e][1]-o,c=-1;++c<=e;)r=n[c],i=c/e,r[0]=t*r[0]+(1-t)*(u+i*a),r[1]=t*r[1]+(1-t)*(o+i*l);return zu(n)}function Ru(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]}function Du(n,t,e){n.push("C",Ru(Rl,t),",",Ru(Rl,e),",",Ru(Dl,t),",",Ru(Dl,e),",",Ru(Pl,t),",",Ru(Pl,e))}function Pu(n,t){return(t[1]-n[1])/(t[0]-n[0])}function Uu(n){for(var t=0,e=n.length-1,r=[],i=n[0],u=n[1],o=r[0]=Pu(i,u);++t<e;)r[t]=(o+(o=Pu(i=u,u=n[t+1])))/2;return r[t]=o,r}function ju(n){for(var t,e,r,i,u=[],o=Uu(n),a=-1,l=n.length-1;++a<l;)t=Pu(n[a],n[a+1]),xo(t)<Uo?o[a]=o[a+1]=0:(e=o[a]/t,r=o[a+1]/t,i=e*e+r*r,i>9&&(i=3*t/Math.sqrt(i),o[a]=i*e,o[a+1]=i*r));for(a=-1;++a<=l;)i=(n[Math.min(l,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),u.push([i||0,o[a]*i||0]);return u}function Fu(n){return n.length<3?xu(n):n[0]+Au(n,ju(n))}function Hu(n){for(var t,e,r,i=-1,u=n.length;++i<u;)t=n[i],e=t[0],r=t[1]-Io,t[0]=e*Math.cos(r),t[1]=e*Math.sin(r);return n}function Ou(n){function t(t){function l(){v.push("M",a(n(y),s),f,c(n(d.reverse()),s),"Z")}for(var h,p,g,v=[],d=[],y=[],m=-1,M=t.length,x=En(e),b=En(i),_=e===r?function(){ +return p}:En(r),w=i===u?function(){return g}:En(u);++m<M;)o.call(this,h=t[m],m)?(d.push([p=+x.call(this,h,m),g=+b.call(this,h,m)]),y.push([+_.call(this,h,m),+w.call(this,h,m)])):d.length&&(l(),d=[],y=[]);return d.length&&l(),v.length?v.join(""):null}var e=Ce,r=Ce,i=0,u=ze,o=zt,a=xu,l=a.key,c=a,f="L",s=.7;return t.x=function(n){return arguments.length?(e=r=n,t):r},t.x0=function(n){return arguments.length?(e=n,t):e},t.x1=function(n){return arguments.length?(r=n,t):r},t.y=function(n){return arguments.length?(i=u=n,t):u},t.y0=function(n){return arguments.length?(i=n,t):i},t.y1=function(n){return arguments.length?(u=n,t):u},t.defined=function(n){return arguments.length?(o=n,t):o},t.interpolate=function(n){return arguments.length?(l="function"==typeof n?a=n:(a=Tl.get(n)||xu).key,c=a.reverse||a,f=a.closed?"M":"L",t):l},t.tension=function(n){return arguments.length?(s=n,t):s},t}function Iu(n){return n.radius}function Yu(n){return[n.x,n.y]}function Zu(n){return function(){var t=n.apply(this,arguments),e=t[0],r=t[1]-Io;return[e*Math.cos(r),e*Math.sin(r)]}}function Vu(){return 64}function Xu(){return"circle"}function $u(n){var t=Math.sqrt(n/Fo);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function Bu(n){return function(){var t,e,r;(t=this[n])&&(r=t[e=t.active])&&(r.timer.c=null,r.timer.t=NaN,--t.count?delete t[e]:delete this[n],t.active+=.5,r.event&&r.event.interrupt.call(this,this.__data__,r.index))}}function Wu(n,t,e){return ko(n,Yl),n.namespace=t,n.id=e,n}function Ju(n,t,e,r){var i=n.id,u=n.namespace;return Y(n,"function"==typeof e?function(n,o,a){n[u][i].tween.set(t,r(e.call(n,n.__data__,o,a)))}:(e=r(e),function(n){n[u][i].tween.set(t,e)}))}function Gu(n){return null==n&&(n=""),function(){this.textContent=n}}function Ku(n){return null==n?"__transition__":"__transition_"+n+"__"}function Qu(n,t,e,r,i){function u(n){var t=v.delay;return f.t=t+l,n>=t?o(n-t):void(f.c=o)}function o(e){var i=g.active,u=g[i];u&&(u.timer.c=null,u.timer.t=NaN,--g.count,delete g[i],u.event&&u.event.interrupt.call(n,n.__data__,u.index));for(var o in g)if(r>+o){var c=g[o];c.timer.c=null,c.timer.t=NaN,--g.count,delete g[o]}f.c=a,qn(function(){return f.c&&a(e||1)&&(f.c=null,f.t=NaN),1},0,l),g.active=r,v.event&&v.event.start.call(n,n.__data__,t),p=[],v.tween.forEach(function(e,r){(r=r.call(n,n.__data__,t))&&p.push(r)}),h=v.ease,s=v.duration}function a(i){for(var u=i/s,o=h(u),a=p.length;a>0;)p[--a].call(n,o);return u>=1?(v.event&&v.event.end.call(n,n.__data__,t),--g.count?delete g[r]:delete n[e],1):void 0}var l,f,s,h,p,g=n[e]||(n[e]={active:0,count:0}),v=g[r];v||(l=i.time,f=qn(u,0,l),v=g[r]={tween:new c,time:l,timer:f,delay:i.delay,duration:i.duration,ease:i.ease,index:t},i=null,++g.count)}function no(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate("+(isFinite(r)?r:e(n))+",0)"})}function to(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate(0,"+(isFinite(r)?r:e(n))+")"})}function eo(n){return n.toISOString()}function ro(n,t,e){function r(t){return n(t)}function i(n,e){var r=n[1]-n[0],i=r/e,u=ao.bisect(Kl,i);return u==Kl.length?[t.year,Ki(n.map(function(n){return n/31536e6}),e)[2]]:u?t[i/Kl[u-1]<Kl[u]/i?u-1:u]:[tc,Ki(n,e)[2]]}return r.invert=function(t){return io(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain(t),r):n.domain().map(io)},r.nice=function(n,t){function e(e){return!isNaN(e)&&!n.range(e,io(+e+1),t).length}var u=r.domain(),o=Yi(u),a=null==n?i(o,10):"number"==typeof n&&i(o,n);return a&&(n=a[0],t=a[1]),r.domain(Xi(u,t>1?{floor:function(t){for(;e(t=n.floor(t));)t=io(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=io(+t+1);return t}}:n))},r.ticks=function(n,t){var e=Yi(r.domain()),u=null==n?i(e,10):"number"==typeof n?i(e,n):!n.range&&[{range:n},t];return u&&(n=u[0],t=u[1]),n.range(e[0],io(+e[1]+1),1>t?1:t)},r.tickFormat=function(){return e},r.copy=function(){return ro(n.copy(),t,e)},Ji(r,n)}function io(n){return new Date(n)}function uo(n){return JSON.parse(n.responseText)}function oo(n){var t=fo.createRange();return t.selectNode(fo.body),t.createContextualFragment(n.responseText)}var ao={version:"3.5.17"},lo=[].slice,co=function(n){return lo.call(n)},fo=this.document;if(fo)try{co(fo.documentElement.childNodes)[0].nodeType}catch(so){co=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}if(Date.now||(Date.now=function(){return+new Date}),fo)try{fo.createElement("DIV").style.setProperty("opacity",0,"")}catch(ho){var po=this.Element.prototype,go=po.setAttribute,vo=po.setAttributeNS,yo=this.CSSStyleDeclaration.prototype,mo=yo.setProperty;po.setAttribute=function(n,t){go.call(this,n,t+"")},po.setAttributeNS=function(n,t,e){vo.call(this,n,t,e+"")},yo.setProperty=function(n,t,e){mo.call(this,n,t+"",e)}}ao.ascending=e,ao.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:NaN},ao.min=function(n,t){var e,r,i=-1,u=n.length;if(1===arguments.length){for(;++i<u;)if(null!=(r=n[i])&&r>=r){e=r;break}for(;++i<u;)null!=(r=n[i])&&e>r&&(e=r)}else{for(;++i<u;)if(null!=(r=t.call(n,n[i],i))&&r>=r){e=r;break}for(;++i<u;)null!=(r=t.call(n,n[i],i))&&e>r&&(e=r)}return e},ao.max=function(n,t){var e,r,i=-1,u=n.length;if(1===arguments.length){for(;++i<u;)if(null!=(r=n[i])&&r>=r){e=r;break}for(;++i<u;)null!=(r=n[i])&&r>e&&(e=r)}else{for(;++i<u;)if(null!=(r=t.call(n,n[i],i))&&r>=r){e=r;break}for(;++i<u;)null!=(r=t.call(n,n[i],i))&&r>e&&(e=r)}return e},ao.extent=function(n,t){var e,r,i,u=-1,o=n.length;if(1===arguments.length){for(;++u<o;)if(null!=(r=n[u])&&r>=r){e=i=r;break}for(;++u<o;)null!=(r=n[u])&&(e>r&&(e=r),r>i&&(i=r))}else{for(;++u<o;)if(null!=(r=t.call(n,n[u],u))&&r>=r){e=i=r;break}for(;++u<o;)null!=(r=t.call(n,n[u],u))&&(e>r&&(e=r),r>i&&(i=r))}return[e,i]},ao.sum=function(n,t){var e,r=0,u=n.length,o=-1;if(1===arguments.length)for(;++o<u;)i(e=+n[o])&&(r+=e);else for(;++o<u;)i(e=+t.call(n,n[o],o))&&(r+=e);return r},ao.mean=function(n,t){var e,u=0,o=n.length,a=-1,l=o;if(1===arguments.length)for(;++a<o;)i(e=r(n[a]))?u+=e:--l;else for(;++a<o;)i(e=r(t.call(n,n[a],a)))?u+=e:--l;return l?u/l:void 0},ao.quantile=function(n,t){var e=(n.length-1)*t+1,r=Math.floor(e),i=+n[r-1],u=e-r;return u?i+u*(n[r]-i):i},ao.median=function(n,t){var u,o=[],a=n.length,l=-1;if(1===arguments.length)for(;++l<a;)i(u=r(n[l]))&&o.push(u);else for(;++l<a;)i(u=r(t.call(n,n[l],l)))&&o.push(u);return o.length?ao.quantile(o.sort(e),.5):void 0},ao.variance=function(n,t){var e,u,o=n.length,a=0,l=0,c=-1,f=0;if(1===arguments.length)for(;++c<o;)i(e=r(n[c]))&&(u=e-a,a+=u/++f,l+=u*(e-a));else for(;++c<o;)i(e=r(t.call(n,n[c],c)))&&(u=e-a,a+=u/++f,l+=u*(e-a));return f>1?l/(f-1):void 0},ao.deviation=function(){var n=ao.variance.apply(this,arguments);return n?Math.sqrt(n):n};var Mo=u(e);ao.bisectLeft=Mo.left,ao.bisect=ao.bisectRight=Mo.right,ao.bisector=function(n){return u(1===n.length?function(t,r){return e(n(t),r)}:n)},ao.shuffle=function(n,t,e){(u=arguments.length)<3&&(e=n.length,2>u&&(t=0));for(var r,i,u=e-t;u;)i=Math.random()*u--|0,r=n[u+t],n[u+t]=n[i+t],n[i+t]=r;return n},ao.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},ao.pairs=function(n){for(var t,e=0,r=n.length-1,i=n[0],u=new Array(0>r?0:r);r>e;)u[e]=[t=i,i=n[++e]];return u},ao.transpose=function(n){if(!(i=n.length))return[];for(var t=-1,e=ao.min(n,o),r=new Array(e);++t<e;)for(var i,u=-1,a=r[t]=new Array(i);++u<i;)a[u]=n[u][t];return r},ao.zip=function(){return ao.transpose(arguments)},ao.keys=function(n){var t=[];for(var e in n)t.push(e);return t},ao.values=function(n){var t=[];for(var e in n)t.push(n[e]);return t},ao.entries=function(n){var t=[];for(var e in n)t.push({key:e,value:n[e]});return t},ao.merge=function(n){for(var t,e,r,i=n.length,u=-1,o=0;++u<i;)o+=n[u].length;for(e=new Array(o);--i>=0;)for(r=n[i],t=r.length;--t>=0;)e[--o]=r[t];return e};var xo=Math.abs;ao.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),(t-n)/e===1/0)throw new Error("infinite range");var r,i=[],u=a(xo(e)),o=-1;if(n*=u,t*=u,e*=u,0>e)for(;(r=n+e*++o)>t;)i.push(r/u);else for(;(r=n+e*++o)<t;)i.push(r/u);return i},ao.map=function(n,t){var e=new c;if(n instanceof c)n.forEach(function(n,t){e.set(n,t)});else if(Array.isArray(n)){var r,i=-1,u=n.length;if(1===arguments.length)for(;++i<u;)e.set(i,n[i]);else for(;++i<u;)e.set(t.call(n,r=n[i],i),r)}else for(var o in n)e.set(o,n[o]);return e};var bo="__proto__",_o="\x00";l(c,{has:h,get:function(n){return this._[f(n)]},set:function(n,t){return this._[f(n)]=t},remove:p,keys:g,values:function(){var n=[];for(var t in this._)n.push(this._[t]);return n},entries:function(){var n=[];for(var t in this._)n.push({key:s(t),value:this._[t]});return n},size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,s(t),this._[t])}}),ao.nest=function(){function n(t,o,a){if(a>=u.length)return r?r.call(i,o):e?o.sort(e):o;for(var l,f,s,h,p=-1,g=o.length,v=u[a++],d=new c;++p<g;)(h=d.get(l=v(f=o[p])))?h.push(f):d.set(l,[f]);return t?(f=t(),s=function(e,r){f.set(e,n(t,r,a))}):(f={},s=function(e,r){f[e]=n(t,r,a)}),d.forEach(s),f}function t(n,e){if(e>=u.length)return n;var r=[],i=o[e++];return n.forEach(function(n,i){r.push({key:n,values:t(i,e)})}),i?r.sort(function(n,t){return i(n.key,t.key)}):r}var e,r,i={},u=[],o=[];return i.map=function(t,e){return n(e,t,0)},i.entries=function(e){return t(n(ao.map,e,0),0)},i.key=function(n){return u.push(n),i},i.sortKeys=function(n){return o[u.length-1]=n,i},i.sortValues=function(n){return e=n,i},i.rollup=function(n){return r=n,i},i},ao.set=function(n){var t=new y;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},l(y,{has:h,add:function(n){return this._[f(n+="")]=!0,n},remove:p,values:g,size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,s(t))}}),ao.behavior={},ao.rebind=function(n,t){for(var e,r=1,i=arguments.length;++r<i;)n[e=arguments[r]]=M(n,t,t[e]);return n};var wo=["webkit","ms","moz","Moz","o","O"];ao.dispatch=function(){for(var n=new _,t=-1,e=arguments.length;++t<e;)n[arguments[t]]=w(n);return n},_.prototype.on=function(n,t){var e=n.indexOf("."),r="";if(e>=0&&(r=n.slice(e+1),n=n.slice(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},ao.event=null,ao.requote=function(n){return n.replace(So,"\\$&")};var So=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,ko={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},No=function(n,t){return t.querySelector(n)},Eo=function(n,t){return t.querySelectorAll(n)},Ao=function(n,t){var e=n.matches||n[x(n,"matchesSelector")];return(Ao=function(n,t){return e.call(n,t)})(n,t)};"function"==typeof Sizzle&&(No=function(n,t){return Sizzle(n,t)[0]||null},Eo=Sizzle,Ao=Sizzle.matchesSelector),ao.selection=function(){return ao.select(fo.documentElement)};var Co=ao.selection.prototype=[];Co.select=function(n){var t,e,r,i,u=[];n=A(n);for(var o=-1,a=this.length;++o<a;){u.push(t=[]),t.parentNode=(r=this[o]).parentNode;for(var l=-1,c=r.length;++l<c;)(i=r[l])?(t.push(e=n.call(i,i.__data__,l,o)),e&&"__data__"in i&&(e.__data__=i.__data__)):t.push(null)}return E(u)},Co.selectAll=function(n){var t,e,r=[];n=C(n);for(var i=-1,u=this.length;++i<u;)for(var o=this[i],a=-1,l=o.length;++a<l;)(e=o[a])&&(r.push(t=co(n.call(e,e.__data__,a,i))),t.parentNode=e);return E(r)};var zo="http://www.w3.org/1999/xhtml",Lo={svg:"http://www.w3.org/2000/svg",xhtml:zo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};ao.ns={prefix:Lo,qualify:function(n){var t=n.indexOf(":"),e=n;return t>=0&&"xmlns"!==(e=n.slice(0,t))&&(n=n.slice(t+1)),Lo.hasOwnProperty(e)?{space:Lo[e],local:n}:n}},Co.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=ao.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(z(t,n[t]));return this}return this.each(z(n,t))},Co.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=T(n)).length,i=-1;if(t=e.classList){for(;++i<r;)if(!t.contains(n[i]))return!1}else for(t=e.getAttribute("class");++i<r;)if(!q(n[i]).test(t))return!1;return!0}for(t in n)this.each(R(t,n[t]));return this}return this.each(R(n,t))},Co.style=function(n,e,r){var i=arguments.length;if(3>i){if("string"!=typeof n){2>i&&(e="");for(r in n)this.each(P(r,n[r],e));return this}if(2>i){var u=this.node();return t(u).getComputedStyle(u,null).getPropertyValue(n)}r=""}return this.each(P(n,e,r))},Co.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(U(t,n[t]));return this}return this.each(U(n,t))},Co.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},Co.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},Co.append=function(n){return n=j(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},Co.insert=function(n,t){return n=j(n),t=A(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments)||null)})},Co.remove=function(){return this.each(F)},Co.data=function(n,t){function e(n,e){var r,i,u,o=n.length,s=e.length,h=Math.min(o,s),p=new Array(s),g=new Array(s),v=new Array(o);if(t){var d,y=new c,m=new Array(o);for(r=-1;++r<o;)(i=n[r])&&(y.has(d=t.call(i,i.__data__,r))?v[r]=i:y.set(d,i),m[r]=d);for(r=-1;++r<s;)(i=y.get(d=t.call(e,u=e[r],r)))?i!==!0&&(p[r]=i,i.__data__=u):g[r]=H(u),y.set(d,!0);for(r=-1;++r<o;)r in m&&y.get(m[r])!==!0&&(v[r]=n[r])}else{for(r=-1;++r<h;)i=n[r],u=e[r],i?(i.__data__=u,p[r]=i):g[r]=H(u);for(;s>r;++r)g[r]=H(e[r]);for(;o>r;++r)v[r]=n[r]}g.update=p,g.parentNode=p.parentNode=v.parentNode=n.parentNode,a.push(g),l.push(p),f.push(v)}var r,i,u=-1,o=this.length;if(!arguments.length){for(n=new Array(o=(r=this[0]).length);++u<o;)(i=r[u])&&(n[u]=i.__data__);return n}var a=Z([]),l=E([]),f=E([]);if("function"==typeof n)for(;++u<o;)e(r=this[u],n.call(r,r.parentNode.__data__,u));else for(;++u<o;)e(r=this[u],n);return l.enter=function(){return a},l.exit=function(){return f},l},Co.datum=function(n){return arguments.length?this.property("__data__",n):this.property("__data__")},Co.filter=function(n){var t,e,r,i=[];"function"!=typeof n&&(n=O(n));for(var u=0,o=this.length;o>u;u++){i.push(t=[]),t.parentNode=(e=this[u]).parentNode;for(var a=0,l=e.length;l>a;a++)(r=e[a])&&n.call(r,r.__data__,a,u)&&t.push(r)}return E(i)},Co.order=function(){for(var n=-1,t=this.length;++n<t;)for(var e,r=this[n],i=r.length-1,u=r[i];--i>=0;)(e=r[i])&&(u&&u!==e.nextSibling&&u.parentNode.insertBefore(e,u),u=e);return this},Co.sort=function(n){n=I.apply(this,arguments);for(var t=-1,e=this.length;++t<e;)this[t].sort(n);return this.order()},Co.each=function(n){return Y(this,function(t,e,r){n.call(t,t.__data__,e,r)})},Co.call=function(n){var t=co(arguments);return n.apply(t[0]=this,t),this},Co.empty=function(){return!this.node()},Co.node=function(){for(var n=0,t=this.length;t>n;n++)for(var e=this[n],r=0,i=e.length;i>r;r++){var u=e[r];if(u)return u}return null},Co.size=function(){var n=0;return Y(this,function(){++n}),n};var qo=[];ao.selection.enter=Z,ao.selection.enter.prototype=qo,qo.append=Co.append,qo.empty=Co.empty,qo.node=Co.node,qo.call=Co.call,qo.size=Co.size,qo.select=function(n){for(var t,e,r,i,u,o=[],a=-1,l=this.length;++a<l;){r=(i=this[a]).update,o.push(t=[]),t.parentNode=i.parentNode;for(var c=-1,f=i.length;++c<f;)(u=i[c])?(t.push(r[c]=e=n.call(i.parentNode,u.__data__,c,a)),e.__data__=u.__data__):t.push(null)}return E(o)},qo.insert=function(n,t){return arguments.length<2&&(t=V(this)),Co.insert.call(this,n,t)},ao.select=function(t){var e;return"string"==typeof t?(e=[No(t,fo)],e.parentNode=fo.documentElement):(e=[t],e.parentNode=n(t)),E([e])},ao.selectAll=function(n){var t;return"string"==typeof n?(t=co(Eo(n,fo)),t.parentNode=fo.documentElement):(t=co(n),t.parentNode=null),E([t])},Co.on=function(n,t,e){var r=arguments.length;if(3>r){if("string"!=typeof n){2>r&&(t=!1);for(e in n)this.each(X(e,n[e],t));return this}if(2>r)return(r=this.node()["__on"+n])&&r._;e=!1}return this.each(X(n,t,e))};var To=ao.map({mouseenter:"mouseover",mouseleave:"mouseout"});fo&&To.forEach(function(n){"on"+n in fo&&To.remove(n)});var Ro,Do=0;ao.mouse=function(n){return J(n,k())};var Po=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;ao.touch=function(n,t,e){if(arguments.length<3&&(e=t,t=k().changedTouches),t)for(var r,i=0,u=t.length;u>i;++i)if((r=t[i]).identifier===e)return J(n,r)},ao.behavior.drag=function(){function n(){this.on("mousedown.drag",u).on("touchstart.drag",o)}function e(n,t,e,u,o){return function(){function a(){var n,e,r=t(h,v);r&&(n=r[0]-M[0],e=r[1]-M[1],g|=n|e,M=r,p({type:"drag",x:r[0]+c[0],y:r[1]+c[1],dx:n,dy:e}))}function l(){t(h,v)&&(y.on(u+d,null).on(o+d,null),m(g),p({type:"dragend"}))}var c,f=this,s=ao.event.target.correspondingElement||ao.event.target,h=f.parentNode,p=r.of(f,arguments),g=0,v=n(),d=".drag"+(null==v?"":"-"+v),y=ao.select(e(s)).on(u+d,a).on(o+d,l),m=W(s),M=t(h,v);i?(c=i.apply(f,arguments),c=[c.x-M[0],c.y-M[1]]):c=[0,0],p({type:"dragstart"})}}var r=N(n,"drag","dragstart","dragend"),i=null,u=e(b,ao.mouse,t,"mousemove","mouseup"),o=e(G,ao.touch,m,"touchmove","touchend");return n.origin=function(t){return arguments.length?(i=t,n):i},ao.rebind(n,r,"on")},ao.touches=function(n,t){return arguments.length<2&&(t=k().touches),t?co(t).map(function(t){var e=J(n,t);return e.identifier=t.identifier,e}):[]};var Uo=1e-6,jo=Uo*Uo,Fo=Math.PI,Ho=2*Fo,Oo=Ho-Uo,Io=Fo/2,Yo=Fo/180,Zo=180/Fo,Vo=Math.SQRT2,Xo=2,$o=4;ao.interpolateZoom=function(n,t){var e,r,i=n[0],u=n[1],o=n[2],a=t[0],l=t[1],c=t[2],f=a-i,s=l-u,h=f*f+s*s;if(jo>h)r=Math.log(c/o)/Vo,e=function(n){return[i+n*f,u+n*s,o*Math.exp(Vo*n*r)]};else{var p=Math.sqrt(h),g=(c*c-o*o+$o*h)/(2*o*Xo*p),v=(c*c-o*o-$o*h)/(2*c*Xo*p),d=Math.log(Math.sqrt(g*g+1)-g),y=Math.log(Math.sqrt(v*v+1)-v);r=(y-d)/Vo,e=function(n){var t=n*r,e=rn(d),a=o/(Xo*p)*(e*un(Vo*t+d)-en(d));return[i+a*f,u+a*s,o*e/rn(Vo*t+d)]}}return e.duration=1e3*r,e},ao.behavior.zoom=function(){function n(n){n.on(L,s).on(Wo+".zoom",p).on("dblclick.zoom",g).on(R,h)}function e(n){return[(n[0]-k.x)/k.k,(n[1]-k.y)/k.k]}function r(n){return[n[0]*k.k+k.x,n[1]*k.k+k.y]}function i(n){k.k=Math.max(A[0],Math.min(A[1],n))}function u(n,t){t=r(t),k.x+=n[0]-t[0],k.y+=n[1]-t[1]}function o(t,e,r,o){t.__chart__={x:k.x,y:k.y,k:k.k},i(Math.pow(2,o)),u(d=e,r),t=ao.select(t),C>0&&(t=t.transition().duration(C)),t.call(n.event)}function a(){b&&b.domain(x.range().map(function(n){return(n-k.x)/k.k}).map(x.invert)),w&&w.domain(_.range().map(function(n){return(n-k.y)/k.k}).map(_.invert))}function l(n){z++||n({type:"zoomstart"})}function c(n){a(),n({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function f(n){--z||(n({type:"zoomend"}),d=null)}function s(){function n(){a=1,u(ao.mouse(i),h),c(o)}function r(){s.on(q,null).on(T,null),p(a),f(o)}var i=this,o=D.of(i,arguments),a=0,s=ao.select(t(i)).on(q,n).on(T,r),h=e(ao.mouse(i)),p=W(i);Il.call(i),l(o)}function h(){function n(){var n=ao.touches(g);return p=k.k,n.forEach(function(n){n.identifier in d&&(d[n.identifier]=e(n))}),n}function t(){var t=ao.event.target;ao.select(t).on(x,r).on(b,a),_.push(t);for(var e=ao.event.changedTouches,i=0,u=e.length;u>i;++i)d[e[i].identifier]=null;var l=n(),c=Date.now();if(1===l.length){if(500>c-M){var f=l[0];o(g,f,d[f.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),S()}M=c}else if(l.length>1){var f=l[0],s=l[1],h=f[0]-s[0],p=f[1]-s[1];y=h*h+p*p}}function r(){var n,t,e,r,o=ao.touches(g);Il.call(g);for(var a=0,l=o.length;l>a;++a,r=null)if(e=o[a],r=d[e.identifier]){if(t)break;n=e,t=r}if(r){var f=(f=e[0]-n[0])*f+(f=e[1]-n[1])*f,s=y&&Math.sqrt(f/y);n=[(n[0]+e[0])/2,(n[1]+e[1])/2],t=[(t[0]+r[0])/2,(t[1]+r[1])/2],i(s*p)}M=null,u(n,t),c(v)}function a(){if(ao.event.touches.length){for(var t=ao.event.changedTouches,e=0,r=t.length;r>e;++e)delete d[t[e].identifier];for(var i in d)return void n()}ao.selectAll(_).on(m,null),w.on(L,s).on(R,h),N(),f(v)}var p,g=this,v=D.of(g,arguments),d={},y=0,m=".zoom-"+ao.event.changedTouches[0].identifier,x="touchmove"+m,b="touchend"+m,_=[],w=ao.select(g),N=W(g);t(),l(v),w.on(L,null).on(R,t)}function p(){var n=D.of(this,arguments);m?clearTimeout(m):(Il.call(this),v=e(d=y||ao.mouse(this)),l(n)),m=setTimeout(function(){m=null,f(n)},50),S(),i(Math.pow(2,.002*Bo())*k.k),u(d,v),c(n)}function g(){var n=ao.mouse(this),t=Math.log(k.k)/Math.LN2;o(this,n,e(n),ao.event.shiftKey?Math.ceil(t)-1:Math.floor(t)+1)}var v,d,y,m,M,x,b,_,w,k={x:0,y:0,k:1},E=[960,500],A=Jo,C=250,z=0,L="mousedown.zoom",q="mousemove.zoom",T="mouseup.zoom",R="touchstart.zoom",D=N(n,"zoomstart","zoom","zoomend");return Wo||(Wo="onwheel"in fo?(Bo=function(){return-ao.event.deltaY*(ao.event.deltaMode?120:1)},"wheel"):"onmousewheel"in fo?(Bo=function(){return ao.event.wheelDelta},"mousewheel"):(Bo=function(){return-ao.event.detail},"MozMousePixelScroll")),n.event=function(n){n.each(function(){var n=D.of(this,arguments),t=k;Hl?ao.select(this).transition().each("start.zoom",function(){k=this.__chart__||{x:0,y:0,k:1},l(n)}).tween("zoom:zoom",function(){var e=E[0],r=E[1],i=d?d[0]:e/2,u=d?d[1]:r/2,o=ao.interpolateZoom([(i-k.x)/k.k,(u-k.y)/k.k,e/k.k],[(i-t.x)/t.k,(u-t.y)/t.k,e/t.k]);return function(t){var r=o(t),a=e/r[2];this.__chart__=k={x:i-r[0]*a,y:u-r[1]*a,k:a},c(n)}}).each("interrupt.zoom",function(){f(n)}).each("end.zoom",function(){f(n)}):(this.__chart__=k,l(n),c(n),f(n))})},n.translate=function(t){return arguments.length?(k={x:+t[0],y:+t[1],k:k.k},a(),n):[k.x,k.y]},n.scale=function(t){return arguments.length?(k={x:k.x,y:k.y,k:null},i(+t),a(),n):k.k},n.scaleExtent=function(t){return arguments.length?(A=null==t?Jo:[+t[0],+t[1]],n):A},n.center=function(t){return arguments.length?(y=t&&[+t[0],+t[1]],n):y},n.size=function(t){return arguments.length?(E=t&&[+t[0],+t[1]],n):E},n.duration=function(t){return arguments.length?(C=+t,n):C},n.x=function(t){return arguments.length?(b=t,x=t.copy(),k={x:0,y:0,k:1},n):b},n.y=function(t){return arguments.length?(w=t,_=t.copy(),k={x:0,y:0,k:1},n):w},ao.rebind(n,D,"on")};var Bo,Wo,Jo=[0,1/0];ao.color=an,an.prototype.toString=function(){return this.rgb()+""},ao.hsl=ln;var Go=ln.prototype=new an;Go.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new ln(this.h,this.s,this.l/n)},Go.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new ln(this.h,this.s,n*this.l)},Go.rgb=function(){return cn(this.h,this.s,this.l)},ao.hcl=fn;var Ko=fn.prototype=new an;Ko.brighter=function(n){return new fn(this.h,this.c,Math.min(100,this.l+Qo*(arguments.length?n:1)))},Ko.darker=function(n){return new fn(this.h,this.c,Math.max(0,this.l-Qo*(arguments.length?n:1)))},Ko.rgb=function(){return sn(this.h,this.c,this.l).rgb()},ao.lab=hn;var Qo=18,na=.95047,ta=1,ea=1.08883,ra=hn.prototype=new an;ra.brighter=function(n){return new hn(Math.min(100,this.l+Qo*(arguments.length?n:1)),this.a,this.b)},ra.darker=function(n){return new hn(Math.max(0,this.l-Qo*(arguments.length?n:1)),this.a,this.b)},ra.rgb=function(){return pn(this.l,this.a,this.b)},ao.rgb=mn;var ia=mn.prototype=new an;ia.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,i=30;return t||e||r?(t&&i>t&&(t=i),e&&i>e&&(e=i),r&&i>r&&(r=i),new mn(Math.min(255,t/n),Math.min(255,e/n),Math.min(255,r/n))):new mn(i,i,i)},ia.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new mn(n*this.r,n*this.g,n*this.b)},ia.hsl=function(){return wn(this.r,this.g,this.b)},ia.toString=function(){return"#"+bn(this.r)+bn(this.g)+bn(this.b)};var ua=ao.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});ua.forEach(function(n,t){ua.set(n,Mn(t))}),ao.functor=En,ao.xhr=An(m),ao.dsv=function(n,t){function e(n,e,u){arguments.length<3&&(u=e,e=null);var o=Cn(n,t,null==e?r:i(e),u);return o.row=function(n){return arguments.length?o.response(null==(e=n)?r:i(n)):e},o}function r(n){return e.parse(n.responseText)}function i(n){return function(t){return e.parse(t.responseText,n)}}function u(t){return t.map(o).join(n)}function o(n){return a.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var a=new RegExp('["'+n+"\n]"),l=n.charCodeAt(0);return e.parse=function(n,t){var r;return e.parseRows(n,function(n,e){if(r)return r(n,e-1);var i=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");r=t?function(n,e){return t(i(n),e)}:i})},e.parseRows=function(n,t){function e(){if(f>=c)return o;if(i)return i=!1,u;var t=f;if(34===n.charCodeAt(t)){for(var e=t;e++<c;)if(34===n.charCodeAt(e)){if(34!==n.charCodeAt(e+1))break;++e}f=e+2;var r=n.charCodeAt(e+1);return 13===r?(i=!0,10===n.charCodeAt(e+2)&&++f):10===r&&(i=!0),n.slice(t+1,e).replace(/""/g,'"')}for(;c>f;){var r=n.charCodeAt(f++),a=1;if(10===r)i=!0;else if(13===r)i=!0,10===n.charCodeAt(f)&&(++f,++a);else if(r!==l)continue;return n.slice(t,f-a)}return n.slice(t)}for(var r,i,u={},o={},a=[],c=n.length,f=0,s=0;(r=e())!==o;){for(var h=[];r!==u&&r!==o;)h.push(r),r=e();t&&null==(h=t(h,s++))||a.push(h)}return a},e.format=function(t){if(Array.isArray(t[0]))return e.formatRows(t);var r=new y,i=[];return t.forEach(function(n){for(var t in n)r.has(t)||i.push(r.add(t))}),[i.map(o).join(n)].concat(t.map(function(t){return i.map(function(n){return o(t[n])}).join(n)})).join("\n")},e.formatRows=function(n){return n.map(u).join("\n")},e},ao.csv=ao.dsv(",","text/csv"),ao.tsv=ao.dsv(" ","text/tab-separated-values");var oa,aa,la,ca,fa=this[x(this,"requestAnimationFrame")]||function(n){setTimeout(n,17)};ao.timer=function(){qn.apply(this,arguments)},ao.timer.flush=function(){Rn(),Dn()},ao.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};var sa=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(Un);ao.formatPrefix=function(n,t){var e=0;return(n=+n)&&(0>n&&(n*=-1),t&&(n=ao.round(n,Pn(n,t))),e=1+Math.floor(1e-12+Math.log(n)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e-1)/3)))),sa[8+e/3]};var ha=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,pa=ao.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=ao.round(n,Pn(n,t))).toFixed(Math.max(0,Math.min(20,Pn(n*(1+1e-15),t))))}}),ga=ao.time={},va=Date;Hn.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){da.setUTCDate.apply(this._,arguments)},setDay:function(){da.setUTCDay.apply(this._,arguments)},setFullYear:function(){da.setUTCFullYear.apply(this._,arguments)},setHours:function(){da.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){da.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){da.setUTCMinutes.apply(this._,arguments)},setMonth:function(){da.setUTCMonth.apply(this._,arguments)},setSeconds:function(){da.setUTCSeconds.apply(this._,arguments)},setTime:function(){da.setTime.apply(this._,arguments)}};var da=Date.prototype;ga.year=On(function(n){return n=ga.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),ga.years=ga.year.range,ga.years.utc=ga.year.utc.range,ga.day=On(function(n){var t=new va(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),ga.days=ga.day.range,ga.days.utc=ga.day.utc.range,ga.dayOfYear=function(n){var t=ga.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(n,t){t=7-t;var e=ga[n]=On(function(n){return(n=ga.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var e=ga.year(n).getDay();return Math.floor((ga.dayOfYear(n)+(e+t)%7)/7)-(e!==t)});ga[n+"s"]=e.range,ga[n+"s"].utc=e.utc.range,ga[n+"OfYear"]=function(n){var e=ga.year(n).getDay();return Math.floor((ga.dayOfYear(n)+(e+t)%7)/7)}}),ga.week=ga.sunday,ga.weeks=ga.sunday.range,ga.weeks.utc=ga.sunday.utc.range,ga.weekOfYear=ga.sundayOfYear;var ya={"-":"",_:" ",0:"0"},ma=/^\s*\d+/,Ma=/^%/;ao.locale=function(n){return{numberFormat:jn(n),timeFormat:Yn(n)}};var xa=ao.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"], +shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});ao.format=xa.numberFormat,ao.geo={},ft.prototype={s:0,t:0,add:function(n){st(n,this.t,ba),st(ba.s,this.s,this),this.s?this.t+=ba.t:this.s=ba.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var ba=new ft;ao.geo.stream=function(n,t){n&&_a.hasOwnProperty(n.type)?_a[n.type](n,t):ht(n,t)};var _a={Feature:function(n,t){ht(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,i=e.length;++r<i;)ht(e[r].geometry,t)}},wa={Sphere:function(n,t){t.sphere()},Point:function(n,t){n=n.coordinates,t.point(n[0],n[1],n[2])},MultiPoint:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)n=e[r],t.point(n[0],n[1],n[2])},LineString:function(n,t){pt(n.coordinates,t,0)},MultiLineString:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)pt(e[r],t,0)},Polygon:function(n,t){gt(n.coordinates,t)},MultiPolygon:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)gt(e[r],t)},GeometryCollection:function(n,t){for(var e=n.geometries,r=-1,i=e.length;++r<i;)ht(e[r],t)}};ao.geo.area=function(n){return Sa=0,ao.geo.stream(n,Na),Sa};var Sa,ka=new ft,Na={sphere:function(){Sa+=4*Fo},point:b,lineStart:b,lineEnd:b,polygonStart:function(){ka.reset(),Na.lineStart=vt},polygonEnd:function(){var n=2*ka;Sa+=0>n?4*Fo+n:n,Na.lineStart=Na.lineEnd=Na.point=b}};ao.geo.bounds=function(){function n(n,t){M.push(x=[f=n,h=n]),s>t&&(s=t),t>p&&(p=t)}function t(t,e){var r=dt([t*Yo,e*Yo]);if(y){var i=mt(y,r),u=[i[1],-i[0],0],o=mt(u,i);bt(o),o=_t(o);var l=t-g,c=l>0?1:-1,v=o[0]*Zo*c,d=xo(l)>180;if(d^(v>c*g&&c*t>v)){var m=o[1]*Zo;m>p&&(p=m)}else if(v=(v+360)%360-180,d^(v>c*g&&c*t>v)){var m=-o[1]*Zo;s>m&&(s=m)}else s>e&&(s=e),e>p&&(p=e);d?g>t?a(f,t)>a(f,h)&&(h=t):a(t,h)>a(f,h)&&(f=t):h>=f?(f>t&&(f=t),t>h&&(h=t)):t>g?a(f,t)>a(f,h)&&(h=t):a(t,h)>a(f,h)&&(f=t)}else n(t,e);y=r,g=t}function e(){b.point=t}function r(){x[0]=f,x[1]=h,b.point=n,y=null}function i(n,e){if(y){var r=n-g;m+=xo(r)>180?r+(r>0?360:-360):r}else v=n,d=e;Na.point(n,e),t(n,e)}function u(){Na.lineStart()}function o(){i(v,d),Na.lineEnd(),xo(m)>Uo&&(f=-(h=180)),x[0]=f,x[1]=h,y=null}function a(n,t){return(t-=n)<0?t+360:t}function l(n,t){return n[0]-t[0]}function c(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:n<t[0]||t[1]<n}var f,s,h,p,g,v,d,y,m,M,x,b={point:n,lineStart:e,lineEnd:r,polygonStart:function(){b.point=i,b.lineStart=u,b.lineEnd=o,m=0,Na.polygonStart()},polygonEnd:function(){Na.polygonEnd(),b.point=n,b.lineStart=e,b.lineEnd=r,0>ka?(f=-(h=180),s=-(p=90)):m>Uo?p=90:-Uo>m&&(s=-90),x[0]=f,x[1]=h}};return function(n){p=h=-(f=s=1/0),M=[],ao.geo.stream(n,b);var t=M.length;if(t){M.sort(l);for(var e,r=1,i=M[0],u=[i];t>r;++r)e=M[r],c(e[0],i)||c(e[1],i)?(a(i[0],e[1])>a(i[0],i[1])&&(i[1]=e[1]),a(e[0],i[1])>a(i[0],i[1])&&(i[0]=e[0])):u.push(i=e);for(var o,e,g=-(1/0),t=u.length-1,r=0,i=u[t];t>=r;i=e,++r)e=u[r],(o=a(i[1],e[0]))>g&&(g=o,f=e[0],h=i[1])}return M=x=null,f===1/0||s===1/0?[[NaN,NaN],[NaN,NaN]]:[[f,s],[h,p]]}}(),ao.geo.centroid=function(n){Ea=Aa=Ca=za=La=qa=Ta=Ra=Da=Pa=Ua=0,ao.geo.stream(n,ja);var t=Da,e=Pa,r=Ua,i=t*t+e*e+r*r;return jo>i&&(t=qa,e=Ta,r=Ra,Uo>Aa&&(t=Ca,e=za,r=La),i=t*t+e*e+r*r,jo>i)?[NaN,NaN]:[Math.atan2(e,t)*Zo,tn(r/Math.sqrt(i))*Zo]};var Ea,Aa,Ca,za,La,qa,Ta,Ra,Da,Pa,Ua,ja={sphere:b,point:St,lineStart:Nt,lineEnd:Et,polygonStart:function(){ja.lineStart=At},polygonEnd:function(){ja.lineStart=Nt}},Fa=Rt(zt,jt,Ht,[-Fo,-Fo/2]),Ha=1e9;ao.geo.clipExtent=function(){var n,t,e,r,i,u,o={stream:function(n){return i&&(i.valid=!1),i=u(n),i.valid=!0,i},extent:function(a){return arguments.length?(u=Zt(n=+a[0][0],t=+a[0][1],e=+a[1][0],r=+a[1][1]),i&&(i.valid=!1,i=null),o):[[n,t],[e,r]]}};return o.extent([[0,0],[960,500]])},(ao.geo.conicEqualArea=function(){return Vt(Xt)}).raw=Xt,ao.geo.albers=function(){return ao.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},ao.geo.albersUsa=function(){function n(n){var u=n[0],o=n[1];return t=null,e(u,o),t||(r(u,o),t)||i(u,o),t}var t,e,r,i,u=ao.geo.albers(),o=ao.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=ao.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(n,e){t=[n,e]}};return n.invert=function(n){var t=u.scale(),e=u.translate(),r=(n[0]-e[0])/t,i=(n[1]-e[1])/t;return(i>=.12&&.234>i&&r>=-.425&&-.214>r?o:i>=.166&&.234>i&&r>=-.214&&-.115>r?a:u).invert(n)},n.stream=function(n){var t=u.stream(n),e=o.stream(n),r=a.stream(n);return{point:function(n,i){t.point(n,i),e.point(n,i),r.point(n,i)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},n.precision=function(t){return arguments.length?(u.precision(t),o.precision(t),a.precision(t),n):u.precision()},n.scale=function(t){return arguments.length?(u.scale(t),o.scale(.35*t),a.scale(t),n.translate(u.translate())):u.scale()},n.translate=function(t){if(!arguments.length)return u.translate();var c=u.scale(),f=+t[0],s=+t[1];return e=u.translate(t).clipExtent([[f-.455*c,s-.238*c],[f+.455*c,s+.238*c]]).stream(l).point,r=o.translate([f-.307*c,s+.201*c]).clipExtent([[f-.425*c+Uo,s+.12*c+Uo],[f-.214*c-Uo,s+.234*c-Uo]]).stream(l).point,i=a.translate([f-.205*c,s+.212*c]).clipExtent([[f-.214*c+Uo,s+.166*c+Uo],[f-.115*c-Uo,s+.234*c-Uo]]).stream(l).point,n},n.scale(1070)};var Oa,Ia,Ya,Za,Va,Xa,$a={point:b,lineStart:b,lineEnd:b,polygonStart:function(){Ia=0,$a.lineStart=$t},polygonEnd:function(){$a.lineStart=$a.lineEnd=$a.point=b,Oa+=xo(Ia/2)}},Ba={point:Bt,lineStart:b,lineEnd:b,polygonStart:b,polygonEnd:b},Wa={point:Gt,lineStart:Kt,lineEnd:Qt,polygonStart:function(){Wa.lineStart=ne},polygonEnd:function(){Wa.point=Gt,Wa.lineStart=Kt,Wa.lineEnd=Qt}};ao.geo.path=function(){function n(n){return n&&("function"==typeof a&&u.pointRadius(+a.apply(this,arguments)),o&&o.valid||(o=i(u)),ao.geo.stream(n,o)),u.result()}function t(){return o=null,n}var e,r,i,u,o,a=4.5;return n.area=function(n){return Oa=0,ao.geo.stream(n,i($a)),Oa},n.centroid=function(n){return Ca=za=La=qa=Ta=Ra=Da=Pa=Ua=0,ao.geo.stream(n,i(Wa)),Ua?[Da/Ua,Pa/Ua]:Ra?[qa/Ra,Ta/Ra]:La?[Ca/La,za/La]:[NaN,NaN]},n.bounds=function(n){return Va=Xa=-(Ya=Za=1/0),ao.geo.stream(n,i(Ba)),[[Ya,Za],[Va,Xa]]},n.projection=function(n){return arguments.length?(i=(e=n)?n.stream||re(n):m,t()):e},n.context=function(n){return arguments.length?(u=null==(r=n)?new Wt:new te(n),"function"!=typeof a&&u.pointRadius(a),t()):r},n.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(u.pointRadius(+t),+t),n):a},n.projection(ao.geo.albersUsa()).context(null)},ao.geo.transform=function(n){return{stream:function(t){var e=new ie(t);for(var r in n)e[r]=n[r];return e}}},ie.prototype={point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},ao.geo.projection=oe,ao.geo.projectionMutator=ae,(ao.geo.equirectangular=function(){return oe(ce)}).raw=ce.invert=ce,ao.geo.rotation=function(n){function t(t){return t=n(t[0]*Yo,t[1]*Yo),t[0]*=Zo,t[1]*=Zo,t}return n=se(n[0]%360*Yo,n[1]*Yo,n.length>2?n[2]*Yo:0),t.invert=function(t){return t=n.invert(t[0]*Yo,t[1]*Yo),t[0]*=Zo,t[1]*=Zo,t},t},fe.invert=ce,ao.geo.circle=function(){function n(){var n="function"==typeof r?r.apply(this,arguments):r,t=se(-n[0]*Yo,-n[1]*Yo,0).invert,i=[];return e(null,null,1,{point:function(n,e){i.push(n=t(n,e)),n[0]*=Zo,n[1]*=Zo}}),{type:"Polygon",coordinates:[i]}}var t,e,r=[0,0],i=6;return n.origin=function(t){return arguments.length?(r=t,n):r},n.angle=function(r){return arguments.length?(e=ve((t=+r)*Yo,i*Yo),n):t},n.precision=function(r){return arguments.length?(e=ve(t*Yo,(i=+r)*Yo),n):i},n.angle(90)},ao.geo.distance=function(n,t){var e,r=(t[0]-n[0])*Yo,i=n[1]*Yo,u=t[1]*Yo,o=Math.sin(r),a=Math.cos(r),l=Math.sin(i),c=Math.cos(i),f=Math.sin(u),s=Math.cos(u);return Math.atan2(Math.sqrt((e=s*o)*e+(e=c*f-l*s*a)*e),l*f+c*s*a)},ao.geo.graticule=function(){function n(){return{type:"MultiLineString",coordinates:t()}}function t(){return ao.range(Math.ceil(u/d)*d,i,d).map(h).concat(ao.range(Math.ceil(c/y)*y,l,y).map(p)).concat(ao.range(Math.ceil(r/g)*g,e,g).filter(function(n){return xo(n%d)>Uo}).map(f)).concat(ao.range(Math.ceil(a/v)*v,o,v).filter(function(n){return xo(n%y)>Uo}).map(s))}var e,r,i,u,o,a,l,c,f,s,h,p,g=10,v=g,d=90,y=360,m=2.5;return n.lines=function(){return t().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(u).concat(p(l).slice(1),h(i).reverse().slice(1),p(c).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.majorExtent(t).minorExtent(t):n.minorExtent()},n.majorExtent=function(t){return arguments.length?(u=+t[0][0],i=+t[1][0],c=+t[0][1],l=+t[1][1],u>i&&(t=u,u=i,i=t),c>l&&(t=c,c=l,l=t),n.precision(m)):[[u,c],[i,l]]},n.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],a=+t[0][1],o=+t[1][1],r>e&&(t=r,r=e,e=t),a>o&&(t=a,a=o,o=t),n.precision(m)):[[r,a],[e,o]]},n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(d=+t[0],y=+t[1],n):[d,y]},n.minorStep=function(t){return arguments.length?(g=+t[0],v=+t[1],n):[g,v]},n.precision=function(t){return arguments.length?(m=+t,f=ye(a,o,90),s=me(r,e,m),h=ye(c,l,90),p=me(u,i,m),n):m},n.majorExtent([[-180,-90+Uo],[180,90-Uo]]).minorExtent([[-180,-80-Uo],[180,80+Uo]])},ao.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||i.apply(this,arguments)]}}var t,e,r=Me,i=xe;return n.distance=function(){return ao.geo.distance(t||r.apply(this,arguments),e||i.apply(this,arguments))},n.source=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,n):r},n.target=function(t){return arguments.length?(i=t,e="function"==typeof t?null:t,n):i},n.precision=function(){return arguments.length?n:0},n},ao.geo.interpolate=function(n,t){return be(n[0]*Yo,n[1]*Yo,t[0]*Yo,t[1]*Yo)},ao.geo.length=function(n){return Ja=0,ao.geo.stream(n,Ga),Ja};var Ja,Ga={sphere:b,point:b,lineStart:_e,lineEnd:b,polygonStart:b,polygonEnd:b},Ka=we(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(ao.geo.azimuthalEqualArea=function(){return oe(Ka)}).raw=Ka;var Qa=we(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},m);(ao.geo.azimuthalEquidistant=function(){return oe(Qa)}).raw=Qa,(ao.geo.conicConformal=function(){return Vt(Se)}).raw=Se,(ao.geo.conicEquidistant=function(){return Vt(ke)}).raw=ke;var nl=we(function(n){return 1/n},Math.atan);(ao.geo.gnomonic=function(){return oe(nl)}).raw=nl,Ne.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-Io]},(ao.geo.mercator=function(){return Ee(Ne)}).raw=Ne;var tl=we(function(){return 1},Math.asin);(ao.geo.orthographic=function(){return oe(tl)}).raw=tl;var el=we(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(ao.geo.stereographic=function(){return oe(el)}).raw=el,Ae.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-Io]},(ao.geo.transverseMercator=function(){var n=Ee(Ae),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):(n=t(),[n[1],-n[0]])},n.rotate=function(n){return n?e([n[0],n[1],n.length>2?n[2]+90:90]):(n=e(),[n[0],n[1],n[2]-90])},e([0,0,90])}).raw=Ae,ao.geom={},ao.geom.hull=function(n){function t(n){if(n.length<3)return[];var t,i=En(e),u=En(r),o=n.length,a=[],l=[];for(t=0;o>t;t++)a.push([+i.call(this,n[t],t),+u.call(this,n[t],t),t]);for(a.sort(qe),t=0;o>t;t++)l.push([a[t][0],-a[t][1]]);var c=Le(a),f=Le(l),s=f[0]===c[0],h=f[f.length-1]===c[c.length-1],p=[];for(t=c.length-1;t>=0;--t)p.push(n[a[c[t]][2]]);for(t=+s;t<f.length-h;++t)p.push(n[a[f[t]][2]]);return p}var e=Ce,r=ze;return arguments.length?t(n):(t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t)},ao.geom.polygon=function(n){return ko(n,rl),n};var rl=ao.geom.polygon.prototype=[];rl.area=function(){for(var n,t=-1,e=this.length,r=this[e-1],i=0;++t<e;)n=r,r=this[t],i+=n[1]*r[0]-n[0]*r[1];return.5*i},rl.centroid=function(n){var t,e,r=-1,i=this.length,u=0,o=0,a=this[i-1];for(arguments.length||(n=-1/(6*this.area()));++r<i;)t=a,a=this[r],e=t[0]*a[1]-a[0]*t[1],u+=(t[0]+a[0])*e,o+=(t[1]+a[1])*e;return[u*n,o*n]},rl.clip=function(n){for(var t,e,r,i,u,o,a=De(n),l=-1,c=this.length-De(this),f=this[c-1];++l<c;){for(t=n.slice(),n.length=0,i=this[l],u=t[(r=t.length-a)-1],e=-1;++e<r;)o=t[e],Te(o,f,i)?(Te(u,f,i)||n.push(Re(u,o,f,i)),n.push(o)):Te(u,f,i)&&n.push(Re(u,o,f,i)),u=o;a&&n.push(n[0]),f=i}return n};var il,ul,ol,al,ll,cl=[],fl=[];Ye.prototype.prepare=function(){for(var n,t=this.edges,e=t.length;e--;)n=t[e].edge,n.b&&n.a||t.splice(e,1);return t.sort(Ve),t.length},tr.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},er.prototype={insert:function(n,t){var e,r,i;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=or(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)r=e.U,e===r.L?(i=r.R,i&&i.C?(e.C=i.C=!1,r.C=!0,n=r):(n===e.R&&(ir(this,e),n=e,e=n.U),e.C=!1,r.C=!0,ur(this,r))):(i=r.L,i&&i.C?(e.C=i.C=!1,r.C=!0,n=r):(n===e.L&&(ur(this,e),n=e,e=n.U),e.C=!1,r.C=!0,ir(this,r))),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t,e,r,i=n.U,u=n.L,o=n.R;if(e=u?o?or(o):u:o,i?i.L===n?i.L=e:i.R=e:this._=e,u&&o?(r=e.C,e.C=n.C,e.L=u,u.U=e,e!==o?(i=e.U,e.U=n.U,n=e.R,i.L=n,e.R=o,o.U=e):(e.U=i,i=e,n=e.R)):(r=n.C,n=e),n&&(n.U=i),!r){if(n&&n.C)return void(n.C=!1);do{if(n===this._)break;if(n===i.L){if(t=i.R,t.C&&(t.C=!1,i.C=!0,ir(this,i),t=i.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,ur(this,t),t=i.R),t.C=i.C,i.C=t.R.C=!1,ir(this,i),n=this._;break}}else if(t=i.L,t.C&&(t.C=!1,i.C=!0,ur(this,i),t=i.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,ir(this,t),t=i.L),t.C=i.C,i.C=t.L.C=!1,ur(this,i),n=this._;break}t.C=!0,n=i,i=i.U}while(!n.C);n&&(n.C=!1)}}},ao.geom.voronoi=function(n){function t(n){var t=new Array(n.length),r=a[0][0],i=a[0][1],u=a[1][0],o=a[1][1];return ar(e(n),a).cells.forEach(function(e,a){var l=e.edges,c=e.site,f=t[a]=l.length?l.map(function(n){var t=n.start();return[t.x,t.y]}):c.x>=r&&c.x<=u&&c.y>=i&&c.y<=o?[[r,o],[u,o],[u,i],[r,i]]:[];f.point=n[a]}),t}function e(n){return n.map(function(n,t){return{x:Math.round(u(n,t)/Uo)*Uo,y:Math.round(o(n,t)/Uo)*Uo,i:t}})}var r=Ce,i=ze,u=r,o=i,a=sl;return n?t(n):(t.links=function(n){return ar(e(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},t.triangles=function(n){var t=[];return ar(e(n)).cells.forEach(function(e,r){for(var i,u,o=e.site,a=e.edges.sort(Ve),l=-1,c=a.length,f=a[c-1].edge,s=f.l===o?f.r:f.l;++l<c;)i=f,u=s,f=a[l].edge,s=f.l===o?f.r:f.l,r<u.i&&r<s.i&&cr(o,u,s)<0&&t.push([n[r],n[u.i],n[s.i]])}),t},t.x=function(n){return arguments.length?(u=En(r=n),t):r},t.y=function(n){return arguments.length?(o=En(i=n),t):i},t.clipExtent=function(n){return arguments.length?(a=null==n?sl:n,t):a===sl?null:a},t.size=function(n){return arguments.length?t.clipExtent(n&&[[0,0],n]):a===sl?null:a&&a[1]},t)};var sl=[[-1e6,-1e6],[1e6,1e6]];ao.geom.delaunay=function(n){return ao.geom.voronoi().triangles(n)},ao.geom.quadtree=function(n,t,e,r,i){function u(n){function u(n,t,e,r,i,u,o,a){if(!isNaN(e)&&!isNaN(r))if(n.leaf){var l=n.x,f=n.y;if(null!=l)if(xo(l-e)+xo(f-r)<.01)c(n,t,e,r,i,u,o,a);else{var s=n.point;n.x=n.y=n.point=null,c(n,s,l,f,i,u,o,a),c(n,t,e,r,i,u,o,a)}else n.x=e,n.y=r,n.point=t}else c(n,t,e,r,i,u,o,a)}function c(n,t,e,r,i,o,a,l){var c=.5*(i+a),f=.5*(o+l),s=e>=c,h=r>=f,p=h<<1|s;n.leaf=!1,n=n.nodes[p]||(n.nodes[p]=hr()),s?i=c:a=c,h?o=f:l=f,u(n,t,e,r,i,o,a,l)}var f,s,h,p,g,v,d,y,m,M=En(a),x=En(l);if(null!=t)v=t,d=e,y=r,m=i;else if(y=m=-(v=d=1/0),s=[],h=[],g=n.length,o)for(p=0;g>p;++p)f=n[p],f.x<v&&(v=f.x),f.y<d&&(d=f.y),f.x>y&&(y=f.x),f.y>m&&(m=f.y),s.push(f.x),h.push(f.y);else for(p=0;g>p;++p){var b=+M(f=n[p],p),_=+x(f,p);v>b&&(v=b),d>_&&(d=_),b>y&&(y=b),_>m&&(m=_),s.push(b),h.push(_)}var w=y-v,S=m-d;w>S?m=d+w:y=v+S;var k=hr();if(k.add=function(n){u(k,n,+M(n,++p),+x(n,p),v,d,y,m)},k.visit=function(n){pr(n,k,v,d,y,m)},k.find=function(n){return gr(k,n[0],n[1],v,d,y,m)},p=-1,null==t){for(;++p<g;)u(k,n[p],s[p],h[p],v,d,y,m);--p}else n.forEach(k.add);return s=h=n=f=null,k}var o,a=Ce,l=ze;return(o=arguments.length)?(a=fr,l=sr,3===o&&(i=e,r=t,e=t=0),u(n)):(u.x=function(n){return arguments.length?(a=n,u):a},u.y=function(n){return arguments.length?(l=n,u):l},u.extent=function(n){return arguments.length?(null==n?t=e=r=i=null:(t=+n[0][0],e=+n[0][1],r=+n[1][0],i=+n[1][1]),u):null==t?null:[[t,e],[r,i]]},u.size=function(n){return arguments.length?(null==n?t=e=r=i=null:(t=e=0,r=+n[0],i=+n[1]),u):null==t?null:[r-t,i-e]},u)},ao.interpolateRgb=vr,ao.interpolateObject=dr,ao.interpolateNumber=yr,ao.interpolateString=mr;var hl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pl=new RegExp(hl.source,"g");ao.interpolate=Mr,ao.interpolators=[function(n,t){var e=typeof t;return("string"===e?ua.has(t.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(t)?vr:mr:t instanceof an?vr:Array.isArray(t)?xr:"object"===e&&isNaN(t)?dr:yr)(n,t)}],ao.interpolateArray=xr;var gl=function(){return m},vl=ao.map({linear:gl,poly:Er,quad:function(){return Sr},cubic:function(){return kr},sin:function(){return Ar},exp:function(){return Cr},circle:function(){return zr},elastic:Lr,back:qr,bounce:function(){return Tr}}),dl=ao.map({"in":m,out:_r,"in-out":wr,"out-in":function(n){return wr(_r(n))}});ao.ease=function(n){var t=n.indexOf("-"),e=t>=0?n.slice(0,t):n,r=t>=0?n.slice(t+1):"in";return e=vl.get(e)||gl,r=dl.get(r)||m,br(r(e.apply(null,lo.call(arguments,1))))},ao.interpolateHcl=Rr,ao.interpolateHsl=Dr,ao.interpolateLab=Pr,ao.interpolateRound=Ur,ao.transform=function(n){var t=fo.createElementNS(ao.ns.prefix.svg,"g");return(ao.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new jr(e?e.matrix:yl)})(n)},jr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var yl={a:1,b:0,c:0,d:1,e:0,f:0};ao.interpolateTransform=$r,ao.layout={},ao.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++e<r;)t.push(Jr(n[e]));return t}},ao.layout.chord=function(){function n(){var n,c,s,h,p,g={},v=[],d=ao.range(u),y=[];for(e=[],r=[],n=0,h=-1;++h<u;){for(c=0,p=-1;++p<u;)c+=i[h][p];v.push(c),y.push(ao.range(u)),n+=c}for(o&&d.sort(function(n,t){return o(v[n],v[t])}),a&&y.forEach(function(n,t){n.sort(function(n,e){return a(i[t][n],i[t][e])})}),n=(Ho-f*u)/n,c=0,h=-1;++h<u;){for(s=c,p=-1;++p<u;){var m=d[h],M=y[m][p],x=i[m][M],b=c,_=c+=x*n;g[m+"-"+M]={index:m,subindex:M,startAngle:b,endAngle:_,value:x}}r[m]={index:m,startAngle:s,endAngle:c,value:v[m]},c+=f}for(h=-1;++h<u;)for(p=h-1;++p<u;){var w=g[h+"-"+p],S=g[p+"-"+h];(w.value||S.value)&&e.push(w.value<S.value?{source:S,target:w}:{source:w,target:S})}l&&t()}function t(){e.sort(function(n,t){return l((n.source.value+n.target.value)/2,(t.source.value+t.target.value)/2)})}var e,r,i,u,o,a,l,c={},f=0;return c.matrix=function(n){return arguments.length?(u=(i=n)&&i.length,e=r=null,c):i},c.padding=function(n){return arguments.length?(f=n,e=r=null,c):f},c.sortGroups=function(n){return arguments.length?(o=n,e=r=null,c):o},c.sortSubgroups=function(n){return arguments.length?(a=n,e=null,c):a},c.sortChords=function(n){return arguments.length?(l=n,e&&t(),c):l},c.chords=function(){return e||n(),e},c.groups=function(){return r||n(),r},c},ao.layout.force=function(){function n(n){return function(t,e,r,i){if(t.point!==n){var u=t.cx-n.x,o=t.cy-n.y,a=i-e,l=u*u+o*o;if(l>a*a/y){if(v>l){var c=t.charge/l;n.px-=u*c,n.py-=o*c}return!0}if(t.point&&l&&v>l){var c=t.pointCharge/l;n.px-=u*c,n.py-=o*c}}return!t.charge}}function t(n){n.px=ao.event.x,n.py=ao.event.y,l.resume()}var e,r,i,u,o,a,l={},c=ao.dispatch("start","tick","end"),f=[1,1],s=.9,h=ml,p=Ml,g=-30,v=xl,d=.1,y=.64,M=[],x=[];return l.tick=function(){if((i*=.99)<.005)return e=null,c.end({type:"end",alpha:i=0}),!0;var t,r,l,h,p,v,y,m,b,_=M.length,w=x.length;for(r=0;w>r;++r)l=x[r],h=l.source,p=l.target,m=p.x-h.x,b=p.y-h.y,(v=m*m+b*b)&&(v=i*o[r]*((v=Math.sqrt(v))-u[r])/v,m*=v,b*=v,p.x-=m*(y=h.weight+p.weight?h.weight/(h.weight+p.weight):.5),p.y-=b*y,h.x+=m*(y=1-y),h.y+=b*y);if((y=i*d)&&(m=f[0]/2,b=f[1]/2,r=-1,y))for(;++r<_;)l=M[r],l.x+=(m-l.x)*y,l.y+=(b-l.y)*y;if(g)for(ri(t=ao.geom.quadtree(M),i,a),r=-1;++r<_;)(l=M[r]).fixed||t.visit(n(l));for(r=-1;++r<_;)l=M[r],l.fixed?(l.x=l.px,l.y=l.py):(l.x-=(l.px-(l.px=l.x))*s,l.y-=(l.py-(l.py=l.y))*s);c.tick({type:"tick",alpha:i})},l.nodes=function(n){return arguments.length?(M=n,l):M},l.links=function(n){return arguments.length?(x=n,l):x},l.size=function(n){return arguments.length?(f=n,l):f},l.linkDistance=function(n){return arguments.length?(h="function"==typeof n?n:+n,l):h},l.distance=l.linkDistance,l.linkStrength=function(n){return arguments.length?(p="function"==typeof n?n:+n,l):p},l.friction=function(n){return arguments.length?(s=+n,l):s},l.charge=function(n){return arguments.length?(g="function"==typeof n?n:+n,l):g},l.chargeDistance=function(n){return arguments.length?(v=n*n,l):Math.sqrt(v)},l.gravity=function(n){return arguments.length?(d=+n,l):d},l.theta=function(n){return arguments.length?(y=n*n,l):Math.sqrt(y)},l.alpha=function(n){return arguments.length?(n=+n,i?n>0?i=n:(e.c=null,e.t=NaN,e=null,c.end({type:"end",alpha:i=0})):n>0&&(c.start({type:"start",alpha:i=n}),e=qn(l.tick)),l):i},l.start=function(){function n(n,r){if(!e){for(e=new Array(i),l=0;i>l;++l)e[l]=[];for(l=0;c>l;++l){var u=x[l];e[u.source.index].push(u.target),e[u.target.index].push(u.source)}}for(var o,a=e[t],l=-1,f=a.length;++l<f;)if(!isNaN(o=a[l][n]))return o;return Math.random()*r}var t,e,r,i=M.length,c=x.length,s=f[0],v=f[1];for(t=0;i>t;++t)(r=M[t]).index=t,r.weight=0;for(t=0;c>t;++t)r=x[t],"number"==typeof r.source&&(r.source=M[r.source]),"number"==typeof r.target&&(r.target=M[r.target]),++r.source.weight,++r.target.weight;for(t=0;i>t;++t)r=M[t],isNaN(r.x)&&(r.x=n("x",s)),isNaN(r.y)&&(r.y=n("y",v)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(u=[],"function"==typeof h)for(t=0;c>t;++t)u[t]=+h.call(this,x[t],t);else for(t=0;c>t;++t)u[t]=h;if(o=[],"function"==typeof p)for(t=0;c>t;++t)o[t]=+p.call(this,x[t],t);else for(t=0;c>t;++t)o[t]=p;if(a=[],"function"==typeof g)for(t=0;i>t;++t)a[t]=+g.call(this,M[t],t);else for(t=0;i>t;++t)a[t]=g;return l.resume()},l.resume=function(){return l.alpha(.1)},l.stop=function(){return l.alpha(0)},l.drag=function(){return r||(r=ao.behavior.drag().origin(m).on("dragstart.force",Qr).on("drag.force",t).on("dragend.force",ni)),arguments.length?void this.on("mouseover.force",ti).on("mouseout.force",ei).call(r):r},ao.rebind(l,c,"on")};var ml=20,Ml=1,xl=1/0;ao.layout.hierarchy=function(){function n(i){var u,o=[i],a=[];for(i.depth=0;null!=(u=o.pop());)if(a.push(u),(c=e.call(n,u,u.depth))&&(l=c.length)){for(var l,c,f;--l>=0;)o.push(f=c[l]),f.parent=u,f.depth=u.depth+1;r&&(u.value=0),u.children=c}else r&&(u.value=+r.call(n,u,u.depth)||0),delete u.children;return oi(i,function(n){var e,i;t&&(e=n.children)&&e.sort(t),r&&(i=n.parent)&&(i.value+=n.value)}),a}var t=ci,e=ai,r=li;return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(ui(t,function(n){n.children&&(n.value=0)}),oi(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},ao.layout.partition=function(){function n(t,e,r,i){var u=t.children;if(t.x=e,t.y=t.depth*i,t.dx=r,t.dy=i,u&&(o=u.length)){var o,a,l,c=-1;for(r=t.value?r/t.value:0;++c<o;)n(a=u[c],e,l=a.value*r,i),e+=l}}function t(n){var e=n.children,r=0;if(e&&(i=e.length))for(var i,u=-1;++u<i;)r=Math.max(r,t(e[u]));return 1+r}function e(e,u){var o=r.call(this,e,u);return n(o[0],0,i[0],i[1]/t(o[0])),o}var r=ao.layout.hierarchy(),i=[1,1];return e.size=function(n){return arguments.length?(i=n,e):i},ii(e,r)},ao.layout.pie=function(){function n(o){var a,l=o.length,c=o.map(function(e,r){return+t.call(n,e,r)}),f=+("function"==typeof r?r.apply(this,arguments):r),s=("function"==typeof i?i.apply(this,arguments):i)-f,h=Math.min(Math.abs(s)/l,+("function"==typeof u?u.apply(this,arguments):u)),p=h*(0>s?-1:1),g=ao.sum(c),v=g?(s-l*p)/g:0,d=ao.range(l),y=[];return null!=e&&d.sort(e===bl?function(n,t){return c[t]-c[n]}:function(n,t){return e(o[n],o[t])}),d.forEach(function(n){y[n]={data:o[n],value:a=c[n],startAngle:f,endAngle:f+=a*v+p,padAngle:h}}),y}var t=Number,e=bl,r=0,i=Ho,u=0;return n.value=function(e){return arguments.length?(t=e,n):t},n.sort=function(t){return arguments.length?(e=t,n):e},n.startAngle=function(t){return arguments.length?(r=t,n):r},n.endAngle=function(t){return arguments.length?(i=t,n):i},n.padAngle=function(t){return arguments.length?(u=t,n):u},n};var bl={};ao.layout.stack=function(){function n(a,l){if(!(h=a.length))return a;var c=a.map(function(e,r){return t.call(n,e,r)}),f=c.map(function(t){return t.map(function(t,e){return[u.call(n,t,e),o.call(n,t,e)]})}),s=e.call(n,f,l);c=ao.permute(c,s),f=ao.permute(f,s);var h,p,g,v,d=r.call(n,f,l),y=c[0].length;for(g=0;y>g;++g)for(i.call(n,c[0][g],v=d[g],f[0][g][1]),p=1;h>p;++p)i.call(n,c[p][g],v+=f[p-1][g][1],f[p][g][1]);return a}var t=m,e=gi,r=vi,i=pi,u=si,o=hi;return n.values=function(e){return arguments.length?(t=e,n):t},n.order=function(t){return arguments.length?(e="function"==typeof t?t:_l.get(t)||gi,n):e},n.offset=function(t){return arguments.length?(r="function"==typeof t?t:wl.get(t)||vi,n):r},n.x=function(t){return arguments.length?(u=t,n):u},n.y=function(t){return arguments.length?(o=t,n):o},n.out=function(t){return arguments.length?(i=t,n):i},n};var _l=ao.map({"inside-out":function(n){var t,e,r=n.length,i=n.map(di),u=n.map(yi),o=ao.range(r).sort(function(n,t){return i[n]-i[t]}),a=0,l=0,c=[],f=[];for(t=0;r>t;++t)e=o[t],l>a?(a+=u[e],c.push(e)):(l+=u[e],f.push(e));return f.reverse().concat(c)},reverse:function(n){return ao.range(n.length).reverse()},"default":gi}),wl=ao.map({silhouette:function(n){var t,e,r,i=n.length,u=n[0].length,o=[],a=0,l=[];for(e=0;u>e;++e){for(t=0,r=0;i>t;t++)r+=n[t][e][1];r>a&&(a=r),o.push(r)}for(e=0;u>e;++e)l[e]=(a-o[e])/2;return l},wiggle:function(n){var t,e,r,i,u,o,a,l,c,f=n.length,s=n[0],h=s.length,p=[];for(p[0]=l=c=0,e=1;h>e;++e){for(t=0,i=0;f>t;++t)i+=n[t][e][1];for(t=0,u=0,a=s[e][0]-s[e-1][0];f>t;++t){for(r=0,o=(n[t][e][1]-n[t][e-1][1])/(2*a);t>r;++r)o+=(n[r][e][1]-n[r][e-1][1])/a;u+=o*n[t][e][1]}p[e]=l-=i?u/i*a:0,c>l&&(c=l)}for(e=0;h>e;++e)p[e]-=c;return p},expand:function(n){var t,e,r,i=n.length,u=n[0].length,o=1/i,a=[];for(e=0;u>e;++e){for(t=0,r=0;i>t;t++)r+=n[t][e][1];if(r)for(t=0;i>t;t++)n[t][e][1]/=r;else for(t=0;i>t;t++)n[t][e][1]=o}for(e=0;u>e;++e)a[e]=0;return a},zero:vi});ao.layout.histogram=function(){function n(n,u){for(var o,a,l=[],c=n.map(e,this),f=r.call(this,c,u),s=i.call(this,f,c,u),u=-1,h=c.length,p=s.length-1,g=t?1:1/h;++u<p;)o=l[u]=[],o.dx=s[u+1]-(o.x=s[u]),o.y=0;if(p>0)for(u=-1;++u<h;)a=c[u],a>=f[0]&&a<=f[1]&&(o=l[ao.bisect(s,a,1,p)-1],o.y+=g,o.push(n[u]));return l}var t=!0,e=Number,r=bi,i=Mi;return n.value=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=En(t),n):r},n.bins=function(t){return arguments.length?(i="number"==typeof t?function(n){return xi(n,t)}:En(t),n):i},n.frequency=function(e){return arguments.length?(t=!!e,n):t},n},ao.layout.pack=function(){function n(n,u){var o=e.call(this,n,u),a=o[0],l=i[0],c=i[1],f=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(a.x=a.y=0,oi(a,function(n){n.r=+f(n.value)}),oi(a,Ni),r){var s=r*(t?1:Math.max(2*a.r/l,2*a.r/c))/2;oi(a,function(n){n.r+=s}),oi(a,Ni),oi(a,function(n){n.r-=s})}return Ci(a,l/2,c/2,t?1:1/Math.max(2*a.r/l,2*a.r/c)),o}var t,e=ao.layout.hierarchy().sort(_i),r=0,i=[1,1];return n.size=function(t){return arguments.length?(i=t,n):i},n.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,n):t},n.padding=function(t){return arguments.length?(r=+t,n):r},ii(n,e)},ao.layout.tree=function(){function n(n,i){var f=o.call(this,n,i),s=f[0],h=t(s);if(oi(h,e),h.parent.m=-h.z,ui(h,r),c)ui(s,u);else{var p=s,g=s,v=s;ui(s,function(n){n.x<p.x&&(p=n),n.x>g.x&&(g=n),n.depth>v.depth&&(v=n)});var d=a(p,g)/2-p.x,y=l[0]/(g.x+a(g,p)/2+d),m=l[1]/(v.depth||1);ui(s,function(n){n.x=(n.x+d)*y,n.y=n.depth*m})}return f}function t(n){for(var t,e={A:null,children:[n]},r=[e];null!=(t=r.pop());)for(var i,u=t.children,o=0,a=u.length;a>o;++o)r.push((u[o]=i={_:u[o],parent:t,children:(i=u[o].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=i);return e.children[0]}function e(n){var t=n.children,e=n.parent.children,r=n.i?e[n.i-1]:null;if(t.length){Di(n);var u=(t[0].z+t[t.length-1].z)/2;r?(n.z=r.z+a(n._,r._),n.m=n.z-u):n.z=u}else r&&(n.z=r.z+a(n._,r._));n.parent.A=i(n,r,n.parent.A||e[0])}function r(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function i(n,t,e){if(t){for(var r,i=n,u=n,o=t,l=i.parent.children[0],c=i.m,f=u.m,s=o.m,h=l.m;o=Ti(o),i=qi(i),o&&i;)l=qi(l),u=Ti(u),u.a=n,r=o.z+s-i.z-c+a(o._,i._),r>0&&(Ri(Pi(o,n,e),n,r),c+=r,f+=r),s+=o.m,c+=i.m,h+=l.m,f+=u.m;o&&!Ti(u)&&(u.t=o,u.m+=s-f),i&&!qi(l)&&(l.t=i,l.m+=c-h,e=n)}return e}function u(n){n.x*=l[0],n.y=n.depth*l[1]}var o=ao.layout.hierarchy().sort(null).value(null),a=Li,l=[1,1],c=null;return n.separation=function(t){return arguments.length?(a=t,n):a},n.size=function(t){return arguments.length?(c=null==(l=t)?u:null,n):c?null:l},n.nodeSize=function(t){return arguments.length?(c=null==(l=t)?null:u,n):c?l:null},ii(n,o)},ao.layout.cluster=function(){function n(n,u){var o,a=t.call(this,n,u),l=a[0],c=0;oi(l,function(n){var t=n.children;t&&t.length?(n.x=ji(t),n.y=Ui(t)):(n.x=o?c+=e(n,o):0,n.y=0,o=n)});var f=Fi(l),s=Hi(l),h=f.x-e(f,s)/2,p=s.x+e(s,f)/2;return oi(l,i?function(n){n.x=(n.x-l.x)*r[0],n.y=(l.y-n.y)*r[1]}:function(n){n.x=(n.x-h)/(p-h)*r[0],n.y=(1-(l.y?n.y/l.y:1))*r[1]}),a}var t=ao.layout.hierarchy().sort(null).value(null),e=Li,r=[1,1],i=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(i=null==(r=t),n):i?null:r},n.nodeSize=function(t){return arguments.length?(i=null!=(r=t),n):i?r:null},ii(n,t)},ao.layout.treemap=function(){function n(n,t){for(var e,r,i=-1,u=n.length;++i<u;)r=(e=n[i]).value*(0>t?0:t),e.area=isNaN(r)||0>=r?0:r}function t(e){var u=e.children;if(u&&u.length){var o,a,l,c=s(e),f=[],h=u.slice(),g=1/0,v="slice"===p?c.dx:"dice"===p?c.dy:"slice-dice"===p?1&e.depth?c.dy:c.dx:Math.min(c.dx,c.dy);for(n(h,c.dx*c.dy/e.value),f.area=0;(l=h.length)>0;)f.push(o=h[l-1]),f.area+=o.area,"squarify"!==p||(a=r(f,v))<=g?(h.pop(),g=a):(f.area-=f.pop().area,i(f,v,c,!1),v=Math.min(c.dx,c.dy),f.length=f.area=0,g=1/0);f.length&&(i(f,v,c,!0),f.length=f.area=0),u.forEach(t)}}function e(t){var r=t.children;if(r&&r.length){var u,o=s(t),a=r.slice(),l=[];for(n(a,o.dx*o.dy/t.value),l.area=0;u=a.pop();)l.push(u),l.area+=u.area,null!=u.z&&(i(l,u.z?o.dx:o.dy,o,!a.length),l.length=l.area=0);r.forEach(e)}}function r(n,t){for(var e,r=n.area,i=0,u=1/0,o=-1,a=n.length;++o<a;)(e=n[o].area)&&(u>e&&(u=e),e>i&&(i=e));return r*=r,t*=t,r?Math.max(t*i*g/r,r/(t*u*g)):1/0}function i(n,t,e,r){var i,u=-1,o=n.length,a=e.x,c=e.y,f=t?l(n.area/t):0; +if(t==e.dx){for((r||f>e.dy)&&(f=e.dy);++u<o;)i=n[u],i.x=a,i.y=c,i.dy=f,a+=i.dx=Math.min(e.x+e.dx-a,f?l(i.area/f):0);i.z=!0,i.dx+=e.x+e.dx-a,e.y+=f,e.dy-=f}else{for((r||f>e.dx)&&(f=e.dx);++u<o;)i=n[u],i.x=a,i.y=c,i.dx=f,c+=i.dy=Math.min(e.y+e.dy-c,f?l(i.area/f):0);i.z=!1,i.dy+=e.y+e.dy-c,e.x+=f,e.dx-=f}}function u(r){var i=o||a(r),u=i[0];return u.x=u.y=0,u.value?(u.dx=c[0],u.dy=c[1]):u.dx=u.dy=0,o&&a.revalue(u),n([u],u.dx*u.dy/u.value),(o?e:t)(u),h&&(o=i),i}var o,a=ao.layout.hierarchy(),l=Math.round,c=[1,1],f=null,s=Oi,h=!1,p="squarify",g=.5*(1+Math.sqrt(5));return u.size=function(n){return arguments.length?(c=n,u):c},u.padding=function(n){function t(t){var e=n.call(u,t,t.depth);return null==e?Oi(t):Ii(t,"number"==typeof e?[e,e,e,e]:e)}function e(t){return Ii(t,n)}if(!arguments.length)return f;var r;return s=null==(f=n)?Oi:"function"==(r=typeof n)?t:"number"===r?(n=[n,n,n,n],e):e,u},u.round=function(n){return arguments.length?(l=n?Math.round:Number,u):l!=Number},u.sticky=function(n){return arguments.length?(h=n,o=null,u):h},u.ratio=function(n){return arguments.length?(g=n,u):g},u.mode=function(n){return arguments.length?(p=n+"",u):p},ii(u,a)},ao.random={normal:function(n,t){var e=arguments.length;return 2>e&&(t=1),1>e&&(n=0),function(){var e,r,i;do e=2*Math.random()-1,r=2*Math.random()-1,i=e*e+r*r;while(!i||i>1);return n+t*e*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var n=ao.random.normal.apply(ao,arguments);return function(){return Math.exp(n())}},bates:function(n){var t=ao.random.irwinHall(n);return function(){return t()/n}},irwinHall:function(n){return function(){for(var t=0,e=0;n>e;e++)t+=Math.random();return t}}},ao.scale={};var Sl={floor:m,ceil:m};ao.scale.linear=function(){return Wi([0,1],[0,1],Mr,!1)};var kl={s:1,g:1,p:1,r:1,e:1};ao.scale.log=function(){return ru(ao.scale.linear().domain([0,1]),10,!0,[1,10])};var Nl=ao.format(".0e"),El={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};ao.scale.pow=function(){return iu(ao.scale.linear(),1,[0,1])},ao.scale.sqrt=function(){return ao.scale.pow().exponent(.5)},ao.scale.ordinal=function(){return ou([],{t:"range",a:[[]]})},ao.scale.category10=function(){return ao.scale.ordinal().range(Al)},ao.scale.category20=function(){return ao.scale.ordinal().range(Cl)},ao.scale.category20b=function(){return ao.scale.ordinal().range(zl)},ao.scale.category20c=function(){return ao.scale.ordinal().range(Ll)};var Al=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(xn),Cl=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(xn),zl=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(xn),Ll=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(xn);ao.scale.quantile=function(){return au([],[])},ao.scale.quantize=function(){return lu(0,1,[0,1])},ao.scale.threshold=function(){return cu([.5],[0,1])},ao.scale.identity=function(){return fu([0,1])},ao.svg={},ao.svg.arc=function(){function n(){var n=Math.max(0,+e.apply(this,arguments)),c=Math.max(0,+r.apply(this,arguments)),f=o.apply(this,arguments)-Io,s=a.apply(this,arguments)-Io,h=Math.abs(s-f),p=f>s?0:1;if(n>c&&(g=c,c=n,n=g),h>=Oo)return t(c,p)+(n?t(n,1-p):"")+"Z";var g,v,d,y,m,M,x,b,_,w,S,k,N=0,E=0,A=[];if((y=(+l.apply(this,arguments)||0)/2)&&(d=u===ql?Math.sqrt(n*n+c*c):+u.apply(this,arguments),p||(E*=-1),c&&(E=tn(d/c*Math.sin(y))),n&&(N=tn(d/n*Math.sin(y)))),c){m=c*Math.cos(f+E),M=c*Math.sin(f+E),x=c*Math.cos(s-E),b=c*Math.sin(s-E);var C=Math.abs(s-f-2*E)<=Fo?0:1;if(E&&yu(m,M,x,b)===p^C){var z=(f+s)/2;m=c*Math.cos(z),M=c*Math.sin(z),x=b=null}}else m=M=0;if(n){_=n*Math.cos(s-N),w=n*Math.sin(s-N),S=n*Math.cos(f+N),k=n*Math.sin(f+N);var L=Math.abs(f-s+2*N)<=Fo?0:1;if(N&&yu(_,w,S,k)===1-p^L){var q=(f+s)/2;_=n*Math.cos(q),w=n*Math.sin(q),S=k=null}}else _=w=0;if(h>Uo&&(g=Math.min(Math.abs(c-n)/2,+i.apply(this,arguments)))>.001){v=c>n^p?0:1;var T=g,R=g;if(Fo>h){var D=null==S?[_,w]:null==x?[m,M]:Re([m,M],[S,k],[x,b],[_,w]),P=m-D[0],U=M-D[1],j=x-D[0],F=b-D[1],H=1/Math.sin(Math.acos((P*j+U*F)/(Math.sqrt(P*P+U*U)*Math.sqrt(j*j+F*F)))/2),O=Math.sqrt(D[0]*D[0]+D[1]*D[1]);R=Math.min(g,(n-O)/(H-1)),T=Math.min(g,(c-O)/(H+1))}if(null!=x){var I=mu(null==S?[_,w]:[S,k],[m,M],c,T,p),Y=mu([x,b],[_,w],c,T,p);g===T?A.push("M",I[0],"A",T,",",T," 0 0,",v," ",I[1],"A",c,",",c," 0 ",1-p^yu(I[1][0],I[1][1],Y[1][0],Y[1][1]),",",p," ",Y[1],"A",T,",",T," 0 0,",v," ",Y[0]):A.push("M",I[0],"A",T,",",T," 0 1,",v," ",Y[0])}else A.push("M",m,",",M);if(null!=S){var Z=mu([m,M],[S,k],n,-R,p),V=mu([_,w],null==x?[m,M]:[x,b],n,-R,p);g===R?A.push("L",V[0],"A",R,",",R," 0 0,",v," ",V[1],"A",n,",",n," 0 ",p^yu(V[1][0],V[1][1],Z[1][0],Z[1][1]),",",1-p," ",Z[1],"A",R,",",R," 0 0,",v," ",Z[0]):A.push("L",V[0],"A",R,",",R," 0 0,",v," ",Z[0])}else A.push("L",_,",",w)}else A.push("M",m,",",M),null!=x&&A.push("A",c,",",c," 0 ",C,",",p," ",x,",",b),A.push("L",_,",",w),null!=S&&A.push("A",n,",",n," 0 ",L,",",1-p," ",S,",",k);return A.push("Z"),A.join("")}function t(n,t){return"M0,"+n+"A"+n+","+n+" 0 1,"+t+" 0,"+-n+"A"+n+","+n+" 0 1,"+t+" 0,"+n}var e=hu,r=pu,i=su,u=ql,o=gu,a=vu,l=du;return n.innerRadius=function(t){return arguments.length?(e=En(t),n):e},n.outerRadius=function(t){return arguments.length?(r=En(t),n):r},n.cornerRadius=function(t){return arguments.length?(i=En(t),n):i},n.padRadius=function(t){return arguments.length?(u=t==ql?ql:En(t),n):u},n.startAngle=function(t){return arguments.length?(o=En(t),n):o},n.endAngle=function(t){return arguments.length?(a=En(t),n):a},n.padAngle=function(t){return arguments.length?(l=En(t),n):l},n.centroid=function(){var n=(+e.apply(this,arguments)+ +r.apply(this,arguments))/2,t=(+o.apply(this,arguments)+ +a.apply(this,arguments))/2-Io;return[Math.cos(t)*n,Math.sin(t)*n]},n};var ql="auto";ao.svg.line=function(){return Mu(m)};var Tl=ao.map({linear:xu,"linear-closed":bu,step:_u,"step-before":wu,"step-after":Su,basis:zu,"basis-open":Lu,"basis-closed":qu,bundle:Tu,cardinal:Eu,"cardinal-open":ku,"cardinal-closed":Nu,monotone:Fu});Tl.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var Rl=[0,2/3,1/3,0],Dl=[0,1/3,2/3,0],Pl=[0,1/6,2/3,1/6];ao.svg.line.radial=function(){var n=Mu(Hu);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},wu.reverse=Su,Su.reverse=wu,ao.svg.area=function(){return Ou(m)},ao.svg.area.radial=function(){var n=Ou(Hu);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n},ao.svg.chord=function(){function n(n,a){var l=t(this,u,n,a),c=t(this,o,n,a);return"M"+l.p0+r(l.r,l.p1,l.a1-l.a0)+(e(l,c)?i(l.r,l.p1,l.r,l.p0):i(l.r,l.p1,c.r,c.p0)+r(c.r,c.p1,c.a1-c.a0)+i(c.r,c.p1,l.r,l.p0))+"Z"}function t(n,t,e,r){var i=t.call(n,e,r),u=a.call(n,i,r),o=l.call(n,i,r)-Io,f=c.call(n,i,r)-Io;return{r:u,a0:o,a1:f,p0:[u*Math.cos(o),u*Math.sin(o)],p1:[u*Math.cos(f),u*Math.sin(f)]}}function e(n,t){return n.a0==t.a0&&n.a1==t.a1}function r(n,t,e){return"A"+n+","+n+" 0 "+ +(e>Fo)+",1 "+t}function i(n,t,e,r){return"Q 0,0 "+r}var u=Me,o=xe,a=Iu,l=gu,c=vu;return n.radius=function(t){return arguments.length?(a=En(t),n):a},n.source=function(t){return arguments.length?(u=En(t),n):u},n.target=function(t){return arguments.length?(o=En(t),n):o},n.startAngle=function(t){return arguments.length?(l=En(t),n):l},n.endAngle=function(t){return arguments.length?(c=En(t),n):c},n},ao.svg.diagonal=function(){function n(n,i){var u=t.call(this,n,i),o=e.call(this,n,i),a=(u.y+o.y)/2,l=[u,{x:u.x,y:a},{x:o.x,y:a},o];return l=l.map(r),"M"+l[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var t=Me,e=xe,r=Yu;return n.source=function(e){return arguments.length?(t=En(e),n):t},n.target=function(t){return arguments.length?(e=En(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},ao.svg.diagonal.radial=function(){var n=ao.svg.diagonal(),t=Yu,e=n.projection;return n.projection=function(n){return arguments.length?e(Zu(t=n)):t},n},ao.svg.symbol=function(){function n(n,r){return(Ul.get(t.call(this,n,r))||$u)(e.call(this,n,r))}var t=Xu,e=Vu;return n.type=function(e){return arguments.length?(t=En(e),n):t},n.size=function(t){return arguments.length?(e=En(t),n):e},n};var Ul=ao.map({circle:$u,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*Fl)),e=t*Fl;return"M0,"+-t+"L"+e+",0 0,"+t+" "+-e+",0Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/jl),e=t*jl/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/jl),e=t*jl/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});ao.svg.symbolTypes=Ul.keys();var jl=Math.sqrt(3),Fl=Math.tan(30*Yo);Co.transition=function(n){for(var t,e,r=Hl||++Zl,i=Ku(n),u=[],o=Ol||{time:Date.now(),ease:Nr,delay:0,duration:250},a=-1,l=this.length;++a<l;){u.push(t=[]);for(var c=this[a],f=-1,s=c.length;++f<s;)(e=c[f])&&Qu(e,f,i,r,o),t.push(e)}return Wu(u,i,r)},Co.interrupt=function(n){return this.each(null==n?Il:Bu(Ku(n)))};var Hl,Ol,Il=Bu(Ku()),Yl=[],Zl=0;Yl.call=Co.call,Yl.empty=Co.empty,Yl.node=Co.node,Yl.size=Co.size,ao.transition=function(n,t){return n&&n.transition?Hl?n.transition(t):n:ao.selection().transition(n)},ao.transition.prototype=Yl,Yl.select=function(n){var t,e,r,i=this.id,u=this.namespace,o=[];n=A(n);for(var a=-1,l=this.length;++a<l;){o.push(t=[]);for(var c=this[a],f=-1,s=c.length;++f<s;)(r=c[f])&&(e=n.call(r,r.__data__,f,a))?("__data__"in r&&(e.__data__=r.__data__),Qu(e,f,u,i,r[u][i]),t.push(e)):t.push(null)}return Wu(o,u,i)},Yl.selectAll=function(n){var t,e,r,i,u,o=this.id,a=this.namespace,l=[];n=C(n);for(var c=-1,f=this.length;++c<f;)for(var s=this[c],h=-1,p=s.length;++h<p;)if(r=s[h]){u=r[a][o],e=n.call(r,r.__data__,h,c),l.push(t=[]);for(var g=-1,v=e.length;++g<v;)(i=e[g])&&Qu(i,g,a,o,u),t.push(i)}return Wu(l,a,o)},Yl.filter=function(n){var t,e,r,i=[];"function"!=typeof n&&(n=O(n));for(var u=0,o=this.length;o>u;u++){i.push(t=[]);for(var e=this[u],a=0,l=e.length;l>a;a++)(r=e[a])&&n.call(r,r.__data__,a,u)&&t.push(r)}return Wu(i,this.namespace,this.id)},Yl.tween=function(n,t){var e=this.id,r=this.namespace;return arguments.length<2?this.node()[r][e].tween.get(n):Y(this,null==t?function(t){t[r][e].tween.remove(n)}:function(i){i[r][e].tween.set(n,t)})},Yl.attr=function(n,t){function e(){this.removeAttribute(a)}function r(){this.removeAttributeNS(a.space,a.local)}function i(n){return null==n?e:(n+="",function(){var t,e=this.getAttribute(a);return e!==n&&(t=o(e,n),function(n){this.setAttribute(a,t(n))})})}function u(n){return null==n?r:(n+="",function(){var t,e=this.getAttributeNS(a.space,a.local);return e!==n&&(t=o(e,n),function(n){this.setAttributeNS(a.space,a.local,t(n))})})}if(arguments.length<2){for(t in n)this.attr(t,n[t]);return this}var o="transform"==n?$r:Mr,a=ao.ns.qualify(n);return Ju(this,"attr."+n,t,a.local?u:i)},Yl.attrTween=function(n,t){function e(n,e){var r=t.call(this,n,e,this.getAttribute(i));return r&&function(n){this.setAttribute(i,r(n))}}function r(n,e){var r=t.call(this,n,e,this.getAttributeNS(i.space,i.local));return r&&function(n){this.setAttributeNS(i.space,i.local,r(n))}}var i=ao.ns.qualify(n);return this.tween("attr."+n,i.local?r:e)},Yl.style=function(n,e,r){function i(){this.style.removeProperty(n)}function u(e){return null==e?i:(e+="",function(){var i,u=t(this).getComputedStyle(this,null).getPropertyValue(n);return u!==e&&(i=Mr(u,e),function(t){this.style.setProperty(n,i(t),r)})})}var o=arguments.length;if(3>o){if("string"!=typeof n){2>o&&(e="");for(r in n)this.style(r,n[r],e);return this}r=""}return Ju(this,"style."+n,e,u)},Yl.styleTween=function(n,e,r){function i(i,u){var o=e.call(this,i,u,t(this).getComputedStyle(this,null).getPropertyValue(n));return o&&function(t){this.style.setProperty(n,o(t),r)}}return arguments.length<3&&(r=""),this.tween("style."+n,i)},Yl.text=function(n){return Ju(this,"text",n,Gu)},Yl.remove=function(){var n=this.namespace;return this.each("end.transition",function(){var t;this[n].count<2&&(t=this.parentNode)&&t.removeChild(this)})},Yl.ease=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].ease:("function"!=typeof n&&(n=ao.ease.apply(ao,arguments)),Y(this,function(r){r[e][t].ease=n}))},Yl.delay=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].delay:Y(this,"function"==typeof n?function(r,i,u){r[e][t].delay=+n.call(r,r.__data__,i,u)}:(n=+n,function(r){r[e][t].delay=n}))},Yl.duration=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].duration:Y(this,"function"==typeof n?function(r,i,u){r[e][t].duration=Math.max(1,n.call(r,r.__data__,i,u))}:(n=Math.max(1,n),function(r){r[e][t].duration=n}))},Yl.each=function(n,t){var e=this.id,r=this.namespace;if(arguments.length<2){var i=Ol,u=Hl;try{Hl=e,Y(this,function(t,i,u){Ol=t[r][e],n.call(t,t.__data__,i,u)})}finally{Ol=i,Hl=u}}else Y(this,function(i){var u=i[r][e];(u.event||(u.event=ao.dispatch("start","end","interrupt"))).on(n,t)});return this},Yl.transition=function(){for(var n,t,e,r,i=this.id,u=++Zl,o=this.namespace,a=[],l=0,c=this.length;c>l;l++){a.push(n=[]);for(var t=this[l],f=0,s=t.length;s>f;f++)(e=t[f])&&(r=e[o][i],Qu(e,f,o,u,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),n.push(e)}return Wu(a,o,u)},ao.svg.axis=function(){function n(n){n.each(function(){var n,c=ao.select(this),f=this.__chart__||e,s=this.__chart__=e.copy(),h=null==l?s.ticks?s.ticks.apply(s,a):s.domain():l,p=null==t?s.tickFormat?s.tickFormat.apply(s,a):m:t,g=c.selectAll(".tick").data(h,s),v=g.enter().insert("g",".domain").attr("class","tick").style("opacity",Uo),d=ao.transition(g.exit()).style("opacity",Uo).remove(),y=ao.transition(g.order()).style("opacity",1),M=Math.max(i,0)+o,x=Zi(s),b=c.selectAll(".domain").data([0]),_=(b.enter().append("path").attr("class","domain"),ao.transition(b));v.append("line"),v.append("text");var w,S,k,N,E=v.select("line"),A=y.select("line"),C=g.select("text").text(p),z=v.select("text"),L=y.select("text"),q="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(n=no,w="x",k="y",S="x2",N="y2",C.attr("dy",0>q?"0em":".71em").style("text-anchor","middle"),_.attr("d","M"+x[0]+","+q*u+"V0H"+x[1]+"V"+q*u)):(n=to,w="y",k="x",S="y2",N="x2",C.attr("dy",".32em").style("text-anchor",0>q?"end":"start"),_.attr("d","M"+q*u+","+x[0]+"H0V"+x[1]+"H"+q*u)),E.attr(N,q*i),z.attr(k,q*M),A.attr(S,0).attr(N,q*i),L.attr(w,0).attr(k,q*M),s.rangeBand){var T=s,R=T.rangeBand()/2;f=s=function(n){return T(n)+R}}else f.rangeBand?f=s:d.call(n,s,f);v.call(n,f,s),y.call(n,s,s)})}var t,e=ao.scale.linear(),r=Vl,i=6,u=6,o=3,a=[10],l=null;return n.scale=function(t){return arguments.length?(e=t,n):e},n.orient=function(t){return arguments.length?(r=t in Xl?t+"":Vl,n):r},n.ticks=function(){return arguments.length?(a=co(arguments),n):a},n.tickValues=function(t){return arguments.length?(l=t,n):l},n.tickFormat=function(e){return arguments.length?(t=e,n):t},n.tickSize=function(t){var e=arguments.length;return e?(i=+t,u=+arguments[e-1],n):i},n.innerTickSize=function(t){return arguments.length?(i=+t,n):i},n.outerTickSize=function(t){return arguments.length?(u=+t,n):u},n.tickPadding=function(t){return arguments.length?(o=+t,n):o},n.tickSubdivide=function(){return arguments.length&&n},n};var Vl="bottom",Xl={top:1,right:1,bottom:1,left:1};ao.svg.brush=function(){function n(t){t.each(function(){var t=ao.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",u).on("touchstart.brush",u),o=t.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),t.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var a=t.selectAll(".resize").data(v,m);a.exit().remove(),a.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return $l[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),a.style("display",n.empty()?"none":null);var l,s=ao.transition(t),h=ao.transition(o);c&&(l=Zi(c),h.attr("x",l[0]).attr("width",l[1]-l[0]),r(s)),f&&(l=Zi(f),h.attr("y",l[0]).attr("height",l[1]-l[0]),i(s)),e(s)})}function e(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+s[+/e$/.test(n)]+","+h[+/^s/.test(n)]+")"})}function r(n){n.select(".extent").attr("x",s[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",s[1]-s[0])}function i(n){n.select(".extent").attr("y",h[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function u(){function u(){32==ao.event.keyCode&&(C||(M=null,L[0]-=s[1],L[1]-=h[1],C=2),S())}function v(){32==ao.event.keyCode&&2==C&&(L[0]+=s[1],L[1]+=h[1],C=0,S())}function d(){var n=ao.mouse(b),t=!1;x&&(n[0]+=x[0],n[1]+=x[1]),C||(ao.event.altKey?(M||(M=[(s[0]+s[1])/2,(h[0]+h[1])/2]),L[0]=s[+(n[0]<M[0])],L[1]=h[+(n[1]<M[1])]):M=null),E&&y(n,c,0)&&(r(k),t=!0),A&&y(n,f,1)&&(i(k),t=!0),t&&(e(k),w({type:"brush",mode:C?"move":"resize"}))}function y(n,t,e){var r,i,u=Zi(t),l=u[0],c=u[1],f=L[e],v=e?h:s,d=v[1]-v[0];return C&&(l-=f,c-=d+f),r=(e?g:p)?Math.max(l,Math.min(c,n[e])):n[e],C?i=(r+=f)+d:(M&&(f=Math.max(l,Math.min(c,2*M[e]-r))),r>f?(i=r,r=f):i=f),v[0]!=r||v[1]!=i?(e?a=null:o=null,v[0]=r,v[1]=i,!0):void 0}function m(){d(),k.style("pointer-events","all").selectAll(".resize").style("display",n.empty()?"none":null),ao.select("body").style("cursor",null),q.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),z(),w({type:"brushend"})}var M,x,b=this,_=ao.select(ao.event.target),w=l.of(b,arguments),k=ao.select(b),N=_.datum(),E=!/^(n|s)$/.test(N)&&c,A=!/^(e|w)$/.test(N)&&f,C=_.classed("extent"),z=W(b),L=ao.mouse(b),q=ao.select(t(b)).on("keydown.brush",u).on("keyup.brush",v);if(ao.event.changedTouches?q.on("touchmove.brush",d).on("touchend.brush",m):q.on("mousemove.brush",d).on("mouseup.brush",m),k.interrupt().selectAll("*").interrupt(),C)L[0]=s[0]-L[0],L[1]=h[0]-L[1];else if(N){var T=+/w$/.test(N),R=+/^n/.test(N);x=[s[1-T]-L[0],h[1-R]-L[1]],L[0]=s[T],L[1]=h[R]}else ao.event.altKey&&(M=L.slice());k.style("pointer-events","none").selectAll(".resize").style("display",null),ao.select("body").style("cursor",_.style("cursor")),w({type:"brushstart"}),d()}var o,a,l=N(n,"brushstart","brush","brushend"),c=null,f=null,s=[0,0],h=[0,0],p=!0,g=!0,v=Bl[0];return n.event=function(n){n.each(function(){var n=l.of(this,arguments),t={x:s,y:h,i:o,j:a},e=this.__chart__||t;this.__chart__=t,Hl?ao.select(this).transition().each("start.brush",function(){o=e.i,a=e.j,s=e.x,h=e.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=xr(s,t.x),r=xr(h,t.y);return o=a=null,function(i){s=t.x=e(i),h=t.y=r(i),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){o=t.i,a=t.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},n.x=function(t){return arguments.length?(c=t,v=Bl[!c<<1|!f],n):c},n.y=function(t){return arguments.length?(f=t,v=Bl[!c<<1|!f],n):f},n.clamp=function(t){return arguments.length?(c&&f?(p=!!t[0],g=!!t[1]):c?p=!!t:f&&(g=!!t),n):c&&f?[p,g]:c?p:f?g:null},n.extent=function(t){var e,r,i,u,l;return arguments.length?(c&&(e=t[0],r=t[1],f&&(e=e[0],r=r[0]),o=[e,r],c.invert&&(e=c(e),r=c(r)),e>r&&(l=e,e=r,r=l),e==s[0]&&r==s[1]||(s=[e,r])),f&&(i=t[0],u=t[1],c&&(i=i[1],u=u[1]),a=[i,u],f.invert&&(i=f(i),u=f(u)),i>u&&(l=i,i=u,u=l),i==h[0]&&u==h[1]||(h=[i,u])),n):(c&&(o?(e=o[0],r=o[1]):(e=s[0],r=s[1],c.invert&&(e=c.invert(e),r=c.invert(r)),e>r&&(l=e,e=r,r=l))),f&&(a?(i=a[0],u=a[1]):(i=h[0],u=h[1],f.invert&&(i=f.invert(i),u=f.invert(u)),i>u&&(l=i,i=u,u=l))),c&&f?[[e,i],[r,u]]:c?[e,r]:f&&[i,u])},n.clear=function(){return n.empty()||(s=[0,0],h=[0,0],o=a=null),n},n.empty=function(){return!!c&&s[0]==s[1]||!!f&&h[0]==h[1]},ao.rebind(n,l,"on")};var $l={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Bl=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Wl=ga.format=xa.timeFormat,Jl=Wl.utc,Gl=Jl("%Y-%m-%dT%H:%M:%S.%LZ");Wl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?eo:Gl,eo.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},eo.toString=Gl.toString,ga.second=On(function(n){return new va(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),ga.seconds=ga.second.range,ga.seconds.utc=ga.second.utc.range,ga.minute=On(function(n){return new va(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),ga.minutes=ga.minute.range,ga.minutes.utc=ga.minute.utc.range,ga.hour=On(function(n){var t=n.getTimezoneOffset()/60;return new va(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),ga.hours=ga.hour.range,ga.hours.utc=ga.hour.utc.range,ga.month=On(function(n){return n=ga.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),ga.months=ga.month.range,ga.months.utc=ga.month.utc.range;var Kl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Ql=[[ga.second,1],[ga.second,5],[ga.second,15],[ga.second,30],[ga.minute,1],[ga.minute,5],[ga.minute,15],[ga.minute,30],[ga.hour,1],[ga.hour,3],[ga.hour,6],[ga.hour,12],[ga.day,1],[ga.day,2],[ga.week,1],[ga.month,1],[ga.month,3],[ga.year,1]],nc=Wl.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",zt]]),tc={range:function(n,t,e){return ao.range(Math.ceil(n/e)*e,+t,e).map(io)},floor:m,ceil:m};Ql.year=ga.year,ga.scale=function(){return ro(ao.scale.linear(),Ql,nc)};var ec=Ql.map(function(n){return[n[0].utc,n[1]]}),rc=Jl.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",zt]]);ec.year=ga.year.utc,ga.scale.utc=function(){return ro(ao.scale.linear(),ec,rc)},ao.text=An(function(n){return n.responseText}),ao.json=function(n,t){return Cn(n,"application/json",uo,t)},ao.html=function(n,t){return Cn(n,"text/html",oo,t)},ao.xml=An(function(n){return n.responseXML}),"function"==typeof define&&define.amd?(this.d3=ao,define(ao)):"object"==typeof module&&module.exports?module.exports=ao:this.d3=ao}(); \ No newline at end of file diff --git a/cluedo4KG-sources/webvowl/js/webvowl.app.js b/cluedo4KG-sources/webvowl/js/webvowl.app.js new file mode 100644 index 0000000000000000000000000000000000000000..d82eddd61295656b7a8b02feafbb0def19e181b9 --- /dev/null +++ b/cluedo4KG-sources/webvowl/js/webvowl.app.js @@ -0,0 +1,9457 @@ +webvowl.app = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports, __webpack_require__) { + + __webpack_require__(319); + __webpack_require__(321); + + module.exports = __webpack_require__(322); + + +/***/ }), + +/***/ 6: +/***/ (function(module, exports) { + + module.exports = d3; + +/***/ }), + +/***/ 91: +/***/ (function(module, exports, __webpack_require__) { + + var Symbol = __webpack_require__(92), + getRawTag = __webpack_require__(95), + objectToString = __webpack_require__(96); + + /** `Object#toString` result references. */ + var nullTag = '[object Null]', + undefinedTag = '[object Undefined]'; + + /** Built-in value references. */ + var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + + /** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); + } + + module.exports = baseGetTag; + + +/***/ }), + +/***/ 92: +/***/ (function(module, exports, __webpack_require__) { + + var root = __webpack_require__(93); + + /** Built-in value references. */ + var Symbol = root.Symbol; + + module.exports = Symbol; + + +/***/ }), + +/***/ 93: +/***/ (function(module, exports, __webpack_require__) { + + var freeGlobal = __webpack_require__(94); + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); + + module.exports = root; + + +/***/ }), + +/***/ 94: +/***/ (function(module, exports) { + + /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + + module.exports = freeGlobal; + + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) + +/***/ }), + +/***/ 95: +/***/ (function(module, exports, __webpack_require__) { + + var Symbol = __webpack_require__(92); + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString = objectProto.toString; + + /** Built-in value references. */ + var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + + /** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ + function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; + } + + module.exports = getRawTag; + + +/***/ }), + +/***/ 96: +/***/ (function(module, exports) { + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString = objectProto.toString; + + /** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ + function objectToString(value) { + return nativeObjectToString.call(value); + } + + module.exports = objectToString; + + +/***/ }), + +/***/ 103: +/***/ (function(module, exports, __webpack_require__) { + + var baseGetTag = __webpack_require__(91), + isObjectLike = __webpack_require__(104); + + /** `Object#toString` result references. */ + var symbolTag = '[object Symbol]'; + + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); + } + + module.exports = isSymbol; + + +/***/ }), + +/***/ 104: +/***/ (function(module, exports) { + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return value != null && typeof value == 'object'; + } + + module.exports = isObjectLike; + + +/***/ }), + +/***/ 112: +/***/ (function(module, exports) { + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray = Array.isArray; + + module.exports = isArray; + + +/***/ }), + +/***/ 154: +/***/ (function(module, exports) { + + /** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; + } + + module.exports = arrayMap; + + +/***/ }), + +/***/ 219: +/***/ (function(module, exports, __webpack_require__) { + + var baseToString = __webpack_require__(220); + + /** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + function toString(value) { + return value == null ? '' : baseToString(value); + } + + module.exports = toString; + + +/***/ }), + +/***/ 220: +/***/ (function(module, exports, __webpack_require__) { + + var Symbol = __webpack_require__(92), + arrayMap = __webpack_require__(154), + isArray = __webpack_require__(112), + isSymbol = __webpack_require__(103); + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0; + + /** Used to convert symbols to primitives and strings. */ + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + + /** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ + function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + module.exports = baseToString; + + +/***/ }), + +/***/ 319: +/***/ (function(module, exports) { + + // removed by extract-text-webpack-plugin + +/***/ }), + +/***/ 321: +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {/* Taken from here: http://stackoverflow.com/a/17907562 */ + function getInternetExplorerVersion(){ + var ua, + re, + rv = -1; + + // check for edge + var isEdge = /(?:\b(MS)?IE\s+|\bTrident\/7\.0;.*\s+rv:|\bEdge\/)(\d+)/.test(navigator.userAgent); + if ( isEdge ) { + rv = parseInt("12"); + return rv; + } + + var isIE11 = /Trident.*rv[ :]*11\./.test(navigator.userAgent); + if ( isIE11 ) { + rv = parseInt("11"); + return rv; + } + if ( navigator.appName === "Microsoft Internet Explorer" ) { + ua = navigator.userAgent; + re = new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})"); + if ( re.exec(ua) !== null ) { + rv = parseFloat(RegExp.$1); + } + } else if ( navigator.appName === "Netscape" ) { + ua = navigator.userAgent; + re = new RegExp("Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})"); + if ( re.exec(ua) !== null ) { + rv = parseFloat(RegExp.$1); + } + } + return rv; + } + + function showBrowserWarningIfRequired(){ + var version = getInternetExplorerVersion(); + console.log("Browser Version =" + version); + if ( version > 0 && version <= 11 ) { + d3.select("#browserCheck").classed("hidden", false); + d3.select("#killWarning").classed("hidden", true); + d3.select("#optionsArea").classed("hidden", true); + d3.select("#logo").classed("hidden", true); + } + if ( version == 12 ) { + d3.select("#logo").classed("hidden", false); + d3.select("#browserCheck").classed("hidden", false); + // connect the button; + var pb_kill = d3.select("#killWarning"); + pb_kill.on("click", function (){ + console.log("hide the warning please"); + d3.select("#browserCheck").classed("hidden", true); + d3.select("#logo").style("padding", "10px"); + }); + } + else { + d3.select("#logo").classed("hidden", false); + d3.select("#browserCheck").classed("hidden", true); + } + + } + + module.exports = showBrowserWarningIfRequired; + showBrowserWarningIfRequired(); + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), + +/***/ 322: +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {String.prototype.replaceAll = function ( search, replacement ){ + var target = this; + return target.split(search).join(replacement); + }; + module.exports = function (){ + var newOntologyCounter = 1; + var app = {}, + graph = webvowl.graph(), + options = graph.graphOptions(), + languageTools = webvowl.util.languageTools(), + GRAPH_SELECTOR = "#graph", + // Modules for the webvowl app + exportMenu = __webpack_require__(323)(graph), + filterMenu = __webpack_require__(325)(graph), + gravityMenu = __webpack_require__(326)(graph), + modeMenu = __webpack_require__(327)(graph), + debugMenu = __webpack_require__(328)(graph), + ontologyMenu = __webpack_require__(329)(graph), + pauseMenu = __webpack_require__(333)(graph), + resetMenu = __webpack_require__(334)(graph), + searchMenu = __webpack_require__(335)(graph), + navigationMenu = __webpack_require__(336)(graph), + zoomSlider = __webpack_require__(337)(graph), + sidebar = __webpack_require__(338)(graph), + leftSidebar = __webpack_require__(339)(graph), + editSidebar = __webpack_require__(340)(graph), + configMenu = __webpack_require__(341)(graph), + loadingModule = __webpack_require__(342)(graph), + warningModule = __webpack_require__(343)(graph), + directInputMod = __webpack_require__(344)(graph), + + + // Graph modules + colorExternalsSwitch = webvowl.modules.colorExternalsSwitch(graph), + compactNotationSwitch = webvowl.modules.compactNotationSwitch(graph), + datatypeFilter = webvowl.modules.datatypeFilter(), + disjointFilter = webvowl.modules.disjointFilter(), + focuser = webvowl.modules.focuser(graph), + emptyLiteralFilter = webvowl.modules.emptyLiteralFilter(), + nodeDegreeFilter = webvowl.modules.nodeDegreeFilter(filterMenu), + nodeScalingSwitch = webvowl.modules.nodeScalingSwitch(graph), + objectPropertyFilter = webvowl.modules.objectPropertyFilter(), + pickAndPin = webvowl.modules.pickAndPin(), + selectionDetailDisplayer = webvowl.modules.selectionDetailsDisplayer(sidebar.updateSelectionInformation), + statistics = webvowl.modules.statistics(), + subclassFilter = webvowl.modules.subclassFilter(), + setOperatorFilter = webvowl.modules.setOperatorFilter(); + + + app.getOptions = function (){ + return webvowl.opts; + }; + app.getGraph = function (){ + return webvowl.gr; + }; + // app.afterInitializationCallback=undefined; + + + var executeFileDrop = false; + var wasMessageToShow = false; + var firstTime = false; + + function addFileDropEvents( selector ){ + var node = d3.select(selector); + + node.node().ondragover = function ( e ){ + e.preventDefault(); + + d3.select("#dragDropContainer").classed("hidden", false); + // get svg size + var w = graph.options().width(); + var h = graph.options().height(); + + // get event position; (using clientX and clientY); + var cx = e.clientX; + var cy = e.clientY; + + if ( firstTime === false ) { + var state = d3.select("#loading-info").classed("hidden"); + wasMessageToShow = !state; + firstTime = true; + d3.select("#loading-info").classed("hidden", true); // hide it so it does not conflict with drop event + var bb=d3.select("#drag_msg").node().getBoundingClientRect(); + var hs = bb.height; + var ws = bb.width; + + var icon_scale=Math.min(hs,ws); + icon_scale/=100; + + d3.select("#drag_icon_group").attr("transform", "translate ( " + 0.25 * ws + " " + 0.25 * hs + ")"); + d3.select("#drag_icon").attr("transform","matrix ("+icon_scale+",0,0,"+icon_scale+",0,0)"); + d3.select("#drag_icon_drop").attr("transform","matrix ("+icon_scale+",0,0,"+icon_scale+",0,0)"); + } + + + if ( (cx > 0.25 * w && cx < 0.75 * w) && (cy > 0.25 * h && cy < 0.75 * h) ) { + + d3.select("#drag_msg_text").node().innerHTML = "Drop it here."; + d3.select("#drag_msg").style("background-color", "#67bc0f"); + d3.select("#drag_msg").style("color", "#000000"); + executeFileDrop = true; + // d3.select("#drag_svg").transition() + // .duration(100) + // // .attr("-webkit-transform", "rotate(90)") + // // .attr("-moz-transform", "rotate(90)") + // // .attr("-o-transform", "rotate(90)") + // .attr("transform", "rotate(90)"); + + d3.select("#drag_icon").classed("hidden",true); + d3.select("#drag_icon_drop").classed("hidden",false); + + + } else { + d3.select("#drag_msg_text").node().innerHTML = "Drag ontology file here."; + d3.select("#drag_msg").style("background-color", "#fefefe"); + d3.select("#drag_msg").style("color", "#000000"); + executeFileDrop = false; + + d3.select("#drag_icon").classed("hidden",false); + d3.select("#drag_icon_drop").classed("hidden",true); + + + // d3.select("#drag_svg").transition() + // .duration(100) + // // .attr("-webkit-transform", "rotate(0)") + // // .attr("-moz-transform", "rotate(0)") + // // .attr("-o-transform", "rotate(0)") + // .attr("transform", "rotate(0)"); + // + } + + }; + node.node().ondrop = function ( ev ){ + ev.preventDefault(); + firstTime = false; + if ( executeFileDrop ) { + if ( ev.dataTransfer.items ) { + if ( ev.dataTransfer.items.length === 1 ) { + if ( ev.dataTransfer.items[0].kind === 'file' ) { + var file = ev.dataTransfer.items[0].getAsFile(); + graph.options().loadingModule().fromFileDrop(file.name, file); + } + } + else { + // >> WARNING not multiple file uploaded; + graph.options().warningModule().showMultiFileUploadWarning(); + } + } + } + d3.select("#dragDropContainer").classed("hidden", true); + }; + + node.node().ondragleave = function ( e ){ + var w = graph.options().width(); + var h = graph.options().height(); + + // get event position; (using clientX and clientY); + var cx = e.clientX; + var cy = e.clientY; + + var hidden = false; + firstTime = false; + + if ( cx < 0.1 * w || cx > 0.9 * w ) hidden = true; + if ( cy < 0.1 * h || cy > 0.9 * h ) hidden = true; + d3.select("#dragDropContainer").classed("hidden", hidden); + + d3.select("#loading-info").classed("hidden", !wasMessageToShow); // show it again + // check if it should be visible + var should_show=graph.options().loadingModule().getMessageVisibilityStatus(); + if (should_show===false){ + d3.select("#loading-info").classed("hidden", true); // hide it + } + }; + + } + + + app.initialize = function (){ + addFileDropEvents(GRAPH_SELECTOR); + + window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || function ( f ){ + return setTimeout(f, 1000 / 60); + }; // simulate calling code 60 + window.cancelAnimationFrame = window.cancelAnimationFrame || window.mozCancelAnimationFrame || function ( requestID ){ + clearTimeout(requestID); + }; //fall back + + options.graphContainerSelector(GRAPH_SELECTOR); + options.selectionModules().push(focuser); + options.selectionModules().push(selectionDetailDisplayer); + options.selectionModules().push(pickAndPin); + + options.filterModules().push(emptyLiteralFilter); + options.filterModules().push(statistics); + + options.filterModules().push(nodeDegreeFilter); + options.filterModules().push(datatypeFilter); + options.filterModules().push(objectPropertyFilter); + options.filterModules().push(subclassFilter); + options.filterModules().push(disjointFilter); + options.filterModules().push(setOperatorFilter); + options.filterModules().push(nodeScalingSwitch); + options.filterModules().push(compactNotationSwitch); + options.filterModules().push(colorExternalsSwitch); + + d3.select(window).on("resize", adjustSize); + + exportMenu.setup(); + gravityMenu.setup(); + filterMenu.setup(datatypeFilter, objectPropertyFilter, subclassFilter, disjointFilter, setOperatorFilter, nodeDegreeFilter); + modeMenu.setup(pickAndPin, nodeScalingSwitch, compactNotationSwitch, colorExternalsSwitch); + pauseMenu.setup(); + sidebar.setup(); + loadingModule.setup(); + leftSidebar.setup(); + editSidebar.setup(); + debugMenu.setup(); + var agentVersion = getInternetExplorerVersion(); + if ( agentVersion > 0 && agentVersion <= 11 ) { + console.log("Agent version " + agentVersion); + console.log("This agent is not supported"); + d3.select("#browserCheck").classed("hidden", false); + d3.select("#killWarning").classed("hidden", true); + d3.select("#optionsArea").classed("hidden", true); + d3.select("#logo").classed("hidden", true); + } else { + d3.select("#logo").classed("hidden", false); + if ( agentVersion === 12 ) { + // allow Mircosoft Edge Browser but with warning + d3.select("#browserCheck").classed("hidden", false); + d3.select("#killWarning").classed("hidden", false); + } else { + d3.select("#browserCheck").classed("hidden", true); + } + + resetMenu.setup([gravityMenu, filterMenu, modeMenu, focuser, selectionDetailDisplayer, pauseMenu]); + searchMenu.setup(); + navigationMenu.setup(); + zoomSlider.setup(); + + // give the options the pointer to the some menus for import and export + options.literalFilter(emptyLiteralFilter); + options.nodeDegreeFilter(nodeDegreeFilter); + options.loadingModule(loadingModule); + options.filterMenu(filterMenu); + options.modeMenu(modeMenu); + options.gravityMenu(gravityMenu); + options.pausedMenu(pauseMenu); + options.pickAndPinModule(pickAndPin); + options.resetMenu(resetMenu); + options.searchMenu(searchMenu); + options.ontologyMenu(ontologyMenu); + options.navigationMenu(navigationMenu); + options.sidebar(sidebar); + options.leftSidebar(leftSidebar); + options.editSidebar(editSidebar); + options.exportMenu(exportMenu); + options.graphObject(graph); + options.zoomSlider(zoomSlider); + options.warningModule(warningModule); + options.directInputModule(directInputMod); + options.datatypeFilter(datatypeFilter); + options.objectPropertyFilter(objectPropertyFilter); + options.subclassFilter(subclassFilter); + options.setOperatorFilter(setOperatorFilter); + options.disjointPropertyFilter(disjointFilter); + options.focuserModule(focuser); + options.colorExternalsModule(colorExternalsSwitch); + options.compactNotationModule(compactNotationSwitch); + + ontologyMenu.setup(loadOntologyFromText); + configMenu.setup(); + + leftSidebar.showSidebar(0); + leftSidebar.hideCollapseButton(true); + + + graph.start(); + + var modeOp = d3.select("#modeOfOperationString"); + modeOp.style("font-size", "0.6em"); + modeOp.style("font-style", "italic"); + + adjustSize(); + var defZoom; + var w = graph.options().width(); + var h = graph.options().height(); + defZoom = Math.min(w, h) / 1000; + + var hideDebugOptions = true; + if ( hideDebugOptions === false ) { + graph.setForceTickFunctionWithFPS(); + } + + graph.setDefaultZoom(defZoom); + d3.selectAll(".debugOption").classed("hidden", hideDebugOptions); + + // prevent backspace reloading event + var htmlBody = d3.select("body"); + d3.select(document).on("keydown", function ( e ){ + if ( d3.event.keyCode === 8 && d3.event.target === htmlBody.node() ) { + // we could add here an alert + d3.event.preventDefault(); + } + // using ctrl+Shift+d as debug option + if ( d3.event.ctrlKey && d3.event.shiftKey && d3.event.keyCode === 68 ) { + graph.options().executeHiddenDebugFeatuers(); + d3.event.preventDefault(); + } + }); + if ( d3.select("#maxLabelWidthSliderOption") ) { + var setValue = !graph.options().dynamicLabelWidth(); + d3.select("#maxLabelWidthSlider").node().disabled = setValue; + d3.select("#maxLabelWidthvalueLabel").classed("disabledLabelForSlider", setValue); + d3.select("#maxLabelWidthDescriptionLabel").classed("disabledLabelForSlider", setValue); + } + + d3.select("#blockGraphInteractions").style("position", "absolute") + .style("top", "0") + .style("background-color", "#bdbdbd") + .style("opacity", "0.5") + .style("pointer-events", "auto") + .style("width", graph.options().width() + "px") + .style("height", graph.options().height() + "px") + .on("click", function (){ + d3.event.preventDefault(); + d3.event.stopPropagation(); + }) + .on("dblclick", function (){ + d3.event.preventDefault(); + d3.event.stopPropagation(); + }); + + d3.select("#direct-text-input").on("click", function (){ + directInputMod.setDirectInputMode(); + }); + d3.select("#blockGraphInteractions").node().draggable = false; + options.prefixModule(webvowl.util.prefixTools(graph)); + adjustSize(); + sidebar.updateOntologyInformation(undefined, statistics); + loadingModule.parseUrlAndLoadOntology(); // loads automatically the ontology provided by the parameters + options.debugMenu(debugMenu); + debugMenu.updateSettings(); + + // connect the reloadCachedVersionButton + d3.select("#reloadSvgIcon").on("click", function (){ + if ( d3.select("#reloadSvgIcon").node().disabled === true ) { + graph.options().ontologyMenu().clearCachedVersion(); + return; + } + d3.select("#reloadCachedOntology").classed("hidden", true); + graph.options().ontologyMenu().reloadCachedOntology(); + + }); + // add the initialized objects + webvowl.opts = options; + webvowl.gr = graph; + + } + }; + + + function loadOntologyFromText( jsonText, filename, alternativeFilename ){ + d3.select("#reloadCachedOntology").classed("hidden", true); + pauseMenu.reset(); + graph.options().navigationMenu().hideAllMenus(); + + if ( (jsonText === undefined && filename === undefined) || (jsonText.length === 0) ) { + loadingModule.notValidJsonFile(); + return; + } + graph.editorMode(); // updates the checkbox + var data; + if ( jsonText ) { + // validate JSON FILE + var validJSON; + try { + data = JSON.parse(jsonText); + validJSON = true; + } catch ( e ) { + validJSON = false; + } + if ( validJSON === false ) { + // the server output is not a valid json file + loadingModule.notValidJsonFile(); + return; + } + + if ( !filename ) { + // First look if an ontology title exists, otherwise take the alternative filename + var ontologyNames = data.header ? data.header.title : undefined; + var ontologyName = languageTools.textInLanguage(ontologyNames); + + if ( ontologyName ) { + filename = ontologyName; + } else { + filename = alternativeFilename; + } + } + } + + + // check if we have graph data + var classCount = 0; + if ( data.class !== undefined ) { + classCount = data.class.length; + } + + var loadEmptyOntologyForEditing = false; + if ( location.hash.indexOf("#new_ontology") !== -1 ) { + loadEmptyOntologyForEditing = true; + newOntologyCounter++; + d3.select("#empty").node().href = "#opts=editorMode=true;#new_ontology" + newOntologyCounter; + } + if ( classCount === 0 && graph.editorMode() === false && loadEmptyOntologyForEditing === false ) { + // generate message for the user; + loadingModule.emptyGraphContentError(); + } else { + loadingModule.validJsonFile(); + ontologyMenu.setCachedOntology(filename, jsonText); + exportMenu.setJsonText(jsonText); + options.data(data); + graph.options().loadingModule().setPercentMode(); + if ( loadEmptyOntologyForEditing === true ) { + graph.editorMode(true); + + } + graph.load(); + sidebar.updateOntologyInformation(data, statistics); + exportMenu.setFilename(filename); + graph.updateZoomSliderValueFromOutside(); + adjustSize(); + + var flagOfCheckBox = d3.select("#editorModeModuleCheckbox").node().checked; + graph.editorMode(flagOfCheckBox);// update gui + + } + } + + function adjustSize(){ + var graphContainer = d3.select(GRAPH_SELECTOR), + svg = graphContainer.select("svg"), + height = window.innerHeight - 40, + width = window.innerWidth - (window.innerWidth * 0.22); + + if ( sidebar.getSidebarVisibility() === "0" ) { + height = window.innerHeight - 40; + width = window.innerWidth; + } + + directInputMod.updateLayout(); + d3.select("#blockGraphInteractions").style("width", window.innerWidth + "px"); + d3.select("#blockGraphInteractions").style("height", window.innerHeight + "px"); + + d3.select("#WarningErrorMessagesContainer").style("width", width + "px"); + d3.select("#WarningErrorMessagesContainer").style("height", height + "px"); + + d3.select("#WarningErrorMessages").style("max-height", (height - 12) + "px"); + + graphContainer.style("height", height + "px"); + svg.attr("width", width) + .attr("height", height); + + options.width(width) + .height(height); + + graph.updateStyle(); + + if ( isTouchDevice() === true ) { + if ( graph.isEditorMode() === true ) + d3.select("#modeOfOperationString").node().innerHTML = "touch able device detected"; + graph.setTouchDevice(true); + + } else { + if ( graph.isEditorMode() === true ) + d3.select("#modeOfOperationString").node().innerHTML = "point & click device detected"; + graph.setTouchDevice(false); + } + + d3.select("#loadingInfo-container").style("height", 0.5 * (height - 80) + "px"); + loadingModule.checkForScreenSize(); + + adjustSliderSize(); + // update also the padding options of loading and the logo positions; + var warningDiv = d3.select("#browserCheck"); + if ( warningDiv.classed("hidden") === false ) { + var offset = 10 + warningDiv.node().getBoundingClientRect().height; + d3.select("#logo").style("padding", offset + "px 10px"); + } else { + // remove the dynamic padding from the logo element; + d3.select("#logo").style("padding", "10px"); + } + + // scrollbar tests; + var element = d3.select("#menuElementContainer").node(); + var maxScrollLeft = element.scrollWidth - element.clientWidth; + var leftButton = d3.select("#scrollLeftButton"); + var rightButton = d3.select("#scrollRightButton"); + if ( maxScrollLeft > 0 ) { + // show both and then check how far is bar; + rightButton.classed("hidden", false); + leftButton.classed("hidden", false); + navigationMenu.updateScrollButtonVisibility(); + } else { + // hide both; + rightButton.classed("hidden", true); + leftButton.classed("hidden", true); + } + + // adjust height of the leftSidebar element; + editSidebar.updateElementWidth(); + + + var hs = d3.select("#drag_msg").node().getBoundingClientRect().height; + var ws = d3.select("#drag_msg").node().getBoundingClientRect().width; + d3.select("#drag_icon_group").attr("transform", "translate ( " + 0.25 * ws + " " + 0.25 * hs + ")"); + + } + + function adjustSliderSize(){ + // TODO: refactor and put this into the slider it self + var height = window.innerHeight - 40; + var fullHeight = height; + var zoomOutPos = height - 30; + var sliderHeight = 150; + + // assuming DOM elements are generated in the index.html + // todo: refactor for independent usage of graph and app + if ( fullHeight < 150 ) { + // hide the slider button; + d3.select("#zoomSliderParagraph").classed("hidden", true); + d3.select("#zoomOutButton").classed("hidden", true); + d3.select("#zoomInButton").classed("hidden", true); + d3.select("#centerGraphButton").classed("hidden", true); + return; + } + d3.select("#zoomSliderParagraph").classed("hidden", false); + d3.select("#zoomOutButton").classed("hidden", false); + d3.select("#zoomInButton").classed("hidden", false); + d3.select("#centerGraphButton").classed("hidden", false); + + var zoomInPos = zoomOutPos - 20; + var centerPos = zoomInPos - 20; + if ( fullHeight < 280 ) { + // hide the slider button; + d3.select("#zoomSliderParagraph").classed("hidden", true);//var sliderPos=zoomOutPos-sliderHeight; + d3.select("#zoomOutButton").style("top", zoomOutPos + "px"); + d3.select("#zoomInButton").style("top", zoomInPos + "px"); + d3.select("#centerGraphButton").style("top", centerPos + "px"); + return; + } + + var sliderPos = zoomOutPos - sliderHeight; + zoomInPos = sliderPos - 20; + centerPos = zoomInPos - 20; + d3.select("#zoomSliderParagraph").classed("hidden", false); + d3.select("#zoomOutButton").style("top", zoomOutPos + "px"); + d3.select("#zoomInButton").style("top", zoomInPos + "px"); + d3.select("#centerGraphButton").style("top", centerPos + "px"); + d3.select("#zoomSliderParagraph").style("top", sliderPos + "px"); + } + + function isTouchDevice(){ + try { + document.createEvent("TouchEvent"); + return true; + } catch ( e ) { + return false; + } + } + + + function getInternetExplorerVersion(){ + var ua, + re, + rv = -1; + + // check for edge + var isEdge = /(?:\b(MS)?IE\s+|\bTrident\/7\.0;.*\s+rv:|\bEdge\/)(\d+)/.test(navigator.userAgent); + if ( isEdge ) { + rv = parseInt("12"); + return rv; + } + + var isIE11 = /Trident.*rv[ :]*11\./.test(navigator.userAgent); + if ( isIE11 ) { + rv = parseInt("11"); + return rv; + } + if ( navigator.appName === "Microsoft Internet Explorer" ) { + ua = navigator.userAgent; + re = new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})"); + if ( re.exec(ua) !== null ) { + rv = parseFloat(RegExp.$1); + } + } else if ( navigator.appName === "Netscape" ) { + ua = navigator.userAgent; + re = new RegExp("Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})"); + if ( re.exec(ua) !== null ) { + rv = parseFloat(RegExp.$1); + } + } + return rv; + } + + return app; + } + ; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), + +/***/ 323: +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {/** + * Contains the logic for the export button. + * @returns {{}} + */ + module.exports = function ( graph ){ + + var exportMenu = {}, + exportSvgButton, + exportFilename, + exportJsonButton, + exportTurtleButton, + exportTexButton, + copyButton, + exportableJsonText; + + var exportTTLModule = __webpack_require__(324)(graph); + + + String.prototype.replaceAll = function ( search, replacement ){ + var target = this; + return target.split(search).join(replacement); + }; + + + /** + * Adds the export button to the website. + */ + exportMenu.setup = function (){ + exportSvgButton = d3.select("#exportSvg") + .on("click", exportSvg); + exportJsonButton = d3.select("#exportJson") + .on("click", exportJson); + + copyButton = d3.select("#copyBt") + .on("click", copyUrl); + + exportTexButton = d3.select("#exportTex") + .on("click", exportTex); + + exportTurtleButton = d3.select("#exportTurtle") + .on("click", exportTurtle); + + var menuEntry = d3.select("#m_export"); + menuEntry.on("mouseover", function (){ + var searchMenu = graph.options().searchMenu(); + searchMenu.hideSearchEntries(); + exportMenu.exportAsUrl(); + }); + }; + function exportTurtle(){ + var success = exportTTLModule.requestExport(); + var result = exportTTLModule.resultingTTL_Content(); + var ontoTitle = "NewOntology"; + console.log("Exporter was successful: " + success); + if ( success ) { + // console.log("The result is : " + result); + // var ontoTitle=graph.options().getGeneralMetaObjectProperty('title'); + // if (ontoTitle===undefined || ontoTitle.length===0) + // ontoTitle="NewOntology"; + // else{ + // // language object -.- + // ontoTitle.replace(" ","_") + // } + + // TODO: show TEXT in warning module? + + + // // write the data + var dataURI = "data:text/json;charset=utf-8," + encodeURIComponent(result); + + exportTurtleButton.attr("href", dataURI) + .attr("download", ontoTitle + ".ttl"); + + // okay restore old href? + // exportTurtleButton.attr("href", oldHref); + } else { + console.log("ShowWarning!"); + graph.options().warningModule().showExporterWarning(); + console.log("Stay on the page! " + window.location.href); + exportTurtleButton.attr("href", window.location.href); + d3.event.preventDefault(); // prevent the href to be called ( reloads the page otherwise ) + } + } + + exportMenu.setFilename = function ( filename ){ + exportFilename = filename || "export"; + }; + + exportMenu.setJsonText = function ( jsonText ){ + exportableJsonText = jsonText; + }; + + function copyUrl(){ + d3.select("#exportedUrl").node().focus(); + d3.select("#exportedUrl").node().select(); + document.execCommand("copy"); + graph.options().navigationMenu().hideAllMenus(); + d3.event.preventDefault(); // prevent the href to be called ( reloads the page otherwise ) + } + + function prepareOptionString( defOpts, currOpts ){ + var setOptions = 0; + var optsString = "opts="; + + for ( var name in defOpts ) { + // define key and value ; + if ( defOpts.hasOwnProperty(name) ) {// for travis warning + var def_value = defOpts[name]; + var cur_value = currOpts[name]; + if ( def_value !== cur_value ) { + optsString += name + "=" + cur_value + ";"; + setOptions++; + } + } + } + optsString += ""; + if ( setOptions === 0 ) { + return ""; + } + return optsString; + } + + exportMenu.exportAsUrl = function (){ + var currObj = {}; + currObj.sidebar = graph.options().sidebar().getSidebarVisibility(); + + // identify default value given by ontology; + var defOntValue = graph.options().filterMenu().getDefaultDegreeValue(); + var currentValue = graph.options().filterMenu().getDegreeSliderValue(); + if ( parseInt(defOntValue) === parseInt(currentValue) ) { + currObj.doc = -1; + } else { + currObj.doc = currentValue; + } + + currObj.cd = graph.options().classDistance(); + currObj.dd = graph.options().datatypeDistance(); + if ( graph.editorMode() === true ) { + currObj.editorMode = "true"; + } else { + currObj.editorMode = "false"; + } + currObj.filter_datatypes = String(graph.options().filterMenu().getCheckBoxValue("datatypeFilterCheckbox")); + currObj.filter_sco = String(graph.options().filterMenu().getCheckBoxValue("subclassFilterCheckbox")); + currObj.filter_disjoint = String(graph.options().filterMenu().getCheckBoxValue("disjointFilterCheckbox")); + currObj.filter_setOperator = String(graph.options().filterMenu().getCheckBoxValue("setoperatorFilterCheckbox")); + currObj.filter_objectProperties = String(graph.options().filterMenu().getCheckBoxValue("objectPropertyFilterCheckbox")); + currObj.mode_dynamic = String(graph.options().dynamicLabelWidth()); + currObj.mode_scaling = String(graph.options().modeMenu().getCheckBoxValue("nodescalingModuleCheckbox")); + currObj.mode_compact = String(graph.options().modeMenu().getCheckBoxValue("compactnotationModuleCheckbox")); + currObj.mode_colorExt = String(graph.options().modeMenu().getCheckBoxValue("colorexternalsModuleCheckbox")); + currObj.mode_multiColor = String(graph.options().modeMenu().colorModeState()); + currObj.mode_pnp = String(graph.options().modeMenu().getCheckBoxValue("pickandpinModuleCheckbox")); + currObj.debugFeatures = String(!graph.options().getHideDebugFeatures()); + currObj.rect = 0; + + var defObj = graph.options().initialConfig(); + var optsString = prepareOptionString(defObj, currObj); + var urlString = String(location); + var htmlElement; + // when everything is default then there is nothing to write + if ( optsString.length === 0 ) { + // building up parameter list; + + // remove the all options form location + var hashCode = location.hash; + urlString = urlString.split(hashCode)[0]; + + var lPos = hashCode.lastIndexOf("#"); + if ( lPos === -1 ) { + htmlElement = d3.select("#exportedUrl").node(); + htmlElement.value = String(location); + htmlElement.title = String(location); + return; // nothing to change in the location String + } + var newURL = hashCode.slice(lPos, hashCode.length); + htmlElement = d3.select("#exportedUrl").node(); + htmlElement.value = urlString + newURL; + htmlElement.title = urlString + newURL; + return; + } + + // generate the options string; + var numParameters = (urlString.match(/#/g) || []).length; + var newUrlString; + if ( numParameters === undefined || numParameters === 0 ) { + newUrlString = urlString + "#" + optsString; + } + if ( numParameters > 0 ) { + var tokens = urlString.split("#"); + var i; + if ( tokens[1].indexOf("opts=") >= 0 ) { + tokens[1] = optsString; + newUrlString = tokens[0]; + } else { + newUrlString = tokens[0] + "#"; + newUrlString += optsString; + } + // append parameters + for ( i = 1; i < tokens.length; i++ ) { + if ( tokens[i].length > 0 ) { + newUrlString += "#" + tokens[i]; + } + } + } + // building up parameter list; + htmlElement = d3.select("#exportedUrl").node(); + htmlElement.value = newUrlString; + htmlElement.title = newUrlString; + + }; + + function exportSvg(){ + graph.options().navigationMenu().hideAllMenus(); + // Get the d3js SVG element + var graphSvg = d3.select(graph.options().graphContainerSelector()).select("svg"), + graphSvgCode, + escapedGraphSvgCode, + dataURI; + + // inline the styles, so that the exported svg code contains the css rules + inlineVowlStyles(); + hideNonExportableElements(); + + graphSvgCode = graphSvg.attr("version", 1.1) + .attr("xmlns", "http://www.w3.org/2000/svg") + .node().parentNode.innerHTML; + + // Insert the reference to VOWL + graphSvgCode = "<!-- Created with WebVOWL (version " + webvowl.version + ")" + + ", http://vowl.visualdataweb.org -->\n" + graphSvgCode; + + escapedGraphSvgCode = escapeUnicodeCharacters(graphSvgCode); + //btoa(); Creates a base-64 encoded ASCII string from a "string" of binary data. + dataURI = "data:image/svg+xml;base64," + btoa(escapedGraphSvgCode); + + + exportSvgButton.attr("href", dataURI) + .attr("download", exportFilename + ".svg"); + + // remove graphic styles for interaction to go back to normal + removeVowlInlineStyles(); + showNonExportableElements(); + graph.lazyRefresh(); + } + + function escapeUnicodeCharacters( text ){ + var textSnippets = [], + i, textLength = text.length, + character, + charCode; + + for ( i = 0; i < textLength; i++ ) { + character = text.charAt(i); + charCode = character.charCodeAt(0); + + if ( charCode < 128 ) { + textSnippets.push(character); + } else { + textSnippets.push("&#" + charCode + ";"); + } + } + + return textSnippets.join(""); + } + + function inlineVowlStyles(){ + setStyleSensitively(".text", [{ name: "font-family", value: "Helvetica, Arial, sans-serif" }, { + name: "font-size", + value: "12px" + }]); + setStyleSensitively(".subtext", [{ name: "font-size", value: "9px" }]); + setStyleSensitively(".text.instance-count", [{ name: "fill", value: "#666" }]); + setStyleSensitively(".external + text .instance-count", [{ name: "fill", value: "#aaa" }]); + setStyleSensitively(".cardinality", [{ name: "font-size", value: "10px" }]); + setStyleSensitively(".text, .embedded", [{ name: "pointer-events", value: "none" }]); + setStyleSensitively(".class, .object, .disjoint, .objectproperty, .disjointwith, .equivalentproperty, .transitiveproperty, .functionalproperty, .inversefunctionalproperty, .symmetricproperty, .allvaluesfromproperty, .somevaluesfromproperty", [{ + name: "fill", + value: "#acf" + }]); + setStyleSensitively(".label .datatype, .datatypeproperty", [{ name: "fill", value: "#9c6" }]); + setStyleSensitively(".rdf, .rdfproperty", [{ name: "fill", value: "#c9c" }]); + setStyleSensitively(".literal, .node .datatype", [{ name: "fill", value: "#fc3" }]); + setStyleSensitively(".deprecated, .deprecatedproperty", [{ name: "fill", value: "#ccc" }]); + setStyleSensitively(".external, .externalproperty", [{ name: "fill", value: "#36c" }]); + setStyleSensitively("path, .nofill", [{ name: "fill", value: "none" }]); + setStyleSensitively("marker path", [{ name: "fill", value: "#000" }]); + setStyleSensitively(".class, path, line, .fineline", [{ name: "stroke", value: "#000" }]); + setStyleSensitively(".white, .subclass, .subclassproperty, .external + text", [{ name: "fill", value: "#fff" }]); + setStyleSensitively(".class.hovered, .property.hovered, .cardinality.hovered, .cardinality.focused, circle.pin, .filled.hovered, .filled.focused", [{ + name: "fill", + value: "#f00" + }, { name: "cursor", value: "pointer" }]); + setStyleSensitively(".focused, path.hovered", [{ name: "stroke", value: "#f00" }]); + setStyleSensitively(".indirect-highlighting, .feature:hover", [{ name: "fill", value: "#f90" }]); + setStyleSensitively(".values-from", [{ name: "stroke", value: "#69c" }]); + setStyleSensitively(".symbol, .values-from.filled", [{ name: "fill", value: "#69c" }]); + setStyleSensitively(".class, path, line", [{ name: "stroke-width", value: "2" }]); + setStyleSensitively(".fineline", [{ name: "stroke-width", value: "1" }]); + setStyleSensitively(".dashed, .anonymous", [{ name: "stroke-dasharray", value: "8" }]); + setStyleSensitively(".dotted", [{ name: "stroke-dasharray", value: "3" }]); + setStyleSensitively("rect.focused, circle.focused", [{ name: "stroke-width", value: "4px" }]); + setStyleSensitively(".nostroke", [{ name: "stroke", value: "none" }]); + setStyleSensitively("marker path", [{ name: "stroke-dasharray", value: "100" }]); + } + + function setStyleSensitively( selector, styles ){ + var elements = d3.selectAll(selector); + if ( elements.empty() ) { + return; + } + + styles.forEach(function ( style ){ + elements.each(function (){ + var element = d3.select(this); + if ( !shouldntChangeInlineCss(element, style.name) ) { + element.style(style.name, style.value); + } + }); + }); + } + + function shouldntChangeInlineCss( element, style ){ + return style === "fill" && hasBackgroundColorSet(element); + } + + function hasBackgroundColorSet( element ){ + var data = element.datum(); + if ( data === undefined ) { + return false; + } + return data.backgroundColor && !!data.backgroundColor(); + } + + /** + * For example the pin of the pick&pin module should be invisible in the exported graphic. + */ + function hideNonExportableElements(){ + d3.selectAll(".hidden-in-export").style("display", "none"); + } + + function removeVowlInlineStyles(){ + d3.selectAll(".text, .subtext, .text.instance-count, .external + text .instance-count, .cardinality, .text, .embedded, .class, .object, .disjoint, .objectproperty, .disjointwith, .equivalentproperty, .transitiveproperty, .functionalproperty, .inversefunctionalproperty, .symmetricproperty, .allvaluesfromproperty, .somevaluesfromproperty, .label .datatype, .datatypeproperty, .rdf, .rdfproperty, .literal, .node .datatype, .deprecated, .deprecatedproperty, .external, .externalproperty, path, .nofill, .symbol, .values-from.filled, marker path, .class, path, line, .fineline, .white, .subclass, .subclassproperty, .external + text, .class.hovered, .property.hovered, .cardinality.hovered, .cardinality.focused, circle.pin, .filled.hovered, .filled.focused, .focused, path.hovered, .indirect-highlighting, .feature:hover, .values-from, .class, path, line, .fineline, .dashed, .anonymous, .dotted, rect.focused, circle.focused, .nostroke, marker path") + .each(function (){ + var element = d3.select(this); + + var inlineStyles = element.node().style; + for ( var styleName in inlineStyles ) { + if ( inlineStyles.hasOwnProperty(styleName) ) { + if ( shouldntChangeInlineCss(element, styleName) ) { + continue; + } + element.style(styleName, null); + } + } + + if ( element.datum && element.datum() !== undefined && element.datum().type ) { + if ( element.datum().type() === "rdfs:subClassOf" ) { + element.style("fill", null); + } + } + }); + + // repair svg icons in the menu; + var scrollContainer = d3.select("#menuElementContainer").node(); + var controlElements = scrollContainer.children; + var numEntries = controlElements.length; + + for ( var i = 0; i < numEntries; i++ ) { + var currentMenu = controlElements[i].id; + d3.select("#" + currentMenu).select("path").style("stroke-width", "0"); + d3.select("#" + currentMenu).select("path").style("fill", "#fff"); + } + + d3.select("#magnifyingGlass").style("stroke-width", "0"); + d3.select("#magnifyingGlass").style("fill", "#666"); + + } + + function showNonExportableElements(){ + d3.selectAll(".hidden-in-export").style("display", null); + } + + exportMenu.createJSON_exportObject = function (){ + var i, j, k; // an index variable for the for-loops + + /** get data for exporter **/ + if (!graph.options().data()) {return {};} // return an empty json object + // extract onotology information; + var unfilteredData = graph.getUnfilteredData(); + var ontologyComment = graph.options().data()._comment; + var metaObj = graph.options().getGeneralMetaObject(); + var header = graph.options().data().header; + + if ( metaObj.iri && metaObj.iri !== header.iri ) { + header.iri = metaObj.iri; + } + if ( metaObj.title && metaObj.title !== header.title ) { + header.title = metaObj.title; + } + if ( metaObj.version && metaObj.version !== header.version ) { + header.version = metaObj.version; + } + if ( metaObj.author && metaObj.author !== header.author ) { + header.author = metaObj.author; + } + if ( metaObj.description && metaObj.description !== header.description ) { + header.description = metaObj.description; + } + + + var exportText = {}; + exportText._comment = ontologyComment; + exportText.header = header; + exportText.namespace = graph.options().data().namespace; + if ( exportText.namespace === undefined ) { + exportText.namespace = []; // just an empty namespace array + } + // we do have now the unfiltered data which needs to be transfered to class/classAttribute and property/propertyAttribute + + + // var classAttributeString='classAttribute:[ \n'; + var nodes = unfilteredData.nodes; + var nLen = nodes.length; // hope for compiler unroll + var classObjects = []; + var classAttributeObjects = []; + for ( i = 0; i < nLen; i++ ) { + var classObj = {}; + var classAttr = {}; + classObj.id = nodes[i].id(); + classObj.type = nodes[i].type(); + classObjects.push(classObj); + + // define the attributes object + classAttr.id = nodes[i].id(); + classAttr.iri = nodes[i].iri(); + classAttr.baseIri = nodes[i].baseIri(); + classAttr.label = nodes[i].label(); + + if ( nodes[i].attributes().length > 0 ) { + classAttr.attributes = nodes[i].attributes(); + } + if ( nodes[i].comment() ) { + classAttr.comment = nodes[i].comment(); + } + if ( nodes[i].annotations() ) { + classAttr.annotations = nodes[i].annotations(); + } + if ( nodes[i].description() ) { + classAttr.description = nodes[i].description(); + } + + + if ( nodes[i].individuals().length > 0 ) { + var classIndividualElements = []; + var nIndividuals = nodes[i].individuals(); + for ( j = 0; j < nIndividuals.length; j++ ) { + var indObj = {}; + indObj.iri = nIndividuals[j].iri(); + indObj.baseIri = nIndividuals[j].baseIri(); + indObj.labels = nIndividuals[j].label(); + if ( nIndividuals[j].annotations() ) { + indObj.annotations = nIndividuals[j].annotations(); + } + if ( nIndividuals[j].description() ) { + indObj.description = nIndividuals[j].description(); + } + if ( nIndividuals[j].comment() ) { + indObj.comment = nIndividuals[j].comment(); + } + classIndividualElements.push(indObj); + } + classAttr.individuals = classIndividualElements; + } + + var equalsForAttributes = undefined; + if ( nodes[i].equivalents().length > 0 ) { + equalsForAttributes = []; + var equals = nodes[i].equivalents(); + for ( j = 0; j < equals.length; j++ ) { + var eqObj = {}; + var eqAttr = {}; + eqObj.id = equals[j].id(); + equalsForAttributes.push(equals[j].id()); + eqObj.type = equals[j].type(); + classObjects.push(eqObj); + + eqAttr.id = equals[j].id(); + eqAttr.iri = equals[j].iri(); + eqAttr.baseIri = equals[j].baseIri(); + eqAttr.label = equals[j].label(); + + if ( equals[j].attributes().length > 0 ) { + eqAttr.attributes = equals[j].attributes(); + } + if ( equals[j].comment() ) { + eqAttr.comment = equals[j].comment(); + } + if ( equals[j].individuals().length > 0 ) { + eqAttr.individuals = equals[j].individuals(); + } + if ( equals[j].annotations() ) { + eqAttr.annotations = equals[j].annotations(); + } + if ( equals[j].description() ) { + eqAttr.description = equals[j].description(); + } + + if ( equals[j].individuals().length > 0 ) { + var e_classIndividualElements = []; + var e_nIndividuals = equals[i].individuals(); + for ( k = 0; k < e_nIndividuals.length; k++ ) { + var e_indObj = {}; + e_indObj.iri = e_nIndividuals[k].iri(); + e_indObj.baseIri = e_nIndividuals[k].baseIri(); + e_indObj.labels = e_nIndividuals[k].label(); + + if ( e_nIndividuals[k].annotations() ) { + e_indObj.annotations = e_nIndividuals[k].annotations(); + } + if ( e_nIndividuals[k].description() ) { + e_indObj.description = e_nIndividuals[k].description(); + } + if ( e_nIndividuals[k].comment() ) { + e_indObj.comment = e_nIndividuals[k].comment(); + } + e_classIndividualElements.push(e_indObj); + } + eqAttr.individuals = e_classIndividualElements; + } + + classAttributeObjects.push(eqAttr); + } + } + if ( equalsForAttributes && equalsForAttributes.length > 0 ) { + classAttr.equivalent = equalsForAttributes; + } + + // classAttr.subClasses=nodes[i].subClasses(); // not needed + // classAttr.instances=nodes[i].instances(); + + // + // .complement(element.complement) + // .disjointUnion(element.disjointUnion) + // .description(element.description) + // .equivalents(element.equivalent) + // .intersection(element.intersection) + // .type(element.type) Ignore, because we predefined it + // .union(element.union) + classAttributeObjects.push(classAttr); + } + + /** -- properties -- **/ + var properties = unfilteredData.properties; + var pLen = properties.length; // hope for compiler unroll + var propertyObjects = []; + var propertyAttributeObjects = []; + + for ( i = 0; i < pLen; i++ ) { + var pObj = {}; + var pAttr = {}; + pObj.id = properties[i].id(); + pObj.type = properties[i].type(); + propertyObjects.push(pObj); + + // // define the attributes object + pAttr.id = properties[i].id(); + pAttr.iri = properties[i].iri(); + pAttr.baseIri = properties[i].baseIri(); + pAttr.label = properties[i].label(); + + if ( properties[i].attributes().length > 0 ) { + pAttr.attributes = properties[i].attributes(); + } + if ( properties[i].comment() ) { + pAttr.comment = properties[i].comment(); + } + + if ( properties[i].annotations() ) { + pAttr.annotations = properties[i].annotations(); + } + if ( properties[i].maxCardinality() ) { + pAttr.maxCardinality = properties[i].maxCardinality(); + } + if ( properties[i].minCardinality() ) { + pAttr.minCardinality = properties[i].minCardinality(); + } + if ( properties[i].cardinality() ) { + pAttr.cardinality = properties[i].cardinality(); + } + if ( properties[i].description() ) { + pAttr.description = properties[i].description(); + } + + pAttr.domain = properties[i].domain().id(); + pAttr.range = properties[i].range().id(); + // sub properties; + if ( properties[i].subproperties() ) { + var subProps = properties[i].subproperties(); + var subPropsIdArray = []; + for ( j = 0; j < subProps.length; j++ ) { + if ( subProps[j].id ) + subPropsIdArray.push(subProps[j].id()); + } + pAttr.subproperty = subPropsIdArray; + } + + // super properties + if ( properties[i].superproperties() ) { + var superProps = properties[i].superproperties(); + var superPropsIdArray = []; + for ( j = 0; j < superProps.length; j++ ) { + if ( superProps[j].id ) + superPropsIdArray.push(superProps[j].id()); + } + pAttr.superproperty = superPropsIdArray; + } + + // check for inverse element + if ( properties[i].inverse() ) { + if ( properties[i].inverse().id ) + pAttr.inverse = properties[i].inverse().id(); + } + propertyAttributeObjects.push(pAttr); + } + + exportText.class = classObjects; + exportText.classAttribute = classAttributeObjects; + exportText.property = propertyObjects; + exportText.propertyAttribute = propertyAttributeObjects; + + + var nodeElements = graph.graphNodeElements(); // get visible nodes + var propElements = graph.graphLabelElements(); // get visible labels + // var jsonObj = JSON.parse(exportableJsonText); // reparse the original input json + + /** modify comment **/ + var comment = exportText._comment; + var additionalString = " [Additional Information added by WebVOWL Exporter Version: " + "1.1.7" + "]"; + // adding new string to comment only if it does not exist + if ( comment.indexOf(additionalString) === -1 ) { + exportText._comment = comment + " [Additional Information added by WebVOWL Exporter Version: " + "1.1.7" + "]"; + } + + var classAttribute = exportText.classAttribute; + var propAttribute = exportText.propertyAttribute; + /** remove previously stored variables **/ + for ( i = 0; i < classAttribute.length; i++ ) { + var classObj_del = classAttribute[i]; + delete classObj_del.pos; + delete classObj_del.pinned; + } + var propertyObj; + for ( i = 0; i < propAttribute.length; i++ ) { + propertyObj = propAttribute[i]; + delete propertyObj.pos; + delete propertyObj.pinned; + } + /** add new variables to jsonObj **/ + // class attribute variables + nodeElements.each(function ( node ){ + var nodeId = node.id(); + for ( i = 0; i < classAttribute.length; i++ ) { + var classObj = classAttribute[i]; + if ( classObj.id === nodeId ) { + // store relative positions + classObj.pos = [parseFloat(node.x.toFixed(2)), parseFloat(node.y.toFixed(2))]; + if ( node.pinned() ) + classObj.pinned = true; + break; + } + } + }); + // property attribute variables + for ( j = 0; j < propElements.length; j++ ) { + var correspondingProp = propElements[j].property(); + for ( i = 0; i < propAttribute.length; i++ ) { + propertyObj = propAttribute[i]; + if ( propertyObj.id === correspondingProp.id() ) { + propertyObj.pos = [parseFloat(propElements[j].x.toFixed(2)), parseFloat(propElements[j].y.toFixed(2))]; + if ( propElements[j].pinned() ) + propertyObj.pinned = true; + break; + } + } + } + /** create the variable for settings and set their values **/ + exportText.settings = {}; + + // Global Settings + var zoom = graph.scaleFactor(); + var paused = graph.paused(); + var translation = [parseFloat(graph.translation()[0].toFixed(2)), parseFloat(graph.translation()[1].toFixed(2))]; + exportText.settings.global = {}; + exportText.settings.global.zoom = zoom.toFixed(2); + exportText.settings.global.translation = translation; + exportText.settings.global.paused = paused; + + // shared variable declaration + var cb_text; + var isEnabled; + var cb_obj; + + // Gravity Settings + var classDistance = graph.options().classDistance(); + var datatypeDistance = graph.options().datatypeDistance(); + exportText.settings.gravity = {}; + exportText.settings.gravity.classDistance = classDistance; + exportText.settings.gravity.datatypeDistance = datatypeDistance; + + // Filter Settings + var fMenu = graph.options().filterMenu(); + var fContainer = fMenu.getCheckBoxContainer(); + var cbCont = []; + for ( i = 0; i < fContainer.length; i++ ) { + cb_text = fContainer[i].checkbox.attr("id"); + isEnabled = fContainer[i].checkbox.property("checked"); + cb_obj = {}; + cb_obj.id = cb_text; + cb_obj.checked = isEnabled; + cbCont.push(cb_obj); + } + var degreeSliderVal = fMenu.getDegreeSliderValue(); + exportText.settings.filter = {}; + exportText.settings.filter.checkBox = cbCont; + exportText.settings.filter.degreeSliderValue = degreeSliderVal; + + // Modes Settings + var mMenu = graph.options().modeMenu(); + var mContainer = mMenu.getCheckBoxContainer(); + var cb_modes = []; + for ( i = 0; i < mContainer.length; i++ ) { + cb_text = mContainer[i].attr("id"); + isEnabled = mContainer[i].property("checked"); + cb_obj = {}; + cb_obj.id = cb_text; + cb_obj.checked = isEnabled; + cb_modes.push(cb_obj); + } + var colorSwitchState = mMenu.colorModeState(); + exportText.settings.modes = {}; + exportText.settings.modes.checkBox = cb_modes; + exportText.settings.modes.colorSwitchState = colorSwitchState; + + var exportObj = {}; + // todo: [ ] find better way for ordering the objects + // hack for ordering of objects, so settings is after metrics + exportObj._comment = exportText._comment; + exportObj.header = exportText.header; + exportObj.namespace = exportText.namespace; + exportObj.metrics = exportText.metrics; + exportObj.settings = exportText.settings; + exportObj.class = exportText.class; + exportObj.classAttribute = exportText.classAttribute; + exportObj.property = exportText.property; + exportObj.propertyAttribute = exportText.propertyAttribute; + + return exportObj; + }; + + function exportJson(){ + graph.options().navigationMenu().hideAllMenus(); + /** check if there is data **/ + if ( !exportableJsonText ) { + alert("No graph data available."); + // Stop the redirection to the path of the href attribute + d3.event.preventDefault(); + return; + } + + var exportObj = exportMenu.createJSON_exportObject(); + + // make a string again; + var exportText = JSON.stringify(exportObj, null, ' '); + // write the data + var dataURI = "data:text/json;charset=utf-8," + encodeURIComponent(exportText); + var jsonExportFileName = exportFilename; + + if ( !jsonExportFileName.endsWith(".json") ) + jsonExportFileName += ".json"; + exportJsonButton.attr("href", dataURI) + .attr("download", jsonExportFileName); + } + + var curveFunction = d3.svg.line() + .x(function ( d ){ + return d.x; + }) + .y(function ( d ){ + return d.y; + }) + .interpolate("cardinal"); + var loopFunction = d3.svg.line() + .x(function ( d ){ + return d.x; + }) + .y(function ( d ){ + return d.y; + }) + .interpolate("cardinal") + .tension(-1); + + function exportTex(){ + var zoom = graph.scaleFactor(); + var grTranslate = graph.translation(); + var bbox = graph.getBoundingBoxForTex(); + var comment = " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n"; + comment += " % Generated with the experimental alpha version of the TeX exporter of WebVOWL (version 1.1.3) %%% \n"; + comment += " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\n"; + comment += " % The content can be used as import in other TeX documents. \n"; + comment += " % Parent document has to use the following packages \n"; + comment += " % \\usepackage{tikz} \n"; + comment += " % \\usepackage{helvet} \n"; + comment += " % \\usetikzlibrary{decorations.markings,decorations.shapes,decorations,arrows,automata,backgrounds,petri,shapes.geometric} \n"; + comment += " % \\usepackage{xcolor} \n\n"; + comment += " %%%%%%%%%%%%%%% Example Parent Document %%%%%%%%%%%%%%%%%%%%%%%\n"; + comment += " %\\documentclass{article} \n"; + comment += " %\\usepackage{tikz} \n"; + comment += " %\\usepackage{helvet} \n"; + comment += " %\\usetikzlibrary{decorations.markings,decorations.shapes,decorations,arrows,automata,backgrounds,petri,shapes.geometric} \n"; + comment += " %\\usepackage{xcolor} \n\n"; + comment += " %\\begin{document} \n"; + comment += " %\\section{Example} \n"; + comment += " % This is an example. \n"; + comment += " % \\begin{figure} \n"; + comment += " % \\input{<THIS_FILE_NAME>} % << tex file name for the graph \n"; + comment += " % \\caption{A generated graph with TKIZ using alpha version of the TeX exporter of WebVOWL (version 1.1.3) } \n"; + comment += " % \\end{figure} \n"; + comment += " %\\end{document} \n"; + comment += " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\n"; + + + var texString = comment + "\\definecolor{imageBGCOLOR}{HTML}{FFFFFF} \n" + + "\\definecolor{owlClassColor}{HTML}{AACCFF}\n" + + "\\definecolor{owlObjectPropertyColor}{HTML}{AACCFF}\n" + + "\\definecolor{owlExternalClassColor}{HTML}{AACCFF}\n" + + "\\definecolor{owlDatatypePropertyColor}{HTML}{99CC66}\n" + + "\\definecolor{owlDatatypeColor}{HTML}{FFCC33}\n" + + "\\definecolor{owlThingColor}{HTML}{FFFFFF}\n" + + "\\definecolor{valuesFrom}{HTML}{6699CC}\n" + + "\\definecolor{rdfPropertyColor}{HTML}{CC99CC}\n" + + "\\definecolor{unionColor}{HTML}{6699cc}\n" + + "\\begin{center} \n" + + "\\resizebox{\\linewidth}{!}{\n" + + + "\\begin{tikzpicture}[framed]\n" + + "\\clip (" + bbox[0] + "pt , " + bbox[1] + "pt ) rectangle (" + bbox[2] + "pt , " + bbox[3] + "pt);\n" + + "\\tikzstyle{dashed}=[dash pattern=on 4pt off 4pt] \n" + + "\\tikzstyle{dotted}=[dash pattern=on 2pt off 2pt] \n" + + "\\fontfamily{sans-serif}{\\fontsize{12}{12}\\selectfont}\n \n"; + + + texString += "\\tikzset{triangleBlack/.style = {fill=black, draw=black, line width=1pt,scale=0.7,regular polygon, regular polygon sides=3} }\n"; + texString += "\\tikzset{triangleWhite/.style = {fill=white, draw=black, line width=1pt,scale=0.7,regular polygon, regular polygon sides=3} }\n"; + texString += "\\tikzset{triangleBlue/.style = {fill=valuesFrom, draw=valuesFrom, line width=1pt,scale=0.7,regular polygon, regular polygon sides=3} }\n"; + + texString += "\\tikzset{Diamond/.style = {fill=white, draw=black, line width=2pt,scale=1.2,regular polygon, regular polygon sides=4} }\n"; + + + texString += "\\tikzset{Literal/.style={rectangle,align=center,\n" + + "font={\\fontsize{12pt}{12}\\selectfont \\sffamily },\n" + + "black, draw=black, dashed, line width=1pt, fill=owlDatatypeColor, minimum width=80pt,\n" + + "minimum height = 20pt}}\n\n"; + + texString += "\\tikzset{Datatype/.style={rectangle,align=center,\n" + + "font={\\fontsize{12pt}{12}\\selectfont \\sffamily },\n" + + "black, draw=black, line width=1pt, fill=owlDatatypeColor, minimum width=80pt,\n" + + "minimum height = 20pt}}\n\n"; + + + texString += "\\tikzset{owlClass/.style={circle, inner sep=0mm,align=center, \n" + + "font={\\fontsize{12pt}{12}\\selectfont \\sffamily },\n" + + "black, draw=black, line width=1pt, fill=owlClassColor, minimum size=101pt}}\n\n"; + + texString += "\\tikzset{anonymousClass/.style={circle, inner sep=0mm,align=center, \n" + + "font={\\fontsize{12pt}{12}\\selectfont \\sffamily },\n" + + "black, dashed, draw=black, line width=1pt, fill=owlClassColor, minimum size=101pt}}\n\n"; + + + texString += "\\tikzset{owlThing/.style={circle, inner sep=0mm,align=center,\n" + + "font={\\fontsize{12pt}{12}\\selectfont \\sffamily },\n" + + "black, dashed, draw=black, line width=1pt, fill=owlThingColor, minimum size=62pt}}\n\n"; + + + texString += "\\tikzset{owlObjectProperty/.style={rectangle,align=center,\n" + + "inner sep=0mm,\n" + + "font={\\fontsize{12pt}{12}\\selectfont \\sffamily },\n" + + "fill=owlObjectPropertyColor, minimum width=80pt,\n" + + "minimum height = 25pt}}\n\n"; + + texString += "\\tikzset{rdfProperty/.style={rectangle,align=center,\n" + + "inner sep=0mm,\n" + + "font={\\fontsize{12pt}{12}\\selectfont \\sffamily },\n" + + "fill=rdfPropertyColor, minimum width=80pt,\n" + + "minimum height = 25pt}}\n\n"; + + + texString += "\\tikzset{owlDatatypeProperty/.style={rectangle,align=center,\n" + + "fill=owlDatatypePropertyColor, minimum width=80pt,\n" + + "inner sep=0mm,\n" + + "font={\\fontsize{12pt}{12}\\selectfont \\sffamily },\n" + + "minimum height = 25pt}}\n\n"; + + texString += "\\tikzset{rdfsSubClassOf/.style={rectangle,align=center,\n" + + "font={\\fontsize{12pt}{12}\\selectfont \\sffamily },\n" + + "inner sep=0mm,\n" + + "fill=imageBGCOLOR, minimum width=80pt,\n" + + "minimum height = 25pt}}\n\n"; + + texString += "\\tikzset{unionOf/.style={circle, inner sep=0mm,align=center,\n" + + "font={\\fontsize{12pt}{12}\\selectfont \\sffamily },\n" + + "black, draw=black, line width=1pt, fill=unionColor, minimum size=25pt}}\n\n"; + + texString += "\\tikzset{disjointWith/.style={circle, inner sep=0mm,align=center,\n" + + "font={\\fontsize{12pt}{12}\\selectfont \\sffamily },\n" + + "black, draw=black, line width=1pt, fill=unionColor, minimum size=20pt}}\n\n"; + + + texString += "\\tikzset{owlEquivalentClass/.style={circle,align=center,\n" + + "font={\\fontsize{12pt}{12}\\selectfont \\sffamily },\n" + + "inner sep=0mm,\n" + + "black, solid, draw=black, line width=3pt, fill=owlExternalClassColor, minimum size=101pt,\n" + + "postaction = {draw,line width=1pt, white}}}\n\n"; + + // draw a bounding box; + + // get bbox coordinates; + + + graph.options().navigationMenu().hideAllMenus(); + /** check if there is data **/ + if ( !exportableJsonText ) { + alert("No graph data available."); + // Stop the redirection to the path of the href attribute + d3.event.preventDefault(); + return; + } + + var i = 0, identifier; + + /** get data for exporter **/ + var nodeElements = graph.graphNodeElements(); // get visible nodes + var propElements = graph.graphLabelElements(); // get visible labels + var links = graph.graphLinkElements(); + + // export only nodes; + // draw Links; + for ( i = 0; i < links.length; i++ ) { + var link = links[i]; + // console.log("\n****************\nInverstigating Link for property "+link.property().labelForCurrentLanguage()); + + var prop = link.property(); + var dx, dy, px, py, rx, ry; + var colorStr = "black"; + var linkDomainIntersection; + var linkRangeIntersection; + var center; + var linkStyle = ""; + var isLoop = ""; + var curvePoint; + var pathStart; + var pathEnd; + var controlPoints; + var len; + var ahAngle; + var pathLen; + var markerOffset = 7; + + var arrowType = "triangleBlack"; + var linkWidth = ",line width=2pt"; + if ( prop.linkType ) { + if ( prop.linkType() === "dotted" ) { + //stroke-dasharray: 3; + linkStyle = ", dotted "; + arrowType = "triangleWhite"; + } + if ( prop.linkType() === "dashed" ) { + //stroke-dasharray: 3; + linkStyle = ", dashed "; + } + + if ( prop.linkType() === "values-from" ) { + colorStr = "valuesFrom"; + } + + } + + var startX, startY, endX, endY, normX, normY, lg; + + if ( link.layers().length === 1 && !link.loops() ) { + + linkDomainIntersection = graph.math().calculateIntersection(link.range(), link.domain(), 1); + linkRangeIntersection = graph.math().calculateIntersection(link.domain(), link.range(), 1); + center = graph.math().calculateCenter(linkDomainIntersection, linkRangeIntersection); + dx = linkDomainIntersection.x; + dy = -linkDomainIntersection.y; + px = center.x; + py = -center.y; + rx = linkRangeIntersection.x; + ry = -linkRangeIntersection.y; + + + pathStart = linkDomainIntersection; + curvePoint = center; + pathEnd = linkRangeIntersection; + + var nx = rx - px; + var ny = ry - py; + + // normalize ; + len = Math.sqrt(nx * nx + ny * ny); + + nx = nx / len; + ny = ny / len; + + ahAngle = Math.atan2(ny, nx) * (180 / Math.PI); + normX = nx; + normY = ny; + } + else { + if ( link.isLoop() ) { + isLoop = ", tension=3"; + controlPoints = graph.math().calculateLoopPoints(link); + pathStart = controlPoints[0]; + curvePoint = controlPoints[1]; + pathEnd = controlPoints[2]; + } else { + curvePoint = link.label(); + pathStart = graph.math().calculateIntersection(curvePoint, link.domain(), 1); + pathEnd = graph.math().calculateIntersection(curvePoint, link.range(), 1); + } + dx = pathStart.x; + dy = -pathStart.y; + px = curvePoint.x; + py = -curvePoint.y; + rx = pathEnd.x; + ry = -pathEnd.y; + } + + texString += "\\draw [" + colorStr + linkStyle + linkWidth + isLoop + "] plot [smooth] coordinates {(" + + dx + "pt, " + dy + "pt) (" + px + "pt, " + py + "pt) (" + rx + "pt, " + ry + "pt)};\n"; + + + if ( link.property().markerElement() === undefined ) continue; + + // add arrow head; + + + if ( link.property().type() === "owl:someValuesFrom" || link.property().type() === "owl:allValuesFrom" ) { + arrowType = "triangleBlue"; + } + + lg = link.pathObj(); + pathLen = Math.floor(lg.node().getTotalLength()); + var p1 = lg.node().getPointAtLength(pathLen - 4); + var p2 = lg.node().getPointAtLength(pathLen); + var markerCenter = lg.node().getPointAtLength(pathLen - 6); + + if ( link.property().type() === "setOperatorProperty" ) { + p1 = lg.node().getPointAtLength(4); + p2 = lg.node().getPointAtLength(0); + markerCenter = lg.node().getPointAtLength(8); + arrowType = "Diamond"; + } + + startX = p1.x; + startY = p1.y; + endX = p2.x; + endY = p2.y; + normX = endX - startX; + normY = endY - startY; + len = Math.sqrt(normX * normX + normY * normY); + normX = normX / len; + normY = normY / len; + + ahAngle = -1.0 * Math.atan2(normY, normX) * (180 / Math.PI); + ahAngle -= 90; + if ( link.property().type() === "setOperatorProperty" ) { + ahAngle -= 45; + } + // console.log(link.property().labelForCurrentLanguage()+ ": "+normX+ " "+normY +" "+ahAngle); + rx = markerCenter.x; + ry = markerCenter.y; + if ( link.layers().length === 1 && !link.loops() ) { + // markerOffset=-1*m + ry = -1 * ry; + texString += "\\node[" + arrowType + ", rotate=" + ahAngle + "] at (" + rx + "pt, " + ry + "pt) (single_marker" + i + ") {};\n "; + } else { + ry = -1 * ry; + texString += "\\node[" + arrowType + ", rotate=" + ahAngle + "] at (" + rx + "pt, " + ry + "pt) (marker" + i + ") {};\n "; + } + + // if (link.isLoop()){ + // rotAngle=-10+angle * (180 / Math.PI); + // } + + // add cardinality; + var cardinalityText = link.property().generateCardinalityText(); + if ( cardinalityText && cardinalityText.length > 0 ) { + var cardinalityCenter = lg.node().getPointAtLength(pathLen - 18); + var cx = cardinalityCenter.x - (10 * normY); + var cy = cardinalityCenter.y + (10 * normX); // using orthonormal y Coordinate + cy *= -1.0; + var textColor = "black"; + if ( cardinalityText.indexOf("A") > -1 ) { + cardinalityText = "$\\forall$"; + } + if ( cardinalityText.indexOf("E") > -1 ) { + cardinalityText = "$\\exists$"; + } + + + texString += "\\node[font={\\fontsize{12pt}{12}\\selectfont \\sffamily },text=" + textColor + "] at (" + cx + "pt, " + cy + "pt) (cardinalityText" + i + ") {" + cardinalityText + "};\n "; + } + + + if ( link.property().inverse() ) { + lg = link.pathObj(); + pathLen = Math.floor(lg.node().getTotalLength()); + var p1_inv = lg.node().getPointAtLength(4); + var p2_inv = lg.node().getPointAtLength(0); + var markerCenter_inv = lg.node().getPointAtLength(6); + startX = p1_inv.x; + startY = p1_inv.y; + endX = p2_inv.x; + endY = p2_inv.y; + normX = endX - startX; + normY = endY - startY; + len = Math.sqrt(normX * normX + normY * normY); + normX = normX / len; + normY = normY / len; + + ahAngle = -1.0 * Math.atan2(normY, normX) * (180 / Math.PI); + ahAngle -= 90; + // console.log("INV>>\n "+link.property().inverse().labelForCurrentLanguage()+ ": "+normX+ " "+normY +" "+ahAngle); + rx = markerCenter_inv.x; + ry = markerCenter_inv.y; + if ( link.layers().length === 1 && !link.loops() ) { + // markerOffset=-1*m + ry = -1 * ry; + texString += "\\node[" + arrowType + ", rotate=" + ahAngle + "] at (" + rx + "pt, " + ry + "pt) (INV_single_marker" + i + ") {};\n "; + } else { + ry = -1 * ry; + texString += "\\node[" + arrowType + ", rotate=" + ahAngle + "] at (" + rx + "pt, " + ry + "pt) (INV_marker" + i + ") {};\n "; + } + } + + + } + + + nodeElements.each(function ( node ){ + + px = node.x; + py = -node.y; + identifier = node.labelForCurrentLanguage(); + // console.log("Writing : "+ identifier); + if ( identifier === undefined ) identifier = ""; + var qType = "owlClass"; + if ( node.type() === "owl:Thing" || node.type() === "owl:Nothing" ) + qType = "owlThing"; + + if ( node.type() === "owl:equivalentClass" ) { + qType = "owlEquivalentClass"; + } + var textColorStr = ""; + if ( node.textBlock ) { + var txtColor = node.textBlock()._textBlock().style("fill"); + if ( txtColor === "rgb(0, 0, 0)" ) { + textColorStr = ", text=black"; + } + if ( txtColor === "rgb(255, 255, 255)" ) { + textColorStr = ", text=white"; + } + + + var tspans = node.textBlock()._textBlock().node().children; + if ( tspans[0] ) { + identifier = tspans[0].innerHTML; + if ( node.individuals() && node.individuals().length === parseInt(tspans[0].innerHTML) ) { + identifier = "{\\color{gray} " + tspans[0].innerHTML + " }"; + } + for ( var t = 1; t < tspans.length; t++ ) { + if ( node.individuals() && node.individuals().length === parseInt(tspans[t].innerHTML) ) { + identifier += "\\\\ {\\color{gray} " + tspans[t].innerHTML + " }"; + } else { + identifier += "\\\\ {\\small " + tspans[t].innerHTML + " }"; + } + } + } + } + if ( node.type() === "rdfs:Literal" ) { + qType = "Literal"; + } + if ( node.type() === "rdfs:Datatype" ) { + qType = "Datatype"; + } + if ( node.attributes().indexOf("anonymous") !== -1 ) { + qType = "anonymousClass"; + } + + + if ( node.type() === "owl:unionOf" || node.type() === "owl:complementOf" || node.type() === "owl:disjointUnionOf" || node.type() === "owl:intersectionOf" ) + qType = "owlClass"; + + var bgColorStr = ""; + var widthString = ""; + + if ( node.type() === "rdfs:Literal" || node.type() === "rdfs:Datatype" ) { + var width = node.width(); + widthString = ",minimum width=" + width + "pt"; + } + else { + widthString = ",minimum size=" + 2 * node.actualRadius() + "pt"; + + } + if ( node.backgroundColor() ) { + var bgColor = node.backgroundColor(); + bgColor.toUpperCase(); + bgColor = bgColor.slice(1, bgColor.length); + texString += "\\definecolor{Node" + i + "_COLOR}{HTML}{" + bgColor + "} \n "; + bgColorStr = ", fill=Node" + i + "_COLOR "; + } + if ( node.attributes().indexOf("deprecated") > -1 ) { + texString += "\\definecolor{Node" + i + "_COLOR}{HTML}{CCCCCC} \n "; + bgColorStr = ", fill=Node" + i + "_COLOR "; + } + + var leftPos = px - 7; + var rightPos = px + 7; + var txtOffset = py + 20; + if ( node.type() !== "owl:unionOf" || node.type() !== "owl:disjointUnionOf" ) { + texString += "\\node[" + qType + " " + widthString + " " + bgColorStr + " " + textColorStr + "] at (" + px + "pt, " + py + "pt) (Node" + i + ") {" + identifier.replaceAll("_", "\\_ ") + "};\n"; + } + if ( node.type() === "owl:unionOf" ) { + // add symbol to it; + texString += "\\node[" + qType + " " + widthString + " " + bgColorStr + " " + textColorStr + "] at (" + px + "pt, " + py + "pt) (Node" + i + ") {};\n"; + texString += "\\node[unionOf , text=black] at (" + leftPos + "pt, " + py + "pt) (SymbolNode" + i + ") {};\n"; + texString += "\\node[unionOf , text=black] at (" + rightPos + "pt, " + py + "pt) (SymbolNode" + i + ") {};\n"; + texString += "\\node[unionOf ,fill=none , text=black] at (" + leftPos + "pt, " + py + "pt) (SymbolNode" + i + ") {};\n"; + texString += "\\node[text=black] at (" + px + "pt, " + py + "pt) (unionText13) {$\\mathbf{\\cup}$};\n"; + texString += "\\node[font={\\fontsize{12pt}{12}\\selectfont \\sffamily }" + textColorStr + "] at (" + px + "pt, " + txtOffset + "pt) (Node_text" + i + ") {" + identifier.replaceAll("_", "\\_ ") + "};\n"; + } + // OWL DISJOINT UNION OF + if ( node.type() === "owl:disjointUnionOf" ) { + texString += "\\node[" + qType + " " + widthString + " " + bgColorStr + " " + textColorStr + "] at (" + px + "pt, " + py + "pt) (Node" + i + ") {};\n"; + texString += "\\node[unionOf , text=black] at (" + leftPos + "pt, " + py + "pt) (SymbolNode" + i + ") {};\n"; + texString += "\\node[unionOf , text=black] at (" + rightPos + "pt, " + py + "pt) (SymbolNode" + i + ") {};\n"; + texString += "\\node[unionOf ,fill=none , text=black] at (" + leftPos + "pt, " + py + "pt) (SymbolNode" + i + ") {};\n"; + texString += "\\node[font={\\fontsize{12pt}{12}\\selectfont \\sffamily }" + textColorStr + "] at (" + px + "pt, " + py + "pt) (disjointUnoinText" + i + ") {1};\n"; + texString += "\\node[font={\\fontsize{12pt}{12}\\selectfont \\sffamily }" + textColorStr + "] at (" + px + "pt, " + txtOffset + "pt) (Node_text" + i + ") {" + identifier.replaceAll("_", "\\_ ") + "};\n"; + } + // OWL COMPLEMENT OF + if ( node.type() === "owl:complementOf" ) { + // add symbol to it; + texString += "\\node[" + qType + " " + widthString + " " + bgColorStr + " " + textColorStr + "] at (" + px + "pt, " + py + "pt) (Node" + i + ") {};\n"; + texString += "\\node[unionOf , text=black] at (" + px + "pt, " + py + "pt) (SymbolNode" + i + ") {};\n"; + texString += "\\node[font={\\fontsize{18pt}{18}\\selectfont \\sffamily }" + textColorStr + "] at (" + px + "pt, " + py + "pt) (unionText13) {$\\neg$};\n"; + texString += "\\node[font={\\fontsize{12pt}{12}\\selectfont \\sffamily }" + textColorStr + "] at (" + px + "pt, " + txtOffset + "pt) (Node_text" + i + ") {" + identifier.replaceAll("_", "\\_ ") + "};\n"; + } + // OWL INTERSECTION OF + if ( node.type() === "owl:intersectionOf" ) { + texString += "\\node[" + qType + " " + widthString + " " + bgColorStr + " " + textColorStr + "] at (" + px + "pt, " + py + "pt) (Node" + i + ") {};\n"; + texString += "\\node[unionOf , text=black] at (" + leftPos + "pt, " + py + "pt) (SymbolNode" + i + ") {};\n"; + texString += "\\node[unionOf , text=black] at (" + rightPos + "pt, " + py + "pt) (SymbolNode" + i + ") {};\n"; + texString += "\\node[unionOf ,fill=none , text=black] at (" + leftPos + "pt, " + py + "pt) (SymbolNode" + i + ") {};\n"; + + // add now the outer colors; + texString += "\\filldraw[even odd rule,fill=owlClassColor,line width=1pt] (" + leftPos + "pt, " + py + "pt) circle (12.5pt) (" + rightPos + "pt, " + py + "pt) circle (12.5pt);\n "; + + // add texts + texString += "\\node[font={\\fontsize{12pt}{12}\\selectfont \\sffamily }" + textColorStr + "] at (" + px + "pt, " + py + "pt) (intersectionText" + i + ") {$\\cap$};\n"; + texString += "\\node[font={\\fontsize{12pt}{12}\\selectfont \\sffamily }" + textColorStr + "] at (" + px + "pt, " + txtOffset + "pt) (Node_text" + i + ") {" + identifier.replaceAll("_", "\\_ ") + "};\n"; + + } + + + i++; + + }); + for ( i = 0; i < propElements.length; i++ ) { + var correspondingProp = propElements[i].property(); + var p_px = propElements[i].x; + var p_py = -propElements[i].y; + identifier = correspondingProp.labelForCurrentLanguage(); + if ( identifier === undefined ) identifier = ""; + var textColorStr = ""; + if ( correspondingProp.textBlock && correspondingProp.textBlock() ) { + var txtColor = correspondingProp.textBlock()._textBlock().style("fill"); + // console.log("PropertyTextColor="+txtColor); + if ( txtColor === "rgb(0, 0, 0)" ) { + textColorStr = ", text=black"; + } + if ( txtColor === "rgb(255, 255, 255)" ) { + textColorStr = ", text=white"; + } + var tspans = correspondingProp.textBlock()._textBlock().node().children; + + // identifier=node.textBlock()._textBlock().text(); + // console.log(tspans); + if ( tspans[0] ) { + identifier = tspans[0].innerHTML; + + for ( var t = 1; t < tspans.length; t++ ) { + var spanText = tspans[t].innerHTML; + if ( spanText.indexOf("(") > -1 ) { + identifier += "\\\\ {\\small " + tspans[t].innerHTML + " }"; + } + else { + identifier += "\\\\ " + tspans[t].innerHTML; + } + } + } + else { + } + } + if ( correspondingProp.type() === "setOperatorProperty" ) { + continue; // this property does not have a label + } + var qType = "owlObjectProperty"; + if ( correspondingProp.type() === "owl:DatatypeProperty" ) { + qType = "owlDatatypeProperty"; + } + if ( correspondingProp.type() === "rdfs:subClassOf" ) { + qType = "rdfsSubClassOf"; + } + if ( correspondingProp.type() === "rdf:Property" ) { + qType = "rdfProperty"; + } + + + var bgColorStr = ""; + if ( correspondingProp.backgroundColor() ) { + // console.log("Found backGround color"); + var bgColor = correspondingProp.backgroundColor(); + //console.log(bgColor); + bgColor.toUpperCase(); + bgColor = bgColor.slice(1, bgColor.length); + texString += "\\definecolor{property" + i + "_COLOR}{HTML}{" + bgColor + "} \n "; + bgColorStr = ", fill=property" + i + "_COLOR "; + } + if ( correspondingProp.attributes().indexOf("deprecated") > -1 ) { + texString += "\\definecolor{property" + i + "_COLOR}{HTML}{CCCCCC} \n "; + bgColorStr = ", fill=property" + i + "_COLOR "; + } + + var widthString = ""; + var width = correspondingProp.textWidth(); + widthString = ",minimum width=" + width + "pt"; + + + // OWL INTERSECTION OF + if ( correspondingProp.type() === "owl:disjointWith" ) { + var leftPos = p_px - 12; + var rightPos = p_px + 12; + var txtOffset = p_py - 20; + texString += "\\node[" + qType + " " + widthString + " " + bgColorStr + " " + textColorStr + "] at (" + p_px + "pt, " + p_py + "pt) (Node" + i + ") {};\n"; + texString += "\\node[disjointWith , text=black] at (" + leftPos + "pt, " + p_py + "pt) (SymbolNode" + i + ") {};\n"; + texString += "\\node[disjointWith , text=black] at (" + rightPos + "pt, " + p_py + "pt) (SymbolNode" + i + ") {};\n"; + texString += "\\node[font={\\fontsize{12pt}{12}\\selectfont \\sffamily }" + textColorStr + "] at (" + p_px + "pt, " + txtOffset + "pt) (Node_text" + i + ") {"; + if ( graph.options().compactNotation() === false ) { + texString += "(disjoint)"; + } + texString += "};\n"; + continue; + } + + + if ( correspondingProp.inverse() ) { + var inv_correspondingProp = correspondingProp.inverse(); + // create the rendering element for the inverse property; + var inv_identifier = inv_correspondingProp.labelForCurrentLanguage(); + if ( inv_identifier === undefined ) inv_identifier = ""; + var inv_textColorStr = ""; + //console.log(inv_correspondingProp); + //console.log(inv_correspondingProp.textBlock()); + + if ( inv_correspondingProp.textBlock && inv_correspondingProp.textBlock() ) { + + var inv_txtColor = inv_correspondingProp.textBlock()._textBlock().style("fill"); + // console.log("PropertyTextColor="+inv_txtColor); + if ( inv_txtColor === "rgb(0, 0, 0)" ) { + inv_textColorStr = ", text=black"; + } + if ( inv_txtColor === "rgb(255, 255, 255)" ) { + inv_textColorStr = ", text=white"; + } + var inv_tspans = inv_correspondingProp.textBlock()._textBlock().node().children; + + // identifier=node.textBlock()._textBlock().text(); + // console.log(inv_tspans); + if ( inv_tspans[0] ) { + inv_identifier = inv_tspans[0].innerHTML; + + for ( var inv_t = 1; inv_t < inv_tspans.length; inv_t++ ) { + var ispanText = inv_tspans[inv_t].innerHTML; + if ( ispanText.indexOf("(") > -1 ) { + inv_identifier += "\\\\ {\\small " + inv_tspans[inv_t].innerHTML + " }"; + } else { + inv_identifier += "\\\\ " + inv_tspans[inv_t].innerHTML; + } + } + } + } + var inv_qType = "owlObjectProperty"; + var inv_bgColorStr = ""; + + if ( inv_correspondingProp.backgroundColor() ) { + // console.log("Found backGround color"); + var inv_bgColor = inv_correspondingProp.backgroundColor(); + // console.log(inv_bgColor); + inv_bgColor.toUpperCase(); + inv_bgColor = inv_bgColor.slice(1, inv_bgColor.length); + texString += "\\definecolor{inv_property" + i + "_COLOR}{HTML}{" + inv_bgColor + "} \n "; + inv_bgColorStr = ", fill=inv_property" + i + "_COLOR "; + } + if ( inv_correspondingProp.attributes().indexOf("deprecated") > -1 ) { + texString += "\\definecolor{inv_property" + i + "_COLOR}{HTML}{CCCCCC} \n "; + inv_bgColorStr = ", fill=inv_property" + i + "_COLOR "; + } + + var inv_widthString = ""; + var inv_width = inv_correspondingProp.textWidth(); + + var pOY1 = p_py - 14; + var pOY2 = p_py + 14; + inv_widthString = ",minimum width=" + inv_width + "pt"; + texString += "% Createing Inverse Property \n"; + texString += "\\node[" + inv_qType + " " + inv_widthString + " " + inv_bgColorStr + " " + inv_textColorStr + "] at (" + p_px + "pt, " + pOY1 + "pt) (property" + i + ") {" + inv_identifier.replaceAll("_", "\\_ ") + "};\n"; + texString += "% " + inv_qType + " vs " + qType + "\n"; + texString += "% " + inv_widthString + " vs " + widthString + "\n"; + texString += "% " + inv_bgColorStr + " vs " + bgColorStr + "\n"; + texString += "% " + inv_textColorStr + " vs " + textColorStr + "\n"; + + texString += "\\node[" + qType + " " + widthString + " " + bgColorStr + " " + textColorStr + "] at (" + p_px + "pt, " + pOY2 + "pt) (property" + i + ") {" + identifier.replaceAll("_", "\\_ ") + "};\n"; + + } else { + texString += "\\node[" + qType + " " + widthString + " " + bgColorStr + " " + textColorStr + "] at (" + p_px + "pt, " + p_py + "pt) (property" + i + ") {" + identifier.replaceAll("_", "\\_ ") + "};\n"; + } + } + + texString += "\\end{tikzpicture}\n}\n \\end{center}\n"; + + // console.log("Tex Output\n"+ texString); + var dataURI = "data:text/json;charset=utf-8," + encodeURIComponent(texString); + exportTexButton.attr("href", dataURI) + .attr("download", exportFilename + ".tex"); + + + } + + function calculateRadian( angle ){ + angle = angle % 360; + if ( angle < 0 ) { + angle = angle + 360; + } + return (Math.PI * angle) / 180; + } + + function calculateAngle( radian ){ + return radian * (180 / Math.PI); + } + + return exportMenu; + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), + +/***/ 324: +/***/ (function(module, exports) { + + /** + * Contains the logic for the export button. + * @returns {{}} + */ + module.exports = function ( graph ){ + var exportTTLModule = {}; + var resultingTTLContent = ""; + var currentNodes; + var currentProperties; + var currentAxioms; + var Map_ID2Node = {}; + var Map_ID2Prop = {}; + var prefixModule = webvowl.util.prefixTools(graph); + + exportTTLModule.requestExport = function (){ + prefixModule.updatePrefixModel(); + resultingTTLContent = ""; + currentNodes = graph.getClassDataForTtlExport(); + var i; + for ( i = 0; i < currentNodes.length; i++ ) { + Map_ID2Node[currentNodes[i].id()] = currentNodes[i]; + } + currentProperties = graph.getPropertyDataForTtlExport(); + + for ( i = 0; i < currentProperties.length; i++ ) { + Map_ID2Prop[currentProperties[i].id()] = currentProperties[i]; + } + + + prepareHeader(); + preparePrefixList(); + prepareOntologyDef(); + resultingTTLContent += "#################################################################\r\n\r\n"; + preparePrefixRepresentation(); + var property_success = exportProperties(); + var class_success = exportClasses(); + currentNodes = null; + currentProperties = null; + Map_ID2Node = {}; + Map_ID2Prop = {}; + if ( property_success === false || class_success === false ) + return false; + return true; + + }; + + function preparePrefixRepresentation(){ + var i; + var allNodes = graph.getUnfilteredData().nodes; + var allProps = graph.getUnfilteredData().properties; + for ( i = 0; i < allNodes.length; i++ ) { + var nodeIRI = prefixModule.getPrefixRepresentationForFullURI(allNodes[i].iri()); + if ( prefixModule.validURL(nodeIRI) === true ) + allNodes[i].prefixRepresentation = "<" + nodeIRI + ">"; + else + allNodes[i].prefixRepresentation = nodeIRI; + } + for ( i = 0; i < allProps.length; i++ ) { + var propIRI = prefixModule.getPrefixRepresentationForFullURI(allProps[i].iri()); + if ( prefixModule.validURL(propIRI) === true ) + allProps[i].prefixRepresentation = "<" + propIRI + ">"; + else + allProps[i].prefixRepresentation = propIRI; + } + } + + function exportProperties(){ + if ( currentProperties.length === 0 ) return; // we dont need to write that + resultingTTLContent += "### Property Definitions (Number of Property) " + currentProperties.length + " ###\r\n"; + for ( var i = 0; i < currentProperties.length; i++ ) { + + resultingTTLContent += "# --------------------------- Property " + i + "------------------------- \r\n"; + var addedElement = extractPropertyDescription(currentProperties[i]); + resultingTTLContent += addedElement; + //@ workaround for not supported elements + if ( addedElement.indexOf("WHYEMPTYNAME") !== -1 ) { + return false; + } + } + return true; + } + + + function exportClasses(){ + if ( currentNodes.length === 0 ) return; // we dont need to write that + resultingTTLContent += "### Class Definitions (Number of Classes) " + currentNodes.length + " ###\r\n"; + for ( var i = 0; i < currentNodes.length; i++ ) { + // check for node type here and return false + resultingTTLContent += "# --------------------------- Class " + i + "------------------------- \r\n"; + var addedElement = extractClassDescription(currentNodes[i]); + resultingTTLContent += addedElement; + + if ( addedElement.indexOf("WHYEMPTYNAME") !== -1 ) { + return false; + } + } + return true; + } + + function getPresentAttribute( selectedElement, element ){ + var attr = selectedElement.attributes(); + return (attr.indexOf(element) >= 0); + } + + function extractClassDescription( node ){ + var subject = node.prefixRepresentation; + var predicate = "rdf:type"; + var object = node.type(); + if ( node.type() === "owl:equivalentClass" ) + object = "owl:Class"; + if ( node.type() === "owl:disjointUnionOf" ) + object = "owl:Class"; + if ( node.type() === "owl:unionOf" ) + object = "owl:Class"; + var arrayOfNodes = []; + var arrayOfUnionNodes = []; + + if ( node.union() ) { + var union = node.union(); + for ( var u = 0; u < union.length; u++ ) { + var u_node = Map_ID2Node[union[u]]; + arrayOfUnionNodes.push(u_node); + } + } + + if ( node.disjointUnion() ) { + var distUnion = node.disjointUnion(); + for ( var du = 0; du < distUnion.length; du++ ) { + var du_node = Map_ID2Node[distUnion[du]]; + arrayOfNodes.push(du_node); + } + } + + var objectDef = subject + " " + predicate + " " + object; + if ( getPresentAttribute(node, "deprecated") === true ) { + objectDef += ", owl:DeprecatedProperty"; + } + // equivalent class handeled using type itself! + + // check for equivalent classes; + var indent = getIndent(subject); + objectDef += "; \r\n"; + for ( var e = 0; e < node.equivalents().length; e++ ) { + var eqIRI = prefixModule.getPrefixRepresentationForFullURI(node.equivalents()[e].iri()); + var eqNode_prefRepresentation = ""; + if ( prefixModule.validURL(eqIRI) === true ) + eqNode_prefRepresentation = "<" + eqIRI + ">"; + else + eqNode_prefRepresentation = eqIRI; + objectDef += indent + " owl:equivalentClass " + eqNode_prefRepresentation + " ;\r\n"; + } + + // if (getPresentAttribute(node,"equivalent")===true){ + // objectDef+=", owl:EquivalentClass"; + // } + + // add Comments + + if ( node.commentForCurrentLanguage() ) { + + objectDef += indent + " rdfs:comment \"" + node.commentForCurrentLanguage() + "\" ;\r\n"; + } + + if ( node.annotations() ) { + var annotations = node.annotations(); + for ( var an in annotations ) { + if ( annotations.hasOwnProperty(an) ) { + var anArrayObj = annotations[an]; + var anObj = anArrayObj[0]; + var an_ident = anObj.identifier; + var an_val = anObj.value; + + if ( an_ident === "isDefinedBy" ) { + objectDef += indent + " rdfs:isDefinedBy <" + an_val + "> ;\r\n"; + } + if ( an_ident === "term_status" ) { + objectDef += indent + " vs:term_status \"" + an_val + "\" ;\r\n"; + } + } + } + } + + + if ( arrayOfNodes.length > 0 ) { + // add disjoint unionOf + objectDef += indent + " owl:disjointUnionOf ("; + for ( var duE = 0; duE < arrayOfNodes.length; duE++ ) { + var duIri = prefixModule.getPrefixRepresentationForFullURI(arrayOfNodes[duE].iri()); + var duNode_prefRepresentation = ""; + if ( prefixModule.validURL(duIri) === true ) + duNode_prefRepresentation = "<" + duIri + ">"; + else + duNode_prefRepresentation = duIri; + objectDef += indent + indent + duNode_prefRepresentation + " \n"; + } + objectDef += ") ;\r\n"; + } + + if ( arrayOfUnionNodes.length > 0 ) { + // add disjoint unionOf + objectDef += indent + " rdfs:subClassOf [ rdf:type owl:Class ; \r\n"; + objectDef += indent + indent + " owl:unionOf ( "; + + for ( var uE = 0; uE < arrayOfUnionNodes.length; uE++ ) { + + if ( arrayOfUnionNodes[uE] && arrayOfUnionNodes[uE].iri() ) { + var uIri = prefixModule.getPrefixRepresentationForFullURI(arrayOfUnionNodes[uE].iri()); + var uNode_prefRepresentation = ""; + if ( prefixModule.validURL(uIri) === true ) + uNode_prefRepresentation = "<" + uIri + ">"; + else + uNode_prefRepresentation = uIri; + objectDef += indent + indent + indent + uNode_prefRepresentation + " \n"; + } + } + objectDef += ") ;\r\n"; + + + } + + + var allProps = graph.getUnfilteredData().properties; + var myProperties = []; + var i; + for ( i = 0; i < allProps.length; i++ ) { + if ( allProps[i].domain() === node && + ( allProps[i].type() === "rdfs:subClassOf" || + allProps[i].type() === "owl:allValuesFrom" || + allProps[i].type() === "owl:someValuesFrom") + ) { + myProperties.push(allProps[i]); + } + // special case disjoint with>> both domain and range get that property + if ( (allProps[i].domain() === node) && + allProps[i].type() === "owl:disjointWith" ) { + myProperties.push(allProps[i]); + } + + } + for ( i = 0; i < myProperties.length; i++ ) { + // depending on the property we have to do some things; + + // special case + if ( myProperties[i].type() === "owl:someValuesFrom" ) { + objectDef += indent + " rdfs:subClassOf [ rdf:type owl:Restriction ; \r\n"; + objectDef += indent + " owl:onProperty " + myProperties[i].prefixRepresentation + ";\r\n"; + if ( myProperties[i].range().type() !== "owl:Thing" ) { + objectDef += indent + " owl:someValuesFrom " + myProperties[i].range().prefixRepresentation + "\r\n"; + } + objectDef += indent + " ];\r\n"; + continue; + } + + if ( myProperties[i].type() === "owl:allValuesFrom" ) { + objectDef += indent + " rdfs:subClassOf [ rdf:type owl:Restriction ; \r\n"; + objectDef += indent + " owl:onProperty " + myProperties[i].prefixRepresentation + ";\r\n"; + if ( myProperties[i].range().type() !== "owl:Thing" ) { + objectDef += indent + " owl:allValuesFrom " + myProperties[i].range().prefixRepresentation + "\r\n"; + } + objectDef += indent + " ];\r\n"; + continue; + } + + if ( myProperties[i].range().type() !== "owl:Thing" ) { + objectDef += indent + " " + myProperties[i].prefixRepresentation + + " " + myProperties[i].range().prefixRepresentation + " ;\r\n"; + + + } + } + + + objectDef += general_Label_languageExtractor(indent, node.label(), "rdfs:label", true); + return objectDef; + + } + + function extractPropertyDescription( property ){ + var subject = property.prefixRepresentation; + if ( subject.length === 0 ) { + console.log("THIS SHOULD NOT HAPPEN"); + var propIRI = prefixModule.getPrefixRepresentationForFullURI(property.iri()); + console.log("FOUND " + propIRI); + + + } + var predicate = "rdf:type"; + var object = property.type(); + + var objectDef = subject + " " + predicate + " " + object; + if ( getPresentAttribute(property, "deprecated") === true ) { + objectDef += ", owl:DeprecatedProperty"; + } + if ( getPresentAttribute(property, "functional") === true ) { + objectDef += ", owl:FunctionalProperty"; + } + if ( getPresentAttribute(property, "inverse functional") === true ) { + objectDef += ", owl:InverseFunctionalProperty"; + } + if ( getPresentAttribute(property, "symmetric") === true ) { + objectDef += ", owl:SymmetricProperty"; + } + if ( getPresentAttribute(property, "transitive") === true ) { + objectDef += ", owl:TransitiveProperty"; + } + var indent = getIndent(subject); + + if ( property.inverse() ) { + objectDef += "; \r\n"; + objectDef += indent + " owl:inverseOf " + property.inverse().prefixRepresentation; + } + + // check for domain and range; + + + var closeStatement = false; + var domain = property.domain(); + var range = property.range(); + + + objectDef += " ;\r\n"; + + + if ( property.commentForCurrentLanguage() ) { + + objectDef += indent + " rdfs:comment \"" + property.commentForCurrentLanguage() + "\" ;\r\n"; + } + + if ( property.superproperties() ) { + var superProps = property.superproperties(); + for ( var sP = 0; sP < superProps.length; sP++ ) { + var sPelement = superProps[sP]; + objectDef += indent + "rdfs:subPropertyOf " + sPelement.prefixRepresentation + ";\r\n"; + } + // for (var an in annotations){ + // if (annotations.hasOwnProperty(an)){ + // var anArrayObj=annotations[an]; + // var anObj=anArrayObj[0]; + // var an_ident=anObj.identifier; + // var an_val=anObj.value; + // console.log(an_ident + " "+ an_val); + // + // if (an_ident==="isDefinedBy"){ + // objectDef+=indent+" rdfs:isDefinedBy <"+an_val+"> ;\r\n"; + // } + // if (an_ident==="term_status"){ + // objectDef+=indent+" vs:term_status \""+an_val+"\" ;\r\n"; + // } + // } + // } + + } + + if ( property.annotations() ) { + var annotations = property.annotations(); + for ( var an in annotations ) { + if ( annotations.hasOwnProperty(an) ) { + var anArrayObj = annotations[an]; + var anObj = anArrayObj[0]; + var an_ident = anObj.identifier; + var an_val = anObj.value; + + if ( an_ident === "isDefinedBy" ) { + objectDef += indent + " rdfs:isDefinedBy <" + an_val + "> ;\r\n"; + } + if ( an_ident === "term_status" ) { + objectDef += indent + " vs:term_status \"" + an_val + "\" ;\r\n"; + } + } + } + } + + + if ( domain.type() === "owl:Thing" && range.type() === "owl:Thing" ) { + // we do not write domain and range + if ( typeof property.label() !== "object" && property.label().length === 0 ) { + closeStatement = true; + } + } + + + if ( closeStatement === true ) { + var uobjectDef = objectDef.substring(0, objectDef.length - 2); + objectDef = uobjectDef + " . \r\n"; + return objectDef; + } + // objectDef+="; \r\n"; + var labelDescription; + + + if ( domain.type() === "owl:Thing" && range.type() === "owl:Thing" ) { + labelDescription = general_Label_languageExtractor(indent, property.label(), "rdfs:label", true); + objectDef += labelDescription; + } + else { + // do not close the statement; + labelDescription = general_Label_languageExtractor(indent, property.label(), "rdfs:label"); + objectDef += labelDescription; + if ( domain.type() !== "owl:Thing" ) { + objectDef += indent + " rdfs:domain " + domain.prefixRepresentation + ";\r\n"; + } + if ( range.type() !== "owl:Thing" ) { + objectDef += indent + " rdfs:range " + range.prefixRepresentation + ";\r\n"; + } + + // close statement now; + + var s_needUpdate = objectDef; + var s_lastPtr = s_needUpdate.lastIndexOf(";"); + objectDef = s_needUpdate.substring(0, s_lastPtr) + " . \r\n"; + } + + return objectDef; + + } + + + exportTTLModule.resultingTTL_Content = function (){ + return resultingTTLContent; + }; + + function getIndent( name ){ + if ( name === undefined ) { + return "WHYEMPTYNAME?"; + } + return new Array(name.length + 1).join(" "); + } + + function prepareHeader(){ + resultingTTLContent += "#################################################################\r\n"; + resultingTTLContent += "### Generated with the experimental alpha version of the TTL exporter of WebVOWL (version 1.1.7) " + + " http://visualdataweb.de/webvowl/ ###\r\n"; + resultingTTLContent += "#################################################################\r\n\r\n"; + + } + + function preparePrefixList(){ + var ontoIri = graph.options().getGeneralMetaObjectProperty('iri'); + var prefixList = graph.options().prefixList(); + var prefixDef = []; + prefixDef.push('@prefix : \t\t<' + ontoIri + '> .'); + for ( var name in prefixList ) { + if ( prefixList.hasOwnProperty(name) ) { + prefixDef.push('@prefix ' + name + ': \t\t<' + prefixList[name] + '> .'); + } + } + prefixDef.push('@base \t\t\t<' + ontoIri + '> .\r\n'); + + for ( var i = 0; i < prefixDef.length; i++ ) { + resultingTTLContent += prefixDef[i] + '\r\n'; + } + } + + function prepareOntologyDef(){ + var ontoIri = graph.options().getGeneralMetaObjectProperty('iri'); + var indent = getIndent('<' + ontoIri + '>'); + resultingTTLContent += '<' + ontoIri + '> rdf:type owl:Ontology ;\r\n' + + getOntologyTitle(indent) + + getOntologyDescription(indent) + + getOntologyVersion(indent) + + getOntologyAuthor(indent); + + // close the statement; + var s_needUpdate = resultingTTLContent; + var s_lastPtr = s_needUpdate.lastIndexOf(";"); + resultingTTLContent = s_needUpdate.substring(0, s_lastPtr) + " . \r\n"; + } + + function getOntologyTitle( indent ){ + return general_languageExtractor(indent, "title", "dc:title"); + } + + function getOntologyDescription( indent ){ + return general_languageExtractor(indent, "description", "dc:description"); + } + + function getOntologyAuthor( indent ){ + var languageElement = graph.options().getGeneralMetaObjectProperty('author'); + if ( languageElement ) { + if ( typeof languageElement !== "object" ) { + if ( languageElement.length === 0 ) + return ""; // an empty string + var aString = indent + " dc:creator " + '"' + languageElement + '";\r\n'; + return aString; + } + // we assume this thing is an array; + var authorString = indent + " dc:creator " + '"'; + for ( var i = 0; i < languageElement.length - 1; i++ ) { + authorString += languageElement[i] + ", "; + } + authorString += languageElement[languageElement.length - 1] + '";\r\n'; + return authorString; + } else { + return ""; // an empty string + } + } + + function getOntologyVersion( indent ){ + var languageElement = graph.options().getGeneralMetaObjectProperty('version'); + if ( languageElement ) { + if ( typeof languageElement !== "object" ) { + if ( languageElement.length === 0 ) + return ""; // an empty string + } + return general_languageExtractor(indent, "version", "owl:versionInfo"); + } else return ""; // an empty string + } + + function general_languageExtractor( indent, metaObjectDescription, annotationDescription, endStatement ){ + var languageElement = graph.options().getGeneralMetaObjectProperty(metaObjectDescription); + + if ( typeof languageElement === 'object' ) { + + var resultingLanguages = []; + for ( var name in languageElement ) { + if ( languageElement.hasOwnProperty(name) ) { + var content = languageElement[name]; + if ( name === "undefined" ) { + resultingLanguages.push(indent + " " + annotationDescription + ' "' + content + '"@en; \r\n'); + } + else { + resultingLanguages.push(indent + " " + annotationDescription + ' "' + content + '"@' + name + '; \r\n'); + } + } + } + // create resulting titles; + + var resultingString = ""; + for ( var i = 0; i < resultingLanguages.length; i++ ) { + resultingString += resultingLanguages[i]; + } + if ( endStatement && endStatement === true ) { + var needUpdate = resultingString; + var lastPtr = needUpdate.lastIndexOf(";"); + return needUpdate.substring(0, lastPtr) + ". \r\n"; + } else { + return resultingString; + } + + } else { + if ( endStatement && endStatement === true ) { + var s_needUpdate = indent + " " + annotationDescription + ' "' + languageElement + '"@en; \r\n'; + var s_lastPtr = s_needUpdate.lastIndexOf(";"); + return s_needUpdate.substring(0, s_lastPtr) + " . \r\n"; + } + return indent + " " + annotationDescription + ' "' + languageElement + '"@en;\r\n'; + } + } + + function general_Label_languageExtractor( indent, label, annotationDescription, endStatement ){ + var languageElement = label; + + if ( typeof languageElement === 'object' ) { + var resultingLanguages = []; + for ( var name in languageElement ) { + if ( languageElement.hasOwnProperty(name) ) { + var content = languageElement[name]; + if ( name === "undefined" ) { + resultingLanguages.push(indent + " " + annotationDescription + ' "' + content + '"@en; \r\n'); + } + else { + resultingLanguages.push(indent + " " + annotationDescription + ' "' + content + '"@' + name + '; \r\n'); + } + } + } + // create resulting titles; + var resultingString = ""; + for ( var i = 0; i < resultingLanguages.length; i++ ) { + resultingString += resultingLanguages[i]; + } + if ( endStatement && endStatement === true ) { + var needUpdate = resultingString; + var lastPtr = needUpdate.lastIndexOf(";"); + return needUpdate.substring(0, lastPtr) + " . \r\n"; + } else { + return resultingString; + } + + } else { + if ( endStatement && endStatement === true ) { + var s_needUpdate = indent + " " + annotationDescription + ' "' + languageElement + '"@en; \r\n'; + var s_lastPtr = s_needUpdate.lastIndexOf(";"); + return s_needUpdate.substring(0, s_lastPtr) + " . \r\n"; + } + return indent + " " + annotationDescription + ' "' + languageElement + '"@en; \r\n'; + } + } + + return exportTTLModule; + }; + + +/***/ }), + +/***/ 325: +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {/** + * Contains the logic for connecting the filters with the website. + * + * @param graph required for calling a refresh after a filter change + * @returns {{}} + */ + module.exports = function ( graph ){ + + var filterMenu = {}, + checkboxData = [], + menuElement = d3.select("#m_filter"), + menuControl = d3.select("#c_filter a"), + nodeDegreeContainer = d3.select("#nodeDegreeFilteringOption"), + graphDegreeLevel, + defaultDegreeValue = 0, + degreeSlider; + + filterMenu.setDefaultDegreeValue = function ( val ){ + defaultDegreeValue = val; + }; + filterMenu.getDefaultDegreeValue = function (){ + return defaultDegreeValue; + }; + + filterMenu.getGraphObject = function (){ + return graph; + }; + /** some getter function **/ + filterMenu.getCheckBoxContainer = function (){ + return checkboxData; + }; + + filterMenu.getDegreeSliderValue = function (){ + return degreeSlider.property("value"); + }; + /** + * Connects the website with graph filters. + * @param datatypeFilter filter for all datatypes + * @param objectPropertyFilter filter for all object properties + * @param subclassFilter filter for all subclasses + * @param disjointFilter filter for all disjoint with properties + * @param setOperatorFilter filter for all set operators with properties + * @param nodeDegreeFilter filters nodes by their degree + */ + filterMenu.setup = function ( datatypeFilter, objectPropertyFilter, subclassFilter, disjointFilter, setOperatorFilter, nodeDegreeFilter ){ + // TODO: is this here really necessarry? << new menu visualization style? + menuControl.on("mouseover", function (){ + var searchMenu = graph.options().searchMenu(); + searchMenu.hideSearchEntries(); + }); + menuControl.on("mouseleave", function (){ + filterMenu.highlightForDegreeSlider(false); + }); + + addFilterItem(datatypeFilter, "datatype", "Datatype properties", "#datatypeFilteringOption"); + addFilterItem(objectPropertyFilter, "objectProperty", "Object properties", "#objectPropertyFilteringOption"); + addFilterItem(subclassFilter, "subclass", "Solitary subclasses", "#subclassFilteringOption"); + addFilterItem(disjointFilter, "disjoint", "Class disjointness", "#disjointFilteringOption"); + addFilterItem(setOperatorFilter, "setoperator", "Set operators", "#setOperatorFilteringOption"); + + addNodeDegreeFilter(nodeDegreeFilter, nodeDegreeContainer); + addAnimationFinishedListener(); + }; + + + function addFilterItem( filter, identifier, pluralNameOfFilteredItems, selector ){ + var filterContainer, + filterCheckbox; + + filterContainer = d3.select(selector) + .append("div") + .classed("checkboxContainer", true); + + filterCheckbox = filterContainer.append("input") + .classed("filterCheckbox", true) + .attr("id", identifier + "FilterCheckbox") + .attr("type", "checkbox") + .property("checked", filter.enabled()); + + // Store for easier resetting + checkboxData.push({ checkbox: filterCheckbox, defaultState: filter.enabled() }); + + filterCheckbox.on("click", function ( silent ){ + // There might be no parameters passed because of a manual + // invocation when resetting the filters + var isEnabled = filterCheckbox.property("checked"); + filter.enabled(isEnabled); + if ( silent !== true ) { + // updating graph when silent is false or the parameter is not given. + graph.update(); + } + }); + + filterContainer.append("label") + .attr("for", identifier + "FilterCheckbox") + .text(pluralNameOfFilteredItems); + } + + function addNodeDegreeFilter( nodeDegreeFilter, container ){ + nodeDegreeFilter.setMaxDegreeSetter(function ( maxDegree ){ + degreeSlider.attr("max", maxDegree); + setSliderValue(degreeSlider, Math.min(maxDegree, degreeSlider.property("value"))); + }); + + nodeDegreeFilter.setDegreeGetter(function (){ + return degreeSlider.property("value"); + }); + + nodeDegreeFilter.setDegreeSetter(function ( value ){ + setSliderValue(degreeSlider, value); + }); + + var sliderContainer, + sliderValueLabel; + + sliderContainer = container.append("div") + .classed("distanceSliderContainer", true); + + degreeSlider = sliderContainer.append("input") + .attr("id", "nodeDegreeDistanceSlider") + .attr("type", "range") + .attr("min", 0) + .attr("step", 1); + + sliderContainer.append("label") + .classed("description", true) + .attr("for", "nodeDegreeDistanceSlider") + .text("Degree of collapsing"); + + sliderValueLabel = sliderContainer.append("label") + .classed("value", true) + .attr("for", "nodeDegreeDistanceSlider") + .text(0); + + + degreeSlider.on("change", function ( silent ){ + if ( silent !== true ) { + graph.update(); + graphDegreeLevel = degreeSlider.property("value"); + } + }); + + + degreeSlider.on("input", function (){ + var degree = degreeSlider.property("value"); + sliderValueLabel.text(degree); + }); + + + // adding wheel events + degreeSlider.on("wheel", handleWheelEvent); + degreeSlider.on("focusout", function (){ + if ( degreeSlider.property("value") !== graphDegreeLevel ) { + graph.update(); + } + }); + } + + function handleWheelEvent(){ + var wheelEvent = d3.event; + + var offset; + if ( wheelEvent.deltaY < 0 ) offset = 1; + if ( wheelEvent.deltaY > 0 ) offset = -1; + var maxDeg = parseInt(degreeSlider.attr("max")); + var oldVal = parseInt(degreeSlider.property("value")); + var newSliderValue = oldVal + offset; + if ( oldVal !== newSliderValue && (newSliderValue >= 0 && newSliderValue <= maxDeg) ) { + // only update when they are different [reducing redundant updates] + // set the new value and emit an update signal + degreeSlider.property("value", newSliderValue); + degreeSlider.on("input")();// <<-- sets the text value + graph.update(); + } + d3.event.preventDefault(); + } + + function setSliderValue( slider, value ){ + slider.property("value", value).on("input")(); + } + + /** + * Resets the filters (and also filtered elements) to their default. + */ + filterMenu.reset = function (){ + checkboxData.forEach(function ( checkboxData ){ + var checkbox = checkboxData.checkbox, + enabledByDefault = checkboxData.defaultState, + isChecked = checkbox.property("checked"); + + if ( isChecked !== enabledByDefault ) { + checkbox.property("checked", enabledByDefault); + // Call onclick event handlers programmatically + checkbox.on("click")(); + } + }); + + setSliderValue(degreeSlider, 0); + degreeSlider.on("change")(); + }; + + function addAnimationFinishedListener(){ + menuControl.node().addEventListener("animationend", function (){ + menuControl.classed("buttonPulse", false); + menuControl.classed("filterMenuButtonHighlight", true); + + }); + } + + filterMenu.killButtonAnimation = function (){ + menuControl.classed("buttonPulse", false); + menuControl.classed("filterMenuButtonHighlight", false); + }; + + + filterMenu.highlightForDegreeSlider = function ( enable ){ + if ( !arguments.length ) { + enable = true; + } + menuControl.classed("highlighted", enable); + nodeDegreeContainer.classed("highlighted", enable); + // pulse button handling + if ( menuControl.classed("buttonPulse") === true && enable === true ) { + menuControl.classed("buttonPulse", false); + var timer = setTimeout(function (){ + menuControl.classed("buttonPulse", enable); + clearTimeout(timer); + // after the time is done, remove the pulse but stay highlighted + }, 100); + } else { + menuControl.classed("buttonPulse", enable); + menuControl.classed("filterMenuButtonHighlight", enable); + } + }; + + + /** importer functions **/ + // setting manually the values of the filter + // no update of the gui settings, these are updated in updateSettings + filterMenu.setCheckBoxValue = function ( id, checked ){ + for ( var i = 0; i < checkboxData.length; i++ ) { + var cbdId = checkboxData[i].checkbox.attr("id"); + if ( cbdId === id ) { + checkboxData[i].checkbox.property("checked", checked); + break; + } + } + }; + + filterMenu.getCheckBoxValue = function ( id ){ + for ( var i = 0; i < checkboxData.length; i++ ) { + var cbdId = checkboxData[i].checkbox.attr("id"); + if ( cbdId === id ) { + return checkboxData[i].checkbox.property("checked"); + + } + } + }; + // set the value of the slider + filterMenu.setDegreeSliderValue = function ( val ){ + degreeSlider.property("value", val); + }; + + filterMenu.getDegreeSliderValue = function (){ + return degreeSlider.property("value"); + }; + + // update the gui without invoking graph update (calling silent onclick function) + filterMenu.updateSettings = function (){ + var silent = true; + var sliderValue = degreeSlider.property("value"); + if ( sliderValue > 0 ) { + filterMenu.highlightForDegreeSlider(true); + } else { + filterMenu.highlightForDegreeSlider(false); + } + checkboxData.forEach(function ( checkboxData ){ + var checkbox = checkboxData.checkbox; + checkbox.on("click")(silent); + }); + + degreeSlider.on("input")(); + degreeSlider.on("change")(); + + }; + + return filterMenu; + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), + +/***/ 326: +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {/** + * Contains the logic for setting up the gravity sliders. + * + * @param graph the associated webvowl graph + * @returns {{}} + */ + module.exports = function ( graph ){ + + var gravityMenu = {}, + sliders = [], + options = graph.graphOptions(), + defaultCharge = options.charge(); + + + /** + * Adds the gravity sliders to the website. + */ + gravityMenu.setup = function (){ + var menuEntry = d3.select("#m_gravity"); + menuEntry.on("mouseover", function (){ + var searchMenu = graph.options().searchMenu(); + searchMenu.hideSearchEntries(); + }); + addDistanceSlider("#classSliderOption", "class", "Class distance", options.classDistance); + addDistanceSlider("#datatypeSliderOption", "datatype", "Datatype distance", options.datatypeDistance); + }; + + function addDistanceSlider( selector, identifier, label, distanceFunction ){ + var defaultLinkDistance = distanceFunction(); + + var sliderContainer, + sliderValueLabel; + + sliderContainer = d3.select(selector) + .append("div") + .datum({ distanceFunction: distanceFunction }) // connect the options-function with the slider + .classed("distanceSliderContainer", true); + + var slider = sliderContainer.append("input") + .attr("id", identifier + "DistanceSlider") + .attr("type", "range") + .attr("min", 10) + .attr("max", 600) + .attr("value", distanceFunction()) + .attr("step", 10); + + sliderContainer.append("label") + .classed("description", true) + .attr("for", identifier + "DistanceSlider") + .text(label); + + sliderValueLabel = sliderContainer.append("label") + .classed("value", true) + .attr("for", identifier + "DistanceSlider") + .text(distanceFunction()); + + // Store slider for easier resetting + sliders.push(slider); + + slider.on("focusout", function (){ + graph.updateStyle(); + }); + + slider.on("input", function (){ + var distance = slider.property("value"); + distanceFunction(distance); + adjustCharge(defaultLinkDistance); + sliderValueLabel.text(distance); + graph.updateStyle(); + }); + + // add wheel event to the slider + slider.on("wheel", function (){ + var wheelEvent = d3.event; + var offset; + if ( wheelEvent.deltaY < 0 ) offset = 10; + if ( wheelEvent.deltaY > 0 ) offset = -10; + var oldVal = parseInt(slider.property("value")); + var newSliderValue = oldVal + offset; + if ( newSliderValue !== oldVal ) { + slider.property("value", newSliderValue); + distanceFunction(newSliderValue); + slider.on("input")(); // << set text and update the graphStyles + } + d3.event.preventDefault(); + }); + } + + function adjustCharge( defaultLinkDistance ){ + var greaterDistance = Math.max(options.classDistance(), options.datatypeDistance()), + ratio = greaterDistance / defaultLinkDistance, + newCharge = defaultCharge * ratio; + + options.charge(newCharge); + } + + /** + * Resets the gravity sliders to their default. + */ + gravityMenu.reset = function (){ + sliders.forEach(function ( slider ){ + slider.property("value", function ( d ){ + // Simply reload the distance from the options + return d.distanceFunction(); + }); + slider.on("input")(); + }); + }; + + + return gravityMenu; + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), + +/***/ 327: +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {/** + * Contains the logic for connecting the modes with the website. + * + * @param graph the graph that belongs to these controls + * @returns {{}} + */ + module.exports = function ( graph ){ + + var SAME_COLOR_MODE = { text: "Multicolor", type: "same" }; + var GRADIENT_COLOR_MODE = { text: "Multicolor", type: "gradient" }; + + var modeMenu = {}, + checkboxes = [], + colorModeSwitch; + + var dynamicLabelWidthCheckBox; + // getter and setter for the state of color modes + modeMenu.colorModeState = function ( s ){ + if ( !arguments.length ) return colorModeSwitch.datum().active; + colorModeSwitch.datum().active = s; + return modeMenu; + }; + + + modeMenu.setDynamicLabelWidth = function ( val ){ + dynamicLabelWidthCheckBox.property("checked", val); + }; + // getter for checkboxes + modeMenu.getCheckBoxContainer = function (){ + return checkboxes; + }; + // getter for the color switch [needed? ] + modeMenu.colorModeSwitch = function (){ + return colorModeSwitch; + }; + + /** + * Connects the website with the available graph modes. + */ + modeMenu.setup = function ( pickAndPin, nodeScaling, compactNotation, colorExternals ){ + var menuEntry = d3.select("#m_modes"); + menuEntry.on("mouseover", function (){ + var searchMenu = graph.options().searchMenu(); + searchMenu.hideSearchEntries(); + }); + addCheckBoxD("labelWidth", "Dynamic label width", "#dynamicLabelWidth", graph.options().dynamicLabelWidth, 1); + addCheckBox("editorMode", "Editing ", "#editMode", graph.editorMode); + addModeItem(pickAndPin, "pickandpin", "Pick & pin", "#pickAndPinOption", false); + addModeItem(nodeScaling, "nodescaling", "Node scaling", "#nodeScalingOption", true); + addModeItem(compactNotation, "compactnotation", "Compact notation", "#compactNotationOption", true); + var container = addModeItem(colorExternals, "colorexternals", "Color externals", "#colorExternalsOption", true); + colorModeSwitch = addExternalModeSelection(container, colorExternals); + }; + function addCheckBoxD( identifier, modeName, selector, onChangeFunc, updateLvl ){ + var moduleOptionContainer = d3.select(selector) + .append("div") + .classed("checkboxContainer", true); + + var moduleCheckbox = moduleOptionContainer.append("input") + .classed("moduleCheckbox", true) + .attr("id", identifier + "ModuleCheckbox") + .attr("type", "checkbox") + .property("checked", onChangeFunc()); + + moduleCheckbox.on("click", function ( d ){ + var isEnabled = moduleCheckbox.property("checked"); + onChangeFunc(isEnabled); + d3.select("#maxLabelWidthSlider").node().disabled = !isEnabled; + d3.select("#maxLabelWidthvalueLabel").classed("disabledLabelForSlider", !isEnabled); + d3.select("#maxLabelWidthDescriptionLabel").classed("disabledLabelForSlider", !isEnabled); + + if ( updateLvl > 0 ) { + graph.animateDynamicLabelWidth(); + // graph.lazyRefresh(); + } + }); + moduleOptionContainer.append("label") + .attr("for", identifier + "ModuleCheckbox") + .text(modeName); + if ( identifier === "editorMode" ) { + moduleOptionContainer.append("label") + .attr("style", "font-size:10px;padding-top:3px") + .text("(experimental)"); + } + + dynamicLabelWidthCheckBox = moduleCheckbox; + } + + function addCheckBox( identifier, modeName, selector, onChangeFunc ){ + var moduleOptionContainer = d3.select(selector) + .append("div") + .classed("checkboxContainer", true); + + var moduleCheckbox = moduleOptionContainer.append("input") + .classed("moduleCheckbox", true) + .attr("id", identifier + "ModuleCheckbox") + .attr("type", "checkbox") + .property("checked", onChangeFunc()); + + moduleCheckbox.on("click", function ( d ){ + var isEnabled = moduleCheckbox.property("checked"); + onChangeFunc(isEnabled); + if ( isEnabled === true ) + graph.showEditorHintIfNeeded(); + }); + moduleOptionContainer.append("label") + .attr("for", identifier + "ModuleCheckbox") + .text(modeName); + if ( identifier === "editorMode" ) { + moduleOptionContainer.append("label") + .attr("style", "font-size:10px;padding-top:3px") + .text(" (experimental)"); + } + } + + function addModeItem( module, identifier, modeName, selector, updateGraphOnClick ){ + var moduleOptionContainer, + moduleCheckbox; + + moduleOptionContainer = d3.select(selector) + .append("div") + .classed("checkboxContainer", true) + .datum({ module: module, defaultState: module.enabled() }); + + moduleCheckbox = moduleOptionContainer.append("input") + .classed("moduleCheckbox", true) + .attr("id", identifier + "ModuleCheckbox") + .attr("type", "checkbox") + .property("checked", module.enabled()); + + // Store for easier resetting all modes + checkboxes.push(moduleCheckbox); + + moduleCheckbox.on("click", function ( d, silent ){ + var isEnabled = moduleCheckbox.property("checked"); + d.module.enabled(isEnabled); + if ( updateGraphOnClick && silent !== true ) { + graph.executeColorExternalsModule(); + graph.executeCompactNotationModule(); + graph.lazyRefresh(); + } + }); + + moduleOptionContainer.append("label") + .attr("for", identifier + "ModuleCheckbox") + .text(modeName); + + return moduleOptionContainer; + } + + function addExternalModeSelection( container, colorExternalsMode ){ + var button = container.append("button").datum({ active: false }).classed("color-mode-switch", true); + applyColorModeSwitchState(button, colorExternalsMode); + + button.on("click", function ( silent ){ + var data = button.datum(); + data.active = !data.active; + applyColorModeSwitchState(button, colorExternalsMode); + if ( colorExternalsMode.enabled() && silent !== true ) { + graph.executeColorExternalsModule(); + graph.lazyRefresh(); + } + }); + + return button; + } + + function applyColorModeSwitchState( element, colorExternalsMode ){ + var isActive = element.datum().active; + var activeColorMode = getColorModeByState(isActive); + + element.classed("active", isActive) + .text(activeColorMode.text); + + if ( colorExternalsMode ) { + colorExternalsMode.colorModeType(activeColorMode.type); + } + } + + function getColorModeByState( isActive ){ + return isActive ? GRADIENT_COLOR_MODE : SAME_COLOR_MODE; + } + + /** + * Resets the modes to their default. + */ + modeMenu.reset = function (){ + checkboxes.forEach(function ( checkbox ){ + var defaultState = checkbox.datum().defaultState, + isChecked = checkbox.property("checked"); + + if ( isChecked !== defaultState ) { + checkbox.property("checked", defaultState); + // Call onclick event handlers programmatically + checkbox.on("click")(checkbox.datum()); + } + + // Reset the module that is connected with the checkbox + checkbox.datum().module.reset(); + }); + + // set the switch to active and simulate disabling + colorModeSwitch.datum().active = true; + colorModeSwitch.on("click")(); + }; + + /** importer functions **/ + // setting manually the values of the filter + // no update of the gui settings, these are updated in updateSettings + modeMenu.setCheckBoxValue = function ( id, checked ){ + for ( var i = 0; i < checkboxes.length; i++ ) { + var cbdId = checkboxes[i].attr("id"); + + if ( cbdId === id ) { + checkboxes[i].property("checked", checked); + break; + } + } + }; + modeMenu.getCheckBoxValue = function ( id ){ + for ( var i = 0; i < checkboxes.length; i++ ) { + var cbdId = checkboxes[i].attr("id"); + if ( cbdId === id ) { + return checkboxes[i].property("checked"); + } + } + }; + + modeMenu.setColorSwitchState = function ( state ){ + // need the !state because we simulate later a click + modeMenu.colorModeState(!state); + }; + modeMenu.setColorSwitchStateUsingURL = function ( state ){ + // need the !state because we simulate later a click + modeMenu.colorModeState(!state); + colorModeSwitch.on("click")(true); + }; + + + modeMenu.updateSettingsUsingURL = function (){ + var silent = true; + checkboxes.forEach(function ( checkbox ){ + checkbox.on("click")(checkbox.datum(), silent); + }); + }; + + modeMenu.updateSettings = function (){ + var silent = true; + checkboxes.forEach(function ( checkbox ){ + checkbox.on("click")(checkbox.datum(), silent); + }); + // this simulates onclick and inverts its state + colorModeSwitch.on("click")(silent); + }; + return modeMenu; + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), + +/***/ 328: +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {module.exports = function ( graph ){ + var debugMenu = {}, + checkboxes = []; + + + var hoverFlag = false; + var specialCbx; + debugMenu.setup = function (){ + var menuEntry = d3.select("#debugMenuHref"); + + menuEntry.on("mouseover", function (){ + if ( hoverFlag === false ) { + var searchMenu = graph.options().searchMenu(); + searchMenu.hideSearchEntries(); + specialCbx.on("click")(true); + if ( graph.editorMode() === false ) { + d3.select("#useAccuracyHelper").style("color", "#979797"); + d3.select("#useAccuracyHelper").style("pointer-events", "none"); + + // regardless the state on which useAccuracyHelper is , we are not in editing mode -> disable it + d3.select("#showDraggerObject").style("color", "#979797"); + d3.select("#showDraggerObject").style("pointer-events", "none"); + } else { + d3.select("#useAccuracyHelper").style("color", "#2980b9"); + d3.select("#useAccuracyHelper").style("pointer-events", "auto"); + } + hoverFlag = true; + } + }); + menuEntry.on("mouseout", function (){ + hoverFlag = false; + }); + + + specialCbx = addCheckBox("useAccuracyHelper", "Use accuracy helper", "#useAccuracyHelper", graph.options().useAccuracyHelper, + function ( enabled, silent ){ + if ( !enabled ) { + d3.select("#showDraggerObject").style("color", "#979797"); + d3.select("#showDraggerObject").style("pointer-events", "none"); + d3.select("#showDraggerObjectConfigCheckbox").node().checked = false; + } else { + d3.select("#showDraggerObject").style("color", "#2980b9"); + d3.select("#showDraggerObject").style("pointer-events", "auto"); + } + + if ( silent === true ) return; + graph.lazyRefresh(); + graph.updateDraggerElements(); + } + ); + addCheckBox("showDraggerObject", "Show accuracy helper", "#showDraggerObject", graph.options().showDraggerObject, + function ( enabled, silent ){ + if ( silent === true ) return; + graph.lazyRefresh(); + graph.updateDraggerElements(); + }); + addCheckBox("showFPS_Statistics", "Show rendering statistics", "#showFPS_Statistics", graph.options().showRenderingStatistic, + function ( enabled, silent ){ + + if ( graph.options().getHideDebugFeatures() === false ) { + d3.select("#FPS_Statistics").classed("hidden", !enabled); + } else { + d3.select("#FPS_Statistics").classed("hidden", true); + } + + + }); + addCheckBox("showModeOfOperation", "Show input modality", "#showModeOfOperation", graph.options().showInputModality, + function ( enabled ){ + if ( graph.options().getHideDebugFeatures() === false ) { + d3.select("#modeOfOperationString").classed("hidden", !enabled); + } else { + d3.select("#modeOfOperationString").classed("hidden", true); + } + }); + + + }; + + + function addCheckBox( identifier, modeName, selector, onChangeFunc, _callbackFunction ){ + var configOptionContainer = d3.select(selector) + .append("div") + .classed("checkboxContainer", true); + var configCheckbox = configOptionContainer.append("input") + .classed("moduleCheckbox", true) + .attr("id", identifier + "ConfigCheckbox") + .attr("type", "checkbox") + .property("checked", onChangeFunc()); + + + configCheckbox.on("click", function ( silent ){ + var isEnabled = configCheckbox.property("checked"); + onChangeFunc(isEnabled); + _callbackFunction(isEnabled, silent); + + }); + checkboxes.push(configCheckbox); + configOptionContainer.append("label") + .attr("for", identifier + "ConfigCheckbox") + .text(modeName); + + return configCheckbox; + } + + debugMenu.setCheckBoxValue = function ( identifier, value ){ + for ( var i = 0; i < checkboxes.length; i++ ) { + var cbdId = checkboxes[i].attr("id"); + if ( cbdId === identifier ) { + checkboxes[i].property("checked", value); + break; + } + } + }; + + debugMenu.getCheckBoxValue = function ( id ){ + for ( var i = 0; i < checkboxes.length; i++ ) { + var cbdId = checkboxes[i].attr("id"); + if ( cbdId === id ) { + return checkboxes[i].property("checked"); + } + } + }; + + debugMenu.updateSettings = function (){ + d3.selectAll(".debugOption").classed("hidden", graph.options().getHideDebugFeatures()); + + var silent = true; + checkboxes.forEach(function ( checkbox ){ + checkbox.on("click")(silent); + }); + if ( graph.editorMode() === false ) { + + d3.select("#useAccuracyHelper").style("color", "#979797"); + d3.select("#useAccuracyHelper").style("pointer-events", "none"); + + // regardless the state on which useAccuracyHelper is , we are not in editing mode -> disable it + d3.select("#showDraggerObject").style("color", "#979797"); + d3.select("#showDraggerObject").style("pointer-events", "none"); + } else { + + d3.select("#useAccuracyHelper").style("color", "#2980b9"); + d3.select("#useAccuracyHelper").style("pointer-events", "auto"); + } + + }; + + return debugMenu; + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), + +/***/ 329: +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {var unescape = __webpack_require__(330); + + module.exports = function ( graph ){ + + var ontologyMenu = {}, + loadingInfo = d3.select("#loading-info"), + loadingProgress = d3.select("#loading-progress"), + + ontologyMenuTimeout, + fileToLoad, + stopTimer = false, + loadingError = false, + loadingStatusTimer, + conversion_sessionId, + cachedConversions = {}, + loadingModule, + loadOntologyFromText; + var currentLoadedOntologyName = ""; + + String.prototype.beginsWith = function ( string ){ + return (this.indexOf(string) === 0); + }; + + ontologyMenu.getLoadingFunction = function (){ + return loadOntologyFromText; + }; + + ontologyMenu.clearCachedVersion = function (){ + if ( cachedConversions[currentLoadedOntologyName] ) { + cachedConversions[currentLoadedOntologyName] = undefined; + } + }; + + + ontologyMenu.reloadCachedOntology = function (){ + ontologyMenu.clearCachedVersion(); + graph.clearGraphData(); + loadingModule.parseUrlAndLoadOntology(false); + }; + + ontologyMenu.cachedOntology = function ( ontoName ){ + currentLoadedOntologyName = ontoName; + if ( cachedConversions[ontoName] ) { + var locStr = String(location.hash); + d3.select("#reloadSvgIcon").node().disabled = false; + graph.showReloadButtonAfterLayoutOptimization(true); + if ( locStr.indexOf("#file") > -1 ) { + d3.select("#reloadSvgIcon").node().disabled = true; + d3.select("#reloadCachedOntology").node().title = "reloading original version not possible, please reload the file"; + d3.select("#reloadSvgIcon").classed("disabledReloadElement", true); + d3.select("#svgStringText").style("fill", "gray"); + d3.select("#svgStringText").classed("noselect", true); + } + else { + d3.select("#reloadCachedOntology").node().title = "generate new visualization and overwrite cached ontology"; + d3.select("#reloadSvgIcon").classed("disabledReloadElement", false); + d3.select("#svgStringText").style("fill", "black"); + d3.select("#svgStringText").classed("noselect", true); + } + } else { + graph.showReloadButtonAfterLayoutOptimization(false); + + } + return cachedConversions[ontoName]; + }; + ontologyMenu.setCachedOntology = function ( ontoName, ontoContent ){ + cachedConversions[ontoName] = ontoContent; + currentLoadedOntologyName = ontoName; + }; + + ontologyMenu.getErrorStatus = function (){ + return loadingError; + }; + + ontologyMenu.setup = function ( _loadOntologyFromText ){ + loadOntologyFromText = _loadOntologyFromText; + loadingModule = graph.options().loadingModule(); + var menuEntry = d3.select("#m_select"); + menuEntry.on("mouseover", function (){ + var searchMenu = graph.options().searchMenu(); + searchMenu.hideSearchEntries(); + }); + + setupConverterButtons(); + setupUploadButton(); + + var descriptionButton = d3.select("#error-description-button").datum({ open: false }); + descriptionButton.on("click", function ( data ){ + var errorContainer = d3.select("#error-description-container"); + var errorDetailsButton = d3.select(this); + + // toggle the state + data.open = !data.open; + var descriptionVisible = data.open; + if ( descriptionVisible ) { + errorDetailsButton.text("Hide error details"); + } else { + errorDetailsButton.text("Show error details"); + } + errorContainer.classed("hidden", !descriptionVisible); + }); + + setupUriListener(); + loadingModule.setOntologyMenu(ontologyMenu); + }; + + + function setupUriListener(){ + // reload ontology when hash parameter gets changed manually + d3.select(window).on("hashchange", function (){ + var oldURL = d3.event.oldURL, newURL = d3.event.newURL; + if ( oldURL !== newURL ) { + // don't reload when just the hash parameter gets appended + if ( newURL === oldURL + "#" ) { + return; + } + updateNavigationHrefs(); + loadingModule.parseUrlAndLoadOntology(); + } + }); + updateNavigationHrefs(); + } + + ontologyMenu.stopLoadingTimer = function (){ + stopTimer = true; + clearTimeout(loadingStatusTimer); + }; + + /** + * Quick fix: update all anchor tags that are used as buttons because a click on them + * changes the url and this will load an other ontology. + */ + function updateNavigationHrefs(){ + d3.selectAll("#menuElementContainer > li > a").attr("href", location.hash || "#"); + } + + ontologyMenu.setIriText = function ( text ){ + d3.select("#iri-converter-input").node().value = text; + d3.select("#iri-converter-button").attr("disabled", false); + d3.select("#iri-converter-form").on("submit")(); + }; + + ontologyMenu.clearDetailInformation = function (){ + var bpContainer = d3.select("#bulletPoint_container"); + var htmlCollection = bpContainer.node().children; + var numEntries = htmlCollection.length; + + for ( var i = 0; i < numEntries; i++ ) { + htmlCollection[0].remove(); + } + }; + ontologyMenu.append_message = function ( msg ){ + // forward call + append_message(msg); + }; + function append_message( msg ){ + var bpContainer = d3.select("#bulletPoint_container"); + var div = bpContainer.append("div"); + div.node().innerHTML = msg; + loadingModule.scrollDownDetails(); + } + + ontologyMenu.append_message_toLastBulletPoint = function ( msg ){ + // forward call + append_message_toLastBulletPoint(msg); + }; + + ontologyMenu.append_bulletPoint = function ( msg ){ + // forward call + append_bulletPoint(msg); + }; + function append_message_toLastBulletPoint( msg ){ + var bpContainer = d3.select("#bulletPoint_container"); + var htmlCollection = bpContainer.node().getElementsByTagName("LI"); + var lastItem = htmlCollection.length - 1; + if ( lastItem >= 0 ) { + var oldText = htmlCollection[lastItem].innerHTML; + htmlCollection[lastItem].innerHTML = oldText + msg; + } + loadingModule.scrollDownDetails(); + } + + function append_bulletPoint( msg ){ + var bp_container = d3.select("#bulletPoint_container"); + var bp = bp_container.append("li"); + bp.node().innerHTML = msg; + d3.select("#currentLoadingStep").node().innerHTML = msg; + loadingModule.scrollDownDetails(); + } + + + function setupConverterButtons(){ + var iriConverterButton = d3.select("#iri-converter-button"); + var iriConverterInput = d3.select("#iri-converter-input"); + + iriConverterInput.on("input", function (){ + keepOntologySelectionOpenShortly(); + + var inputIsEmpty = iriConverterInput.property("value") === ""; + iriConverterButton.attr("disabled", inputIsEmpty || undefined); + }).on("click", function (){ + keepOntologySelectionOpenShortly(); + }); + + d3.select("#iri-converter-form").on("submit", function (){ + var inputName = iriConverterInput.property("value"); + + // remove first spaces + var clearedName = inputName.replace(/%20/g, " "); + while ( clearedName.beginsWith(" ") ) { + clearedName = clearedName.substr(1, clearedName.length); + } + // remove ending spaces + while ( clearedName.endsWith(" ") ) { + clearedName = clearedName.substr(0, clearedName.length - 1); + } + // check if iri is actually an url for a json file (ends with .json) + // create lowercase filenames; + inputName = clearedName; + var lc_iri = inputName.toLowerCase(); + if ( lc_iri.endsWith(".json") ) { + location.hash = "url=" + inputName; + iriConverterInput.property("value", ""); + iriConverterInput.on("input")(); + } else { + location.hash = "iri=" + inputName; + iriConverterInput.property("value", ""); + iriConverterInput.on("input")(); + } + d3.event.preventDefault(); + return false; + }); + } + + function setupUploadButton(){ + var input = d3.select("#file-converter-input"), + inputLabel = d3.select("#file-converter-label"), + uploadButton = d3.select("#file-converter-button"); + + input.on("change", function (){ + var selectedFiles = input.property("files"); + if ( selectedFiles.length <= 0 ) { + inputLabel.text("Select ontology file"); + uploadButton.property("disabled", true); + } else { + inputLabel.text(selectedFiles[0].name); + fileToLoad = selectedFiles[0].name; + uploadButton.property("disabled", false); + uploadButton.node().click(); + // close menu; + graph.options().navigationMenu().hideAllMenus(); + } + }); + + uploadButton.on("click", function (){ + var selectedFile = input.property("files")[0]; + if ( !selectedFile ) { + return false; + } + var newHashParameter = "file=" + selectedFile.name; + // Trigger the reupload manually, because the iri is not changing + if ( location.hash === "#" + newHashParameter ) { + loadingModule.parseUrlAndLoadOntology(); + } else { + location.hash = newHashParameter; + } + }); + } + + function setLoadingStatusInfo( message ){ + // check if there is a owl2vowl li item; + var o2vConverterContainer = d3.select("#o2vConverterContainer"); + if ( !o2vConverterContainer.node() ) { + var bp_container = d3.select("#bulletPoint_container"); + var div = bp_container.append("div"); + o2vConverterContainer = div.append("ul"); + o2vConverterContainer.attr("id", "o2vConverterContainer"); + o2vConverterContainer.style("margin-left", "-25px"); + } + // clear o2vConverterContainer; + var htmlCollection = o2vConverterContainer.node().children; + var numEntries = htmlCollection.length; + for ( var i = 0; i < numEntries; i++ ) { + htmlCollection[0].remove(); + } + // split tokens provided by o2v messages + var tokens = message.split("* "); + var liForToken; + for ( var t = 0; t < tokens.length; t++ ) { + var tokenMessage = tokens[t]; + // create li for tokens; + if ( tokenMessage.length > 0 ) { + liForToken = o2vConverterContainer.append("li"); + liForToken.attr("type", "disc"); + liForToken.node().innerHTML = tokenMessage.replace(/\n/g, "<br>"); + } + } + if ( liForToken ) + liForToken.node().innerHTML += "<br>"; + + loadingModule.scrollDownDetails(); + } + + ontologyMenu.setLoadingStatusInfo = function ( message ){ + // forward call + setLoadingStatusInfo(message); + }; + + function getLoadingStatusOnceCallBacked( callback, parameter ){ + d3.xhr("loadingStatus?sessionId=" + conversion_sessionId, "application/text", function ( error, request ){ + if ( error ) { + console.log("ontologyMenu getLoadingStatusOnceCallBacked throws error"); + console.log("---------Error -----------"); + console.log(error); + console.log("---------Request -----------"); + console.log(request); + } + setLoadingStatusInfo(request.responseText); + callback(parameter); + }); + } + + function getLoadingStatusTimeLooped(){ + d3.xhr("loadingStatus?sessionId=" + conversion_sessionId, "application/text", function ( error, request ){ + if ( error ) { + console.log("ontologyMenu getLoadingStatusTimeLooped throws error"); + console.log("---------Error -----------"); + console.log(error); + console.log("---------Request -----------"); + console.log(request); + } + if ( stopTimer === false ) { + setLoadingStatusInfo(request.responseText); + timedLoadingStatusLogger(); + } + }); + } + + function timedLoadingStatusLogger(){ + clearTimeout(loadingStatusTimer); + if ( stopTimer === false ) { + loadingStatusTimer = setTimeout(function (){ + getLoadingStatusTimeLooped(); + }, 1000); + } + } + + function callbackUpdateLoadingMessage( msg ){ + d3.xhr("loadingStatus", "application/text", function ( error, request ){ + if ( request !== undefined ) { + setLoadingStatusInfo(request.responseText + "<br>" + msg); + } else { + append_message(msg); + } + }); + } + + ontologyMenu.setConversionID = function ( id ){ + conversion_sessionId = id; + }; + + ontologyMenu.callbackLoad_Ontology_FromIRI = function ( parameter ){ + var relativePath = parameter[0]; + var ontoName = parameter[1]; + var localThreadId = parameter[2]; + stopTimer = false; + timedLoadingStatusLogger(); + d3.xhr(relativePath, "application/json", function ( error, request ){ + var loadingSuccessful = !error; + // check if error occurred or responseText is empty + if ( (error !== null && error.status === 500) || (request && request.responseText.length === 0) ) { + clearTimeout(loadingStatusTimer); + stopTimer = true; + getLoadingStatusOnceCallBacked(callbackFromIRI_URL_ERROR, [error, request, localThreadId]); + } + var jsonText; + if ( loadingSuccessful ) { + clearTimeout(loadingStatusTimer); + stopTimer = true; + jsonText = request.responseText; + getLoadingStatusOnceCallBacked(callbackFromIRI_Success, [jsonText, ontoName, localThreadId]); + } + }); + }; + + + ontologyMenu.callbackLoad_Ontology_From_DirectInput = function ( text, parameter ){ + var input = text; + var sessionId = parameter[1]; + stopTimer = false; + timedLoadingStatusLogger(); + + var formData = new FormData(); + formData.append("input", input); + formData.append("sessionId", sessionId); + var xhr = new XMLHttpRequest(); + + xhr.open("POST", "directInput", true); + xhr.onload = function (){ + clearTimeout(loadingStatusTimer); + stopTimer = true; + getLoadingStatusOnceCallBacked(callbackForConvert, [xhr, input, sessionId]); + }; + timedLoadingStatusLogger(); + xhr.send(formData); + + }; + function callbackFromIRI_Success( parameter ){ + var local_conversionId = parameter[2]; + if ( local_conversionId !== conversion_sessionId ) { + console.log("The conversion process for file:" + parameter[1] + " has been canceled!"); + ontologyMenu.conversionFinished(local_conversionId); + return; + } + loadingModule.loadFromOWL2VOWL(parameter[0], parameter[1]); + ontologyMenu.conversionFinished(); + + } + + function callbackFromDirectInput_Success( parameter ){ + var local_conversionId = parameter[1]; + if ( local_conversionId !== conversion_sessionId ) { + console.log("The conversion process for file:" + parameter[1] + " has been canceled!"); + ontologyMenu.conversionFinished(local_conversionId); + return; + } + loadingModule.loadFromOWL2VOWL(parameter[0], "DirectInputConversionID" + local_conversionId); + ontologyMenu.conversionFinished(); + + } + + ontologyMenu.getConversionId = function (){ + return conversion_sessionId; + }; + + ontologyMenu.callbackLoad_JSON_FromURL = function ( parameter ){ + var relativePath = parameter[0]; + var ontoName = parameter[1]; + var local_conversionId = parameter[2]; + stopTimer = false; + timedLoadingStatusLogger(); + d3.xhr(relativePath, "application/json", function ( error, request ){ + var loadingSuccessful = !error; + // check if error occurred or responseText is empty + if ( (error !== null && error.status === 500) || (request && request.responseText.length === 0) ) { + clearTimeout(loadingStatusTimer); + stopTimer = true; + loadingSuccessful = false; + console.log(request); + console.log(request.responseText.length); + getLoadingStatusOnceCallBacked(callbackFromJSON_URL_ERROR, [error, request, local_conversionId]); + } + if ( loadingSuccessful ) { + clearTimeout(loadingStatusTimer); + stopTimer = true; + var jsonText = request.responseText; + getLoadingStatusOnceCallBacked(callbackFromJSON_Success, [jsonText, ontoName, local_conversionId]); + } + }); + }; + + function callbackFromJSON_Success( parameter ){ + var local_conversionId = parameter[2]; + if ( local_conversionId !== conversion_sessionId ) { + console.log("The conversion process for file:" + parameter[1] + " has been canceled!"); + return; + } + loadingModule.loadFromOWL2VOWL(parameter[0], parameter[1]); + } + + function callbackFromJSON_URL_ERROR( parameter ){ + var error = parameter[0]; + var request = parameter[1]; + var local_conversionId = parameter[2]; + if ( local_conversionId !== conversion_sessionId ) { + console.log("This thread has been canceled!!"); + ontologyMenu.conversionFinished(local_conversionId); + return; + } + callbackUpdateLoadingMessage("<br><span style='color:red'> Failed to convert the file.</span> " + + " Ontology could not be loaded.<br>Is it a valid OWL ontology? Please check with <a target=\"_blank\"" + + "href=\"http://visualdataweb.de/validator/\">OWL Validator</a>"); + + if ( error !== null && error.status === 500 ) { + append_message("<span style='color:red'>Could not find ontology at the URL</span>"); + } + if ( request && request.responseText.length === 0 ) { + append_message("<span style='color:red'>Received empty graph</span>"); + } + graph.handleOnLoadingError(); + ontologyMenu.conversionFinished(); + } + + + function callbackFromIRI_URL_ERROR( parameter ){ + var error = parameter[0]; + var request = parameter[1]; + var local_conversionId = parameter[2]; + if ( local_conversionId !== conversion_sessionId ) { + console.log("This thread has been canceled!!"); + ontologyMenu.conversionFinished(local_conversionId); + return; + } + callbackUpdateLoadingMessage("<br><span style='color:red'> Failed to convert the file.</span> " + + " Ontology could not be loaded.<br>Is it a valid OWL ontology? Please check with <a target=\"_blank\"" + + "href=\"http://visualdataweb.de/validator/\">OWL Validator</a>"); + + if ( error !== null && error.status === 500 ) { + append_message("<span style='color:red'>Could not find ontology at the URL</span>"); + } + if ( request && request.responseText.length === 0 ) { + append_message("<span style='color:red'>Received empty graph</span>"); + } + graph.handleOnLoadingError(); + ontologyMenu.conversionFinished(); + } + + function callbackFromDirectInput_ERROR( parameter ){ + + var error = parameter[0]; + var request = parameter[1]; + var local_conversionId = parameter[2]; + if ( local_conversionId !== conversion_sessionId ) { + console.log("The loading process for direct input has been canceled!"); + return; + } + // callbackUpdateLoadingMessage("<br> <span style='color:red'> Failed to convert the file.</span> "+ + // "Ontology could not be loaded.<br>Is it a valid OWL ontology? Please check with <a target=\"_blank\"" + + // "href=\"http://visualdataweb.de/validator/\">OWL Validator</a>"); + if ( error !== null && error.status === 500 ) { + append_message("<span style='color:red'>Could not convert direct input</span>"); + } + if ( request && request.responseText.length === 0 ) { + append_message("<span style='color:red'>Received empty graph</span>"); + } + + graph.handleOnLoadingError(); + ontologyMenu.conversionFinished(); + } + + ontologyMenu.callbackLoadFromOntology = function ( selectedFile, filename, local_threadId ){ + callbackLoadFromOntology(selectedFile, filename, local_threadId); + }; + + function callbackLoadFromOntology( selectedFile, filename, local_threadId ){ + stopTimer = false; + timedLoadingStatusLogger(); + + var formData = new FormData(); + formData.append("ontology", selectedFile); + formData.append("sessionId", local_threadId); + var xhr = new XMLHttpRequest(); + + xhr.open("POST", "convert", true); + xhr.onload = function (){ + clearTimeout(loadingStatusTimer); + stopTimer = true; + console.log(xhr); + getLoadingStatusOnceCallBacked(callbackForConvert, [xhr, filename, local_threadId]); + }; + timedLoadingStatusLogger(); + xhr.send(formData); + } + + function callbackForConvert( parameter ){ + var xhr = parameter[0]; + var filename = parameter[1]; + var local_threadId = parameter[2]; + if ( local_threadId !== conversion_sessionId ) { + console.log("The conversion process for file:" + filename + " has been canceled!"); + ontologyMenu.conversionFinished(local_threadId); + return; + } + if ( xhr.status === 200 ) { + loadingModule.loadFromOWL2VOWL(xhr.responseText, filename); + ontologyMenu.conversionFinished(); + } else { + var uglyJson=xhr.responseText; + var jsonResut=JSON.parse(uglyJson); + var niceJSON=JSON.stringify(jsonResut, 'null', ' '); + niceJSON= niceJSON.replace(new RegExp('\r?\n','g'), '<br />'); + callbackUpdateLoadingMessage("Failed to convert the file. " + + "<br />Server answer: <br />"+ + "<hr>"+niceJSON+ "<hr>"+ + "Ontology could not be loaded.<br />Is it a valid OWL ontology? Please check with <a target=\"_blank\"" + + "href=\"http://visualdataweb.de/validator/\">OWL Validator</a>"); + + graph.handleOnLoadingError(); + ontologyMenu.conversionFinished(); + } + } + + ontologyMenu.conversionFinished = function ( id ){ + var local_id = conversion_sessionId; + if ( id ) { + local_id = id; + } + d3.xhr("conversionDone?sessionId=" + local_id, "application/text", function ( error, request ){ + if ( error ) { + console.log("ontologyMenu conversionFinished throws error"); + console.log("---------Error -----------"); + console.log(error); + console.log("---------Request -----------"); + console.log(request); + } + }); + }; + + function keepOntologySelectionOpenShortly(){ + // Events in the menu should not be considered + var ontologySelection = d3.select("#select .toolTipMenu"); + ontologySelection.on("click", function (){ + d3.event.stopPropagation(); + }).on("keydown", function (){ + d3.event.stopPropagation(); + }); + + ontologySelection.style("display", "block"); + + function disableKeepingOpen(){ + ontologySelection.style("display", undefined); + + clearTimeout(ontologyMenuTimeout); + d3.select(window).on("click", undefined).on("keydown", undefined); + ontologySelection.on("mouseover", undefined); + } + + // Clear the timeout to handle fast calls of this function + clearTimeout(ontologyMenuTimeout); + ontologyMenuTimeout = setTimeout(function (){ + disableKeepingOpen(); + }, 3000); + + // Disable forced open selection on interaction + d3.select(window).on("click", function (){ + disableKeepingOpen(); + }).on("keydown", function (){ + disableKeepingOpen(); + }); + + ontologySelection.on("mouseover", function (){ + disableKeepingOpen(); + }); + } + + ontologyMenu.showLoadingStatus = function ( visible ){ + if ( visible === true ) { + displayLoadingIndicators(); + } + else { + hideLoadingInformations(); + } + }; + + function displayLoadingIndicators(){ + d3.select("#layoutLoadingProgressBarContainer").classed("hidden", false); + loadingInfo.classed("hidden", false); + loadingProgress.classed("hidden", false); + } + + function hideLoadingInformations(){ + loadingInfo.classed("hidden", true); + } + + return ontologyMenu; + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), + +/***/ 330: +/***/ (function(module, exports, __webpack_require__) { + + var toString = __webpack_require__(219), + unescapeHtmlChar = __webpack_require__(331); + + /** Used to match HTML entities and HTML characters. */ + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, + reHasEscapedHtml = RegExp(reEscapedHtml.source); + + /** + * The inverse of `_.escape`; this method converts the HTML entities + * `&`, `<`, `>`, `"`, and `'` in `string` to + * their corresponding characters. + * + * **Note:** No other HTML entities are unescaped. To unescape additional + * HTML entities use a third-party library like [_he_](https://mths.be/he). + * + * @static + * @memberOf _ + * @since 0.6.0 + * @category String + * @param {string} [string=''] The string to unescape. + * @returns {string} Returns the unescaped string. + * @example + * + * _.unescape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ + function unescape(string) { + string = toString(string); + return (string && reHasEscapedHtml.test(string)) + ? string.replace(reEscapedHtml, unescapeHtmlChar) + : string; + } + + module.exports = unescape; + + +/***/ }), + +/***/ 331: +/***/ (function(module, exports, __webpack_require__) { + + var basePropertyOf = __webpack_require__(332); + + /** Used to map HTML entities to characters. */ + var htmlUnescapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" + }; + + /** + * Used by `_.unescape` to convert HTML entities to characters. + * + * @private + * @param {string} chr The matched character to unescape. + * @returns {string} Returns the unescaped character. + */ + var unescapeHtmlChar = basePropertyOf(htmlUnescapes); + + module.exports = unescapeHtmlChar; + + +/***/ }), + +/***/ 332: +/***/ (function(module, exports) { + + /** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; + } + + module.exports = basePropertyOf; + + +/***/ }), + +/***/ 333: +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {/** + * Contains the logic for the pause and resume button. + * + * @param graph the associated webvowl graph + * @returns {{}} + */ + module.exports = function ( graph ){ + + var pauseMenu = {}, + pauseButton; + + + /** + * Adds the pause button to the website. + */ + pauseMenu.setup = function (){ + var menuEntry = d3.select("#pauseOption"); + menuEntry.on("mouseover", function (){ + var searchMenu = graph.options().searchMenu(); + searchMenu.hideSearchEntries(); + }); + pauseButton = d3.select("#pause-button") + .datum({ paused: false }) + .on("click", function ( d ){ + graph.paused(!d.paused); + d.paused = !d.paused; + updatePauseButton(); + pauseButton.classed("highlighted", d.paused); + }); + // Set these properties the first time manually + updatePauseButton(); + }; + + pauseMenu.setPauseValue = function ( value ){ + pauseButton.datum().paused = value; + graph.paused(value); + pauseButton.classed("highlighted", value); + updatePauseButton(); + }; + + function updatePauseButton(){ + updatePauseButtonClass(); + updatePauseButtonText(); + } + + function updatePauseButtonClass(){ + pauseButton.classed("paused", function ( d ){ + return d.paused; + }); + } + + function updatePauseButtonText(){ + if ( pauseButton.datum().paused ) { + pauseButton.text("Resume"); + } else { + pauseButton.text("Pause"); + } + } + + pauseMenu.reset = function (){ + // resuming + pauseMenu.setPauseValue(false); + }; + + + return pauseMenu; + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), + +/***/ 334: +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {/** + * Contains the logic for the reset button. + * + * @param graph the associated webvowl graph + * @returns {{}} + */ + module.exports = function ( graph ){ + + var resetMenu = {}, + options = graph.graphOptions(), + resettableModules, + untouchedOptions = webvowl.options(); + + + /** + * Adds the reset button to the website. + * @param _resettableModules modules that can be resetted + */ + resetMenu.setup = function ( _resettableModules ){ + resettableModules = _resettableModules; + d3.select("#reset-button").on("click", resetGraph); + var menuEntry = d3.select("#resetOption"); + menuEntry.on("mouseover", function (){ + var searchMenu = graph.options().searchMenu(); + searchMenu.hideSearchEntries(); + }); + }; + + function resetGraph(){ + graph.resetSearchHighlight(); + graph.options().searchMenu().clearText(); + options.classDistance(untouchedOptions.classDistance()); + options.datatypeDistance(untouchedOptions.datatypeDistance()); + options.charge(untouchedOptions.charge()); + options.gravity(untouchedOptions.gravity()); + options.linkStrength(untouchedOptions.linkStrength()); + graph.reset(); + + resettableModules.forEach(function ( module ){ + module.reset(); + }); + + graph.updateStyle(); + } + + + return resetMenu; + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), + +/***/ 335: +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {/** + * Contains the search "engine" + * + * @param graph the associated webvowl graph + * @returns {{}} + */ + module.exports = function ( graph ){ + var searchMenu = {}, + dictionary = [], + entryNames = [], + searchLineEdit, + mergedStringsList, + mergedIdList, + maxEntries = 6, + dictionaryUpdateRequired = true, + labelDictionary, + inputText, + viewStatusOfSearchEntries = false; + + var results = []; + var resultID = []; + var c_locate = d3.select("#locateSearchResult"); + var c_search = d3.select("#c_search"); + var m_search = d3.select("#m_search"); // << dropdown container; + + + String.prototype.beginsWith = function ( string ){ + return (this.indexOf(string) === 0); + }; + + searchMenu.requestDictionaryUpdate = function (){ + dictionaryUpdateRequired = true; + // clear possible pre searched entries + var htmlCollection = m_search.node().children; + var numEntries = htmlCollection.length; + + for ( var i = 0; i < numEntries; i++ ) + htmlCollection[0].remove(); + searchLineEdit.node().value = ""; + }; + + + function updateSearchDictionary(){ + labelDictionary = graph.getUpdateDictionary(); + dictionaryUpdateRequired = false; + dictionary = []; + entryNames = []; + var idList = []; + var stringList = []; + + var i; + for ( i = 0; i < labelDictionary.length; i++ ) { + var lEntry = labelDictionary[i].labelForCurrentLanguage(); + idList.push(labelDictionary[i].id()); + stringList.push(lEntry); + // add all equivalents to the search space; + if ( labelDictionary[i].equivalents && labelDictionary[i].equivalents().length > 0 ) { + var eqs = labelDictionary[i].equivalentsString(); + var eqsLabels = eqs.split(", "); + for ( var e = 0; e < eqsLabels.length; e++ ) { + idList.push(labelDictionary[i].id()); + stringList.push(eqsLabels[e]); + } + } + } + + mergedStringsList = []; + mergedIdList = []; + var indexInStringList = -1; + var currentString; + var currentObjectId; + + for ( i = 0; i < stringList.length; i++ ) { + if ( i === 0 ) { + // just add the elements + mergedStringsList.push(stringList[i]); + mergedIdList.push([]); + mergedIdList[0].push(idList[i]); + continue; + } + else { + currentString = stringList[i]; + currentObjectId = idList[i]; + indexInStringList = mergedStringsList.indexOf(currentString); + } + if ( indexInStringList === -1 ) { + mergedStringsList.push(stringList[i]); + mergedIdList.push([]); + var lastEntry = mergedIdList.length; + mergedIdList[lastEntry - 1].push(currentObjectId); + } else { + mergedIdList[indexInStringList].push(currentObjectId); + } + } + + for ( i = 0; i < mergedStringsList.length; i++ ) { + var aString = mergedStringsList[i]; + var correspondingIdList = mergedIdList[i]; + var idListResult = "[ "; + for ( var j = 0; j < correspondingIdList.length; j++ ) { + idListResult = idListResult + correspondingIdList[j].toString(); + idListResult = idListResult + ", "; + } + idListResult = idListResult.substring(0, idListResult.length - 2); + idListResult = idListResult + " ]"; + + dictionary.push(aString); + entryNames.push(aString); + } + } + + searchMenu.setup = function (){ + // clear dictionary; + dictionary = []; + searchLineEdit = d3.select("#search-input-text"); + searchLineEdit.on("input", userInput); + searchLineEdit.on("keydown", userNavigation); + searchLineEdit.on("click", toggleSearchEntryView); + searchLineEdit.on("mouseover", hoverSearchEntryView); + + c_locate.on("click", function (){ + graph.locateSearchResult(); + }); + + c_locate.on("mouseover", function (){ + searchMenu.hideSearchEntries(); + }); + + }; + + function hoverSearchEntryView(){ + updateSelectionStatusFlags(); + searchMenu.showSearchEntries(); + } + + function toggleSearchEntryView(){ + if ( viewStatusOfSearchEntries ) { + searchMenu.hideSearchEntries(); + } else { + searchMenu.showSearchEntries(); + } + } + + searchMenu.hideSearchEntries = function (){ + m_search.style("display", "none"); + viewStatusOfSearchEntries = false; + }; + + searchMenu.showSearchEntries = function (){ + m_search.style("display", "block"); + viewStatusOfSearchEntries = true; + }; + + function ValidURL( str ){ + var urlregex = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/; + return urlregex.test(str); + + } + + + function updateSelectionStatusFlags(){ + if ( searchLineEdit.node().value.length === 0 ) { + createSearchEntries(); + return; + } + handleAutoCompletion(); + } + + function userNavigation(){ + if ( dictionaryUpdateRequired ) { + updateSearchDictionary(); + } + + var htmlCollection = m_search.node().children; + var numEntries = htmlCollection.length; + + + var move = 0; + var i; + var selectedEntry = -1; + for ( i = 0; i < numEntries; i++ ) { + var atr = htmlCollection[i].getAttribute('class'); + if ( atr === "dbEntrySelected" ) { + selectedEntry = i; + } + } + if ( d3.event.keyCode === 13 ) { + if ( selectedEntry >= 0 && selectedEntry < numEntries ) { + // simulate onClick event + htmlCollection[selectedEntry].onclick(); + searchMenu.hideSearchEntries(); + } + else if ( numEntries === 0 ) { + inputText = searchLineEdit.node().value; + // check if input text ends or begins with with space + // remove first spaces + var clearedText = inputText.replace(/%20/g, " "); + while ( clearedText.beginsWith(" ") ) { + clearedText = clearedText.substr(1, clearedText.length); + } + // remove ending spaces + while ( clearedText.endsWith(" ") ) { + clearedText = clearedText.substr(0, clearedText.length - 1); + } + var iri = clearedText.replace(/ /g, "%20"); + + var valid = ValidURL(iri); + // validate url: + if ( valid ) { + var ontM = graph.options().ontologyMenu(); + ontM.setIriText(iri); + searchLineEdit.node().value = ""; + } + else { + console.log(iri + " is not a valid URL!"); + } + } + } + if ( d3.event.keyCode === 38 ) { + move = -1; + searchMenu.showSearchEntries(); + } + if ( d3.event.keyCode === 40 ) { + move = +1; + searchMenu.showSearchEntries(); + } + + var newSelection = selectedEntry + move; + if ( newSelection !== selectedEntry ) { + + if ( newSelection < 0 && selectedEntry <= 0 ) { + htmlCollection[0].setAttribute('class', "dbEntrySelected"); + } + + if ( newSelection >= numEntries ) { + htmlCollection[selectedEntry].setAttribute('class', "dbEntrySelected"); + } + if ( newSelection >= 0 && newSelection < numEntries ) { + htmlCollection[newSelection].setAttribute('class', "dbEntrySelected"); + if ( selectedEntry >= 0 ) + htmlCollection[selectedEntry].setAttribute('class', "dbEntry"); + } + } + } + + searchMenu.getSearchString = function (){ + return searchLineEdit.node().value; + }; + + + function clearSearchEntries(){ + var htmlCollection = m_search.node().children; + var numEntries = htmlCollection.length; + for ( var i = 0; i < numEntries; i++ ) { + htmlCollection[0].remove(); + } + results = []; + resultID = []; + + } + + function createSearchEntries(){ + inputText = searchLineEdit.node().value; + var i; + var lc_text = inputText.toLowerCase(); + var token; + + for ( i = 0; i < dictionary.length; i++ ) { + var tokenElement = dictionary[i]; + if ( tokenElement === undefined ) { + //@WORKAROUND : nodes with undefined labels are skipped + //@FIX: these nodes are now not added to the dictionary + continue; + } + token = dictionary[i].toLowerCase(); + if ( token.indexOf(lc_text) > -1 ) { + results.push(dictionary[i]); + resultID.push(i); + } + } + } + + function measureTextWidth( text, textStyle ){ + // Set a default value + if ( !textStyle ) { + textStyle = "text"; + } + var d = d3.select("body") + .append("div") + .attr("class", textStyle) + .attr("id", "width-test") // tag this element to identify it + .attr("style", "position:absolute; float:left; white-space:nowrap; visibility:hidden;") + .text(text), + w = document.getElementById("width-test").offsetWidth; + d.remove(); + return w; + } + + function cropText( input ){ + var maxWidth = 250; + var textStyle = "dbEntry"; + var truncatedText = input; + var textWidth; + var ratio; + var newTruncatedTextLength; + while ( true ) { + textWidth = measureTextWidth(truncatedText, textStyle); + if ( textWidth <= maxWidth ) { + break; + } + + ratio = textWidth / maxWidth; + newTruncatedTextLength = Math.floor(truncatedText.length / ratio); + + // detect if nothing changes + if ( truncatedText.length === newTruncatedTextLength ) { + break; + } + + truncatedText = truncatedText.substring(0, newTruncatedTextLength); + } + + if ( input.length > truncatedText.length ) { + return input.substring(0, truncatedText.length - 6); + } + return input; + } + + function createDropDownElements(){ + var numEntries; + var copyRes = results; + var i; + var token; + var newResults = []; + var newResultsIds = []; + + var lc_text = searchLineEdit.node().value.toLowerCase(); + // set the number of shown results to be maxEntries or less; + numEntries = results.length; + if ( numEntries > maxEntries ) + numEntries = maxEntries; + + + for ( i = 0; i < numEntries; i++ ) { + // search for the best entry + var indexElement = 1000000; + var lengthElement = 1000000; + var bestElement = -1; + for ( var j = 0; j < copyRes.length; j++ ) { + token = copyRes[j].toLowerCase(); + var tIe = token.indexOf(lc_text); + var tLe = token.length; + if ( tIe > -1 && tIe <= indexElement && tLe <= lengthElement ) { + bestElement = j; + indexElement = tIe; + lengthElement = tLe; + } + } + newResults.push(copyRes[bestElement]); + newResultsIds.push(resultID[bestElement]); + copyRes[bestElement] = ""; + } + + // add the results to the entry menu + //****************************************** + numEntries = results.length; + if ( numEntries > maxEntries ) + numEntries = maxEntries; + + var filteredOutElements = 0; + for ( i = 0; i < numEntries; i++ ) { + //add results to the dropdown menu + var testEntry = document.createElement('li'); + testEntry.setAttribute('elementID', newResultsIds[i]); + testEntry.onclick = handleClick(newResultsIds[i]); + testEntry.setAttribute('class', "dbEntry"); + + var entries = mergedIdList[newResultsIds[i]]; + var eLen = entries.length; + + var croppedText = cropText(newResults[i]); + + var el0 = entries[0]; + var allSame = true; + var nodeMap = graph.getNodeMapForSearch(); + var visible = eLen; + if ( eLen > 1 ) { + for ( var q = 0; q < eLen; q++ ) { + if ( nodeMap[entries[q]] === undefined ) { + visible--; + } + } + } + + for ( var a = 0; a < eLen; a++ ) { + if ( el0 !== entries[a] ) { + allSame = false; + } + } + if ( croppedText !== newResults[i] ) { + // append ...(#numElements) if needed + if ( eLen > 1 && allSame === false ) { + if ( eLen !== visible ) + croppedText += "... (" + visible + "/" + eLen + ")"; + } + else { + croppedText += "..."; + } + testEntry.title = newResults[i]; + } + else { + if ( eLen > 1 && allSame === false ) { + if ( eLen !== visible ) + croppedText += " (" + visible + "/" + eLen + ")"; + else + croppedText += " (" + eLen + ")"; + } + } + + var searchEntryNode = d3.select(testEntry); + if ( eLen === 1 || allSame === true ) { + if ( nodeMap[entries[0]] === undefined ) { + searchEntryNode.style("color", "#979797"); + testEntry.title = newResults[i] + "\nElement is filtered out."; + testEntry.onclick = function (){ + }; + d3.select(testEntry).style("cursor", "default"); + filteredOutElements++; + } + } else { + if ( visible < 1 ) { + searchEntryNode.style("color", "#979797"); + testEntry.onclick = function (){ + }; + testEntry.title = newResults[i] + "\nAll elements are filtered out."; + d3.select(testEntry).style("cursor", "default"); + filteredOutElements++; + } else { + searchEntryNode.style("color", ""); + } + if ( visible < eLen && visible > 1 ) { + testEntry.title = newResults[i] + "\n" + visible + "/" + eLen + " elements are visible."; + } + } + searchEntryNode.node().innerHTML = croppedText; + m_search.node().appendChild(testEntry); + } + } + + + function handleAutoCompletion(){ + /** pre condition: autoCompletion has already a valid text**/ + clearSearchEntries(); + createSearchEntries(); + createDropDownElements(); + } + + function userInput(){ + c_locate.classed("highlighted", false); + c_locate.node().title = "Nothing to locate"; + + if ( dictionaryUpdateRequired ) { + updateSearchDictionary(); + } + graph.resetSearchHighlight(); + + if ( dictionary.length === 0 ) { + console.log("dictionary is empty"); + return; + } + inputText = searchLineEdit.node().value; + + clearSearchEntries(); + if ( inputText.length !== 0 ) { + createSearchEntries(); + createDropDownElements(); + } + + searchMenu.showSearchEntries(); + } + + function handleClick( elementId ){ + + return function (){ + var id = elementId; + var correspondingIds = mergedIdList[id]; + + // autoComplete the text for the user + var autoComStr = entryNames[id]; + searchLineEdit.node().value = autoComStr; + + graph.resetSearchHighlight(); + graph.highLightNodes(correspondingIds); + c_locate.node().title = "Locate search term"; + if ( autoComStr !== inputText ) { + handleAutoCompletion(); + } + searchMenu.hideSearchEntries(); + }; + } + + searchMenu.clearText = function (){ + searchLineEdit.node().value = ""; + c_locate.classed("highlighted", false); + c_locate.node().title = "Nothing to locate"; + var htmlCollection = m_search.node().children; + var numEntries = htmlCollection.length; + for ( var i = 0; i < numEntries; i++ ) { + htmlCollection[0].remove(); + } + }; + + return searchMenu; + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), + +/***/ 336: +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {/** + * Contains the navigation "engine" + * + * @param graph the associated webvowl graph + * @returns {{}} + */ + module.exports = function ( graph ){ + var navigationMenu = {}, + scrollContainer = d3.select("#menuElementContainer").node(), + menuContainer = d3.select("#menuContainer").node(), + leftButton = d3.select("#scrollLeftButton"), + rightButton = d3.select("#scrollRightButton"), + scrolLeftValue, + scrollMax, + currentlyVisibleMenu, + currentlyHoveredEntry, + touchedElement = false, + t_scrollLeft, + t_scrollRight, + c_select = [], + m_select = []; + + + function clearAllTimers(){ + cancelAnimationFrame(t_scrollLeft); + cancelAnimationFrame(t_scrollRight); + } + + function timed_scrollRight(){ + scrolLeftValue += 5; + scrollContainer.scrollLeft = scrolLeftValue; + navigationMenu.updateScrollButtonVisibility(); + if ( scrolLeftValue >= scrollMax ) { + clearAllTimers(); + return; + } + t_scrollRight = requestAnimationFrame(timed_scrollRight); + + } + + function timed_scrollLeft(){ + scrolLeftValue -= 5; + scrollContainer.scrollLeft = scrolLeftValue; + navigationMenu.updateScrollButtonVisibility(); + if ( scrolLeftValue <= 0 ) { + clearAllTimers(); + return; + } + t_scrollRight = requestAnimationFrame(timed_scrollLeft); + } + + // collect all menu entries and stuff; + function setupControlsAndMenus(){ + // HEURISTIC : to match the menus and their controllers we remove the first 2 letters and match + c_select = []; + m_select = []; + + var c_temp = []; + var m_temp = []; + var i; + var controlElements = scrollContainer.children; + var numEntries = controlElements.length; + + for ( i = 0; i < numEntries; i++ ) { + c_temp.push(controlElements[i].id.slice(2)); + } + + var menuElements = menuContainer.children; + numEntries = menuElements.length; + for ( i = 0; i < numEntries; i++ ) { + m_temp.push(menuElements[i].id.slice(2)); + } + + numEntries = controlElements.length; + for ( i = 0; i < numEntries; i++ ) { + c_select[i] = "c_" + c_temp[i]; + if ( m_temp.indexOf(c_temp[i]) > -1 ) { + m_select[i] = "m_" + c_temp[i]; + } else { + m_select[i] = undefined; + } + // create custom behavior for click, touch, and hover + d3.select("#" + c_select[i]).on("mouseover", menuElementOnHovered); + d3.select("#" + c_select[i]).on("mouseout", menuElementOutHovered); + + d3.select("#" + c_select[i]).on("click", menuElementClicked); + d3.select("#" + c_select[i]).on("touchstart", menuElementTouched); + + } + + // connect to mouseWheel + d3.select("#menuElementContainer").on("wheel", function (){ + var wheelEvent = d3.event; + var offset; + if ( wheelEvent.deltaY < 0 ) offset = 20; + if ( wheelEvent.deltaY > 0 ) offset = -20; + scrollContainer.scrollLeft += offset; + navigationMenu.hideAllMenus(); + navigationMenu.updateScrollButtonVisibility(); + }); + + // connect scrollIndicator Buttons; + d3.select("#scrollRightButton").on("mousedown", function (){ + scrolLeftValue = scrollContainer.scrollLeft; + navigationMenu.hideAllMenus(); + t_scrollRight = requestAnimationFrame(timed_scrollRight); + + }).on("touchstart", function (){ + scrolLeftValue = scrollContainer.scrollLeft; + navigationMenu.hideAllMenus(); + t_scrollRight = requestAnimationFrame(timed_scrollRight); + }).on("mouseup", clearAllTimers) + .on("touchend", clearAllTimers) + .on("touchcancel", clearAllTimers); + + d3.select("#scrollLeftButton").on("mousedown", function (){ + scrolLeftValue = scrollContainer.scrollLeft; + navigationMenu.hideAllMenus(); + t_scrollLeft = requestAnimationFrame(timed_scrollLeft); + }).on("touchstart", function (){ + scrolLeftValue = scrollContainer.scrollLeft; + navigationMenu.hideAllMenus(); + t_scrollLeft = requestAnimationFrame(timed_scrollLeft); + }).on("mouseup", clearAllTimers) + .on("touchend", clearAllTimers) + .on("touchcancel", clearAllTimers); + + // connect the scroll functionality; + d3.select("#menuElementContainer").on("scroll", function (){ + navigationMenu.updateScrollButtonVisibility(); + navigationMenu.hideAllMenus(); + }); + } + + function menuElementOnHovered(){ + navigationMenu.hideAllMenus(); + if ( touchedElement ) { + return; + } + showSingleMenu(this.id); + } + + function menuElementOutHovered(){ + hoveroutedControMenu(this.id); + } + + function menuElementClicked(){ + var m_element = m_select[c_select.indexOf(this.id)]; + if ( m_element ) { + var menuElement = d3.select("#" + m_element); + if ( menuElement ) { + if ( menuElement.style("display") === "block" ) { + menuElement.style("display", "none");// hide it + } else { + showSingleMenu(this.id); + } + } + } + } + + function menuElementTouched(){ + // it sets a flag that we have touched it, + // since d3. propagates the event for touch as hover and then click, we block the hover event + touchedElement = true; + } + + + function hoveroutedControMenu( controllerID ){ + currentlyHoveredEntry = d3.select("#" + controllerID); + if ( controllerID !== "c_search" ) { + d3.select("#" + controllerID).select("path").style("stroke-width", "0"); + d3.select("#" + controllerID).select("path").style("fill", "#fff"); + } + + } + + function showSingleMenu( controllerID ){ + currentlyHoveredEntry = d3.select("#" + controllerID).node(); + // get the corresponding menu element for this controller + var m_element = m_select[c_select.indexOf(controllerID)]; + if ( m_element ) { + if ( controllerID !== "c_search" ) { + + d3.select("#" + controllerID).select("path").style("stroke-width", "0"); + d3.select("#" + controllerID).select("path").style("fill", "#bdc3c7"); + } + // show it if we have a menu + currentlyVisibleMenu = d3.select("#" + m_element); + currentlyVisibleMenu.style("display", "block"); + if ( m_element === "m_export" ) + graph.options().exportMenu().exportAsUrl(); + updateMenuPosition(); + } + } + + function updateMenuPosition(){ + if ( currentlyHoveredEntry ) { + var leftOffset = currentlyHoveredEntry.offsetLeft; + var scrollOffset = scrollContainer.scrollLeft; + var totalOffset = leftOffset - scrollOffset; + var finalOffset = Math.max(0, totalOffset); + var fullContainer_width = scrollContainer.getBoundingClientRect().width; + var elementWidth = currentlyVisibleMenu.node().getBoundingClientRect().width; + // make priority > first check if we are right + if ( finalOffset + elementWidth > fullContainer_width ) { + finalOffset = fullContainer_width - elementWidth; + } + // fix priority; + finalOffset = Math.max(0, finalOffset); + currentlyVisibleMenu.style("left", finalOffset + "px"); + + // // check if outside the viewport + // var menuWidth=currentlyHoveredEntry.getBoundingClientRect().width; + // var bt_width=36; + // if (totalOffset+menuWidth<bt_width || totalOffset+bt_width>fullContainer_width){ + // navigationMenu.hideAllMenus(); + // currentlyHoveredEntry=undefined; + // } + } + } + + navigationMenu.hideAllMenus = function (){ + d3.selectAll(".toolTipMenu").style("display", "none"); // hiding all menus + }; + + navigationMenu.updateScrollButtonVisibility = function (){ + scrollMax = scrollContainer.scrollWidth - scrollContainer.clientWidth - 2; + if ( scrollContainer.scrollLeft === 0 ) { + leftButton.classed("hidden", true); + } else { + leftButton.classed("hidden", false); + } + + if ( scrollContainer.scrollLeft > scrollMax ) { + rightButton.classed("hidden", true); + } else { + rightButton.classed("hidden", false); + } + + }; + + navigationMenu.setup = function (){ + setupControlsAndMenus(); + // make sure that the menu elements follow their controller and also their restrictions + // some hovering behavior -- lets the menu disappear when hovered in graph or sidebar; + d3.select("#graph").on("mouseover", function (){ + navigationMenu.hideAllMenus(); + }); + d3.select("#generalDetails").on("mouseover", function (){ + navigationMenu.hideAllMenus(); + }); + }; + + return navigationMenu; + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), + +/***/ 337: +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {/** The zoom Slider **/ + module.exports = function ( graph ){ + var zoomSlider = {}; + var minMag = graph.options().minMagnification(), + maxMag = graph.options().maxMagnification(), + defZoom, + t_zoomOut, + t_zoomIn, + zoomValue, + showSlider = true, + w = graph.options().width(), + h = graph.options().height(), + slider; + + defZoom = Math.min(w, h) / 1000; + + function clearAllTimers(){ + cancelAnimationFrame(t_zoomOut); + cancelAnimationFrame(t_zoomIn); + } + + function timed_zoomOut(){ + zoomValue = 0.98 * zoomValue; + // fail saves + if ( zoomValue < minMag ) { + zoomValue = minMag; + } + graph.setSliderZoom(zoomValue); + t_zoomOut = requestAnimationFrame(timed_zoomOut); + } + + function timed_zoomIn(){ + zoomValue = 1.02 * zoomValue; + // fail saves + if ( zoomValue > maxMag ) { + zoomValue = maxMag; + } + graph.setSliderZoom(zoomValue); + t_zoomIn = requestAnimationFrame(timed_zoomIn); + } + + zoomSlider.setup = function (){ + slider = d3.select("#zoomSliderParagraph").append("input") + .datum({}) + .attr("id", "zoomSliderElement") + .attr("type", "range") + .attr("value", defZoom) + .attr("min", minMag) + .attr("max", maxMag) + .attr("step", (maxMag - minMag) / 40) + .attr("title", "zoom factor") + .on("input", function (){ + zoomSlider.zooming(); + }); + + d3.select("#zoomOutButton").on("mousedown", function (){ + graph.options().navigationMenu().hideAllMenus(); + zoomValue = graph.scaleFactor(); + t_zoomOut = requestAnimationFrame(timed_zoomOut); + }) + .on("touchstart", function (){ + graph.options().navigationMenu().hideAllMenus(); + zoomValue = graph.scaleFactor(); + t_zoomOut = requestAnimationFrame(timed_zoomOut); + }) + .on("mouseup", clearAllTimers) + .on("touchend", clearAllTimers) + .on("touchcancel", clearAllTimers) + .attr("title", "zoom out"); + + d3.select("#zoomInButton").on("mousedown", function (){ + graph.options().navigationMenu().hideAllMenus(); + zoomValue = graph.scaleFactor(); + t_zoomIn = requestAnimationFrame(timed_zoomIn); + }) + .on("touchstart", function (){ + graph.options().navigationMenu().hideAllMenus(); + zoomValue = graph.scaleFactor(); + t_zoomIn = requestAnimationFrame(timed_zoomIn); + }) + .on("mouseup", clearAllTimers) + .on("touchend", clearAllTimers) + .on("touchcancel", clearAllTimers) + .attr("title", "zoom in"); + + d3.select("#centerGraphButton").on("click", function (){ + graph.options().navigationMenu().hideAllMenus(); + graph.forceRelocationEvent(); + }).attr("title", "center graph"); + + }; + + zoomSlider.showSlider = function ( val ){ + if ( !arguments.length ) return showSlider; + d3.select("#zoomSlider").classed("hidden", !val); + showSlider = val; + }; + + zoomSlider.zooming = function (){ + graph.options().navigationMenu().hideAllMenus(); + var zoomValue = slider.property("value"); + slider.attr("value", zoomValue); + graph.setSliderZoom(zoomValue); + }; + + zoomSlider.updateZoomSliderValue = function ( val ){ + if ( slider ) { + slider.attr("value", val); + slider.property("value", val); + } + }; + + return zoomSlider; + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), + +/***/ 338: +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {/** + * Contains the logic for the sidebar. + * @param graph the graph that belongs to these controls + * @returns {{}} + */ + module.exports = function ( graph ){ + + var sidebar = {}, + languageTools = webvowl.util.languageTools(), + elementTools = webvowl.util.elementTools(), + // Required for reloading when the language changes + ontologyInfo, + visibleSidebar = 1, + lastSelectedElement, + + detailArea = d3.select("#detailsArea"), + graphArea = d3.select("#canvasArea"), + menuArea = d3.select("#swipeBarContainer"), + collapseButton = d3.select("#sidebarExpandButton"); + + /** + * Setup the menu bar. + */ + + + function setupCollapsing(){ + // adapted version of this example: http://www.normansblog.de/simple-jquery-accordion/ + function collapseContainers( containers ){ + containers.classed("hidden", true); + } + + function expandContainers( containers ){ + containers.classed("hidden", false); + } + + var triggers = d3.selectAll(".accordion-trigger"); + + // Collapse all inactive triggers on startup + collapseContainers(d3.selectAll(".accordion-trigger:not(.accordion-trigger-active) + div")); + + triggers.on("click", function (){ + var selectedTrigger = d3.select(this), + activeTriggers = d3.selectAll(".accordion-trigger-active"); + + if ( selectedTrigger.classed("accordion-trigger-active") ) { + // Collapse the active (which is also the selected) trigger + collapseContainers(d3.select(selectedTrigger.node().nextElementSibling)); + selectedTrigger.classed("accordion-trigger-active", false); + } else { + // Collapse the other trigger ... + collapseContainers(d3.selectAll(".accordion-trigger-active + div")); + activeTriggers.classed("accordion-trigger-active", false); + // ... and expand the selected one + expandContainers(d3.select(selectedTrigger.node().nextElementSibling)); + selectedTrigger.classed("accordion-trigger-active", true); + } + }); + } + + sidebar.clearOntologyInformation = function (){ + + d3.select("#title").text("No title available"); + d3.select("#about").attr("href", "#").attr("target", "_blank").text("not given"); + d3.select("#version").text("--"); + d3.select("#authors").text("--"); + d3.select("#description").text("No description available."); + var container = d3.select("#ontology-metadata"); + container.selectAll("*").remove(); + d3.select("#classCount") + .text("0"); + d3.select("#objectPropertyCount") + .text("0"); + d3.select("#datatypePropertyCount") + .text("0"); + d3.select("#individualCount") + .text("0"); + d3.select("#nodeCount") + .text("0"); + d3.select("#edgeCount") + .text("0"); + + // clear selectedNode info + var isTriggerActive = d3.select("#selection-details-trigger").classed("accordion-trigger-active"); + if ( isTriggerActive ) { + // close accordion + d3.select("#selection-details-trigger").node().click(); + } + showSelectionAdvice(); + + }; + + /** + * Updates the information of the passed ontology. + * @param data the graph data + * @param statistics the statistics module + */ + sidebar.updateOntologyInformation = function ( data, statistics ){ + data = data || {}; + ontologyInfo = data.header || {}; + + updateGraphInformation(); + displayGraphStatistics(undefined, statistics); + displayMetadata(ontologyInfo.other); + + // Reset the sidebar selection + sidebar.updateSelectionInformation(undefined); + + setLanguages(ontologyInfo.languages); + }; + + function setLanguages( languages ){ + languages = languages || []; + + // Put the default and unset label on top of the selection labels + languages.sort(function ( a, b ){ + if ( a === webvowl.util.constants().LANG_IRIBASED ) { + return -1; + } else if ( b === webvowl.util.constants().LANG_IRIBASED ) { + return 1; + } + if ( a === webvowl.util.constants().LANG_UNDEFINED ) { + return -1; + } else if ( b === webvowl.util.constants().LANG_UNDEFINED ) { + return 1; + } + return a.localeCompare(b); + }); + + var languageSelection = d3.select("#language") + .on("change", function (){ + graph.language(d3.event.target.value); + updateGraphInformation(); + sidebar.updateSelectionInformation(lastSelectedElement); + }); + + languageSelection.selectAll("option").remove(); + languageSelection.selectAll("option") + .data(languages) + .enter().append("option") + .attr("value", function ( d ){ + return d; + }) + .text(function ( d ){ + return d; + }); + + if ( !trySelectDefaultLanguage(languageSelection, languages, "en") ) { + if ( !trySelectDefaultLanguage(languageSelection, languages, webvowl.util.constants().LANG_UNDEFINED) ) { + trySelectDefaultLanguage(languageSelection, languages, webvowl.util.constants().LANG_IRIBASED); + } + } + } + + function trySelectDefaultLanguage( selection, languages, language ){ + var langIndex = languages.indexOf(language); + if ( langIndex >= 0 ) { + selection.property("selectedIndex", langIndex); + graph.language(language); + return true; + } + + return false; + } + + function updateGraphInformation(){ + var title = languageTools.textInLanguage(ontologyInfo.title, graph.language()); + d3.select("#title").text(title || "No title available"); + d3.select("#about").attr("href", ontologyInfo.iri).attr("target", "_blank").text(ontologyInfo.iri); + d3.select("#version").text(ontologyInfo.version || "--"); + var authors = ontologyInfo.author; + if ( typeof authors === "string" ) { + // Stay compatible with author info as strings after change in january 2015 + d3.select("#authors").text(authors); + } else if ( authors instanceof Array ) { + d3.select("#authors").text(authors.join(", ")); + } else { + d3.select("#authors").text("--"); + } + + var description = languageTools.textInLanguage(ontologyInfo.description, graph.language()); + d3.select("#description").text(description || "No description available."); + } + + function displayGraphStatistics( deliveredMetrics, statistics ){ + // Metrics are optional and may be undefined + deliveredMetrics = deliveredMetrics || {}; + + d3.select("#classCount") + .text(deliveredMetrics.classCount || statistics.classCount()); + d3.select("#objectPropertyCount") + .text(deliveredMetrics.objectPropertyCount || statistics.objectPropertyCount()); + d3.select("#datatypePropertyCount") + .text(deliveredMetrics.datatypePropertyCount || statistics.datatypePropertyCount()); + d3.select("#individualCount") + .text(deliveredMetrics.totalIndividualCount || statistics.totalIndividualCount()); + d3.select("#nodeCount") + .text(statistics.nodeCount()); + d3.select("#edgeCount") + .text(statistics.edgeCount()); + } + + function displayMetadata( metadata ){ + var container = d3.select("#ontology-metadata"); + container.selectAll("*").remove(); + + listAnnotations(container, metadata); + + if ( container.selectAll(".annotation").size() <= 0 ) { + container.append("p").text("No annotations available."); + } + } + + function listAnnotations( container, annotationObject ){ + annotationObject = annotationObject || {}; //todo + + // Collect the annotations in an array for simpler processing + var annotations = []; + for ( var annotation in annotationObject ) { + if ( annotationObject.hasOwnProperty(annotation) ) { + annotations.push(annotationObject[annotation][0]); + } + } + + container.selectAll(".annotation").remove(); + container.selectAll(".annotation").data(annotations).enter().append("p") + .classed("annotation", true) + .classed("statisticDetails", true) + .text(function ( d ){ + return d.identifier + ":"; + }) + .append("span") + .each(function ( d ){ + appendIriLabel(d3.select(this), d.value, d.type === "iri" ? d.value : undefined); + }); + } + + /** + * Update the information of the selected node. + * @param selectedElement the selection or null if nothing is selected + */ + sidebar.updateSelectionInformation = function ( selectedElement ){ + lastSelectedElement = selectedElement; + + // Click event was prevented when dragging + if ( d3.event && d3.event.defaultPrevented ) { + return; + } + + var isTriggerActive = d3.select("#selection-details-trigger").classed("accordion-trigger-active"); + if ( selectedElement && !isTriggerActive ) { + d3.select("#selection-details-trigger").node().click(); + } else if ( !selectedElement && isTriggerActive ) { + showSelectionAdvice(); + return; + } + + if ( elementTools.isProperty(selectedElement) ) { + displayPropertyInformation(selectedElement); + } else if ( elementTools.isNode(selectedElement) ) { + displayNodeInformation(selectedElement); + } + }; + + function showSelectionAdvice(){ + setSelectionInformationVisibility(false, false, true); + } + + function setSelectionInformationVisibility( showClasses, showProperties, showAdvice ){ + d3.select("#classSelectionInformation").classed("hidden", !showClasses); + d3.select("#propertySelectionInformation").classed("hidden", !showProperties); + d3.select("#noSelectionInformation").classed("hidden", !showAdvice); + } + + function displayPropertyInformation( property ){ + showPropertyInformations(); + + setIriLabel(d3.select("#propname"), property.labelForCurrentLanguage(), property.iri()); + d3.select("#typeProp").text(property.type()); + + if ( property.inverse() !== undefined ) { + d3.select("#inverse").classed("hidden", false); + setIriLabel(d3.select("#inverse span"), property.inverse().labelForCurrentLanguage(), property.inverse().iri()); + } else { + d3.select("#inverse").classed("hidden", true); + } + + var equivalentIriSpan = d3.select("#propEquivUri"); + listNodeArray(equivalentIriSpan, property.equivalents()); + + listNodeArray(d3.select("#subproperties"), property.subproperties()); + listNodeArray(d3.select("#superproperties"), property.superproperties()); + + if ( property.minCardinality() !== undefined ) { + d3.select("#infoCardinality").classed("hidden", true); + d3.select("#minCardinality").classed("hidden", false); + d3.select("#minCardinality span").text(property.minCardinality()); + d3.select("#maxCardinality").classed("hidden", false); + + if ( property.maxCardinality() !== undefined ) { + d3.select("#maxCardinality span").text(property.maxCardinality()); + } else { + d3.select("#maxCardinality span").text("*"); + } + + } else if ( property.cardinality() !== undefined ) { + d3.select("#minCardinality").classed("hidden", true); + d3.select("#maxCardinality").classed("hidden", true); + d3.select("#infoCardinality").classed("hidden", false); + d3.select("#infoCardinality span").text(property.cardinality()); + } else { + d3.select("#infoCardinality").classed("hidden", true); + d3.select("#minCardinality").classed("hidden", true); + d3.select("#maxCardinality").classed("hidden", true); + } + + setIriLabel(d3.select("#domain"), property.domain().labelForCurrentLanguage(), property.domain().iri()); + setIriLabel(d3.select("#range"), property.range().labelForCurrentLanguage(), property.range().iri()); + + displayAttributes(property.attributes(), d3.select("#propAttributes")); + + setTextAndVisibility(d3.select("#propDescription"), property.descriptionForCurrentLanguage()); + setTextAndVisibility(d3.select("#propComment"), property.commentForCurrentLanguage()); + + listAnnotations(d3.select("#propertySelectionInformation"), property.annotations()); + } + + function showPropertyInformations(){ + setSelectionInformationVisibility(false, true, false); + } + + function setIriLabel( element, name, iri ){ + var parent = d3.select(element.node().parentNode); + + if ( name ) { + element.selectAll("*").remove(); + appendIriLabel(element, name, iri); + parent.classed("hidden", false); + } else { + parent.classed("hidden", true); + } + } + + function appendIriLabel( element, name, iri ){ + var tag; + + if ( iri ) { + tag = element.append("a") + .attr("href", iri) + .attr("title", iri) + .attr("target", "_blank"); + } else { + tag = element.append("span"); + } + tag.text(name); + } + + function displayAttributes( attributes, textSpan ){ + var spanParent = d3.select(textSpan.node().parentNode); + + if ( attributes && attributes.length > 0 ) { + // Remove redundant redundant attributes for sidebar + removeElementFromArray("object", attributes); + removeElementFromArray("datatype", attributes); + removeElementFromArray("rdf", attributes); + } + + if ( attributes && attributes.length > 0 ) { + textSpan.text(attributes.join(", ")); + + spanParent.classed("hidden", false); + } else { + spanParent.classed("hidden", true); + } + } + + function removeElementFromArray( element, array ){ + var index = array.indexOf(element); + if ( index > -1 ) { + array.splice(index, 1); + } + } + + function displayNodeInformation( node ){ + showClassInformations(); + + setIriLabel(d3.select("#name"), node.labelForCurrentLanguage(), node.iri()); + + /* Equivalent stuff. */ + var equivalentIriSpan = d3.select("#classEquivUri"); + listNodeArray(equivalentIriSpan, node.equivalents()); + + d3.select("#typeNode").text(node.type()); + listNodeArray(d3.select("#individuals"), node.individuals()); + + /* Disjoint stuff. */ + var disjointNodes = d3.select("#disjointNodes"); + var disjointNodesParent = d3.select(disjointNodes.node().parentNode); + + if ( node.disjointWith() !== undefined ) { + disjointNodes.selectAll("*").remove(); + + node.disjointWith().forEach(function ( element, index ){ + if ( index > 0 ) { + disjointNodes.append("span").text(", "); + } + appendIriLabel(disjointNodes, element.labelForCurrentLanguage(), element.iri()); + }); + + disjointNodesParent.classed("hidden", false); + } else { + disjointNodesParent.classed("hidden", true); + } + + displayAttributes(node.attributes(), d3.select("#classAttributes")); + + setTextAndVisibility(d3.select("#nodeDescription"), node.descriptionForCurrentLanguage()); + setTextAndVisibility(d3.select("#nodeComment"), node.commentForCurrentLanguage()); + + listAnnotations(d3.select("#classSelectionInformation"), node.annotations()); + } + + function showClassInformations(){ + setSelectionInformationVisibility(true, false, false); + } + + function listNodeArray( textSpan, nodes ){ + var spanParent = d3.select(textSpan.node().parentNode); + + if ( nodes && nodes.length ) { + textSpan.selectAll("*").remove(); + nodes.forEach(function ( element, index ){ + if ( index > 0 ) { + textSpan.append("span").text(", "); + } + appendIriLabel(textSpan, element.labelForCurrentLanguage(), element.iri()); + }); + + spanParent.classed("hidden", false); + } else { + spanParent.classed("hidden", true); + } + } + + function setTextAndVisibility( label, value ){ + var parentNode = d3.select(label.node().parentNode); + var hasValue = !!value; + if ( value ) { + label.text(value); + } + parentNode.classed("hidden", !hasValue); + } + + /** Collapsible Sidebar functions; **/ + + sidebar.showSidebar = function ( val, init ){ + // make val to bool + if ( val === 1 ) { + visibleSidebar = true; + collapseButton.node().innerHTML = ">"; + detailArea.classed("hidden", true); + if ( init === true ) { + detailArea.classed("hidden", !visibleSidebar); + graphArea.style("width", "78%"); + graphArea.style("-webkit-animation-name", "none"); + + menuArea.style("width", "78%"); + menuArea.style("-webkit-animation-name", "none"); + + d3.select("#WarningErrorMessagesContainer").style("width", "78%"); + d3.select("#WarningErrorMessagesContainer").style("-webkit-animation-name", "none"); + } else { + graphArea.style("width", "78%"); + graphArea.style("-webkit-animation-name", "sbCollapseAnimation"); + graphArea.style("-webkit-animation-duration", "0.5s"); + + menuArea.style("width", "78%"); + menuArea.style("-webkit-animation-name", "sbCollapseAnimation"); + menuArea.style("-webkit-animation-duration", "0.5s"); + + d3.select("#WarningErrorMessagesContainer").style("width", "78%"); + d3.select("#WarningErrorMessagesContainer").style("-webkit-animation-name", "warn_ExpandRightBarAnimation"); + d3.select("#WarningErrorMessagesContainer").style("-webkit-animation-duration", "0.5s"); + } + graph.options().width(window.innerWidth - (window.innerWidth * 0.22)); + graph.options().navigationMenu().updateScrollButtonVisibility(); + } + if ( val === 0 ) { + visibleSidebar = false; + detailArea.classed("hidden", true); + + collapseButton.node().innerHTML = "<"; + // adjust the layout + if ( init === true ) { + graphArea.style("width", "100%"); + graphArea.style("-webkit-animation-name", "none"); + + menuArea.style("width", "100%"); + menuArea.style("-webkit-animation-name", "none"); + + d3.select("#WarningErrorMessagesContainer").style("width", "100%"); + d3.select("#WarningErrorMessagesContainer").style("-webkit-animation-name", "none"); + } else { + graphArea.style("width", "100%"); + graphArea.style("-webkit-animation-name", "sbExpandAnimation"); + graphArea.style("-webkit-animation-duration", "0.5s"); + + menuArea.style("width", "100%"); + menuArea.style("-webkit-animation-name", "sbExpandAnimation"); + menuArea.style("-webkit-animation-duration", "0.5s"); + + d3.select("#WarningErrorMessagesContainer").style("width", "100%"); + d3.select("#WarningErrorMessagesContainer").style("-webkit-animation-name", "warn_CollapseRightBarAnimation"); + d3.select("#WarningErrorMessagesContainer").style("-webkit-animation-duration", "0.5s"); + + } + graph.options().width(window.innerWidth); + graph.updateCanvasContainerSize(); + graph.options().navigationMenu().updateScrollButtonVisibility(); + } + }; + + sidebar.isSidebarVisible = function (){ + return visibleSidebar; + }; + + sidebar.updateSideBarVis = function ( init ){ + var vis = sidebar.getSidebarVisibility(); + sidebar.showSidebar(parseInt(vis), init); + }; + + sidebar.getSidebarVisibility = function (){ + var isHidden = detailArea.classed("hidden"); + if ( isHidden === false ) return String(1); + if ( isHidden === true ) return String(0); + }; + + sidebar.initSideBarAnimation = function (){ + graphArea.node().addEventListener("animationend", function (){ + detailArea.classed("hidden", !visibleSidebar); + graph.updateCanvasContainerSize(); + graph.options().navigationMenu().updateScrollButtonVisibility(); + }); + }; + + sidebar.setup = function (){ + setupCollapsing(); + sidebar.initSideBarAnimation(); + + collapseButton.on("click", function (){ + graph.options().navigationMenu().hideAllMenus(); + var settingValue = parseInt(sidebar.getSidebarVisibility()); + if ( settingValue === 1 ) sidebar.showSidebar(0); + else sidebar.showSidebar(1); + }); + }; + + + sidebar.updateShowedInformation = function (){ + var editMode = graph.editorMode(); + d3.select("#generalDetails").classed("hidden", editMode); + d3.select("#generalDetailsEdit").classed("hidden", !editMode); + + // store the meta information in graph.options() + + // todo: update edit meta info + graph.options().editSidebar().updateGeneralOntologyInfo(); + + // todo: update showed meta info; + graph.options().sidebar().updateGeneralOntologyInfo(); + + }; + + sidebar.updateGeneralOntologyInfo = function (){ + // get it from graph.options + var generalMetaObj = graph.options().getGeneralMetaObject(); + var preferredLanguage = graph && graph.language ? graph.language() : null; + if ( generalMetaObj.hasOwnProperty("title") ) { + // title has language to it -.- + if ( typeof generalMetaObj.title === "object" ) { + d3.select("#title").node().value = languageTools.textInLanguage(generalMetaObj.title, preferredLanguage); + } else { + d3.select("#title").node().innerHTML = generalMetaObj.title; + } + + } + if ( generalMetaObj.hasOwnProperty("iri") ) d3.select("#about").node().innerHTML = generalMetaObj.iri; + if ( generalMetaObj.hasOwnProperty("iri") ) d3.select("#about").node().href = generalMetaObj.iri; + if ( generalMetaObj.hasOwnProperty("version") ) d3.select("#version").node().innerHTML = generalMetaObj.version; + if ( generalMetaObj.hasOwnProperty("author") ) d3.select("#authors").node().innerHTML = generalMetaObj.author; + // this could also be an object >> + if ( generalMetaObj.hasOwnProperty("description") ) { + if ( typeof generalMetaObj.description === "object" ) { + d3.select("#description").node().innerHTML = languageTools.textInLanguage(generalMetaObj.description, preferredLanguage); + } + else { + d3.select("#description").node().innerHTML = generalMetaObj.description; + } + } + }; + + + return sidebar; + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), + +/***/ 339: +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {/** + * Contains the logic for the sidebar. + * @param graph the graph that belongs to these controls + * @returns {{}} + */ + module.exports = function ( graph ){ + + var leftSidebar = {}, + languageTools = webvowl.util.languageTools(), + elementTools = webvowl.util.elementTools(); + var collapseButton = d3.select("#leftSideBarCollapseButton"); + var visibleSidebar = 0; + var backupVisibility = 0; + var sideBarContent = d3.select("#leftSideBarContent"); + var sideBarContainer = d3.select("#containerForLeftSideBar"); + var defaultClassSelectionContainers = []; + var defaultDatatypeSelectionContainers = []; + var defaultPropertySelectionContainers = []; + + leftSidebar.setup = function (){ + setupCollapsing(); + leftSidebar.initSideBarAnimation(); + + collapseButton.on("click", function (){ + graph.options().navigationMenu().hideAllMenus(); + var settingValue = parseInt(leftSidebar.getSidebarVisibility()); + if ( settingValue === 0 ) leftSidebar.showSidebar(1); + else leftSidebar.showSidebar(0); + backupVisibility = settingValue; + }); + + setupSelectionContainers(); + d3.select("#WarningErrorMessages").node().addEventListener("animationend", function (){ + d3.select("#WarningErrorMessages").style("-webkit-animation-name", "none"); + }); + + }; + + leftSidebar.hideCollapseButton = function ( val ){ + sideBarContainer.classed("hidden", val); + }; + + + function unselectAllElements( container ){ + for ( var i = 0; i < container.length; i++ ) + container[i].classed("defaultSelected", false); + } + + function selectThisDefaultElement( element ){ + d3.select(element).classed("defaultSelected", true); + } + + function updateDefaultNameInAccordion( element, identifier ){ + var elementDescription = ""; + if ( identifier === "defaultClass" ) elementDescription = "Class: "; + if ( identifier === "defaultDatatype" ) elementDescription = "Datatype: "; + if ( identifier === "defaultProperty" ) elementDescription = "Property: "; + + d3.select("#" + identifier).node().innerHTML = elementDescription + element.innerHTML; + d3.select("#" + identifier).node().title = element.innerHTML; + } + + function classSelectorFunction(){ + unselectAllElements(defaultClassSelectionContainers); + selectThisDefaultElement(this); + updateDefaultNameInAccordion(this, "defaultClass"); + } + + function datatypeSelectorFunction(){ + unselectAllElements(defaultDatatypeSelectionContainers); + selectThisDefaultElement(this); + updateDefaultNameInAccordion(this, "defaultDatatype"); + } + + function propertySelectorFunction(){ + unselectAllElements(defaultPropertySelectionContainers); + selectThisDefaultElement(this); + updateDefaultNameInAccordion(this, "defaultProperty"); + } + + + function setupSelectionContainers(){ + var classContainer = d3.select("#classContainer"); + var datatypeContainer = d3.select("#datatypeContainer"); + var propertyContainer = d3.select("#propertyContainer"); + // create the supported elements + + var defaultClass = "owl:Class"; + var defaultDatatype = "rdfs:Literal"; + var defaultProperty = "owl:objectProperty"; + + var supportedClasses = graph.options().supportedClasses(); + var supportedDatatypes = graph.options().supportedDatatypes(); + var supportedProperties = graph.options().supportedProperties(); + var i; + + for ( i = 0; i < supportedClasses.length; i++ ) { + var aClassSelectionContainer; + aClassSelectionContainer = classContainer.append("div"); + aClassSelectionContainer.classed("containerForDefaultSelection", true); + aClassSelectionContainer.classed("noselect", true); + aClassSelectionContainer.node().id = "selectedClass" + supportedClasses[i]; + aClassSelectionContainer.node().innerHTML = supportedClasses[i]; + + if ( supportedClasses[i] === defaultClass ) { + selectThisDefaultElement(aClassSelectionContainer.node()); + } + aClassSelectionContainer.on("click", classSelectorFunction); + defaultClassSelectionContainers.push(aClassSelectionContainer); + } + + for ( i = 0; i < supportedDatatypes.length; i++ ) { + var aDTSelectionContainer = datatypeContainer.append("div"); + aDTSelectionContainer.classed("containerForDefaultSelection", true); + aDTSelectionContainer.classed("noselect", true); + aDTSelectionContainer.node().id = "selectedDatatype" + supportedDatatypes[i]; + aDTSelectionContainer.node().innerHTML = supportedDatatypes[i]; + + if ( supportedDatatypes[i] === defaultDatatype ) { + selectThisDefaultElement(aDTSelectionContainer.node()); + } + aDTSelectionContainer.on("click", datatypeSelectorFunction); + defaultDatatypeSelectionContainers.push(aDTSelectionContainer); + } + for ( i = 0; i < supportedProperties.length; i++ ) { + var aPropSelectionContainer = propertyContainer.append("div"); + aPropSelectionContainer.classed("containerForDefaultSelection", true); + aPropSelectionContainer.classed("noselect", true); + aPropSelectionContainer.node().id = "selectedClass" + supportedProperties[i]; + aPropSelectionContainer.node().innerHTML = supportedProperties[i]; + aPropSelectionContainer.on("click", propertySelectorFunction); + if ( supportedProperties[i] === defaultProperty ) { + selectThisDefaultElement(aPropSelectionContainer.node()); + } + defaultPropertySelectionContainers.push(aPropSelectionContainer); + } + } + + function setupCollapsing(){ + // adapted version of this example: http://www.normansblog.de/simple-jquery-accordion/ + function collapseContainers( containers ){ + containers.classed("hidden", true); + } + + function expandContainers( containers ){ + containers.classed("hidden", false); + } + + var triggers = d3.selectAll(".accordion-trigger"); + + // Collapse all inactive triggers on startup + // collapseContainers(d3.selectAll(".accordion-trigger:not(.accordion-trigger-active) + div")); + + triggers.on("click", function (){ + var selectedTrigger = d3.select(this); + if ( selectedTrigger.classed("accordion-trigger-active") ) { + // Collapse the active (which is also the selected) trigger + collapseContainers(d3.select(selectedTrigger.node().nextElementSibling)); + selectedTrigger.classed("accordion-trigger-active", false); + } else { + // Collapse the other trigger ... + // collapseContainers(d3.selectAll(".accordion-trigger-active + div")); + // activeTriggers.classed("accordion-trigger-active", false); + // ... and expand the selected one + expandContainers(d3.select(selectedTrigger.node().nextElementSibling)); + selectedTrigger.classed("accordion-trigger-active", true); + } + }); + } + + + leftSidebar.isSidebarVisible = function (){ + return visibleSidebar; + }; + + leftSidebar.updateSideBarVis = function ( init ){ + var vis = leftSidebar.getSidebarVisibility(); + leftSidebar.showSidebar(parseInt(vis), init); + }; + + leftSidebar.initSideBarAnimation = function (){ + sideBarContainer.node().addEventListener("animationend", function (){ + sideBarContent.classed("hidden", !visibleSidebar); + if ( visibleSidebar === true ) { + sideBarContainer.style("width", "200px"); + sideBarContent.classed("hidden", false); + d3.select("#leftSideBarCollapseButton").style("left", "200px"); + d3.select("#leftSideBarCollapseButton").classed("hidden", false); + d3.select("#WarningErrorMessages").style("left", "100px"); + } + else { + sideBarContainer.style("width", "0px"); + d3.select("#leftSideBarCollapseButton").style("left", "0px"); + d3.select("#WarningErrorMessages").style("left", "0px"); + d3.select("#leftSideBarCollapseButton").classed("hidden", false); + + } + graph.updateCanvasContainerSize(); + graph.options().navigationMenu().updateScrollButtonVisibility(); + }); + }; + + leftSidebar.showSidebar = function ( val, init ){ + // make val to bool + var collapseButton = d3.select("#leftSideBarCollapseButton"); + if ( init === true ) { + visibleSidebar = (backupVisibility === 0); + sideBarContent.classed("hidden", !visibleSidebar); + sideBarContainer.style("-webkit-animation-name", "none"); + d3.select("#WarningErrorMessages").style("-webkit-animation-name", "none"); + if ( visibleSidebar === true ) { + sideBarContainer.style("width", "200px"); + sideBarContent.classed("hidden", false); + d3.select("#leftSideBarCollapseButton").style("left", "200px"); + d3.select("#leftSideBarCollapseButton").classed("hidden", false); + d3.select("#WarningErrorMessages").style("left", "100px"); + collapseButton.node().innerHTML = "<"; + } + + else { + sideBarContainer.style("width", "0px"); + d3.select("#WarningErrorMessages").style("left", "0px"); + d3.select("#leftSideBarCollapseButton").style("left", "0px"); + d3.select("#leftSideBarCollapseButton").classed("hidden", false); + collapseButton.node().innerHTML = ">"; + } + + graph.updateCanvasContainerSize(); + graph.options().navigationMenu().updateScrollButtonVisibility(); + return; + } + + d3.select("#leftSideBarCollapseButton").classed("hidden", true); + + if ( val === 1 ) { + visibleSidebar = true; + collapseButton.node().innerHTML = "<"; + // call expand animation; + sideBarContainer.style("-webkit-animation-name", "l_sbExpandAnimation"); + sideBarContainer.style("-webkit-animation-duration", "0.5s"); + // prepare the animation; + + d3.select("#WarningErrorMessages").style("-webkit-animation-name", "warn_ExpandLeftBarAnimation"); + d3.select("#WarningErrorMessages").style("-webkit-animation-duration", "0.5s"); + + } + if ( val === 0 ) { + visibleSidebar = false; + sideBarContent.classed("hidden", true); + collapseButton.node().innerHTML = ">"; + // call collapse animation + sideBarContainer.style("-webkit-animation-name", "l_sbCollapseAnimation"); + sideBarContainer.style("-webkit-animation-duration", "0.5s"); + d3.select("#WarningErrorMessages").style("-webkit-animation-name", "warn_CollapseLeftBarAnimation"); + d3.select("#WarningErrorMessages").style("-webkit-animation-duration", "0.5s"); + d3.select("#WarningErrorMessages").style("left", "0"); + } + + }; + + leftSidebar.getSidebarVisibility = function (){ + var isHidden = sideBarContent.classed("hidden"); + if ( isHidden === false ) return String(1); + if ( isHidden === true ) return String(0); + }; + + return leftSidebar; + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), + +/***/ 340: +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {/** + * Contains the logic for the sidebar. + * @param graph the graph that belongs to these controls + * @returns {{}} + */ + module.exports = function ( graph ){ + + var editSidebar = {}, + languageTools = webvowl.util.languageTools(), + elementTools = webvowl.util.elementTools(); + + var prefixModule = webvowl.util.prefixTools(graph); + var selectedElementForCharacteristics; + var oldPrefix, oldPrefixURL; + var prefix_editMode = false; + + + editSidebar.clearMetaObjectValue = function (){ + d3.select("#titleEditor").node().value = ""; + d3.select("#iriEditor").node().value = ""; + d3.select("#versionEditor").node().value = ""; + d3.select("#authorsEditor").node().value = ""; + d3.select("#descriptionEditor").node().value = ""; + // todo add clear description; + }; + + + editSidebar.updatePrefixUi = function (){ + editSidebar.updateElementWidth(); + var prefixListContainer = d3.select("#prefixURL_Container"); + while ( prefixListContainer.node().firstChild ) { + prefixListContainer.node().removeChild(prefixListContainer.node().firstChild); + } + setupPrefixList(); + }; + + editSidebar.setup = function (){ + setupCollapsing(); + setupPrefixList(); + setupAddPrefixButton(); + setupSupportedDatatypes(); + + + d3.select("#titleEditor") + .on("change", function (){ + graph.options().addOrUpdateGeneralObjectEntry("title", d3.select("#titleEditor").node().value); + }) + .on("keydown", function (){ + d3.event.stopPropagation(); + if ( d3.event.keyCode === 13 ) { + d3.event.preventDefault(); + graph.options().addOrUpdateGeneralObjectEntry("title", d3.select("#titleEditor").node().value); + } + }); + d3.select("#iriEditor") + .on("change", function (){ + if ( graph.options().addOrUpdateGeneralObjectEntry("iri", d3.select("#iriEditor").node().value) === false ) { + // restore value + d3.select("#iriEditor").node().value = graph.options().getGeneralMetaObjectProperty('iri'); + } + }) + .on("keydown", function (){ + d3.event.stopPropagation(); + if ( d3.event.keyCode === 13 ) { + d3.event.preventDefault(); + if ( graph.options().addOrUpdateGeneralObjectEntry("iri", d3.select("#iriEditor").node().value) === false ) { + // restore value + d3.select("#iriEditor").node().value = graph.options().getGeneralMetaObjectProperty('iri'); + } + } + }); + d3.select("#versionEditor") + .on("change", function (){ + graph.options().addOrUpdateGeneralObjectEntry("version", d3.select("#versionEditor").node().value); + }) + .on("keydown", function (){ + d3.event.stopPropagation(); + if ( d3.event.keyCode === 13 ) { + d3.event.preventDefault(); + graph.options().addOrUpdateGeneralObjectEntry("version", d3.select("#versionEditor").node().value); + } + }); + d3.select("#authorsEditor") + .on("change", function (){ + graph.options().addOrUpdateGeneralObjectEntry("author", d3.select("#authorsEditor").node().value); + }) + .on("keydown", function (){ + d3.event.stopPropagation(); + if ( d3.event.keyCode === 13 ) { + d3.event.preventDefault(); + graph.options().addOrUpdateGeneralObjectEntry("author", d3.select("#authorsEditor").node().value); + } + }); + d3.select("#descriptionEditor") + .on("change", function (){ + graph.options().addOrUpdateGeneralObjectEntry("description", d3.select("#descriptionEditor").node().value); + }); + + editSidebar.updateElementWidth(); + + }; + + function setupSupportedDatatypes(){ + var datatypeEditorSelection = d3.select("#typeEditor_datatype").node(); + var supportedDatatypes = ["undefined", "xsd:boolean", "xsd:double", "xsd:integer", "xsd:string"]; + for ( var i = 0; i < supportedDatatypes.length; i++ ) { + var optB = document.createElement('option'); + optB.innerHTML = supportedDatatypes[i]; + datatypeEditorSelection.appendChild(optB); + } + } + + function highlightDeleteButton( enable, name ){ + var deletePath = d3.select("#del_pathFor_" + name); + var deleteRect = d3.select("#del_rectFor_" + name); + + if ( enable === false ) { + deletePath.node().style = "stroke: #f00;"; + deleteRect.style("cursor", "auto"); + } else { + deletePath.node().style = "stroke: #ff972d;"; + deleteRect.style("cursor", "pointer"); + } + } + + + function highlightEditButton( enable, name, fill ){ + var editPath = d3.select("#pathFor_" + name); + var editRect = d3.select("#rectFor_" + name); + + if ( enable === false ) { + if ( fill ) + editPath.node().style = "fill: #fff; stroke : #fff; stroke-width : 1px"; + else + editPath.node().style = " stroke : #fff; stroke-width : 1px"; + + editRect.style("cursor", "auto"); + } else { + if ( fill ) + editPath.node().style = "fill: #ff972d; stroke : #ff972d; stroke-width : 1px"; + else + editPath.node().style = "stroke : #ff972d; stroke-width : 1px"; + editRect.style("cursor", "pointer"); + } + + } + + function setupAddPrefixButton(){ + var btn = d3.select("#addPrefixButton"); + btn.on("click", function (){ + + // check if we are still in editMode? + if ( prefix_editMode === false ) { + // create new line entry; + var name = "emptyPrefixEntry"; + var prefixListContainer = d3.select("#prefixURL_Container"); + var prefixEditContainer = prefixListContainer.append("div"); + prefixEditContainer.classed("prefixIRIElements", true); + prefixEditContainer.node().id = "prefixContainerFor_" + name; + + var IconContainer = prefixEditContainer.append("div"); + IconContainer.style("position", "absolute"); + IconContainer.node().id = "containerFor_" + name; + var editButton = IconContainer.append("svg"); + editButton.style("width", "14px"); + editButton.style("height", "20px"); + // editButton.classed("editPrefixButton", true); + editButton.classed("noselect", true); + //editButton.node().innerHTML = "\u2714"; + editButton.node().id = "editButtonFor_" + name; + + editButton.node().elementStyle = "save"; + editButton.node().selectorName = name; + var editIcon = editButton.append("g"); + var editRect = editIcon.append("rect"); + var editPath = editIcon.append("path"); + editIcon.node().id = "iconFor_" + name; + editPath.node().id = "pathFor_" + name; + editRect.node().id = "rectFor_" + name; + + editIcon.node().selectorName = name; + editPath.node().selectorName = name; + editRect.node().selectorName = name; + IconContainer.node().title = "Save new prefix and IRI"; + + editPath.classed("editPrefixIcon"); + editPath.style("stroke", "#fff"); + editPath.style("stroke-width", "1px"); + editPath.style("fill", "#fff"); + editRect.attr("width", "14px"); + editRect.attr("height", "14px"); + editRect.style("fill", "#18202A"); + editRect.attr("transform", "matrix(1,0,0,1,-3,4)"); + + editButton.selectAll("g").on("mouseover", function (){ + highlightEditButton(true, this.selectorName, true); + }); + editButton.selectAll("g").on("mouseout", function (){ + highlightEditButton(false, this.selectorName, true); + }); + // Check mark + // M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z + // pencil + // M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z + editPath.attr("d", "M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"); + editPath.attr("transform", "matrix(0.45,0,0,0.45,0,5)"); + + var prefInput = prefixEditContainer.append("input"); + prefInput.classed("prefixInput", true); + prefInput.node().type = "text"; + prefInput.node().id = "prefixInputFor_" + name; + prefInput.node().autocomplete = "off"; + prefInput.node().value = ""; + prefInput.style("margin-left", "14px"); + + var prefURL = prefixEditContainer.append("input"); + prefURL.classed("prefixURL", true); + prefURL.node().type = "text"; + prefURL.node().id = "prefixURLFor_" + name; + prefURL.node().autocomplete = "off"; + prefURL.node().value = ""; + + prefInput.node().disabled = false; + prefURL.node().disabled = false; + prefix_editMode = true; + var deleteContainer = prefixEditContainer.append("div"); + deleteContainer.style("float", "right"); + var deleteButton = deleteContainer.append("svg"); + deleteButton.node().id = "deleteButtonFor_" + name; + deleteContainer.node().title = "Delete prefix and IRI"; + deleteButton.style("width", "10px"); + deleteButton.style("height", "20px"); + var deleteIcon = deleteButton.append("g"); + var deleteRect = deleteIcon.append("rect"); + var deletePath = deleteIcon.append("path"); + deleteIcon.node().id = "del_iconFor_" + name; + deletePath.node().id = "del_pathFor_" + name; + deleteRect.node().id = "del_rectFor_" + name; + + deleteIcon.node().selectorName = name; + deletePath.node().selectorName = name; + deleteRect.node().selectorName = name; + + + deletePath.style("stroke", "#f00"); + deleteRect.attr("width", "10px"); + deleteRect.attr("height", "14px"); + deleteRect.style("fill", "#18202A"); + deleteRect.attr("transform", "matrix(1,0,0,1,-3,4)"); + + + deletePath.attr("d", "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"); + deletePath.attr("transform", "matrix(0.45,0,0,0.45,0,5)"); + + deleteButton.selectAll("g").on("mouseover", function (){ + highlightDeleteButton(true, this.selectorName); + }); + deleteButton.selectAll("g").on("mouseout", function (){ + highlightDeleteButton(false, this.selectorName); + }); + + + // connect the buttons; + editButton.on("click", enablePrefixEdit); + deleteButton.on("click", deletePrefixLine); + + editSidebar.updateElementWidth(); + // swap focus to prefixInput + prefInput.node().focus(); + oldPrefix = name; + oldPrefixURL = ""; + d3.select("#addPrefixButton").node().innerHTML = "Save Prefix"; + } else { + d3.select("#editButtonFor_emptyPrefixEntry").on("click")(d3.select("#editButtonFor_emptyPrefixEntry").node()); + } + + }); + + } + + function setupPrefixList(){ + if ( graph.isEditorMode() === false ) return; + var prefixListContainer = d3.select("#prefixURL_Container"); + var prefixElements = graph.options().prefixList(); + for ( var name in prefixElements ) { + if ( prefixElements.hasOwnProperty(name) ) { + var prefixEditContainer = prefixListContainer.append("div"); + prefixEditContainer.classed("prefixIRIElements", true); + prefixEditContainer.node().id = "prefixContainerFor_" + name; + + // create edit button which enables the input fields + var IconContainer = prefixEditContainer.append("div"); + IconContainer.style("position", "absolute"); + IconContainer.node().id = "containerFor_" + name; + var editButton = IconContainer.append("svg"); + editButton.style("width", "14px"); + editButton.style("height", "20px"); + editButton.classed("noselect", true); + editButton.node().id = "editButtonFor_" + name; + IconContainer.node().title = "Edit prefix and IRI"; + editButton.node().elementStyle = "save"; + editButton.node().selectorName = name; + + editButton.node().id = "editButtonFor_" + name; + editButton.node().elementStyle = "edit"; + var editIcon = editButton.append("g"); + var editRect = editIcon.append("rect"); + var editPath = editIcon.append("path"); + editIcon.node().id = "iconFor_" + name; + editPath.node().id = "pathFor_" + name; + editRect.node().id = "rectFor_" + name; + + editIcon.node().selectorName = name; + editPath.node().selectorName = name; + editRect.node().selectorName = name; + + + editPath.classed("editPrefixIcon"); + editPath.style("stroke", "#fff"); + editPath.style("stroke-width", "1px"); + editRect.attr("width", "14px"); + editRect.attr("height", "14px"); + editRect.style("fill", "#18202A"); + editRect.attr("transform", "matrix(1,0,0,1,-3,4)"); + + editButton.selectAll("g").on("mouseover", function (){ + var sender = this; + var fill = false; + var enable = true; + var f_editPath = d3.select("#pathFor_" + sender.selectorName); + var f_editRect = d3.select("#rectFor_" + sender.selectorName); + + if ( enable === false ) { + if ( fill ) + f_editPath.node().style = "fill: #fff; stroke : #fff; stroke-width : 1px"; + else + f_editPath.node().style = " stroke : #fff; stroke-width : 1px"; + + f_editRect.style("cursor", "auto"); + } else { + if ( fill ) + f_editPath.node().style = "fill: #ff972d; stroke : #ff972d; stroke-width : 1px"; + else + f_editPath.node().style = "stroke : #ff972d; stroke-width : 1px"; + f_editRect.style("cursor", "pointer"); + } + }); + editButton.selectAll("g").on("mouseout", function (){ + var sender = this; + var fill = false; + var enable = false; + var f_editPath = d3.select("#pathFor_" + sender.selectorName); + var f_editRect = d3.select("#rectFor_" + sender.selectorName); + + if ( enable === false ) { + if ( fill ) + f_editPath.node().style = "fill: #fff; stroke : #fff; stroke-width : 1px"; + else + f_editPath.node().style = " stroke : #fff; stroke-width : 1px"; + + f_editRect.style("cursor", "auto"); + } else { + if ( fill ) + f_editPath.node().style = "fill: #ff972d; stroke : #ff972d; stroke-width : 1px"; + else + f_editPath.node().style = "stroke : #ff972d; stroke-width : 1px"; + f_editRect.style("cursor", "pointer"); + } + }); + + editPath.attr("d", "M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"); + editPath.attr("transform", "matrix(-0.45,0,0,0.45,10,5)"); + + // create input field for prefix + var prefInput = prefixEditContainer.append("input"); + prefInput.classed("prefixInput", true); + prefInput.node().type = "text"; + prefInput.node().id = "prefixInputFor_" + name; + prefInput.node().autocomplete = "off"; + prefInput.node().value = name; + prefInput.style("margin-left", "14px"); + + // create input field for prefix url + var prefURL = prefixEditContainer.append("input"); + prefURL.classed("prefixURL", true); + prefURL.node().type = "text"; + prefURL.node().id = "prefixURLFor_" + name; + prefURL.node().autocomplete = "off"; + prefURL.node().value = prefixElements[name]; + prefURL.node().title = prefixElements[name]; + // disable the input fields (already defined elements can be edited later) + prefInput.node().disabled = true; + prefURL.node().disabled = true; + + // create the delete button + var deleteContainer = prefixEditContainer.append("div"); + deleteContainer.style("float", "right"); + var deleteButton = deleteContainer.append("svg"); + deleteButton.node().id = "deleteButtonFor_" + name; + deleteContainer.node().title = "Delete prefix and IRI"; + deleteButton.style("width", "10px"); + deleteButton.style("height", "20px"); + var deleteIcon = deleteButton.append("g"); + var deleteRect = deleteIcon.append("rect"); + var deletePath = deleteIcon.append("path"); + deleteIcon.node().id = "del_iconFor_" + name; + deletePath.node().id = "del_pathFor_" + name; + deleteRect.node().id = "del_rectFor_" + name; + + deleteIcon.node().selectorName = name; + deletePath.node().selectorName = name; + deleteRect.node().selectorName = name; + + + deletePath.style("stroke", "#f00"); + deleteRect.attr("width", "10px"); + deleteRect.attr("height", "14px"); + deleteRect.style("fill", "#18202A"); + deleteRect.attr("transform", "matrix(1,0,0,1,-3,4)"); + + + deletePath.attr("d", "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"); + deletePath.attr("transform", "matrix(0.45,0,0,0.45,0,5)"); + + deleteButton.selectAll("g").on("mouseover", function (){ + var selector = this; + var enable = true; + var f_deletePath = d3.select("#del_pathFor_" + selector.selectorName); + var f_deleteRect = d3.select("#del_rectFor_" + selector.selectorName); + + if ( enable === false ) { + f_deletePath.node().style = "stroke: #f00;"; + f_deleteRect.style("cursor", "auto"); + } else { + f_deletePath.node().style = "stroke: #ff972d;"; + f_deleteRect.style("cursor", "pointer"); + } + }); + deleteButton.selectAll("g").on("mouseout", function (){ + var selector = this; + var enable = false; + var f_deletePath = d3.select("#del_pathFor_" + selector.selectorName); + var f_deleteRect = d3.select("#del_rectFor_" + selector.selectorName); + + if ( enable === false ) { + f_deletePath.node().style = "stroke: #f00;"; + f_deleteRect.style("cursor", "auto"); + } else { + f_deletePath.node().style = "stroke: #ff972d;"; + f_deleteRect.style("cursor", "pointer"); + } + }); + + + editButton.on("click", enablePrefixEdit); + deleteButton.on("click", deletePrefixLine); + + // EXPERIMENTAL + + if ( name === "rdf" || + name === "rdfs" || + name === "xsd" || name === "dc" || + name === "owl" + ) { + // make them invis so the spacing does not change + IconContainer.classed("hidden", true); + deleteContainer.classed("hidden", true); + } + } + } + prefixModule.updatePrefixModel(); + } + + function deletePrefixLine(){ + if ( this.disabled === true ) return; + d3.select("#addPrefixButton").node().innerHTML = "Add Prefix"; + var selector = this.id.split("_")[1]; + d3.select("#prefixContainerFor_" + selector).remove(); + graph.options().removePrefix(selector); + prefix_editMode = false; // <<TODO make some sanity checks + prefixModule.updatePrefixModel(); + } + + function enablePrefixEdit( item ){ + + var agent = this; + if ( item ) + agent = item; + + if ( agent.disabled === true ) return; + var selector = agent.id.split("_")[1]; + var stl = agent.elementStyle; + if ( stl === "edit" ) { + d3.select("#prefixInputFor_" + selector).node().disabled = false; + d3.select("#prefixURLFor_" + selector).node().disabled = false; + // change the button content + // this.innerHTML = "\u2714"; + agent.elementStyle = "save"; + oldPrefix = d3.select("#prefixInputFor_" + selector).node().value; + oldPrefixURL = d3.select("#prefixURLFor_" + selector).node().value; + prefix_editMode = true; + if ( d3.select("#containerFor_" + selector).node() ) + d3.select("#containerFor_" + selector).node().title = "Save new prefix and IRI"; + + var editButton = d3.select(agent); + editButton.selectAll("g").on("mouseover", function (){ + + highlightEditButton(true, agent.selectorName, true); + }); + editButton.selectAll("g").on("mouseout", function (){ + highlightEditButton(false, agent.selectorName, true); + }); + + var editPath = d3.select("#pathFor_" + agent.selectorName); + editPath.attr("d", "M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"); + editPath.attr("transform", "matrix(0.45,0,0,0.45,0,5)"); + + highlightEditButton(true, agent.selectorName, true); + + + } + if ( stl === "save" ) { + var newPrefixURL = d3.select("#prefixURLFor_" + selector).node().value; + var newPrefix = d3.select("#prefixInputFor_" + selector).node().value; + + + if ( graph.options().updatePrefix(oldPrefix, newPrefix, oldPrefixURL, newPrefixURL) === true ) { + d3.select("#prefixInputFor_" + newPrefix).node().disabled = true; + d3.select("#prefixURLFor_" + newPrefix).node().disabled = true; + d3.select("#addPrefixButton").node().innerHTML = "Add Prefix"; + if ( d3.select("#containerFor_" + selector).node() ) + d3.select("#containerFor_" + selector).node().title = "Edit prefix and IRI"; + + // change the button content + + agent.elementStyle = "edit"; + prefix_editMode = false; + prefixModule.updatePrefixModel(); + var saveButton = d3.select(agent); + saveButton.selectAll("g").on("mouseover", function (){ + highlightEditButton(true, agent.selectorName, false); + }); + saveButton.selectAll("g").on("mouseout", function (){ + highlightEditButton(false, agent.selectorName, false); + }); + + var savePath = d3.select("#pathFor_" + agent.selectorName); + savePath.attr("d", "M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"); + savePath.attr("transform", "matrix(-0.45,0,0,0.45,10,5)"); + highlightEditButton(true, agent.selectorName, false); + } + } + } + + function changeDatatypeType( element ){ + var datatypeEditorSelection = d3.select("#typeEditor_datatype").node(); + var givenName = datatypeEditorSelection.value; + var identifier = givenName.split(":")[1]; + + if ( datatypeEditorSelection.value !== "undefined" ) { + d3.select("#element_iriEditor").node().disabled = true; + d3.select("#element_labelEditor").node().disabled = true; + } else { + identifier = "undefined"; + d3.select("#element_iriEditor").node().disabled = false; + d3.select("#element_labelEditor").node().disabled = false; + } + element.label(identifier); + element.dType(givenName); + element.iri("http://www.w3.org/2001/XMLSchema#" + identifier); + element.baseIri("http://www.w3.org/2001/XMLSchema#"); + element.redrawLabelText(); + + d3.select("#element_iriEditor").node().value = prefixModule.getPrefixRepresentationForFullURI(element.iri()); + d3.select("#element_iriEditor").node().title = element.iri(); + d3.select("#element_labelEditor").node().value = element.labelForCurrentLanguage(); + } + + + function identifyExternalCharacteristicForElement( ontoIRI, elementIRI ){ + return (elementIRI.indexOf(ontoIRI) === -1); + + } + + function defaultIriValue( element ){ + // get the iri of that element; + if ( graph.options().getGeneralMetaObject().iri ) { + var str2Compare = graph.options().getGeneralMetaObject().iri + element.id(); + return element.iri() === str2Compare; + } + return false; + } + + function getURLFROMPrefixedVersion( element ){ + var url = d3.select("#element_iriEditor").node().value; + var base = graph.options().getGeneralMetaObjectProperty("iri"); + if ( validURL(url) === false ) { + + // make better usability + // try to split element; + var tokens = url.split(":"); + + //console.log("try to split the input into prefix:name") + console.log("Tokens"); + console.log(tokens); + console.log("---------------"); + // TODO MORE VALIDATION TESTS + if ( tokens.length === 2 ) { + var pr = tokens[0]; + var name = tokens[1]; + if ( pr.length > 0 ) { + var basePref = graph.options().prefixList()[pr]; + if ( basePref === undefined ) { + console.log("ERROR __________________"); + graph.options().warningModule().showWarning("Invalid Element IRI", + "Could not resolve prefix '" + basePref + "'", + "Restoring previous IRI for Element" + element.iri(), 1, false); + d3.select("#element_iriEditor").node().value = element.iri(); + return; + + } + // check if url is not empty + + if ( name.length === 0 ) { + graph.options().warningModule().showWarning("Invalid Element IRI", + "Input IRI is EMPTY", + "Restoring previous IRI for Element" + element.iri(), 1, false); + console.log("NO INPUT PROVIDED"); + d3.select("#element_iriEditor").node().value = element.iri(); + return; + + } + url = basePref + name; + } + else { + url = base + name; + } + } else { + if ( url.length === 0 ) { + // + console.log("NO INPUT PROVIDED"); + d3.select("#element_iriEditor").node().value = element.iri(); + return; + } + // failed to identify anything useful + console.log("Tryig to use the input!"); + url = base + url; + } + } + return url; + } + + function changeIriForElement( element ){ + var url = getURLFROMPrefixedVersion(element); + var base = graph.options().getGeneralMetaObjectProperty("iri"); + var sanityCheckResult; + if ( elementTools.isNode(element) ) { + + sanityCheckResult = graph.checkIfIriClassAlreadyExist(url); + if ( sanityCheckResult === false ) { + element.iri(url); + } else { + // throw warnign + graph.options().warningModule().showWarning("Already seen this class", + "Input IRI: " + url + " for element: " + element.labelForCurrentLanguage() + " already been set", + "Restoring previous IRI for Element : " + element.iri(), 2, false, sanityCheckResult); + + editSidebar.updateSelectionInformation(element); + return; + + } + } + if ( elementTools.isProperty(element) === true ) { + sanityCheckResult = editSidebar.checkProperIriChange(element, url); + if ( sanityCheckResult !== false ) { + graph.options().warningModule().showWarning("Already seen this property", + "Input IRI: " + url + " for element: " + element.labelForCurrentLanguage() + " already been set", + "Restoring previous IRI for Element : " + element.iri(), 1, false, sanityCheckResult); + + editSidebar.updateSelectionInformation(element); + return; + } + } + + // if (element.existingPropertyIRI(url)===true){ + // console.log("I Have seen this Particular URL already "+url); + // graph.options().warningModule().showWarning("Already Seen This one ", + // "Input IRI For Element"+ element.labelForCurrentLanguage()+" already been set ", + // "Restoring previous IRI for Element"+element.iri(),1,false); + // d3.select("#element_iriEditor").node().value=graph.options().prefixModule().getPrefixRepresentationForFullURI(element.iri()); + // editSidebar.updateSelectionInformation(element); + // return; + // } + + element.iri(url); + if ( identifyExternalCharacteristicForElement(base, url) === true ) { + addAttribute(element, "external"); + // background color for external element; + element.backgroundColor("#36C"); + element.redrawElement(); + element.redrawLabelText(); + // handle visual selection + + } else { + removeAttribute(element, "external"); + // background color for external element; + element.backgroundColor(undefined); + element.redrawElement(); + element.redrawLabelText(); + + } + + if ( element.focused() ) { + graph.options().focuserModule().handle(element, true); // unfocus + graph.options().focuserModule().handle(element, true); // focus + } + // graph.options().focuserModule().handle(undefined); + + + d3.select("#element_iriEditor").node().value = prefixModule.getPrefixRepresentationForFullURI(url); + editSidebar.updateSelectionInformation(element); + } + + function validURL( str ){ + var urlregex = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/; + return urlregex.test(str); + } + + + function changeLabelForElement( element ){ + element.label(d3.select("#element_labelEditor").node().value); + element.redrawLabelText(); + } + + editSidebar.updateEditDeleteButtonIds = function ( oldPrefix, newPrefix ){ + d3.select("#prefixInputFor_" + oldPrefix).node().id = "prefixInputFor_" + newPrefix; + d3.select("#prefixURLFor_" + oldPrefix).node().id = "prefixURLFor_" + newPrefix; + d3.select("#deleteButtonFor_" + oldPrefix).node().id = "deleteButtonFor_" + newPrefix; + d3.select("#editButtonFor_" + oldPrefix).node().id = "editButtonFor_" + newPrefix; + + d3.select("#prefixContainerFor_" + oldPrefix).node().id = "prefixContainerFor_" + newPrefix; + }; + + editSidebar.checkForExistingURL = function ( url ){ + var i; + var allProps = graph.getUnfilteredData().properties; + for ( i = 0; i < allProps.length; i++ ) { + if ( allProps[i].iri() === url ) return true; + } + return false; + + }; + editSidebar.checkProperIriChange = function ( element, url ){ + console.log("Element changed Label"); + console.log("Testing URL " + url); + if ( element.type() === "rdfs:subClassOf" || element.type() === "owl:disjointWith" ) { + console.log("ignore this for now, already handled in the type and domain range changer"); + } else { + var i; + var allProps = graph.getUnfilteredData().properties; + for ( i = 0; i < allProps.length; i++ ) { + if ( allProps[i] === element ) continue; + if ( allProps[i].iri() === url ) return allProps[i]; + } + } + return false; + }; + + editSidebar.updateSelectionInformation = function ( element ){ + + if ( element === undefined ) { + // show hint; + d3.select("#selectedElementProperties").classed("hidden", true); + d3.select("#selectedElementPropertiesEmptyHint").classed("hidden", false); + selectedElementForCharacteristics = null; + editSidebar.updateElementWidth(); + } + else { + d3.select("#selectedElementProperties").classed("hidden", false); + d3.select("#selectedElementPropertiesEmptyHint").classed("hidden", true); + d3.select("#typeEditForm_datatype").classed("hidden", true); + + // set the element IRI, and labels + d3.select("#element_iriEditor").node().value = element.iri(); + d3.select("#element_labelEditor").node().value = element.labelForCurrentLanguage(); + d3.select("#element_iriEditor").node().title = element.iri(); + + d3.select("#element_iriEditor") + .on("change", function (){ + var elementIRI = element.iri(); + var prefixed = graph.options().prefixModule().getPrefixRepresentationForFullURI(elementIRI); + if ( prefixed === d3.select("#element_iriEditor").node().value ) { + console.log("Iri is identical, nothing has changed!"); + return; + } + + changeIriForElement(element); + }) + .on("keydown", function (){ + d3.event.stopPropagation(); + if ( d3.event.keyCode === 13 ) { + d3.event.preventDefault(); + console.log("IRI CHANGED Via ENTER pressed"); + changeIriForElement(element); + d3.select("#element_iriEditor").node().title = element.iri(); + } + }); + + var forceIRISync = defaultIriValue(element); + d3.select("#element_labelEditor") + .on("change", function (){ + var sanityCheckResult; + console.log("Element changed Label"); + var url = getURLFROMPrefixedVersion(element); + if ( element.iri() !== url ) { + if ( elementTools.isProperty(element) === true ) { + sanityCheckResult = editSidebar.checkProperIriChange(element, url); + if ( sanityCheckResult !== false ) { + graph.options().warningModule().showWarning("Already seen this property", + "Input IRI: " + url + " for element: " + element.labelForCurrentLanguage() + " already been set", + "Continuing with duplicate property!", 1, false, sanityCheckResult); + editSidebar.updateSelectionInformation(element); + return; + } + } + + if ( elementTools.isNode(element) === true ) { + sanityCheckResult = graph.checkIfIriClassAlreadyExist(url); + if ( sanityCheckResult !== false ) { + graph.options().warningModule().showWarning("Already seen this Class", + "Input IRI: " + url + " for element: " + element.labelForCurrentLanguage() + " already been set", + "Restoring previous IRI for Element : " + element.iri(), 2, false, sanityCheckResult); + + editSidebar.updateSelectionInformation(element); + return; + } + } + element.iri(url); + } + changeLabelForElement(element); + editSidebar.updateSelectionInformation(element); // prevents that it will be changed if node is still active + }) + .on("keydown", function (){ + d3.event.stopPropagation(); + if ( d3.event.keyCode === 13 ) { + d3.event.preventDefault(); + var sanityCheckResult; + console.log("Element changed Label"); + var url = getURLFROMPrefixedVersion(element); + if ( element.iri() !== url ) { + if ( elementTools.isProperty(element) === true ) { + sanityCheckResult = editSidebar.checkProperIriChange(element, url); + if ( sanityCheckResult !== false ) { + graph.options().warningModule().showWarning("Already seen this property", + "Input IRI: " + url + " for element: " + element.labelForCurrentLanguage() + " already been set", + "Continuing with duplicate property!", 1, false, sanityCheckResult); + + editSidebar.updateSelectionInformation(element); + return; + } + } + + if ( elementTools.isNode(element) === true ) { + sanityCheckResult = graph.checkIfIriClassAlreadyExist(url); + if ( sanityCheckResult !== false ) { + graph.options().warningModule().showWarning("Already seen this Class", + "Input IRI: " + url + " for element: " + element.labelForCurrentLanguage() + " already been set", + "Restoring previous IRI for Element : " + element.iri(), 2, false, sanityCheckResult); + + editSidebar.updateSelectionInformation(element); + return; + } + } + element.iri(url); + } + changeLabelForElement(element); + } + }) + .on("keyup", function (){ + if ( forceIRISync ) { + var labelName = d3.select("#element_labelEditor").node().value; + var resourceName = labelName.replaceAll(" ", "_"); + var syncedIRI = element.baseIri() + resourceName; + + //element.iri(syncedIRI); + d3.select("#element_iriEditor").node().title = element.iri(); + d3.select("#element_iriEditor").node().value = prefixModule.getPrefixRepresentationForFullURI(syncedIRI); + } + }); + // check if we are allowed to change IRI OR LABEL + d3.select("#element_iriEditor").node().disabled = false; + d3.select("#element_labelEditor").node().disabled = false; + + if ( element.type() === "rdfs:subClassOf" ) { + d3.select("#element_iriEditor").node().value = "http://www.w3.org/2000/01/rdf-schema#subClassOf"; + d3.select("#element_iriEditor").node().title = "http://www.w3.org/2000/01/rdf-schema#subClassOf"; + d3.select("#element_labelEditor").node().value = "Subclass of"; + d3.select("#element_iriEditor").node().disabled = true; + d3.select("#element_labelEditor").node().disabled = true; + } + if ( element.type() === "owl:Thing" ) { + d3.select("#element_iriEditor").node().value = "http://www.w3.org/2002/07/owl#Thing"; + d3.select("#element_iriEditor").node().title = "http://www.w3.org/2002/07/owl#Thing"; + d3.select("#element_labelEditor").node().value = "Thing"; + d3.select("#element_iriEditor").node().disabled = true; + d3.select("#element_labelEditor").node().disabled = true; + } + + if ( element.type() === "owl:disjointWith" ) { + d3.select("#element_iriEditor").node().value = "http://www.w3.org/2002/07/owl#disjointWith"; + d3.select("#element_iriEditor").node().title = "http://www.w3.org/2002/07/owl#disjointWith"; + d3.select("#element_iriEditor").node().disabled = true; + d3.select("#element_labelEditor").node().disabled = true; + } + + if ( element.type() === "rdfs:Literal" ) { + d3.select("#element_iriEditor").node().value = "http://www.w3.org/2000/01/rdf-schema#Literal"; + d3.select("#element_iriEditor").node().title = "http://www.w3.org/2000/01/rdf-schema#Literal"; + d3.select("#element_iriEditor").node().disabled = true; + d3.select("#element_labelEditor").node().disabled = true; + element.iri("http://www.w3.org/2000/01/rdf-schema#Literal"); + } + if ( element.type() === "rdfs:Datatype" ) { + var datatypeEditorSelection = d3.select("#typeEditor_datatype"); + d3.select("#typeEditForm_datatype").classed("hidden", false); + element.iri("http://www.w3.org/2000/01/rdf-schema#Datatype"); + d3.select("#element_iriEditor").node().value = "http://www.w3.org/2000/01/rdf-schema#Datatype"; + d3.select("#element_iriEditor").node().title = "http://www.w3.org/2000/01/rdf-schema#Datatype"; + d3.select("#element_iriEditor").node().disabled = true; + d3.select("#element_labelEditor").node().disabled = true; + + datatypeEditorSelection.node().value = element.dType(); + if ( datatypeEditorSelection.node().value === "undefined" ) { + d3.select("#element_iriEditor").node().disabled = true; // always prevent IRI modifications + d3.select("#element_labelEditor").node().disabled = false; + } + // reconnect the element + datatypeEditorSelection.on("change", function (){ + changeDatatypeType(element); + }); + } + + // add type selector + var typeEditorSelection = d3.select("#typeEditor").node(); + var htmlCollection = typeEditorSelection.children; + var numEntries = htmlCollection.length; + var i; + var elementPrototypes = getElementPrototypes(element); + for ( i = 0; i < numEntries; i++ ) + typeEditorSelection.removeChild(htmlCollection[0]); + + for ( i = 0; i < elementPrototypes.length; i++ ) { + var optA = document.createElement('option'); + optA.innerHTML = elementPrototypes[i]; + typeEditorSelection.appendChild(optA); + } + // set the proper value in the selection + typeEditorSelection.value = element.type(); + d3.select("#typeEditor").on("change", function (){ + elementTypeSelectionChanged(element); + }); + + + // add characteristics selection + var needChar = elementNeedsCharacteristics(element); + d3.select("#property_characteristics_Container").classed("hidden", !needChar); + if ( needChar === true ) { + addElementsCharacteristics(element); + } + var fullURI = d3.select("#element_iriEditor").node().value; + d3.select("#element_iriEditor").node().value = prefixModule.getPrefixRepresentationForFullURI(fullURI); + d3.select("#element_iriEditor").node().title = fullURI; + editSidebar.updateElementWidth(); + } + + }; + + editSidebar.updateGeneralOntologyInfo = function (){ + var preferredLanguage = graph && graph.language ? graph.language() : null; + + // get it from graph.options + var generalMetaObj = graph.options().getGeneralMetaObject(); + if ( generalMetaObj.hasOwnProperty("title") ) { + // title has language to it -.- + if ( typeof generalMetaObj.title === "object" ) { + d3.select("#titleEditor").node().value = languageTools.textInLanguage(generalMetaObj.title, preferredLanguage); + } else + d3.select("#titleEditor").node().value = generalMetaObj.title; + } + if ( generalMetaObj.hasOwnProperty("iri") ) d3.select("#iriEditor").node().value = generalMetaObj.iri; + if ( generalMetaObj.hasOwnProperty("version") ) d3.select("#versionEditor").node().value = generalMetaObj.version; + if ( generalMetaObj.hasOwnProperty("author") ) d3.select("#authorsEditor").node().value = generalMetaObj.author; + + + if ( generalMetaObj.hasOwnProperty("description") ) { + + if ( typeof generalMetaObj.description === "object" ) + d3.select("#descriptionEditor").node().value = + languageTools.textInLanguage(generalMetaObj.description, preferredLanguage); + else + d3.select("#descriptionEditor").node().value = generalMetaObj.description; + } + else + d3.select("#descriptionEditor").node().value = "No Description"; + }; + + editSidebar.updateElementWidth = function (){ + var height = window.innerHeight - 40; + var lsb_offset = d3.select("#logo").node().getBoundingClientRect().height + 5; + var lsb_height = height - lsb_offset; + d3.select("#containerForLeftSideBar").style("top", lsb_offset + "px"); + d3.select("#leftSideBarCollapseButton").style("top", lsb_offset + "px"); + d3.select("#containerForLeftSideBar").style("height", lsb_height + "px"); + + var div_width = d3.select("#generalDetailsEdit").node().getBoundingClientRect().width; + div_width += 10; + + var title_labelWidth = d3.select("#titleEditor-label").node().getBoundingClientRect().width + 20; + var iri_labelWidth = d3.select("#iriEditor-label").node().getBoundingClientRect().width + 20; + var version_labelWidth = d3.select("#versionEditor-label").node().getBoundingClientRect().width + 20; + var author_labelWidth = d3.select("#authorsEditor-label").node().getBoundingClientRect().width + 20; + //find max width; + var maxW = 0; + maxW = Math.max(maxW, title_labelWidth); + maxW = Math.max(maxW, iri_labelWidth); + maxW = Math.max(maxW, version_labelWidth); + maxW = Math.max(maxW, author_labelWidth); + + var meta_inputWidth = div_width - maxW - 10; + + d3.select("#titleEditor").style("width", meta_inputWidth + "px"); + d3.select("#iriEditor").style("width", meta_inputWidth + "px"); + d3.select("#versionEditor").style("width", meta_inputWidth + "px"); + d3.select("#authorsEditor").style("width", meta_inputWidth + "px"); + + + var elementIri_width = d3.select("#element_iriEditor-label").node().getBoundingClientRect().width + 20; + var elementLabel_width = d3.select("#element_labelEditor-label").node().getBoundingClientRect().width + 20; + var elementType_width = d3.select("#typeEditor-label").node().getBoundingClientRect().width + 20; + var elementDType_width = d3.select("#typeEditor_datatype-label").node().getBoundingClientRect().width + 20; + + maxW = 0; + maxW = Math.max(maxW, elementIri_width); + maxW = Math.max(maxW, elementLabel_width); + maxW = Math.max(maxW, elementType_width); + maxW = Math.max(maxW, elementDType_width); + var selectedElement_inputWidth = div_width - maxW - 10; + + d3.select("#element_iriEditor").style("width", selectedElement_inputWidth + "px"); + d3.select("#element_labelEditor").style("width", selectedElement_inputWidth + "px"); + d3.select("#typeEditor").style("width", selectedElement_inputWidth + 4 + "px"); + d3.select("#typeEditor_datatype").style("width", selectedElement_inputWidth + 4 + "px"); + + // update prefix Element width; + var containerWidth = d3.select("#containerForPrefixURL").node().getBoundingClientRect().width; + if ( containerWidth !== 0 ) { + var inputs = d3.selectAll(".prefixInput"); + if ( inputs.node() ) { + var prefixWidth = d3.selectAll(".prefixInput").node().getBoundingClientRect().width; + d3.selectAll(".prefixURL").style("width", containerWidth - prefixWidth - 45 + "px"); + } + } + }; + + function addElementsCharacteristics( element ){ + // save selected element for checkbox handler + selectedElementForCharacteristics = element; + var i; + // KILL old elements + var charSelectionNode = d3.select("#property_characteristics_Selection"); + var htmlCollection = charSelectionNode.node().children; + if ( htmlCollection ) { + var numEntries = htmlCollection.length; + for ( var q = 0; q < numEntries; q++ ) { + charSelectionNode.node().removeChild(htmlCollection[0]); + } + } + // datatypes kind of ignored by the elementsNeedCharacteristics function + // so we need to check if we are a node or not + if ( element.attributes().indexOf("external") > -1 ) { + // add external span to the div; + var externalCharSpan = charSelectionNode.append("span"); + externalCharSpan.classed("spanForCharSelection", true); + externalCharSpan.node().innerHTML = "external"; + } + var filterContainer, + filterCheckbox; + if ( elementTools.isNode(element) === true ) { + // add the deprecated characteristic; + var arrayOfNodeChars = ["deprecated"]; + for ( i = 0; i < arrayOfNodeChars.length; i++ ) { + filterContainer = charSelectionNode + .append("div") + .classed("checkboxContainer", true) + .style("padding-top", "2px"); + + filterCheckbox = filterContainer.append("input") + .classed("filterCheckbox", true) + .attr("id", "CharacteristicsCheckbox" + i) + .attr("type", "checkbox") + .attr("characteristics", arrayOfNodeChars[i]) + .property("checked", getPresentAttribute(element, arrayOfNodeChars[i])); + // + filterContainer.append("label") + .attr("for", "CharacteristicsCheckbox" + i) + .text(arrayOfNodeChars[i]); + + filterCheckbox.on("click", handleCheckBoxClick); + + } + } + + else { + // add the deprecated characteristic; + var arrayOfPropertyChars = ["deprecated", "inverse functional", "functional", "transitive"]; + if ( elementTools.isDatatypeProperty(element) === true ) { + arrayOfPropertyChars = ["deprecated", "functional"]; + } + for ( i = 0; i < arrayOfPropertyChars.length; i++ ) { + filterContainer = charSelectionNode + .append("div") + .classed("checkboxContainer", true) + .style("padding-top", "2px"); + + filterCheckbox = filterContainer.append("input") + .classed("filterCheckbox", true) + .attr("id", "CharacteristicsCheckbox" + i) + .attr("type", "checkbox") + .attr("characteristics", arrayOfPropertyChars[i]) + .property("checked", getPresentAttribute(element, arrayOfPropertyChars[i])); + // + filterContainer.append("label") + .attr("for", "CharacteristicsCheckbox" + i) + .text(arrayOfPropertyChars[i]); + + filterCheckbox.on("click", handleCheckBoxClick); + + } + } + + + } + + function getPresentAttribute( selectedElement, element ){ + return (selectedElement.attributes().indexOf(element) >= 0); + } + + function handleCheckBoxClick(){ + var checked = this.checked; + var char = this.getAttribute("characteristics"); + if ( checked === true ) { + addAttribute(selectedElementForCharacteristics, char); + } else { + removeAttribute(selectedElementForCharacteristics, char); + } + // graph.executeColorExternalsModule(); + selectedElementForCharacteristics.redrawElement(); + // workaround to have the node still be focused as rendering element + selectedElementForCharacteristics.focused(false); + selectedElementForCharacteristics.toggleFocus(); + + } + + + function addAttribute( selectedElement, char ){ + if ( selectedElement.attributes().indexOf(char) === -1 ) { + // not found add it + var attr = selectedElement.attributes(); + attr.push(char); + selectedElement.attributes(attr); + }// indications string update; + if ( selectedElement.indications().indexOf(char) === -1 ) { + var indications = selectedElement.indications(); + indications.push(char); + selectedElement.indications(indications); + } + // add visual attributes + var visAttr; + if ( selectedElement.visualAttributes().indexOf(char) === -1 ) { + visAttr = selectedElement.visualAttributes(); + visAttr.push(char); + selectedElement.visualAttributes(visAttr); + } + if ( getPresentAttribute(selectedElement, "external") && getPresentAttribute(selectedElement, "deprecated") ) { + visAttr = selectedElement.visualAttributes(); + var visInd = visAttr.indexOf("external"); + if ( visInd > -1 ) { + visAttr.splice(visInd, 1); + } + selectedElement.visualAttributes(visAttr); + } + + } + + function removeAttribute( selectedElement, element ){ + var attr = selectedElement.attributes(); + var indications = selectedElement.indications(); + var visAttr = selectedElement.visualAttributes(); + var attrInd = attr.indexOf(element); + if ( attrInd >= 0 ) { + attr.splice(attrInd, 1); + } + var indInd = indications.indexOf(element); + if ( indInd > -1 ) { + indications.splice(indInd, 1); + } + var visInd = visAttr.indexOf(element); + if ( visInd > -1 ) { + visAttr.splice(visInd, 1); + } + selectedElement.attributes(attr); + selectedElement.indications(indications); + selectedElement.visualAttributes(visAttr); + if ( element === "deprecated" ) { + // set its to its original Style + //typeBaseThign + // todo : fix all different types + if ( selectedElement.type() === "owl:Class" ) selectedElement.styleClass("class"); + if ( selectedElement.type() === "owl:DatatypeProperty" ) selectedElement.styleClass("datatypeproperty"); + if ( selectedElement.type() === "owl:ObjectProperty" ) selectedElement.styleClass("objectproperty"); + if ( selectedElement.type() === "owl:disjointWith" ) selectedElement.styleClass("disjointwith"); + } + } + + + function elementNeedsCharacteristics( element ){ + //TODO: Add more types + if ( element.type() === "owl:Thing" || + element.type() === "rdfs:subClassOf" || + element.type() === "rdfs:Literal" || + element.type() === "rdfs:Datatype" || + element.type() === "rdfs:disjointWith" ) + return false; + + // if (element.attributes().indexOf("external")|| + // element.attributes().indexOf("deprecated")) + // return true; + return true; + + } + + function elementTypeSelectionChanged( element ){ + if ( elementTools.isNode(element) ) { + if ( graph.changeNodeType(element) === false ) { + //restore old value + + if ( elementTools.isDatatype(element) === true ) { + + } + editSidebar.updateSelectionInformation(element); + } + } + + if ( elementTools.isProperty(element) ) { + if ( graph.changePropertyType(element) === false ) { + //restore old value + editSidebar.updateSelectionInformation(element); + + } + } + + } + + function getElementPrototypes( selectedElement ){ + var availiblePrototypes = []; + // TODO the text should be also complied with the prefixes loaded into the ontology + if ( elementTools.isProperty(selectedElement) ) { + if ( selectedElement.type() === "owl:DatatypeProperty" ) + availiblePrototypes.push("owl:DatatypeProperty"); + else { + availiblePrototypes.push("owl:ObjectProperty"); + // handling loops ! + if ( selectedElement.domain() !== selectedElement.range() ) { + availiblePrototypes.push("rdfs:subClassOf"); + } + availiblePrototypes.push("owl:disjointWith"); + availiblePrototypes.push("owl:allValuesFrom"); + availiblePrototypes.push("owl:someValuesFrom"); + } + return availiblePrototypes; + } + if ( selectedElement.renderType() === "rect" ) { + availiblePrototypes.push("rdfs:Literal"); + availiblePrototypes.push("rdfs:Datatype"); + } else { + availiblePrototypes.push("owl:Class"); + availiblePrototypes.push("owl:Thing"); + // TODO: ADD MORE TYPES + // availiblePrototypes.push("owl:complementOf"); + // availiblePrototypes.push("owl:disjointUnionOf"); + } + return availiblePrototypes; + } + + + function setupCollapsing(){ + // TODO : Decision , for now I want to have the control over the collapse expand operation of the + // TODO : elements, otherwise the old approach will also randomly collapse other containers + + // adapted version of this example: http://www.normansblog.de/simple-jquery-accordion/ + function collapseContainers( containers ){ + containers.classed("hidden", true); + } + + function expandContainers( containers ){ + containers.classed("hidden", false); + } + + var triggers = d3.selectAll(".accordion-trigger"); + + // Collapse all inactive triggers on startup + // collapseContainers(d3.selectAll(".accordion-trigger:not(.accordion-trigger-active) + div")); + + triggers.on("click", function (){ + var selectedTrigger = d3.select(this); + if ( selectedTrigger.classed("accordion-trigger-active") ) { + // Collapse the active (which is also the selected) trigger + collapseContainers(d3.select(selectedTrigger.node().nextElementSibling)); + selectedTrigger.classed("accordion-trigger-active", false); + } else { + // Collapse the other trigger ... + // collapseContainers(d3.selectAll(".accordion-trigger-active + div")); + + // ... and expand the selected one + expandContainers(d3.select(selectedTrigger.node().nextElementSibling)); + selectedTrigger.classed("accordion-trigger-active", true); + } + editSidebar.updateElementWidth(); + }); + } + + return editSidebar; + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), + +/***/ 341: +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {module.exports = function ( graph ){ + var configMenu = {}, + checkboxes = []; + + + configMenu.setup = function (){ + var menuEntry = d3.select("#m_modes"); + menuEntry.on("mouseover", function (){ + var searchMenu = graph.options().searchMenu(); + searchMenu.hideSearchEntries(); + }); + + addCheckBox("showZoomSlider", "Zoom controls", "#zoomSliderOption", graph.options().zoomSlider().showSlider, 0); + addLabelWidthSlider("#maxLabelWidthSliderOption", "maxLabelWidth", "Max label width", graph.options().maxLabelWidth); + }; + + + function addLabelWidthSlider( selector, identifier, label, onChangeFunction ){ + var sliderContainer, + sliderValueLabel; + + sliderContainer = d3.select(selector) + .append("div") + .classed("distanceSliderContainer", true); + + var slider = sliderContainer.append("input") + .attr("id", identifier + "Slider") + .attr("type", "range") + .attr("min", 20) + .attr("max", 600) + .attr("value", onChangeFunction()) + .attr("step", 10); + sliderContainer.append("label") + .classed("description", true) + .attr("for", identifier + "Slider") + .attr("id", identifier + "DescriptionLabel") + .text(label); + sliderValueLabel = sliderContainer.append("label") + .classed("value", true) + .attr("for", identifier + "Slider") + .attr("id", identifier + "valueLabel") + .text(onChangeFunction()); + + slider.on("input", function (){ + var value = slider.property("value"); + onChangeFunction(value); + sliderValueLabel.text(value); + if ( graph.options().dynamicLabelWidth() === true ) + graph.animateDynamicLabelWidth(); + }); + + // add wheel event to the slider + slider.on("wheel", function (){ + if ( slider.node().disabled === true ) return; + var wheelEvent = d3.event; + var offset; + if ( wheelEvent.deltaY < 0 ) offset = 10; + if ( wheelEvent.deltaY > 0 ) offset = -10; + var oldVal = parseInt(slider.property("value")); + var newSliderValue = oldVal + offset; + if ( newSliderValue !== oldVal ) { + slider.property("value", newSliderValue); + onChangeFunction(newSliderValue); + slider.on("input")(); // << set text and update the graphStyles + } + d3.event.preventDefault(); + }); + } + + function addCheckBox( identifier, modeName, selector, onChangeFunc, updateLvl ){ + var configOptionContainer = d3.select(selector) + .append("div") + .classed("checkboxContainer", true); + var configCheckbox = configOptionContainer.append("input") + .classed("moduleCheckbox", true) + .attr("id", identifier + "ConfigCheckbox") + .attr("type", "checkbox") + .property("checked", onChangeFunc()); + + + configCheckbox.on("click", function ( silent ){ + var isEnabled = configCheckbox.property("checked"); + onChangeFunc(isEnabled); + if ( silent !== true ) { + // updating graph when silent is false or the parameter is not given. + if ( updateLvl === 1 ) { + graph.lazyRefresh(); + //graph.redrawWithoutForce + } + if ( updateLvl === 2 ) { + graph.update(); + } + + if ( updateLvl === 3 ) { + graph.updateDraggerElements(); + } + } + + }); + checkboxes.push(configCheckbox); + configOptionContainer.append("label") + .attr("for", identifier + "ConfigCheckbox") + .text(modeName); + } + + configMenu.setCheckBoxValue = function ( identifier, value ){ + for ( var i = 0; i < checkboxes.length; i++ ) { + var cbdId = checkboxes[i].attr("id"); + if ( cbdId === identifier ) { + checkboxes[i].property("checked", value); + break; + } + } + }; + + configMenu.getCheckBoxValue = function ( id ){ + for ( var i = 0; i < checkboxes.length; i++ ) { + var cbdId = checkboxes[i].attr("id"); + if ( cbdId === id ) { + return checkboxes[i].property("checked"); + } + } + }; + + configMenu.updateSettings = function (){ + var silent = true; + checkboxes.forEach(function ( checkbox ){ + checkbox.on("click")(silent); + }); + }; + + return configMenu; + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), + +/***/ 342: +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {module.exports = function ( graph ){ + /** some constants **/ + var PREDEFINED = 0, + FILE_UPLOAD = 1, + JSON_URL = 2, + IRI_URL = 3; + + var PROGRESS_BAR_ERROR = 0, + PROGRESS_BAR_BUSY = 1, + PROGRESS_BAR_PERCENT = 2, + progressBarMode = 1; + + var loadingWasSuccessFul = false; + var missingImportsWarning = false; + var showLoadingDetails = false; + var visibilityStatus = true; + + var DEFAULT_JSON_NAME = "ontology"; // This file is loaded by default + var conversion_sessionId; + + /** variable defs **/ + var loadingModule = {}, + menuContainer = d3.select("#loading-info"), + loadingInfoContainer = d3.select("#loadingInfo-container"), + detailsButton = d3.select("#show-loadingInfo-button"), + closeButton = d3.select("#loadingIndicator_closeButton"), + ontologyMenu, + ontologyIdentifierFromURL; + + /** functon defs **/ + loadingModule.checkForScreenSize = function (){ + // checks for window size and adjusts the loading indicator + var w = graph.options().width(), + h = graph.options().height(); + + if ( w < 270 ) { + d3.select("#loading-info").classed("hidden", true); + } else { + // check if it should be visible + if ( visibilityStatus === true ) { + d3.select("#loading-info").classed("hidden", false); + } else { + d3.select("#loading-info").classed("hidden", true); + } + } + if ( h < 150 ) { + d3.select("#loadingInfo_msgBox").classed("hidden", true); + } else { + d3.select("#loadingInfo_msgBox").classed("hidden", false); + } + if ( h < 80 ) { + d3.select("#progressBarContext").classed("hidden", true); + d3.select("#layoutLoadingProgressBarContainer").style("height", "20px"); + } else { + d3.select("#progressBarContext").classed("hidden", false); + d3.select("#layoutLoadingProgressBarContainer").style("height", "50px"); + } + }; + + loadingModule.getMessageVisibilityStatus = function (){ + return visibilityStatus; + }; + + loadingModule.getProgressBarMode = function (){ + return progressBarMode; + }; + + loadingModule.successfullyLoadedOntology = function (){ + return loadingWasSuccessFul; + }; + + loadingModule.missingImportsWarning = function (){ + return missingImportsWarning; + }; + + loadingModule.setOntologyMenu = function ( m ){ + ontologyMenu = m; + }; + + loadingModule.showErrorDetailsMessage = function (){ + loadingModule.showLoadingIndicator(); + loadingModule.expandDetails(); + d3.select("#loadingIndicator_closeButton").classed("hidden", true); + loadingModule.scrollDownDetails(); + }; + + loadingModule.showWarningDetailsMessage = function (){ + d3.select("#currentLoadingStep").style("color", "#ff0"); + loadingModule.showLoadingIndicator(); + loadingModule.expandDetails(); + d3.select("#loadingIndicator_closeButton").classed("hidden", false); + loadingModule.scrollDownDetails(); + }; + + loadingModule.scrollDownDetails = function (){ + var scrollingElement = d3.select("#loadingInfo-container").node(); + scrollingElement.scrollTop = scrollingElement.scrollHeight; + }; + + loadingModule.hideLoadingIndicator = function (){ + d3.select("#loading-info").classed("hidden", true); + visibilityStatus = false; + }; + + loadingModule.showLoadingIndicator = function (){ + d3.select("#loading-info").classed("hidden", false); + visibilityStatus = true; + + }; + + /** -- SETUP -- **/ + loadingModule.setup = function (){ + // create connections for close and details button; + loadingInfoContainer.classed("hidden", !showLoadingDetails); + detailsButton.on("click", function (){ + showLoadingDetails = !showLoadingDetails; + loadingInfoContainer.classed("hidden", !showLoadingDetails); + detailsButton.classed("accordion-trigger-active", showLoadingDetails); + }); + + closeButton.on("click", function (){ + menuContainer.classed("hidden", true); + }); + loadingModule.setBusyMode(); + }; + + loadingModule.updateSize = function (){ + showLoadingDetails = !(loadingInfoContainer.classed("hidden")); + loadingInfoContainer.classed("hidden", !showLoadingDetails); + detailsButton.classed("accordion-trigger-active", showLoadingDetails); + }; + + loadingModule.getDetailsState = function (){ + return showLoadingDetails; + }; + + loadingModule.expandDetails = function (){ + showLoadingDetails = true; + loadingInfoContainer.classed("hidden", !showLoadingDetails); + detailsButton.classed("accordion-trigger-active", showLoadingDetails); + }; + + loadingModule.collapseDetails = function (){ + showLoadingDetails = false; + loadingInfoContainer.classed("hidden", !showLoadingDetails); + detailsButton.classed("accordion-trigger-active", showLoadingDetails); + }; + + loadingModule.setBusyMode = function (){ + d3.select("#currentLoadingStep").style("color", "#fff"); + d3.select("#progressBarValue").node().innherHTML = ""; + d3.select("#progressBarValue").style("width", "20%"); + d3.select("#progressBarValue").classed("busyProgressBar", true); + progressBarMode = PROGRESS_BAR_BUSY; + }; + + loadingModule.setSuccessful = function (){ + d3.select("#currentLoadingStep").style("color", "#0f0"); + }; + + loadingModule.setErrorMode = function (){ + d3.select("#currentLoadingStep").style("color", "#f00"); + d3.select("#progressBarValue").style("width", "0%"); + d3.select("#progressBarValue").classed("busyProgressBar", false); + d3.select("#progressBarValue").node().innherHTML = ""; + progressBarMode = PROGRESS_BAR_ERROR; + }; + + loadingModule.setPercentMode = function (){ + d3.select("#currentLoadingStep").style("color", "#fff"); + d3.select("#progressBarValue").classed("busyProgressBar", false); + d3.select("#progressBarValue").node().innherHTML = "0%"; + d3.select("#progressBarValue").style("width", "0%"); + progressBarMode = PROGRESS_BAR_PERCENT; + }; + + loadingModule.setPercentValue = function ( val ){ + d3.select("#progressBarValue").node().innherHTML = val; + }; + + loadingModule.emptyGraphContentError = function (){ + graph.clearGraphData(); + ontologyMenu.append_message_toLastBulletPoint("<span style='color:red;'>failed</span>"); + ontologyMenu.append_message_toLastBulletPoint("<br><span style=\"color:red;\">Error: Received empty graph</span>"); + loadingWasSuccessFul = false; + graph.handleOnLoadingError(); + loadingModule.setErrorMode(); + }; + + loadingModule.isThreadCanceled = function (){ + + }; + + loadingModule.initializeLoader = function ( storeCache ){ + if ( storeCache === true && graph.getCachedJsonObj() !== null ) { + // save cached ontology; + var cachedContent = JSON.stringify(graph.getCachedJsonObj()); + var cachedName = ontologyIdentifierFromURL; + ontologyMenu.setCachedOntology(cachedName, cachedContent); + } + conversion_sessionId = -10000; + ontologyMenu.setConversionID(conversion_sessionId); + ontologyMenu.stopLoadingTimer(); + graph.clearGraphData(); + loadingModule.setBusyMode(); + loadingModule.showLoadingIndicator(); + loadingModule.collapseDetails(); + missingImportsWarning = false; + d3.select("#loadingIndicator_closeButton").classed("hidden", true); + ontologyMenu.clearDetailInformation(); + }; + + /** ------------------ URL Interpreter -------------- **/ + loadingModule.parseUrlAndLoadOntology = function ( storeCache ){ + var autoStore = true; + if ( storeCache === false ) { + autoStore = false; + } + + graph.clearAllGraphData(); + loadingModule.initializeLoader(autoStore); + var urlString = String(location); + var parameterArray = identifyParameter(urlString); + ontologyIdentifierFromURL = DEFAULT_JSON_NAME; + loadGraphOptions(parameterArray); // identifies and loads configuration values + var loadingMethod = identifyOntologyLoadingMethod(ontologyIdentifierFromURL); + d3.select("#progressBarValue").node().innerHTML = " "; + switch ( loadingMethod ) { + case 0: + loadingModule.from_presetOntology(ontologyIdentifierFromURL); + break; + case 1: + loadingModule.from_FileUpload(ontologyIdentifierFromURL); + break; + case 2: + loadingModule.from_JSON_URL(ontologyIdentifierFromURL); + break; + case 3: + loadingModule.from_IRI_URL(ontologyIdentifierFromURL); + break; + default: + console.log("Could not identify loading method , or not IMPLEMENTED YET"); + } + }; + + /** ------------------- LOADING --------------------- **/ + // the loading module splits into 3 branches + // 1] PresetOntology Loading + // 2] File Upload + // 3] Load From URL / IRI + + loadingModule.from_JSON_URL = function ( fileName ){ + var filename = decodeURIComponent(fileName.slice("url=".length)); + ontologyIdentifierFromURL = filename; + + var ontologyContent = ""; + if ( ontologyMenu.cachedOntology(filename) ) { + ontologyMenu.append_bulletPoint("Loading already cached ontology: " + filename); + ontologyContent = ontologyMenu.cachedOntology(filename); + loadingWasSuccessFul = true; // cached Ontology should be true; + parseOntologyContent(ontologyContent); + + } else { + // involve the o2v conveter; + ontologyMenu.append_message("Retrieving ontology from JSON URL " + filename); + requestServerTimeStampForJSON_URL(ontologyMenu.callbackLoad_JSON_FromURL, ["read?json=" + filename, filename]); + } + }; + + function requestServerTimeStampForJSON_URL( callback, parameter ){ + d3.xhr("serverTimeStamp", "application/text", function ( error, request ){ + if ( error ) { + // could not get server timestamp -> no connection to owl2vowl + ontologyMenu.append_bulletPoint("Could not establish connection to OWL2VOWL service"); + fallbackForJSON_URL(callback, parameter); + } else { + conversion_sessionId = request.responseText; + ontologyMenu.setConversionID(conversion_sessionId); + parameter.push(conversion_sessionId); + callback(parameter); + } + }); + + } + + loadingModule.requestServerTimeStampForDirectInput = function ( callback, text ){ + d3.xhr("serverTimeStamp", "application/text", function ( error, request ){ + if ( error ) { + // could not get server timestamp -> no connection to owl2vowl + ontologyMenu.append_bulletPoint("Could not establish connection to OWL2VOWL service"); + loadingModule.setErrorMode(); + ontologyMenu.append_message_toLastBulletPoint("<br><span style='color:red'>Could not connect to OWL2VOWL service </span>"); + loadingModule.showErrorDetailsMessage(); + d3.select("#progressBarValue").style("width", "0%"); + d3.select("#progressBarValue").classed("busyProgressBar", false); + d3.select("#progressBarValue").text("0%"); + + } else { + conversion_sessionId = request.responseText; + ontologyMenu.setConversionID(conversion_sessionId); + callback(text, ["conversionID" + conversion_sessionId, conversion_sessionId]); + } + }); + }; + + loadingModule.from_IRI_URL = function ( fileName ){ + // owl2vowl converters the given ontology url and returns json file; + var filename = decodeURIComponent(fileName.slice("iri=".length)); + ontologyIdentifierFromURL = filename; + + var ontologyContent = ""; + if ( ontologyMenu.cachedOntology(filename) ) { + ontologyMenu.append_bulletPoint("Loading already cached ontology: " + filename); + ontologyContent = ontologyMenu.cachedOntology(filename); + loadingWasSuccessFul = true; // cached Ontology should be true; + parseOntologyContent(ontologyContent); + } else { + // involve the o2v conveter; + var encoded = encodeURIComponent(filename); + ontologyMenu.append_bulletPoint("Retrieving ontology from IRI: " + filename); + requestServerTimeStampForIRI_Converte(ontologyMenu.callbackLoad_Ontology_FromIRI, ["convert?iri=" + encoded, filename]); + } + }; + + loadingModule.fromFileDrop = function ( fileName, file ){ + d3.select("#progressBarValue").node().innerHTML = " "; + loadingModule.initializeLoader(false); + + ontologyMenu.append_bulletPoint("Retrieving ontology from dropped file: " + fileName); + var ontologyContent = ""; + + // two options here + //1] Direct Json Upload + if ( fileName.match(/\.json$/) ) { + ontologyMenu.setConversionID(-10000); + var reader = new FileReader(); + reader.readAsText(file); + reader.onload = function (){ + ontologyContent = reader.result; + ontologyIdentifierFromURL = fileName; + parseOntologyContent(ontologyContent); + }; + } else { + //2] File Upload to OWL2VOWL Converter + // 1) check if we can get a timeStamp; + var parameterArray = [file, fileName]; + requestServerTimeStamp(ontologyMenu.callbackLoadFromOntology, parameterArray); + } + }; + + + loadingModule.from_FileUpload = function ( fileName ){ + loadingModule.setBusyMode(); + var filename = decodeURIComponent(fileName.slice("file=".length)); + ontologyIdentifierFromURL = filename; + var ontologyContent = ""; + if ( ontologyMenu.cachedOntology(filename) ) { + ontologyMenu.append_bulletPoint("Loading already cached ontology: " + filename); + ontologyContent = ontologyMenu.cachedOntology(filename); + loadingWasSuccessFul = true; // cached Ontology should be true; + parseOntologyContent(ontologyContent); + + } else { + // d3.select("#currentLoadingStep").node().innerHTML="Loading ontology from file "+ filename; + ontologyMenu.append_bulletPoint("Retrieving ontology from file: " + filename); + // get the file + var selectedFile = d3.select("#file-converter-input").property("files")[0]; + // No selection -> this was triggered by the iri. Unequal names -> reuploading another file + if ( !selectedFile || (filename && (filename !== selectedFile.name)) ) { + ontologyMenu.append_message_toLastBulletPoint("<br><span style=\"color:red;\">No cached version of \"" + filename + "\" was found.</span><br>Please reupload the file."); + loadingModule.setErrorMode(); + d3.select("#progressBarValue").classed("busyProgressBar", false); + graph.handleOnLoadingError(); + return; + } else { + filename = selectedFile.name; + } + + + // two options here + //1] Direct Json Upload + if ( filename.match(/\.json$/) ) { + ontologyMenu.setConversionID(-10000); + var reader = new FileReader(); + reader.readAsText(selectedFile); + reader.onload = function (){ + ontologyContent = reader.result; + ontologyIdentifierFromURL = filename; + parseOntologyContent(ontologyContent); + }; + } else { + //2] File Upload to OWL2VOWL Converter + // 1) check if we can get a timeStamp; + var parameterArray = [selectedFile, filename]; + requestServerTimeStamp(ontologyMenu.callbackLoadFromOntology, parameterArray); + } + } + }; + + function fallbackForJSON_URL( callback, parameter ){ + ontologyMenu.append_message_toLastBulletPoint("<br>Trying to convert with other communication protocol."); + callback(parameter); + + } + + function fallbackConversion( parameter ){ + ontologyMenu.append_message_toLastBulletPoint("<br>Trying to convert with other communication protocol."); + var file = parameter[0]; + var name = parameter[1]; + var formData = new FormData(); + formData.append("ontology", file); + + var xhr = new XMLHttpRequest(); + xhr.open("POST", "convert", true); + var ontologyContent = ""; + xhr.onload = function (){ + if ( xhr.status === 200 ) { + ontologyContent = xhr.responseText; + ontologyMenu.setCachedOntology(name, ontologyContent); + ontologyIdentifierFromURL = name; + missingImportsWarning = true; // using this variable for warnings + ontologyMenu.append_message_toLastBulletPoint("<br>Success, <span style='color:yellow'>but you are using a deprecated OWL2VOWL service!<span>"); + parseOntologyContent(ontologyContent); + } + }; + + // check what this thing is doing; + xhr.onreadystatechange = function (){ + if ( xhr.readyState === 4 && xhr.status === 0 ) { + ontologyMenu.append_message_toLastBulletPoint("<br>Old protocol also failed to establish connection to OWL2VOWL service!"); + loadingModule.setErrorMode(); + ontologyMenu.append_bulletPoint("Failed to load ontology"); + ontologyMenu.append_message_toLastBulletPoint("<br><span style='color:red'>Could not connect to OWL2VOWL service </span>"); + loadingModule.showErrorDetailsMessage(); + } + }; + xhr.send(formData); + } + + function requestServerTimeStampForIRI_Converte( callback, parameterArray ){ + d3.xhr("serverTimeStamp", "application/text", function ( error, request ){ + loadingModule.setBusyMode(); + if ( error ) { + // could not get server timestamp -> no connection to owl2vowl + ontologyMenu.append_bulletPoint("Could not establish connection to OWL2VOWL service"); + loadingModule.setErrorMode(); + ontologyMenu.append_bulletPoint("Failed to load ontology"); + ontologyMenu.append_message_toLastBulletPoint("<br><span style='color:red'>Could not connect to OWL2VOWL service </span>"); + loadingModule.showErrorDetailsMessage(); + } else { + conversion_sessionId = request.responseText; + ontologyMenu.setConversionID(conversion_sessionId); + // update paramater for new communication paradigm + parameterArray[0] = parameterArray[0] + "&sessionId=" + conversion_sessionId; + parameterArray.push(conversion_sessionId); + callback(parameterArray); + } + }); + } + + function requestServerTimeStamp( callback, parameterArray ){ + d3.xhr("serverTimeStamp", "application/text", function ( error, request ){ + if ( error ) { + // could not get server timestamp -> no connection to owl2vowl + ontologyMenu.append_bulletPoint("Could not establish connection to OWL2VOWL service"); + fallbackConversion(parameterArray); // tries o2v version0.3.4 communication + } else { + conversion_sessionId = request.responseText; + ontologyMenu.setConversionID(conversion_sessionId); + console.log("Request Session ID:" + conversion_sessionId); + callback(parameterArray[0], parameterArray[1], conversion_sessionId); + } + }); + } + + loadingModule.directInput = function ( text ){ + ontologyMenu.clearDetailInformation(); + parseOntologyContent(text); + }; + + loadingModule.loadFromOWL2VOWL = function ( ontoContent, filename ){ + loadingWasSuccessFul = false; + + var old = d3.select("#bulletPoint_container").node().innerHTML; + if ( old.indexOf("(with warnings)") !== -1 ) { + missingImportsWarning = true; + } + + if ( ontologyMenu.cachedOntology(ontoContent) ) { + ontologyMenu.append_bulletPoint("Loading already cached ontology: " + filename); + parseOntologyContent(ontoContent); + } else { // set parse the ontology content; + parseOntologyContent(ontoContent); + } + }; + + loadingModule.from_presetOntology = function ( selectedOntology ){ + ontologyMenu.append_bulletPoint("Retrieving ontology: " + selectedOntology); + loadPresetOntology(selectedOntology); + }; + + function loadPresetOntology( ontology ){ + // check if already cached in ontology menu? + var f2r; + var loadingNewOntologyForEditor=false; + if ( ontology.indexOf("new_ontology") !== -1 ) { + loadingModule.hideLoadingIndicator(); + graph.showEditorHintIfNeeded(); + f2r = "./data/new_ontology.json"; + loadingNewOntologyForEditor=true; + } + + loadingWasSuccessFul = false; + var ontologyContent = ""; + if ( ontologyMenu.cachedOntology(ontology) ) { + ontologyMenu.append_bulletPoint("Loading already cached ontology: " + ontology); + ontologyContent = ontologyMenu.cachedOntology(ontology); + loadingWasSuccessFul = true; // cached Ontology should be true; + loadingModule.showLoadingIndicator(); + parseOntologyContent(ontologyContent); + + } else { + // read the file name + + var fileToRead = "./data/" + ontology + ".json"; + if ( f2r ) { + fileToRead = f2r; + } // overwrite the newOntology Index + // read file + d3.xhr(fileToRead, "application/json", function ( error, request ){ + var loadingSuccessful = !error; + if ( loadingSuccessful ) { + ontologyContent = request.responseText; + parseOntologyContent(ontologyContent); + } else { + + if (loadingNewOntologyForEditor){ + ontologyContent = '{\n' + + ' "_comment": "Empty ontology for WebVOWL Editor",\n' + + ' "header": {\n' + + ' "languages": [\n' + + ' "en"\n' + + ' ],\n' + + ' "baseIris": [\n' + + ' "http://www.w3.org/2000/01/rdf-schema"\n' + + ' ],\n' + + ' "iri": "http://visualdataweb.org/newOntology/",\n' + + ' "title": {\n' + + ' "en": "New ontology"\n' + + ' },\n' + + ' "description": {\n' + + ' "en": "New ontology description"\n' + + ' }\n' + + ' },\n' + + ' "namespace": [],\n' + + ' "metrics": {\n' + + ' "classCount": 0,\n' + + ' "datatypeCount": 0,\n' + + ' "objectPropertyCount": 0,\n' + + ' "datatypePropertyCount": 0,\n' + + ' "propertyCount": 0,\n' + + ' "nodeCount": 0,\n' + + ' "individualCount": 0\n' + + ' }\n' + + '}\n'; + parseOntologyContent(ontologyContent); + }else{ + // some error occurred + ontologyMenu.append_bulletPoint("Failed to load: " + ontology); + if (error.status===0){ // assumption this is CORS error when running locally (error status == 0) + ontologyMenu.append_message_toLastBulletPoint(" <span style='color: red'>ERROR STATUS:</span> " + error.status); + if (window.location.toString().startsWith("file:/")){ + ontologyMenu.append_message_toLastBulletPoint("<br><p>WebVOWL runs in a local instance.</p>"); + ontologyMenu.append_message_toLastBulletPoint("<p>CORS prevents to automatically load files on host system.</p>"); + ontologyMenu.append_message_toLastBulletPoint("<p>You can load preprocessed ontologies (i.e. VOWL-JSON files) using the upload feature in the ontology menu or by dragging the files and dropping them on the canvas.</p>"); + ontologyMenu.append_message_toLastBulletPoint("<p><i>Hint: </i>Note that the conversion of ontologies into the VOWL-JSON format is not part of WebVOWL but requires an additional converter such as OWL2VOWL.</p>"); + ontologyMenu.append_message_toLastBulletPoint("<p>Ontologies can be created using the editor mode (i.e. activate editing mode in <b>Modes</b> menu and create a new ontology using the <b>Ontology</b> menu.</p>"); + } + }else { + ontologyMenu.append_message_toLastBulletPoint(" <span style='color: red'>ERROR STATUS:</span> " + error.status); + } + + + + graph.handleOnLoadingError(); + loadingModule.setErrorMode(); + } + } + }); + } + } + + + /** -- PARSE JSON CONTENT -- **/ + function parseOntologyContent( content ){ + + ontologyMenu.append_bulletPoint("Reading ontology graph ... "); + var _loader = ontologyMenu.getLoadingFunction(); + _loader(content, ontologyIdentifierFromURL, "noAlternativeNameYet"); + } + + loadingModule.notValidJsonFile = function (){ + graph.clearGraphData(); + ontologyMenu.append_message_toLastBulletPoint(" <span style='color:red;'>failed</span>"); + ontologyMenu.append_message_toLastBulletPoint("<br><span style='color:red;'>Error: Received empty graph</span>"); + loadingWasSuccessFul = false; + graph.handleOnLoadingError(); + + }; + + loadingModule.validJsonFile = function (){ + ontologyMenu.append_message_toLastBulletPoint("done"); + loadingWasSuccessFul = true; + }; + + + /** --- HELPER FUNCTIONS **/ + + function identifyParameter( url ){ + var numParameters = (url.match(/#/g) || []).length; + // create parameters array + var paramArray = []; + if ( numParameters > 0 ) { + var tokens = url.split("#"); + // skip the first token since it is the address of the server + for ( var i = 1; i < tokens.length; i++ ) { + if ( tokens[i].length === 0 ) { + // this token belongs actually to the last paramArray + paramArray[paramArray.length - 1] = paramArray[paramArray.length - 1] + "#"; + } else { + paramArray.push(tokens[i]); + } + } + } + return paramArray; + } + + + function loadGraphOptions( parameterArray ){ + var optString = "opts="; + + function loadDefaultConfig(){ + graph.options().setOptionsFromURL(graph.options().defaultConfig(), false); + } + + function loadCustomConfig( opts ){ + var changeEditingFlag = false; + var defObj = graph.options().defaultConfig(); + for ( var i = 0; i < opts.length; i++ ) { + var keyVal = opts[i].split('='); + if ( keyVal[0] === "editorMode" ) { + changeEditingFlag = true; + } + defObj[keyVal[0]] = keyVal[1]; + } + graph.options().setOptionsFromURL(defObj, changeEditingFlag); + } + + function identifyOptions( paramArray ){ + if ( paramArray[0].indexOf(optString) >= 0 ) { + // parse the parameters; + var parameterLength = paramArray[0].length; + var givenOptionsStr = paramArray[0].substr(5, parameterLength - 6); + var optionsArray = givenOptionsStr.split(';'); + loadCustomConfig(optionsArray); + } else { + ontologyIdentifierFromURL = paramArray[0]; + loadDefaultConfig(); + } + } + + function identifyOptionsAndOntology( paramArray ){ + + if ( paramArray[0].indexOf(optString) >= 0 ) { + // parse the parameters; + var parameterLength = paramArray[0].length; + var givenOptionsStr = paramArray[0].substr(5, parameterLength - 6); + var optionsArray = givenOptionsStr.split(';'); + loadCustomConfig(optionsArray); + } else { + loadDefaultConfig(); + } + ontologyIdentifierFromURL = paramArray[1]; + } + + switch ( parameterArray.length ) { + case 0: + loadDefaultConfig(); + break; + case 1: + identifyOptions(parameterArray); + break; + case 2: + identifyOptionsAndOntology(parameterArray); + break; + default : + console.log("To many input parameters , loading default config"); + loadDefaultConfig(); + ontologyIdentifierFromURL = "ERROR_TO_MANY_INPUT_PARAMETERS"; + } + } + + + function identifyOntologyLoadingMethod( url ){ + var iriKey = "iri="; + var urlKey = "url="; + var fileKey = "file="; + + var method = -1; + if ( url.substr(0, fileKey.length) === fileKey ) { + method = FILE_UPLOAD; + } else if ( url.substr(0, urlKey.length) === urlKey ) { + method = JSON_URL; + } else if ( url.substr(0, iriKey.length) === iriKey ) { + method = IRI_URL; + } else { + method = PREDEFINED; + } + return method; + } + + return loadingModule; + } + ; + + + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), + +/***/ 343: +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {module.exports = function ( graph ){ + /** variable defs **/ + var warningModule = {}; + var superContainer = d3.select("#WarningErrorMessages"); + var _messageContainers = []; + var _messageContext = []; + var _visibleStatus = []; + + var _filterHintId; + var _editorHintId; + var _messageId = -1; + superContainer.style("display", "inline-block"); + var cssStyleIndex = 0; + var styleSelectorIndex = 2; + + + // helper for standalone webvowl in chrome + function createCSSSelector( name, rules ){ + var style = document.createElement('style'); + style.type = 'text/css'; + document.getElementsByTagName('head')[0].appendChild(style); + if ( !(style.sheet || {}).insertRule ) + (style.styleSheet || style.sheet).addRule(name, rules); + else + style.sheet.insertRule(name + "{" + rules + "}", 0); + } + + + function findCSS_Index(){ + createCSSSelector("@keyframes msg_CollapseAnimation", " 0% { top: 0; } 100% { top: -400px;}"); + console.log(document.styleSheets ); + } + + findCSS_Index(); + + warningModule.addMessageBox = function (){ + + // add a container; + _messageId++; + var messageContainer = d3.select("#WarningErrorMessages").append("div"); + messageContainer.node().id = "messageContainerId_" + _messageId; + + var messageContext = messageContainer.append("div"); + messageContext.node().id = "messageContextId_" + _messageId; + messageContext.style("top", "0"); + messageContainer.style("position", "relative"); + messageContainer.style("width", "100%"); + //save in array + _messageContainers.push(messageContainer); + _messageContext.push(messageContext); + + // add animation to the container + messageContainer.node().addEventListener("animationend", _msgContainer_animationEnd); + + // set visible flag that is used in end of animation + _visibleStatus[_messageId] = true; + return _messageId; + }; + + function _msgContainer_animationEnd(){ + var containerId = this.id; + var tokens = containerId.split("_")[1]; + var mContainer = d3.select("#" + containerId); + // get number of children + mContainer.classed("hidden", !_visibleStatus[tokens]); + // clean up DOM + if ( !_visibleStatus[tokens] ) { + mContainer.remove(); + _messageContext[tokens] = null; + _messageContainers[tokens] = null; + } + // remove event listener + var c = d3.select(this); + // c.node().removeEventListener("animationend",_msgContainer_animationEnd); + } + + warningModule.createMessageContext = function ( id ){ + var warningContainer = _messageContext[id]; + var moduleContainer = _messageContainers[id]; + var generalHint = warningContainer.append('div'); + generalHint.node().innerHTML = ""; + _editorHintId = id; + /** Editing mode activated. You can now modify an existing ontology or create a new one via the <em>ontology</em> menu. You can save any ontology using the <em>export</em> menu (and exporting it as TTL file).**/ + generalHint.node().innerHTML += "Editing mode activated.<br>" + + "You can now modify an existing ontology or create a new one via the <em>ontology</em> menu.<br>" + + "You can save any ontology using the <em>export</em> menu (and exporting it as TTL file)."; + + generalHint.style("padding", "5px"); + generalHint.style("line-height", "1.2em"); + generalHint.style("font-size", "1.2em"); + + + var ul = warningContainer.append('ul'); + ul.append('li').node().innerHTML = "Create a class with <b>double click / tap</b> on empty canvas area."; + ul.append('li').node().innerHTML = "Edit names with <b>double click / tap</b> on element.</li>"; + ul.append('li').node().innerHTML = "Selection of default constructors is provided in the left sidebar."; + ul.append('li').node().innerHTML = "Additional editing functionality is provided in the right sidebar."; + + + var gotItButton = warningContainer.append("label"); + gotItButton.node().id = "killWarningErrorMessages_" + id; + gotItButton.node().innerHTML = "Got It"; + gotItButton.on("click", warningModule.closeMessage); + + moduleContainer.classed("hidden", false); + moduleContainer.style("-webkit-animation-name", "warn_ExpandAnimation"); + moduleContainer.style("-webkit-animation-duration", "0.5s"); + }; + + warningModule.showMessage = function ( id ){ + var moduleContainer = _messageContainers[id]; + moduleContainer.classed("hidden", false); + moduleContainer.style("-webkit-animation-name", "warn_ExpandAnimation"); + moduleContainer.style("-webkit-animation-duration", "0.5s"); + }; + + warningModule.closeMessage = function ( id ){ + var nId; + if ( id === undefined ) { + var givenId = this.id; + nId = givenId.split("_")[1]; + } else { + nId = id; + } + if ( id && id.indexOf("_") !== -1 ) { + nId = id.split("_")[1]; + } + _visibleStatus[nId] = false; + // get module; + var moduleContainer = _messageContainers[nId]; + moduleContainer.style("-webkit-animation-name", "warn_CollapseAnimation"); + moduleContainer.style("-webkit-animation-duration", "0.5s"); + + var m_height = moduleContainer.node().getBoundingClientRect().height; + + // find my id in the children + var pNode = moduleContainer.node().parentNode; + + var followingChildren = []; + var pChild = pNode.children; + var pChild_len = pChild.length; + var containerId = moduleContainer.node().id; + var found_me = false; + for ( var i = 0; i < pChild_len; i++ ) { + if ( found_me === true ) { + followingChildren.push(pChild[i].id); + } + + if ( containerId === pChild[i].id ) { + found_me = true; + } + } + + for ( var fc = 0; fc < followingChildren.length; fc++ ) { + var child = d3.select("#" + followingChildren[fc]); + // get the document style and overwrite it; + var superCss = document.styleSheets[styleSelectorIndex].cssRules[cssStyleIndex]; + // remove the existing 0% and 100% rules + superCss.deleteRule("0%"); + superCss.deleteRule("100%"); + + superCss.appendRule("0% {top: 0;}"); + superCss.appendRule("100% {top: -" + m_height + "px;"); + + child.style("-webkit-animation-name", "msg_CollapseAnimation"); + child.style("-webkit-animation-duration", "0.5s"); + child.node().addEventListener("animationend", _child_animationEnd); + } + }; + + function _child_animationEnd(){ + var c = d3.select(this); + c.style("-webkit-animation-name", ""); + c.style("-webkit-animation-duration", ""); + c.node().removeEventListener("animationend", _child_animationEnd); + } + + warningModule.closeFilterHint = function (){ + if ( _messageContainers[_filterHintId] ) { + _messageContainers[_filterHintId].classed("hidden", true); + _messageContainers[_filterHintId].remove(); + _messageContainers[_filterHintId] = null; + _messageContext[_filterHintId] = null; + _visibleStatus[_filterHintId] = false; + } + }; + + warningModule.showEditorHint = function (){ + var id = warningModule.addMessageBox(); + warningModule.createMessageContext(id); + }; + + warningModule.showExporterWarning=function (){ + warningModule.showWarning("Can not export ontology", "Detected unsupported ontology axioms, (e.g. owl:Union)", "Ontology is not exported", 1, false); + }; + + + + warningModule.responseWarning = function ( header, reason, action, callback, parameterArray, forcedWarning ){ + var id = warningModule.addMessageBox(); + var warningContainer = _messageContext[id]; + var moduleContainer = _messageContainers[id]; + _visibleStatus[id] = true; + d3.select("#blockGraphInteractions").classed("hidden", false); + var graphWidth = 0.5 * graph.options().width(); + + if ( header.length > 0 ) { + var head = warningContainer.append("div"); + head.style("padding", "5px"); + var titleHeader = head.append("div"); + // some classes + titleHeader.style("display", "inline-flex"); + titleHeader.node().innerHTML = "<b>Warning:</b>"; + titleHeader.style("padding-right", "3px"); + var msgHeader = head.append("div"); + // some classes + msgHeader.style("display", "inline-flex"); + msgHeader.style("max-width", graphWidth + "px"); + + msgHeader.node().innerHTML = header; + } + if ( reason.length > 0 ) { + var reasonContainer = warningContainer.append("div"); + reasonContainer.style("padding", "5px"); + var reasonHeader = reasonContainer.append("div"); + // some classes + reasonHeader.style("display", "inline-flex"); + reasonHeader.style("padding-right", "3px"); + + reasonHeader.node().innerHTML = "<b>Reason:</b>"; + var msgReason = reasonContainer.append("div"); + // some classes + msgReason.style("display", "inline-flex"); + msgReason.style("max-width", graphWidth + "px"); + msgReason.node().innerHTML = reason; + } + if ( action.length > 0 ) { + var actionContainer = warningContainer.append("div"); + actionContainer.style("padding", "5px"); + var actionHeader = actionContainer.append("div"); + // some classes + actionHeader.style("display", "inline-flex"); + actionHeader.style("padding-right", "8px"); + actionHeader.node().innerHTML = "<b>Action:</b>"; + var msgAction = actionContainer.append("div"); + // some classes + msgAction.style("display", "inline-flex"); + msgAction.style("max-width", graphWidth + "px"); + msgAction.node().innerHTML = action; + } + + var gotItButton = warningContainer.append("label"); + gotItButton.node().id = "killWarningErrorMessages_" + id; + gotItButton.node().innerHTML = "Continue"; + gotItButton.on("click", function (){ + warningModule.closeMessage(this.id); + d3.select("#blockGraphInteractions").classed("hidden", true); + callback(parameterArray[0], parameterArray[1], parameterArray[2], parameterArray[3]); + }); + warningContainer.append("span").node().innerHTML = "|"; + var cancelButton = warningContainer.append("label"); + cancelButton.node().id = "cancelButton_" + id; + cancelButton.node().innerHTML = "Cancel"; + cancelButton.on("click", function (){ + warningModule.closeMessage(this.id); + d3.select("#blockGraphInteractions").classed("hidden", true); + }); + moduleContainer.classed("hidden", false); + moduleContainer.style("-webkit-animation-name", "warn_ExpandAnimation"); + moduleContainer.style("-webkit-animation-duration", "0.5s"); + }; + + warningModule.showFilterHint = function (){ + var id = warningModule.addMessageBox(); + var warningContainer = _messageContext[id]; + var moduleContainer = _messageContainers[id]; + _visibleStatus[id] = true; + + _filterHintId = id; + var generalHint = warningContainer.append('div'); + /** Editing mode activated. You can now modify an existing ontology or create a new one via the <em>ontology</em> menu. You can save any ontology using the <em>export</em> menu (and exporting it as TTL file).**/ + generalHint.node().innerHTML = "Collapsing filter activated.<br>" + + "The number of visualized elements has been automatically reduced.<br>" + + "Use the degree of collapsing slider in the <em>filter</em> menu to adjust the visualization.<br><br>" + + "<em>Note:</em> A performance decrease could be experienced with a growing amount of visual elements in the graph."; + + + generalHint.style("padding", "5px"); + generalHint.style("line-height", "1.2em"); + generalHint.style("font-size", "1.2em"); + + var gotItButton = warningContainer.append("label"); + gotItButton.node().id = "killFilterMessages_" + id; + gotItButton.node().innerHTML = "Got It"; + gotItButton.on("click", warningModule.closeMessage); + + moduleContainer.classed("hidden", false); + moduleContainer.style("-webkit-animation-name", "warn_ExpandAnimation"); + moduleContainer.style("-webkit-animation-duration", "0.5s"); + }; + + warningModule.showMultiFileUploadWarning = function (){ + var id = warningModule.addMessageBox(); + var warningContainer = _messageContext[id]; + var moduleContainer = _messageContainers[id]; + _visibleStatus[id] = true; + + _filterHintId = id; + var generalHint = warningContainer.append('div'); + + generalHint.node().innerHTML = "Uploading multiple files is not supported.<br>"; + + generalHint.style("padding", "5px"); + generalHint.style("line-height", "1.2em"); + generalHint.style("font-size", "1.2em"); + + var gotItButton = warningContainer.append("label"); + gotItButton.node().id = "killFilterMessages_" + id; + gotItButton.node().innerHTML = "Got It"; + gotItButton.on("click", warningModule.closeMessage); + + moduleContainer.classed("hidden", false); + moduleContainer.style("-webkit-animation-name", "warn_ExpandAnimation"); + moduleContainer.style("-webkit-animation-duration", "0.5s"); + }; + + warningModule.showWarning = function ( header, reason, action, type, forcedWarning, additionalOpts ){ + var id = warningModule.addMessageBox(); + var warningContainer = _messageContext[id]; + var moduleContainer = _messageContainers[id]; + _visibleStatus[id] = true; + + // add new one; + var graphWidth = 0.5 * graph.options().width(); + + if ( header.length > 0 ) { + var head = warningContainer.append("div"); + head.style("padding", "5px"); + var titleHeader = head.append("div"); + // some classes + titleHeader.style("display", "inline-flex"); + titleHeader.node().innerHTML = "<b>Warning:</b>"; + titleHeader.style("padding-right", "3px"); + var msgHeader = head.append("div"); + // some classes + msgHeader.style("display", "inline-flex"); + msgHeader.style("max-width", graphWidth + "px"); + + msgHeader.node().innerHTML = header; + } + if ( reason.length > 0 ) { + var reasonContainer = warningContainer.append("div"); + reasonContainer.style("padding", "5px"); + var reasonHeader = reasonContainer.append("div"); + // some classes + reasonHeader.style("display", "inline-flex"); + reasonHeader.style("padding-right", "3px"); + + reasonHeader.node().innerHTML = "<b>Reason:</b>"; + var msgReason = reasonContainer.append("div"); + // some classes + msgReason.style("display", "inline-flex"); + msgReason.style("max-width", graphWidth + "px"); + msgReason.node().innerHTML = reason; + } + if ( action.length > 0 ) { + var actionContainer = warningContainer.append("div"); + actionContainer.style("padding", "5px"); + var actionHeader = actionContainer.append("div"); + // some classes + actionHeader.style("display", "inline-flex"); + actionHeader.style("padding-right", "8px"); + actionHeader.node().innerHTML = "<b>Action:</b>"; + var msgAction = actionContainer.append("div"); + // some classes + msgAction.style("display", "inline-flex"); + msgAction.style("max-width", graphWidth + "px"); + msgAction.node().innerHTML = action; + } + + var gotItButton; + if ( type === 1 ) { + gotItButton = warningContainer.append("label"); + gotItButton.node().id = "killWarningErrorMessages_" + id; + gotItButton.node().innerHTML = "Got It"; + gotItButton.on("click", warningModule.closeMessage); + } + + if ( type === 2 ) { + gotItButton = warningContainer.append("label"); + gotItButton.node().id = "killWarningErrorMessages_" + id; + gotItButton.node().innerHTML = "Got It"; + gotItButton.on("click", warningModule.closeMessage); + warningContainer.append("span").node().innerHTML = "|"; + var zoomToElementButton = warningContainer.append("label"); + zoomToElementButton.node().id = "zoomElementThing_" + id; + zoomToElementButton.node().innerHTML = "Zoom to element "; + zoomToElementButton.on("click", function (){ + // assume the additional Element is for halo; + graph.zoomToElementInGraph(additionalOpts); + }); + warningContainer.append("span").node().innerHTML = "|"; + var ShowElementButton = warningContainer.append("label"); + ShowElementButton.node().id = "showElementThing_" + id; + ShowElementButton.node().innerHTML = "Indicate element"; + ShowElementButton.on("click", function (){ + // assume the additional Element is for halo; + if ( additionalOpts.halo() === false ) { + additionalOpts.drawHalo(); + graph.updatePulseIds([additionalOpts.id()]); + } else { + additionalOpts.removeHalo(); + additionalOpts.drawHalo(); + graph.updatePulseIds([additionalOpts.id()]); + } + }); + } + moduleContainer.classed("hidden", false); + moduleContainer.style("-webkit-animation-name", "warn_ExpandAnimation"); + moduleContainer.style("-webkit-animation-duration", "0.5s"); + moduleContainer.classed("hidden", false); + }; + + return warningModule; + }; + + + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), + +/***/ 344: +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {module.exports = function ( graph ){ + /** variable defs **/ + var directInputModule = {}; + var inputContainer = d3.select("#DirectInputContent"); + inputContainer.style("top", "0"); + inputContainer.style("position", "absolute"); + var textArea = d3.select("#directInputTextArea"); + var visibleContainer = false; + + inputContainer.style("border", "1px solid black"); + inputContainer.style("padding", "5px"); + inputContainer.style("background", "#fff"); + + + // connect upload and close button; + directInputModule.handleDirectUpload = function (){ + + var text = textArea.node().value; + var jsonOBJ; + try { + jsonOBJ = JSON.parse(text); + graph.options().loadingModule().directInput(text); + // close if successful + if ( jsonOBJ.class.length > 0 ) { + directInputModule.setDirectInputMode(false); + } + } + catch ( e ) { + try { + // Initialize; + graph.options().loadingModule().initializeLoader(); + graph.options().loadingModule().requestServerTimeStampForDirectInput( + graph.options().ontologyMenu().callbackLoad_Ontology_From_DirectInput, text + ); + } catch ( error2 ) { + console.log("Error " + error2); + d3.select("#Error_onLoad").classed("hidden", false); + d3.select("#Error_onLoad").node().innerHTML = "Failed to convert the input!"; + } + } + }; + + directInputModule.handleCloseButton = function (){ + directInputModule.setDirectInputMode(false); + }; + + directInputModule.updateLayout = function (){ + var w = graph.options().width(); + var h = graph.options().height(); + textArea.style("width", 0.4 * w + "px"); + textArea.style("height", 0.7 * h + "px"); + }; + + directInputModule.setDirectInputMode = function ( val ){ + if ( !val ) { + visibleContainer = !visibleContainer; + } + else { + visibleContainer = val; + } + // update visibility; + directInputModule.updateLayout(); + d3.select("#Error_onLoad").classed("hidden", true); + inputContainer.classed("hidden", !visibleContainer); + }; + + + d3.select("#directUploadBtn").on("click", directInputModule.handleDirectUpload); + d3.select("#close_directUploadBtn").on("click", directInputModule.handleCloseButton); + + return directInputModule; + }; + + + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }) + +/******/ }); diff --git a/cluedo4KG-sources/webvowl/js/webvowl.js b/cluedo4KG-sources/webvowl/js/webvowl.js new file mode 100644 index 0000000000000000000000000000000000000000..1aba35e7277e8a59b4b828083616e3fb6a3e570a --- /dev/null +++ b/cluedo4KG-sources/webvowl/js/webvowl.js @@ -0,0 +1,25345 @@ +webvowl = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + + __webpack_require__(1); + + var nodeMap = __webpack_require__(5)(); + var propertyMap = __webpack_require__(40)(); + + + var webvowl = {}; + webvowl.graph = __webpack_require__(57); + webvowl.options = __webpack_require__(64); + webvowl.version = "1.1.7"; + + webvowl.util = {}; + webvowl.util.constants = __webpack_require__(12); + webvowl.util.languageTools = __webpack_require__(11); + webvowl.util.elementTools = __webpack_require__(63); + webvowl.util.prefixTools = __webpack_require__(72); + webvowl.modules = {}; + webvowl.modules.colorExternalsSwitch = __webpack_require__(73); + webvowl.modules.compactNotationSwitch = __webpack_require__(74); + webvowl.modules.datatypeFilter = __webpack_require__(75); + webvowl.modules.disjointFilter = __webpack_require__(77); + webvowl.modules.focuser = __webpack_require__(78); + webvowl.modules.emptyLiteralFilter = __webpack_require__(79); + webvowl.modules.nodeDegreeFilter = __webpack_require__(80); + webvowl.modules.nodeScalingSwitch = __webpack_require__(81); + webvowl.modules.objectPropertyFilter = __webpack_require__(82); + webvowl.modules.pickAndPin = __webpack_require__(83); + webvowl.modules.selectionDetailsDisplayer = __webpack_require__(315); + webvowl.modules.setOperatorFilter = __webpack_require__(316); + webvowl.modules.statistics = __webpack_require__(317); + webvowl.modules.subclassFilter = __webpack_require__(318); + + + webvowl.nodes = {}; + nodeMap.entries().forEach(function ( entry ){ + mapEntryToIdentifier(webvowl.nodes, entry); + }); + + webvowl.properties = {}; + propertyMap.entries().forEach(function ( entry ){ + mapEntryToIdentifier(webvowl.properties, entry); + }); + + function mapEntryToIdentifier( map, entry ){ + var identifier = entry.key.replace(":", "").toLowerCase(); + map[identifier] = entry.value; + } + + + module.exports = webvowl; + + +/***/ }), +/* 1 */ +/***/ (function(module, exports) { + + // removed by extract-text-webpack-plugin + +/***/ }), +/* 2 */, +/* 3 */, +/* 4 */, +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {var nodes = []; + nodes.push(__webpack_require__(7)); + nodes.push(__webpack_require__(18)); + nodes.push(__webpack_require__(19)); + nodes.push(__webpack_require__(26)); + nodes.push(__webpack_require__(27)); + nodes.push(__webpack_require__(28)); + nodes.push(__webpack_require__(29)); + nodes.push(__webpack_require__(30)); + nodes.push(__webpack_require__(31)); + nodes.push(__webpack_require__(32)); + nodes.push(__webpack_require__(33)); + nodes.push(__webpack_require__(34)); + nodes.push(__webpack_require__(38)); + nodes.push(__webpack_require__(39)); + + var map = d3.map(nodes, function ( Prototype ){ + return new Prototype().type(); + }); + + module.exports = function (){ + return map; + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), +/* 6 */ +/***/ (function(module, exports) { + + module.exports = d3; + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + + var RoundNode = __webpack_require__(8); + + module.exports = (function (){ + + var o = function ( graph ){ + RoundNode.apply(this, arguments); + + this.attributes(["external"]) + .type("ExternalClass"); + }; + o.prototype = Object.create(RoundNode.prototype); + o.prototype.constructor = o; + + return o; + }()); + + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + + var BaseNode = __webpack_require__(9); + var CenteringTextElement = __webpack_require__(14); + var drawTools = __webpack_require__(17)(); + + module.exports = (function (){ + + var o = function ( graph ){ + BaseNode.apply(this, arguments); + + var that = this, + collapsible = false, + radius = 50, + collapsingGroupElement, + pinGroupElement, + haloGroupElement = null, + rectangularRepresentation = false, + renderingElement, + textBlock; + + this.setRectangularRepresentation = function ( val ){ + rectangularRepresentation = val; + }; + this.getRectangularRepresentation = function (){ + return rectangularRepresentation; + }; + + this.getHalos = function (){ + return haloGroupElement; + }; + + // Properties + this.collapsible = function ( p ){ + if ( !arguments.length ) return collapsible; + collapsible = p; + return this; + }; + + this.textBlock = function ( p ){ + if ( !arguments.length ) return textBlock; + textBlock = p; + return this; + }; + + /** + * This might not be equal to the actual radius, because the instance count is used for its calculation. + * @param p + * @returns {*} + */ + this.radius = function ( p ){ + if ( !arguments.length ) return radius; + radius = p; + return this; + }; + + + // Functions + this.setHoverHighlighting = function ( enable ){ + that.nodeElement().selectAll("circle").classed("hovered", enable); + }; + + this.textWidth = function ( yOffset ){ + var availableWidth = this.actualRadius() * 2; + + // if the text is not placed in the center of the circle, it can't have the full width + if ( yOffset ) { + var relativeOffset = Math.abs(yOffset) / this.actualRadius(); + var isOffsetInsideOfNode = relativeOffset <= 1; + + if ( isOffsetInsideOfNode ) { + availableWidth = Math.cos(relativeOffset) * availableWidth; + } else { + availableWidth = 0; + } + } + + return availableWidth; + }; + + this.toggleFocus = function (){ + that.focused(!that.focused()); + if ( that.nodeElement() ) + that.nodeElement().select("circle").classed("focused", that.focused()); + graph.resetSearchHighlight(); + graph.options().searchMenu().clearText(); + + }; + + this.actualRadius = function (){ + if ( !graph.options().scaleNodesByIndividuals() || that.individuals().length <= 0 ) { + return that.radius(); + } else { + // we could "listen" for radius and maxIndividualCount changes, but this is easier + var MULTIPLIER = 8, + additionalRadius = Math.log(that.individuals().length + 1) * MULTIPLIER + 5; + + return that.radius() + additionalRadius; + } + }; + + this.distanceToBorder = function (){ + return that.actualRadius(); + }; + + this.removeHalo = function (){ + if ( that.halo() ) { + that.halo(false); + if ( haloGroupElement ) { + haloGroupElement.remove(); + } + } + }; + + this.drawHalo = function ( pulseAnimation ){ + that.halo(true); + if ( rectangularRepresentation === true ) { + haloGroupElement = drawTools.drawRectHalo(that.nodeElement(), 80, 80, 5); + } else { + haloGroupElement = drawTools.drawHalo(that.nodeElement(), that.actualRadius(), this.removeHalo); + } + if ( pulseAnimation === false ) { + var pulseItem = haloGroupElement.selectAll(".searchResultA"); + pulseItem.classed("searchResultA", false); + pulseItem.classed("searchResultB", true); + pulseItem.attr("animationRunning", false); + } + }; + + /** + * Draws the pin on a round node on a position depending on its radius. + */ + this.drawPin = function (){ + that.pinned(true); + var dx = (-3.5 / 5) * that.actualRadius(), + dy = (-7 / 10) * that.actualRadius(); + pinGroupElement = drawTools.drawPin(that.nodeElement(), dx, dy, this.removePin, graph.options().showDraggerObject, graph.options().useAccuracyHelper()); + + + }; + + /** + * Removes the pin and refreshs the graph to update the force layout. + */ + this.removePin = function (){ + that.pinned(false); + if ( pinGroupElement ) { + pinGroupElement.remove(); + } + graph.updateStyle(); + }; + + this.drawCollapsingButton = function (){ + + collapsingGroupElement = that.nodeElement() + .append("g") + .classed("hidden-in-export", true) + .attr("transform", function (){ + var dx = (-2 / 5) * that.actualRadius(), + dy = (1 / 2) * that.actualRadius(); + return "translate(" + dx + "," + dy + ")"; + }); + + collapsingGroupElement.append("rect") + .classed("class pin feature", true) + .attr("x", 0) + .attr("y", 0) + .attr("width", 40) + .attr("height", 24); + + collapsingGroupElement.append("line") + .attr("x1", 13) + .attr("y1", 12) + .attr("x2", 27) + .attr("y2", 12); + + collapsingGroupElement.append("line") + .attr("x1", 20) + .attr("y1", 6) + .attr("x2", 20) + .attr("y2", 18); + }; + + /** + * Draws a circular node. + * @param parentElement the element to which this node will be appended + * @param [additionalCssClasses] additional css classes + */ + this.draw = function ( parentElement, additionalCssClasses ){ + var cssClasses = that.collectCssClasses(); + that.nodeElement(parentElement); + + var bgColor = that.backgroundColor(); + if ( bgColor === null ) bgColor = undefined; + if ( that.attributes().indexOf("deprecated") > -1 ) { + bgColor = undefined; + } + if ( additionalCssClasses instanceof Array ) { + cssClasses = cssClasses.concat(additionalCssClasses); + } + if ( rectangularRepresentation === true ) { + renderingElement = drawTools.appendRectangularClass(parentElement, 80, 80, cssClasses, that.labelForCurrentLanguage(), bgColor); + } else { + renderingElement = drawTools.appendCircularClass(parentElement, that.actualRadius(), cssClasses, that.labelForCurrentLanguage(), bgColor); + } + that.postDrawActions(parentElement); + }; + + this.redrawElement = function (){ + renderingElement.remove(); + textBlock.remove(); + var bgColor = that.backgroundColor(); + if ( that.attributes().indexOf("deprecated") > -1 ) { + bgColor = undefined; + } + + var cssClasses = that.collectCssClasses(); + + if ( rectangularRepresentation === true ) { + renderingElement = drawTools.appendRectangularClass(that.nodeElement(), 80, 80, cssClasses, that.labelForCurrentLanguage(), bgColor); + } else { + renderingElement = drawTools.appendCircularClass(that.nodeElement(), that.actualRadius(), cssClasses, that.labelForCurrentLanguage(), bgColor); + } + that.postDrawActions(that.nodeElement()); + }; + /** + * Common actions that should be invoked after drawing a node. + */ + this.postDrawActions = function (){ + that.textBlock(createTextBlock()); + + that.addMouseListeners(); + if ( that.pinned() ) { + that.drawPin(); + } + if ( that.halo() ) { + that.drawHalo(false); + } + if ( that.collapsible() ) { + that.drawCollapsingButton(); + } + }; + + this.redrawLabelText = function (){ + that.textBlock().remove(); + that.textBlock(createTextBlock()); + renderingElement.select("title").text(that.labelForCurrentLanguage()); + }; + function createTextBlock(){ + var bgColor = that.backgroundColor(); + if ( that.attributes().indexOf("deprecated") > -1 ) + bgColor = undefined; + + var textBlock = new CenteringTextElement(that.nodeElement(), bgColor); + + var equivalentsString = that.equivalentsString(); + var suffixForFollowingEquivalents = equivalentsString ? "," : ""; + + textBlock.addText(that.labelForCurrentLanguage(), "", suffixForFollowingEquivalents); + textBlock.addEquivalents(equivalentsString); + if ( !graph.options().compactNotation() ) { + textBlock.addSubText(that.indicationString()); + } + textBlock.addInstanceCount(that.individuals().length); + + return textBlock; + } + + this.equivalentsString = function (){ + var equivalentClasses = that.equivalents(); + if ( !equivalentClasses ) { + return; + } + + return equivalentClasses + .map(function ( node ){ + return node.labelForCurrentLanguage(); + }) + .join(", "); + }; + }; + o.prototype = Object.create(BaseNode.prototype); + o.prototype.constructor = o; + + return o; + }()); + + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {var BaseElement = __webpack_require__(10); + var forceLayoutNodeFunctions = __webpack_require__(13)(); + + module.exports = (function (){ + + var Base = function ( graph ){ + BaseElement.apply(this, arguments); + + var that = this, + // Basic attributes + complement, + disjointUnion, + disjointWith, + individuals = [], + intersection, + union, + links, + rendertype = "round", + // Additional attributes + maxIndividualCount, + fobj, // foreigner object for editing + ignoreLocalHoverEvents = false, + backupFullIri, + // Element containers + nodeElement; + + // array to store my properties; // we will need this also later for semantic zooming stuff + var assignedProperties = []; + that.editingTextElement = false; + + this.isPropertyAssignedToThisElement = function ( property ){ + // this goes via IRIS + console.log("Element IRI :" + property.iri()); + if ( property.type() === "rdfs:subClassOf" ) + for ( var i = 0; i < assignedProperties.length; i++ ) { + var iriEl = assignedProperties[i].iri(); + if ( property.iri() === iriEl ) { + return true; + } + if ( property.type() === "rdfs:subClassOf" && assignedProperties[i].type() === "rdfs:subClassOf" ) + return true; + if ( property.type() === "owl:disjointWith" && assignedProperties[i].type() === "owl:disjointWith" ) + return true; + + } + return false; + }; + + + this.existingPropertyIRI = function ( url ){ + // this goes via IRIS + for ( var i = 0; i < assignedProperties.length; i++ ) { + var iriEl = assignedProperties[i].iri(); + if ( iriEl === url ) { + return true; + } + } + return false; + }; + + this.addProperty = function ( property ){ + if ( assignedProperties.indexOf(property) === -1 ) { + assignedProperties.push(property); + } + }; + + this.removePropertyElement = function ( property ){ + // console.log("Calling removing old property!"+ property.iri()); + if ( assignedProperties.indexOf(property) !== -1 ) { + // console.log("Found it!"); + assignedProperties.splice(assignedProperties.indexOf(property), 1); + } + }; + this.getMyProperties = function (){ + return assignedProperties; + }; + this.copyOtherProperties = function ( otherProperties ){ + assignedProperties = otherProperties; + }; + + this.copyInformation = function ( other ){ + console.log(other.labelForCurrentLanguage()); + if ( other.type() !== "owl:Thing" ) + that.label(other.label()); + that.complement(other.complement()); + that.iri(other.iri()); + that.copyOtherProperties(other.getMyProperties()); + that.baseIri(other.baseIri()); + if ( other.type() === "owl:Class" ) { + that.backupLabel(other.label()); + // console.log("copied backup label"+that.backupLabel()); + } + if ( other.backupLabel() !== undefined ) { + that.backupLabel(other.backupLabel()); + } + }; + + this.enableEditing = function ( autoEditing ){ + if ( autoEditing === false ) + return; + that.raiseDoubleClickEdit(true); + }; + + this.raiseDoubleClickEdit = function ( forceIRISync ){ + d3.selectAll(".foreignelements").remove(); + if ( nodeElement === undefined || this.type() === "owl:Thing" || this.type() === "rdfs:Literal" ) { + console.log("No Container found"); + return; + } + if ( fobj !== undefined ) { + nodeElement.selectAll(".foreignelements").remove(); + } + + backupFullIri = undefined; + graph.options().focuserModule().handle(undefined); + graph.options().focuserModule().handle(that); + // add again the editing elements to that one + if ( graph.isTouchDevice() === true ) { + graph.activateHoverElements(true, that, true); + } + that.editingTextElement = true; + ignoreLocalHoverEvents = true; + that.nodeElement().selectAll("circle").classed("hoveredForEditing", true); + graph.killDelayedTimer(); + graph.ignoreOtherHoverEvents(false); + fobj = nodeElement.append("foreignObject") + .attr("x", -0.5 * (that.textWidth() - 2)) + .attr("y", -12) + .attr("height", 30) + .attr("class", "foreignelements") + .on("dragstart", function (){ + return false; + }) // remove drag operations of text element) + .attr("width", that.textWidth() - 2); + + var editText = fobj.append("xhtml:input") + .attr("class", "nodeEditSpan") + .attr("id", that.id()) + .attr("align", "center") + .attr("contentEditable", "true") + .on("dragstart", function (){ + return false; + }); // remove drag operations of text element) + + var bgColor = '#f00'; + var txtWidth = that.textWidth() - 2; + editText.style({ + + 'align': 'center', + 'color': 'black', + 'width': txtWidth + "px", + 'height': '15px', + 'background-color': bgColor, + 'border-bottom': '2px solid black' + }); + var txtNode = editText.node(); + txtNode.value = that.labelForCurrentLanguage(); + txtNode.focus(); + txtNode.select(); + that.frozen(true); // << releases the not after selection + that.locked(true); + + + d3.event.stopPropagation(); + // ignoreNodeHoverEvent=true; + // // add some events that relate to this object + editText.on("click", function (){ + d3.event.stopPropagation(); + }); + // // remove hover Events for now; + editText.on("mouseout", function (){ + d3.event.stopPropagation(); + + + }); + editText.on("mousedown", function (){ + d3.event.stopPropagation(); + }) + .on("keydown", function (){ + d3.event.stopPropagation(); + if ( d3.event.keyCode === 13 ) { + this.blur(); + that.frozen(false); // << releases the not after selection + that.locked(false); + } + }) + .on("keyup", function (){ + if ( forceIRISync ) { + var labelName = editText.node().value; + var resourceName = labelName.replaceAll(" ", "_"); + var syncedIRI = that.baseIri() + resourceName; + backupFullIri = syncedIRI; + + d3.select("#element_iriEditor").node().title = syncedIRI; + d3.select("#element_iriEditor").node().value = graph.options().prefixModule().getPrefixRepresentationForFullURI(syncedIRI); + } + d3.select("#element_labelEditor").node().value = editText.node().value; + + }) + .on("blur", function (){ + that.editingTextElement = false; + ignoreLocalHoverEvents = false; + that.nodeElement().selectAll("circle").classed("hoveredForEditing", false); + var newLabel = editText.node().value; + nodeElement.selectAll(".foreignelements").remove(); + // that.setLabelForCurrentLanguage(classNameConvention(editText.node().value)); + that.label(newLabel); + that.backupLabel(newLabel); + that.redrawLabelText(); + that.frozen(graph.paused()); + that.locked(graph.paused()); + graph.ignoreOtherHoverEvents(false); + // console.log("Calling blur on Node!"); + if ( backupFullIri ) { + var sanityCheckResult = graph.checkIfIriClassAlreadyExist(backupFullIri); + if ( sanityCheckResult === false ) { + that.iri(backupFullIri); + } else { + // throw warnign + graph.options().warningModule().showWarning("Already seen this class", + "Input IRI: " + backupFullIri + " for element: " + that.labelForCurrentLanguage() + " already been set", + "Restoring previous IRI for Element : " + that.iri(), 2, false, sanityCheckResult); + + } + } + if ( graph.isADraggerActive() === false ) { + graph.options().focuserModule().handle(undefined); + graph.options().focuserModule().handle(that); + } + }); // add a foreiner element to this thing; + }; + + + this.renderType = function ( t ){ + if ( !arguments.length ) return rendertype; + rendertype = t; + return this; + }; + // Properties + this.complement = function ( p ){ + if ( !arguments.length ) return complement; + complement = p; + return this; + }; + + this.disjointUnion = function ( p ){ + if ( !arguments.length ) return disjointUnion; + disjointUnion = p; + return this; + }; + + this.disjointWith = function ( p ){ + if ( !arguments.length ) return disjointWith; + disjointWith = p; + return this; + }; + + this.individuals = function ( p ){ + if ( !arguments.length ) return individuals; + individuals = p || []; + return this; + }; + + this.intersection = function ( p ){ + if ( !arguments.length ) return intersection; + intersection = p; + return this; + }; + + this.links = function ( p ){ + if ( !arguments.length ) return links; + links = p; + return this; + }; + + this.maxIndividualCount = function ( p ){ + if ( !arguments.length ) return maxIndividualCount; + maxIndividualCount = p; + return this; + }; + + this.nodeElement = function ( p ){ + if ( !arguments.length ) return nodeElement; + nodeElement = p; + return this; + }; + + this.union = function ( p ){ + if ( !arguments.length ) return union; + union = p; + return this; + }; + + + /** + * Returns css classes generated from the data of this object. + * @returns {Array} + */ + that.collectCssClasses = function (){ + var cssClasses = []; + + if ( typeof that.styleClass() === "string" ) { + cssClasses.push(that.styleClass()); + } + + cssClasses = cssClasses.concat(that.visualAttributes()); + + return cssClasses; + }; + + + // Reused functions TODO refactor + this.addMouseListeners = function (){ + // Empty node + if ( !that.nodeElement() ) { + console.warn(this); + return; + } + + that.nodeElement().selectAll("*") + .on("mouseover", onMouseOver) + .on("mouseout", onMouseOut); + }; + + this.animationProcess = function (){ + var animRuns = false; + if ( that.getHalos() ) { + var haloGr = that.getHalos(); + var haloEls = haloGr.selectAll(".searchResultA"); + animRuns = haloGr.attr("animationRunning"); + if ( typeof animRuns !== "boolean" ) { + // parse this to a boolean value + animRuns = (animRuns === 'true'); + } + if ( animRuns === false ) { + haloEls.classed("searchResultA", false); + haloEls.classed("searchResultB", true); + } + } + return animRuns; + }; + + this.foreground = function (){ + var selectedNode = that.nodeElement().node(), + nodeContainer = selectedNode.parentNode; + // check if the halo is present and an animation is running + if ( that.animationProcess() === false ) { + // Append hovered element as last child to the container list. + nodeContainer.appendChild(selectedNode); + } + + }; + + function onMouseOver(){ + if ( that.mouseEntered() || ignoreLocalHoverEvents === true ) { + return; + } + + var selectedNode = that.nodeElement().node(), + nodeContainer = selectedNode.parentNode; + + // Append hovered element as last child to the container list. + if ( that.animationProcess() === false ) { + nodeContainer.appendChild(selectedNode); + } + if ( graph.isTouchDevice() === false ) { + that.setHoverHighlighting(true); + that.mouseEntered(true); + if ( graph.editorMode() === true && graph.ignoreOtherHoverEvents() === false ) { + graph.activateHoverElements(true, that); + } + } else { + if ( graph.editorMode() === true && graph.ignoreOtherHoverEvents() === false ) { + graph.activateHoverElements(true, that, true); + } + + } + + + } + + function onMouseOut(){ + that.setHoverHighlighting(false); + that.mouseEntered(false); + if ( graph.editorMode() === true && graph.ignoreOtherHoverEvents() === false ) { + graph.activateHoverElements(false); + } + } + + + forceLayoutNodeFunctions.addTo(this); + }; + + Base.prototype = Object.create(BaseElement.prototype); + Base.prototype.constructor = Base; + + + return Base; + }()); + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * The base element for all visual elements of webvowl. + */ + module.exports = (function (){ + + var Base = function ( graph ){ + // Basic attributes + var equivalents = [], + id, + label, + type, + iri, + baseIri, + // Additional attributes + annotations, + attributes = [], + backgroundColor, + comment, + description, + equivalentBase, + visualAttributes = [], + // Style attributes + focused = false, + indications = [], + mouseEntered = false, + styleClass, + visible = true, + + backupLabel, + // Other + languageTools = __webpack_require__(11)(); + + + this.backupLabel = function ( label ){ + if ( !arguments.length ) return backupLabel; + backupLabel = label; + }; + // Properties + this.attributes = function ( p ){ + if ( !arguments.length ) return attributes; + attributes = p; + return this; + }; + + this.annotations = function ( p ){ + if ( !arguments.length ) return annotations; + annotations = p; + return this; + }; + + this.redrawElement = function (){ + // TODO: OVERLOADED BY INDIVIDUAL ELEMENTS + }; + + this.backgroundColor = function ( p ){ + if ( !arguments.length ) return backgroundColor; + backgroundColor = p; + return this; + }; + + this.baseIri = function ( p ){ + if ( !arguments.length ) return baseIri; + baseIri = p; + return this; + }; + + this.comment = function ( p ){ + if ( !arguments.length ) return comment; + comment = p; + return this; + }; + + this.description = function ( p ){ + if ( !arguments.length ) return description; + description = p; + return this; + }; + + this.equivalents = function ( p ){ + if ( !arguments.length ) return equivalents; + equivalents = p || []; + return this; + }; + + this.equivalentBase = function ( p ){ + if ( !arguments.length ) return equivalentBase; + equivalentBase = p; + return this; + }; + + this.focused = function ( p ){ + if ( !arguments.length ) return focused; + focused = p; + return this; + }; + + this.id = function ( p ){ + if ( !arguments.length ) return id; + id = p; + return this; + }; + + this.indications = function ( p ){ + if ( !arguments.length ) return indications; + indications = p; + return this; + }; + + this.iri = function ( p ){ + if ( !arguments.length ) return iri; + iri = p; + return this; + }; + + this.label = function ( p ){ + if ( !arguments.length ) return label; + label = p; + return this; + }; + + this.mouseEntered = function ( p ){ + if ( !arguments.length ) return mouseEntered; + mouseEntered = p; + return this; + }; + + this.styleClass = function ( p ){ + if ( !arguments.length ) return styleClass; + styleClass = p; + return this; + }; + + this.type = function ( p ){ + if ( !arguments.length ) return type; + type = p; + return this; + }; + + this.visible = function ( p ){ + if ( !arguments.length ) return visible; + visible = p; + return this; + }; + + this.visualAttributes = function ( p ){ + if ( !arguments.length ) return visualAttributes; + visualAttributes = p; + return this; + }; + + + this.commentForCurrentLanguage = function (){ + return languageTools.textInLanguage(this.comment(), graph.language()); + }; + + /** + * @returns {string} the css class of this node.. + */ + this.cssClassOfNode = function (){ + return "node" + this.id(); + }; + + this.descriptionForCurrentLanguage = function (){ + return languageTools.textInLanguage(this.description(), graph.language()); + }; + + this.defaultLabel = function (){ + return languageTools.textInLanguage(this.label(), "default"); + }; + + this.indicationString = function (){ + return this.indications().join(", "); + }; + + this.labelForCurrentLanguage = function (){ + var preferredLanguage = graph && graph.language ? graph.language() : null; + return languageTools.textInLanguage(this.label(), preferredLanguage); + }; + }; + + Base.prototype.constructor = Base; + + Base.prototype.equals = function ( other ){ + return other instanceof Base && this.id() === other.id(); + }; + + Base.prototype.toString = function (){ + return this.labelForCurrentLanguage() + " (" + this.type() + ")"; + }; + + + return Base; + }()); + + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + + var constants = __webpack_require__(12)(); + + /** + * Encapsulates methods which return a label in a specific language for a preferred language. + */ + module.exports = (function (){ + + var languageTools = {}; + + + languageTools.textInLanguage = function ( textObject, preferredLanguage ){ + if ( typeof textObject === "undefined" ) { + return undefined; + } + + if ( typeof textObject === "string" ) { + return textObject; + } + + if ( preferredLanguage && textObject.hasOwnProperty(preferredLanguage) ) { + return textObject[preferredLanguage]; + } + + var textForLanguage = searchLanguage(textObject, "en"); + if ( textForLanguage ) { + return textForLanguage; + } + textForLanguage = searchLanguage(textObject, constants.LANG_UNDEFINED); + if ( textForLanguage ) { + return textForLanguage; + } + + return textObject[constants.LANG_IRIBASED]; + }; + + + function searchLanguage( textObject, preferredLanguage ){ + for ( var language in textObject ) { + if ( language === preferredLanguage && textObject.hasOwnProperty(language) ) { + return textObject[language]; + } + } + } + + return function (){ + /* Use a function here to keep a consistent style like webvowl.path.to.module() + * despite having just a single languageTools object. */ + return languageTools; + }; + })(); + + +/***/ }), +/* 12 */ +/***/ (function(module, exports) { + + module.exports = (function (){ + + var constants = {}; + + constants.LANG_IRIBASED = "IRI-based"; + constants.LANG_UNDEFINED = "undefined"; + + return function (){ + /* Use a function here to keep a consistent style like webvowl.path.to.module() + * despite having just a single object. */ + return constants; + }; + })(); + + +/***/ }), +/* 13 */ +/***/ (function(module, exports) { + + /** + * The functions for controlling attributes of nodes of the force layout can't be modelled to the element hierarchy, + * which is used for inheriting visual and OWL-like attributes. + * + * To reduce code redundancy the common functions for controlling the force layout node attributes are excluded into this + * module, which can add them to the node objects. + * + * @type {{}} + */ + var nodeFunctions = {}; + module.exports = function (){ + return nodeFunctions; + }; + + + nodeFunctions.addTo = function ( node ){ + addFixedLocationFunctions(node); + }; + + function addFixedLocationFunctions( node ){ + var locked = false, + frozen = false, + halo = false, + pinned = false; + + node.locked = function ( p ){ + if ( !arguments.length ) { + return locked; + } + locked = p; + applyFixedLocationAttributes(); + return node; + }; + + node.frozen = function ( p ){ + if ( !arguments.length ) { + return frozen; + } + frozen = p; + applyFixedLocationAttributes(); + return node; + }; + + node.halo = function ( p ){ + if ( !arguments.length ) { + return halo; + } + halo = p; + applyFixedLocationAttributes(); + return node; + }; + + node.pinned = function ( p ){ + if ( !arguments.length ) { + return pinned; + } + pinned = p; + applyFixedLocationAttributes(); + return node; + }; + + function applyFixedLocationAttributes(){ + if ( node.locked() || node.frozen() || node.pinned() ) { + node.fixed = true; + } else { + node.fixed = false; + } + } + } + + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + + var textTools = __webpack_require__(15)(); + var AbstractTextElement = __webpack_require__(16); + + module.exports = CenteringTextElement; + function CenteringTextElement( container, backgroundColor ){ + AbstractTextElement.apply(this, arguments); + this.storedFullTextLines = []; + this.storedSpanArrays = []; + this.storedStyle = []; + + } + + CenteringTextElement.prototype = Object.create(AbstractTextElement.prototype); + CenteringTextElement.prototype.constructor = CenteringTextElement; + + CenteringTextElement.prototype.addText = function ( text, prefix, suffix ){ + if ( text ) { + this.addTextline(text, this.CSS_CLASSES.default, prefix, suffix); + } + }; + + CenteringTextElement.prototype.addSubText = function ( text ){ + if ( text ) { + this.addTextline(text, this.CSS_CLASSES.subtext, "(", ")"); + } + }; + + CenteringTextElement.prototype.addEquivalents = function ( text ){ + if ( text ) { + this.addTextline(text, this.CSS_CLASSES.default); + } + }; + + CenteringTextElement.prototype.addInstanceCount = function ( instanceCount ){ + if ( instanceCount ) { + this.addTextline(instanceCount.toString(), this.CSS_CLASSES.instanceCount); + } + }; + CenteringTextElement.prototype.saveCorrespondingSpan = function ( correspondingSpan ){ + this.storedSpanArrays.push(correspondingSpan); + }; + CenteringTextElement.prototype.saveFullTextLine = function ( fullText ){ + this.storedFullTextLines.push(fullText); + }; + CenteringTextElement.prototype.saveStyle = function ( style ){ + this.storedStyle.push(style); + }; + + CenteringTextElement.prototype.updateAllTextElements = function (){ + // TODO : TEST THIS postPrefix >>> _applyPreAndPostFix + for ( var i = 0; i < this.storedSpanArrays.length; i++ ) { + var truncatedText = textTools.truncate(this.storedFullTextLines[i], this._textBlock().datum().textWidth(), this.storedStyle[i]); + this.storedSpanArrays[i].text(truncatedText); + } + }; + + + CenteringTextElement.prototype.addTextline = function ( text, style, prefix, postfix ){ + var truncatedText = textTools.truncate(text, this._textBlock().datum().textWidth(), style); + this.saveFullTextLine(text); + this.saveStyle(style); + var tspan = this._textBlock().append("tspan") + .classed(this.CSS_CLASSES.default, true) + .classed(style, true) + .text(this._applyPreAndPostFix(truncatedText, prefix, postfix)) + .attr("x", 0); + this._repositionTextLine(tspan); + this.saveCorrespondingSpan(tspan); + + this._repositionTextBlock(); + }; + + CenteringTextElement.prototype._repositionTextLine = function ( tspan ){ + var fontSizeProperty = window.getComputedStyle(tspan.node()).getPropertyValue("font-size"); + var fontSize = parseFloat(fontSizeProperty); + + var siblingCount = this._lineCount() - 1; + var lineDistance = siblingCount > 0 ? this.LINE_DISTANCE : 0; + + tspan.attr("dy", fontSize + lineDistance + "px"); + }; + + CenteringTextElement.prototype.getTextBox = function (){ + return this._textBlock(); + }; + + + CenteringTextElement.prototype._repositionTextBlock = function (){ + // Nothing to do if no child elements exist + var lineCount = this._lineCount(); + if ( lineCount < 1 ) { + this._textBlock().attr("y", 0); + return; + } + + var textBlockHeight = this._textBlock().node().getBBox().height; + this._textBlock().attr("y", -textBlockHeight * 0.5 + "px"); + }; + + CenteringTextElement.prototype._lineCount = function (){ + return this._textBlock().property("childElementCount"); + }; + + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {var ADDITIONAL_TEXT_SPACE = 4; + + var tools = {}; + + function measureTextWidth( text, textStyle ){ + // Set a default value + if ( !textStyle ) { + textStyle = "text"; + } + var d = d3.select("body") + .append("div") + .attr("class", textStyle) + .attr("id", "width-test") // tag this element to identify it + .attr("style", "position:absolute; float:left; white-space:nowrap; visibility:hidden;") + .text(text), + w = document.getElementById("width-test").offsetWidth; + d.remove(); + return w; + } + + tools.truncate = function ( text, maxWidth, textStyle, additionalTextSpace ){ + maxWidth -= isNaN(additionalTextSpace) ? ADDITIONAL_TEXT_SPACE : additionalTextSpace; + if ( isNaN(maxWidth) || maxWidth <= 0 ) { + return text; + } + + var truncatedText = text, + newTruncatedTextLength, + textWidth, + ratio; + + while ( true ) { + textWidth = measureTextWidth(truncatedText, textStyle); + if ( textWidth <= maxWidth ) { + break; + } + + ratio = textWidth / maxWidth; + newTruncatedTextLength = Math.floor(truncatedText.length / ratio); + + // detect if nothing changes + if ( truncatedText.length === newTruncatedTextLength ) { + break; + } + + truncatedText = truncatedText.substring(0, newTruncatedTextLength); + } + + if ( text.length > truncatedText.length ) { + return text.substring(0, truncatedText.length - 3) + "..."; + } + return text; + }; + + + module.exports = function (){ + return tools; + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {module.exports = AbstractTextElement; + + function AbstractTextElement( container, backgroundColor ){ + var textBlock = container.append("text") + .classed("text", true) + .style("fill", this._getTextColor(backgroundColor)) + .attr("text-anchor", "middle"); + + this._textBlock = function (){ + return textBlock; + }; + } + + AbstractTextElement.prototype.LINE_DISTANCE = 1; + AbstractTextElement.prototype.CSS_CLASSES = { + default: "text", + subtext: "subtext", + instanceCount: "instance-count" + }; + AbstractTextElement.prototype.DARK_TEXT_COLOR = "#000"; + AbstractTextElement.prototype.LIGHT_TEXT_COLOR = "#fff"; + + AbstractTextElement.prototype.translation = function ( x, y ){ + this._textBlock().attr("transform", "translate(" + x + ", " + y + ")"); + return this; + }; + + AbstractTextElement.prototype.remove = function (){ + this._textBlock().remove(); + return this; + }; + + AbstractTextElement.prototype._applyPreAndPostFix = function ( text, prefix, postfix ){ + if ( prefix ) { + text = prefix + text; + } + if ( postfix ) { + text += postfix; + } + return text; + }; + + AbstractTextElement.prototype._getTextColor = function ( rawBackgroundColor ){ + if ( !rawBackgroundColor ) { + return AbstractTextElement.prototype.DARK_TEXT_COLOR; + } + + var backgroundColor = d3.rgb(rawBackgroundColor); + if ( calculateLuminance(backgroundColor) > 0.5 ) { + return AbstractTextElement.prototype.DARK_TEXT_COLOR; + } else { + return AbstractTextElement.prototype.LIGHT_TEXT_COLOR; + } + }; + + function calculateLuminance( color ){ + return 0.3 * (color.r / 255) + 0.59 * (color.g / 255) + 0.11 * (color.b / 255); + } + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {/** + * Contains reusable function for drawing nodes. + */ + module.exports = (function (){ + + var tools = {}; + + /** + * Append a circular class node with the passed attributes. + * @param parent the parent element to which the circle will be appended + * @param radius + * @param [cssClasses] an array of additional css classes + * @param [tooltip] + * @param [backgroundColor] + * @returns {*} + */ + tools.appendCircularClass = function ( parent, radius, cssClasses, tooltip, backgroundColor ){ + var circle = parent.append("circle") + .classed("class", true) + .attr("r", radius); + + addCssClasses(circle, cssClasses); + addToolTip(circle, tooltip); + addBackgroundColor(circle, backgroundColor); + + return circle; + }; + + function addCssClasses( element, cssClasses ){ + if ( cssClasses instanceof Array ) { + cssClasses.forEach(function ( cssClass ){ + element.classed(cssClass, true); + }); + } + } + + function addToolTip( element, tooltip ){ + if ( tooltip ) { + element.append("title").text(tooltip); + } + } + + function addBackgroundColor( element, backgroundColor ){ + if ( backgroundColor ) { + element.style("fill", backgroundColor); + } + } + + /** + * Appends a rectangular class node with the passed attributes. + * @param parent the parent element to which the rectangle will be appended + * @param width + * @param height + * @param [cssClasses] an array of additional css classes + * @param [tooltip] + * @param [backgroundColor] + * @returns {*} + */ + tools.appendRectangularClass = function ( parent, width, height, cssClasses, tooltip, backgroundColor ){ + var rectangle = parent.append("rect") + .classed("class", true) + .attr("x", -width / 2) + .attr("y", -height / 2) + .attr("width", width) + .attr("height", height); + + addCssClasses(rectangle, cssClasses); + addToolTip(rectangle, tooltip); + addBackgroundColor(rectangle, backgroundColor); + + return rectangle; + }; + + tools.drawPin = function ( container, dx, dy, onClick, accuraciesHelperFunction, useAccuracyHelper ){ + var pinGroupElement = container + .append("g") + .classed("hidden-in-export", true) + .attr("transform", "translate(" + dx + "," + dy + ")"); + + var base = pinGroupElement.append("circle") + .classed("class pin feature", true) + .attr("r", 12) + .on("click", function (){ + if ( onClick ) { + onClick(); + } + d3.event.stopPropagation(); + }); + + pinGroupElement.append("line") + .attr("x1", 0) + .attr("x2", 0) + .attr("y1", 12) + .attr("y2", 16); + + if ( useAccuracyHelper === true ) { + pinGroupElement.append("circle") + .attr("r", 15) + .attr("cx", -7) + .attr("cy", -7) + .classed("superHiddenElement ", true) + .classed("superOpacityElement", !accuraciesHelperFunction()) + .on("click", function (){ + if ( onClick ) { + onClick(); + } + d3.event.stopPropagation(); + }) + .on("mouseover", function (){ + base.classed("feature_hover", true); + }) + .on("mouseout", function (){ + base.classed("feature_hover", false); + }) + ; + + } + + + return pinGroupElement; + }; + + tools.drawRectHalo = function ( node, width, height, offset ){ + var container; + if ( node.nodeElement ) + container = node.nodeElement(); + else + container = node.labelElement(); + + if ( !container ) { + // console.log("no container found"); + return; + } + + var haloGroupElement = container + .append("g") + .classed("hidden-in-export", true); + + haloGroupElement.append("rect") + .classed("searchResultA", true) + .attr("x", (-width - offset) / 2) + .attr("y", (-offset - height) / 2) + .attr("width", width + offset) + .attr("height", height + offset); + haloGroupElement.attr("animationRunning", true); + + haloGroupElement.node().addEventListener("webkitAnimationEnd", function (){ + var test = haloGroupElement.selectAll(".searchResultA"); + test.classed("searchResultA", false) + .classed("searchResultB", true); + haloGroupElement.attr("animationRunning", false); + }); + haloGroupElement.node().addEventListener("animationend", function (){ + var test = haloGroupElement.selectAll(".searchResultA"); + test.classed("searchResultA", false) + .classed("searchResultB", true); + haloGroupElement.attr("animationRunning", false); + }); + + + return haloGroupElement; + + }; + tools.drawHalo = function ( container, radius ){ + if ( container === undefined ) { + return null; + // there is no element to add the halo to; + // this means the node was not rendered previously + } + + var haloGroupElement = container + .append("g") + .classed("hidden-in-export", true); + + + haloGroupElement.append("circle", ":first-child") + .classed("searchResultA", true) + .attr("r", radius + 15); + haloGroupElement.attr("animationRunning", true); + + + haloGroupElement.node().addEventListener("webkitAnimationEnd", function (){ + var test = haloGroupElement.selectAll(".searchResultA"); + test.classed("searchResultA", false) + .classed("searchResultB", true) + .attr("animationRunning", false); + haloGroupElement.attr("animationRunning", false); + }); + haloGroupElement.node().addEventListener("animationend", function (){ + var test = haloGroupElement.selectAll(".searchResultA"); + test.classed("searchResultA", false) + .classed("searchResultB", true) + .attr("animationRunning", false); + haloGroupElement.attr("animationRunning", false); + }); + + return haloGroupElement; + }; + + return function (){ + // Encapsulate into function to maintain default.module.path() + return tools; + }; + })(); + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + + var RoundNode = __webpack_require__(8); + + module.exports = (function (){ + + var o = function ( graph ){ + RoundNode.apply(this, arguments); + + this.type("owl:Class"); + }; + o.prototype = Object.create(RoundNode.prototype); + o.prototype.constructor = o; + + return o; + }()); + + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + + var SetOperatorNode = __webpack_require__(20); + + module.exports = (function (){ + + var o = function ( graph ){ + SetOperatorNode.apply(this, arguments); + + var that = this, + superDrawFunction = that.draw; + + this.styleClass("complementof") + .type("owl:complementOf"); + + this.draw = function ( element ){ + superDrawFunction(element); + + var symbol = element.append("g").classed("embedded", true); + + symbol.append("circle") + .attr("class", "symbol") + .classed("fineline", true) + .attr("r", 10); + symbol.append("path") + .attr("class", "nofill") + .attr("d", "m -7,-1.5 12,0 0,6") + .attr("transform", "scale(.5)"); + + symbol.attr("transform", + "translate(-" + (that.radius() - 15) / 100 + ",-" + (that.radius() - 15) / 100 + ")"); + + that.postDrawActions(); + }; + }; + o.prototype = Object.create(SetOperatorNode.prototype); + o.prototype.constructor = o; + + return o; + }()); + + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + + var AbsoluteTextElement = __webpack_require__(21); + var BoxArrowLink = __webpack_require__(22); + var RoundNode = __webpack_require__(8); + var drawTools = __webpack_require__(17)(); + + module.exports = (function (){ + + var o = function ( graph ){ + RoundNode.apply(this, arguments); + + var that = this, + superHoverHighlightingFunction = that.setHoverHighlighting, + superPostDrawActions = that.postDrawActions; + + this.setHoverHighlighting = function ( enable ){ + superHoverHighlightingFunction(enable); + + // Highlight links pointing to included nodes when hovering the set operator + that.links() + .filter(function ( link ){ + return link instanceof BoxArrowLink; + }) + .filter(function ( link ){ + return link.domain().equals(that); + }) + .forEach(function ( link ){ + link.property().setHighlighting(enable); + }); + }; + + this.draw = function ( element ){ + that.nodeElement(element); + + drawTools.appendCircularClass(element, that.actualRadius(), + that.collectCssClasses().join(" "), + that.labelForCurrentLanguage(), that.backgroundColor()); + }; + + this.postDrawActions = function (){ + superPostDrawActions(); + that.textBlock().remove(); + + var textElement = new AbsoluteTextElement(that.nodeElement(), that.backgroundColor()); + + var equivalentsString = that.equivalentsString(); + var offsetForFollowingEquivalents = equivalentsString ? -30 : -17; + var suffixForFollowingEquivalents = equivalentsString ? "," : ""; + textElement.addText(that.labelForCurrentLanguage(), offsetForFollowingEquivalents, "", + suffixForFollowingEquivalents); + + textElement.addEquivalents(equivalentsString, -17); + + + if ( !graph.options().compactNotation() ) { + + if ( that.indicationString().length > 0 ) { + textElement.addSubText(that.indicationString(), 17); + textElement.addInstanceCount(that.individuals().length, 30); + } else { + textElement.addInstanceCount(that.individuals().length, 17); + } + } else { + textElement.addInstanceCount(that.individuals().length, 17); + } + + that.textBlock(textElement); + }; + }; + o.prototype = Object.create(RoundNode.prototype); + o.prototype.constructor = o; + + return o; + }()); + + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + + var textTools = __webpack_require__(15)(); + var AbstractTextElement = __webpack_require__(16); + + module.exports = AbsoluteTextElement; + function AbsoluteTextElement( container, backgroundColor ){ + AbstractTextElement.apply(this, arguments); + } + + AbsoluteTextElement.prototype = Object.create(AbstractTextElement.prototype); + AbsoluteTextElement.prototype.constructor = AbsoluteTextElement; + + AbsoluteTextElement.prototype.addText = function ( text, yShift, prefix, suffix ){ + if ( text ) { + this.addTextline(text, this.CSS_CLASSES.default, yShift, prefix, suffix); + } + }; + + AbsoluteTextElement.prototype.addSubText = function ( text, yShift ){ + if ( text ) { + this.addTextline(text, this.CSS_CLASSES.subtext, yShift, "(", ")"); + } + }; + + AbsoluteTextElement.prototype.addEquivalents = function ( text, yShift ){ + if ( text ) { + this.addTextline(text, this.CSS_CLASSES.default, yShift); + } + }; + + AbsoluteTextElement.prototype.addInstanceCount = function ( instanceCount, yShift ){ + if ( instanceCount ) { + this.addTextline(instanceCount.toString(), this.CSS_CLASSES.instanceCount, yShift); + } + }; + + + AbsoluteTextElement.prototype.addTextline = function ( text, style, yShift, prefix, postfix ){ + var truncatedText = textTools.truncate(text, this._textBlock().datum().textWidth(yShift), style); + + var tspan = this._textBlock().append("tspan") + .classed(this.CSS_CLASSES.default, true) + .classed(style, true) + .text(this._applyPreAndPostFix(truncatedText, prefix, postfix)) + .attr("x", 0); + this._repositionTextLine(tspan, yShift); + }; + + AbsoluteTextElement.prototype._repositionTextLine = function ( tspan, yShift ){ + var fontSizeProperty = window.getComputedStyle(tspan.node()).getPropertyValue("font-size"); + var fontSize = parseFloat(fontSizeProperty); + + /* BBox height is not supported in Firefox for tspans and dominant-baseline doesn't work in some SVG editors */ + var approximatedShiftForVerticalCentering = (1 / 3) * fontSize; + + tspan.attr("y", approximatedShiftForVerticalCentering + (yShift || 0) + "px"); + }; + + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + + var PlainLink = __webpack_require__(23); + + + module.exports = BoxArrowLink; + + function BoxArrowLink( domain, range, property ){ + PlainLink.apply(this, arguments); + } + + BoxArrowLink.prototype = Object.create(PlainLink.prototype); + BoxArrowLink.prototype.constructor = BoxArrowLink; + + + BoxArrowLink.prototype.draw = function ( linkGroup, markerContainer ){ + var property = this.label().property(); + var inverse = this.label().inverse(); + + createPropertyMarker(markerContainer, property); + if ( inverse ) { + createInverseMarker(markerContainer, inverse); + } + + PlainLink.prototype.draw.apply(this, arguments); + + // attach the markers to the link + linkGroup.attr("marker-start", "url(#" + property.markerId() + ")"); + if ( inverse ) { + linkGroup.attr("marker-end", "url(#" + inverse.markerId() + ")"); + } + }; + + + function createPropertyMarker( markerContainer, inverse ){ + var inverseMarker = appendBasicMarker(markerContainer, inverse); + inverseMarker.attr("refX", -8); + inverseMarker.append("path") + .attr("d", "M0,-8L8,0L0,8L-8,0L0,-8L8,0") + .classed(inverse.markerType(), true); + + inverse.markerElement(inverseMarker); + } + + function createInverseMarker( markerContainer, property ){ + var marker = appendBasicMarker(markerContainer, property); + marker.attr("refX", 8); + marker.append("path") + .attr("d", "M0,-8L8,0L0,8L-8,0L0,-8L8,0") + .classed(property.markerType(), true); + + property.markerElement(marker); + } + + function appendBasicMarker( markerContainer, property ){ + return markerContainer.append("marker") + .datum(property) + .attr("id", property.markerId()) + .attr("viewBox", "-10 -10 20 20") + .attr("markerWidth", 20) + .attr("markerHeight", 20) + .attr("markerUnits", "userSpaceOnUse") + .attr("orient", "auto"); + } + + +/***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { + + var Label = __webpack_require__(24); + + + module.exports = PlainLink; + + /** + * A link connects at least two VOWL nodes. + * The properties connecting the VOWL nodes are stored separately into the label. + * @param domain + * @param range + * @param property + */ + function PlainLink( domain, range, property ){ + var layers, + layerIndex, + loops, + loopIndex, + pathEl, + label = new Label(property, this); + + var backPart = __webpack_require__(25)(domain, label, this), + frontPart = __webpack_require__(25)(label, range, this); + + + this.layers = function ( p ){ + if ( !arguments.length ) return layers; + layers = p; + return this; + }; + + this.layerIndex = function ( p ){ + if ( !arguments.length ) return layerIndex; + layerIndex = p; + return this; + }; + + this.loops = function ( p ){ + if ( !arguments.length ) return loops; + loops = p; + return this; + }; + + this.loopIndex = function ( p ){ + if ( !arguments.length ) return loopIndex; + loopIndex = p; + return this; + }; + + + this.domain = function (){ + return domain; + }; + + this.label = function (){ + return label; + }; + + this.linkParts = function (){ + return [frontPart, backPart]; + }; + + this.range = function (){ + return range; + }; + this.pathObj = function ( pE ){ + if ( !arguments.length ) { + return pathEl; + } + pathEl = pE; + }; + } + + + PlainLink.prototype.draw = function ( linkGroup ){ + var property = this.label().property(); + var inverse = this.label().inverse(); + + property.linkGroup(linkGroup); + if ( inverse ) { + inverse.linkGroup(linkGroup); + } + + var pathElement = linkGroup.append("path"); + pathElement.classed("link-path", true) + .classed(this.domain().cssClassOfNode(), true) + .classed(this.range().cssClassOfNode(), true) + .classed(property.linkType(), true); + this.pathObj(pathElement); + + }; + + + PlainLink.prototype.inverse = function (){ + return this.label().inverse(); + }; + + PlainLink.prototype.isLoop = function (){ + return this.domain().equals(this.range()); + }; + + PlainLink.prototype.property = function (){ + return this.label().property(); + }; + + + +/***/ }), +/* 24 */ +/***/ (function(module, exports) { + + module.exports = Label; + + /** + * A label represents the element(s) which further describe a link. + * It encapsulates the property and its inverse property. + * @param property the property; the inverse is inferred + * @param link the link this label belongs to + */ + function Label( property, link ){ + this.link = function (){ + return link; + }; + + this.property = function (){ + return property; + }; + + // "Forward" the fixed value set on the property to avoid having to access this container + Object.defineProperty(this, "fixed", { + get: function (){ + var inverseFixed = property.inverse() ? property.inverse().fixed : false; + return property.fixed || inverseFixed; + }, + set: function ( v ){ + property.fixed = v; + if ( property.inverse() ) property.inverse().fixed = v; + } + }); + this.frozen = property.frozen; + this.locked = property.locked; + this.pinned = property.pinned; + } + + Label.prototype.actualRadius = function (){ + return this.property().actualRadius(); + }; + + Label.prototype.draw = function ( container ){ + return this.property().draw(container); + }; + + Label.prototype.inverse = function (){ + return this.property().inverse(); + }; + + Label.prototype.equals = function ( other ){ + if ( !other ) { + return false; + } + + var instance = other instanceof Label; + var equalProperty = this.property().equals(other.property()); + + var equalInverse = false; + if ( this.inverse() ) { + equalInverse = this.inverse().equals(other.inverse()); + } else if ( !other.inverse() ) { + equalInverse = true; + } + + return instance && equalProperty && equalInverse; + }; + + +/***/ }), +/* 25 */ +/***/ (function(module, exports) { + + /** + * A linkPart connects two force layout nodes. + * It reprents a link which can be used in d3's force layout. + * @param _domain + * @param _range + * @param _link + */ + module.exports = function ( _domain, _range, _link ){ + var linkPart = {}, + domain = _domain, + link = _link, + range = _range; + + // Define d3 properties + Object.defineProperties(linkPart, { + "source": { value: domain, writable: true }, + "target": { value: range, writable: true } + }); + + + linkPart.domain = function (){ + return domain; + }; + + linkPart.link = function (){ + return link; + }; + + linkPart.range = function (){ + return range; + }; + + + return linkPart; + }; + + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + + var RoundNode = __webpack_require__(8); + + module.exports = (function (){ + + var o = function ( graph ){ + RoundNode.apply(this, arguments); + + this.attributes(["deprecated"]) + .type("owl:DeprecatedClass") + .styleClass("deprecated") + .indications(["deprecated"]); + }; + o.prototype = Object.create(RoundNode.prototype); + o.prototype.constructor = o; + + return o; + }()); + + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + + var SetOperatorNode = __webpack_require__(20); + + module.exports = (function (){ + + var o = function ( graph ){ + SetOperatorNode.apply(this, arguments); + + var that = this, + superDrawFunction = that.draw; + + this.styleClass("disjointunionof") + .type("owl:disjointUnionOf"); + + this.draw = function ( element ){ + superDrawFunction(element); + + var symbol = element.append("g").classed("embedded", true); + + var symbolRadius = 10; + symbol.append("circle") + .attr("class", "symbol") + .attr("r", symbolRadius); + symbol.append("circle") + .attr("cx", 10) + .attr("class", "symbol") + .classed("fineline", true) + .attr("r", symbolRadius); + symbol.append("circle") + .attr("class", "nofill") + .classed("fineline", true) + .attr("r", symbolRadius); + symbol.append("text") + .attr("class", "link") + .text("1") + .attr("transform", "scale(.7)translate(3,5)"); + + symbol.attr("transform", "translate(-" + (that.radius() - 15) / 7 + ",-" + (that.radius() - 15) / 100 + ")"); + + that.postDrawActions(); + }; + }; + o.prototype = Object.create(SetOperatorNode.prototype); + o.prototype.constructor = o; + + return o; + }()); + + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + + var RoundNode = __webpack_require__(8); + var drawTools = __webpack_require__(17)(); + + module.exports = (function (){ + + var o = function ( graph ){ + RoundNode.apply(this, arguments); + + var CIRCLE_SIZE_DIFFERENCE = 4; + var renderingElement; + var that = this, + superActualRadiusFunction = that.actualRadius; + + this.styleClass("equivalentclass") + .type("owl:equivalentClass"); + + this.actualRadius = function (){ + return superActualRadiusFunction() + CIRCLE_SIZE_DIFFERENCE; + }; + + this.redrawElement = function (){ + renderingElement.remove(); + that.textBlock().remove(); + var bgColor = that.backgroundColor(); + + if ( that.attributes().indexOf("deprecated") > -1 ) { + bgColor = undefined; + } + var cssClasses = that.collectCssClasses(); + renderingElement = that.nodeElement().append("g"); + + if ( that.getRectangularRepresentation() === true ) { + drawTools.appendRectangularClass(renderingElement, 84, 84, ["white", "embedded"]); + drawTools.appendRectangularClass(renderingElement, 80 - CIRCLE_SIZE_DIFFERENCE, 80 - CIRCLE_SIZE_DIFFERENCE, cssClasses, that.labelForCurrentLanguage(), bgColor); + } else { + drawTools.appendCircularClass(renderingElement, that.actualRadius(), ["white", "embedded"]); + console.log(cssClasses); + console.log(that.attributes()); + console.log("what is bgColor" + bgColor); + drawTools.appendCircularClass(renderingElement, that.actualRadius() - CIRCLE_SIZE_DIFFERENCE, cssClasses, that.labelForCurrentLanguage(), bgColor); + + } + that.postDrawActions(that.nodeElement()); + + }; + this.draw = function ( parentElement ){ + var cssClasses = that.collectCssClasses(); + + that.nodeElement(parentElement); + renderingElement = parentElement.append("g"); + var bgColor = that.backgroundColor(); + if ( that.attributes().indexOf("deprecated") > -1 ) { + bgColor = undefined; + } + // draw the outer circle at first and afterwards the inner circle + if ( that.getRectangularRepresentation() === true ) { + drawTools.appendRectangularClass(renderingElement, 84, 84, ["white", "embedded"]); + drawTools.appendRectangularClass(renderingElement, 80 - CIRCLE_SIZE_DIFFERENCE, 80 - CIRCLE_SIZE_DIFFERENCE, cssClasses, that.labelForCurrentLanguage(), bgColor); + } else { + drawTools.appendCircularClass(renderingElement, that.actualRadius(), ["white", "embedded"]); + drawTools.appendCircularClass(renderingElement, that.actualRadius() - CIRCLE_SIZE_DIFFERENCE, cssClasses, that.labelForCurrentLanguage(), bgColor); + + } + + that.postDrawActions(); + }; + + /** + * Sets the hover highlighting of this node. + * @param enable + */ + that.setHoverHighlighting = function ( enable ){ + that.nodeElement().selectAll("circle:last-of-type").classed("hovered", enable); + }; + }; + o.prototype = Object.create(RoundNode.prototype); + o.prototype.constructor = o; + + return o; + }()); + + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + + var SetOperatorNode = __webpack_require__(20); + + module.exports = (function (){ + + var o = function ( graph ){ + SetOperatorNode.apply(this, arguments); + + var that = this, + superDrawFunction = that.draw, + INTERSECTION_BACKGROUND_PATH = createIntersectionPath(); + + this.styleClass("intersectionof") + .type("owl:intersectionOf"); + + this.draw = function ( element ){ + superDrawFunction(element); + + var symbol = element.append("g").classed("embedded", true); + + var symbolRadius = 10; + symbol.append("path") + .attr("class", "nostroke") + .classed("symbol", true) + .attr("d", INTERSECTION_BACKGROUND_PATH); + symbol.append("circle") + .attr("class", "nofill") + .classed("fineline", true) + .attr("r", symbolRadius); + symbol.append("circle") + .attr("cx", 10) + .attr("class", "nofill") + .classed("fineline", true) + .attr("r", symbolRadius); + symbol.append("path") + .attr("class", "nofill") + .attr("d", "m 9,5 c 0,-2 0,-4 0,-6 0,0 0,0 0,0 0,0 0,-1.8 -1,-2.3 -0.7,-0.6 -1.7,-0.8 -2.9," + + "-0.8 -1.2,0 -2,0 -3,0.8 -0.7,0.5 -1,1.4 -1,2.3 0,2 0,4 0,6") + .attr("transform", "scale(.5)translate(5,0)"); + + symbol.attr("transform", + "translate(-" + (that.radius() - 15) / 7 + ",-" + (that.radius() - 15) / 100 + ")"); + + that.postDrawActions(); + }; + + function createIntersectionPath(){ + var height = 18; + + var offsetX = 5; + var offsetY = -(height / 2); + + var bezierX = 7; + var bezierY = 5; + var bottomBezierY = height - bezierY; + + var startPosition = "M" + offsetX + "," + offsetY; + var rightSide = "c" + bezierX + "," + bezierY + " " + bezierX + "," + bottomBezierY + " 0," + height; + var leftSide = "c" + -bezierX + "," + -bezierY + " " + -bezierX + "," + -bottomBezierY + " 0," + -height; + + return startPosition + rightSide + leftSide; + } + }; + o.prototype = Object.create(SetOperatorNode.prototype); + o.prototype.constructor = o; + + return o; + }()); + + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + + var OwlThing = __webpack_require__(31); + + module.exports = (function (){ + + var o = function ( graph ){ + OwlThing.apply(this, arguments); + + this.label("Nothing") + .type("owl:Nothing") + .iri("http://www.w3.org/2002/07/owl#Nothing"); + }; + o.prototype = Object.create(OwlThing.prototype); + o.prototype.constructor = o; + + return o; + }()); + + +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + + var RoundNode = __webpack_require__(8); + + module.exports = (function (){ + + var o = function ( graph ){ + RoundNode.apply(this, arguments); + + var superDrawFunction = this.draw; + + this.label("Thing") + .type("owl:Thing") + .iri("http://www.w3.org/2002/07/owl#Thing") + .radius(30); + + this.draw = function ( element ){ + superDrawFunction(element, ["white", "dashed"]); + }; + }; + o.prototype = Object.create(RoundNode.prototype); + o.prototype.constructor = o; + + return o; + }()); + + +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + + var SetOperatorNode = __webpack_require__(20); + + module.exports = (function (){ + + var o = function ( graph ){ + SetOperatorNode.apply(this, arguments); + + var that = this, + superDrawFunction = that.draw; + + this.styleClass("unionof") + .type("owl:unionOf"); + + this.draw = function ( element ){ + superDrawFunction(element); + + var symbol = element.append("g").classed("embedded", true); + + var symbolRadius = 10; + symbol.append("circle") + .attr("class", "symbol") + .attr("r", symbolRadius); + symbol.append("circle") + .attr("cx", 10) + .attr("class", "symbol") + .classed("fineline", true) + .attr("r", symbolRadius); + symbol.append("circle") + .attr("class", "nofill") + .classed("fineline", true) + .attr("r", symbolRadius); + symbol.append("path") + .attr("class", "link") + .attr("d", "m 1,-3 c 0,2 0,4 0,6 0,0 0,0 0,0 0,2 2,3 4,3 2,0 4,-1 4,-3 0,-2 0,-4 0,-6") + .attr("transform", "scale(.5)translate(5,0)"); + + symbol.attr("transform", "translate(-" + (that.radius() - 15) / 7 + ",-" + (that.radius() - 15) / 100 + ")"); + + that.postDrawActions(); + }; + }; + o.prototype = Object.create(SetOperatorNode.prototype); + o.prototype.constructor = o; + + return o; + }()); + + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + + var RoundNode = __webpack_require__(8); + + module.exports = (function (){ + + var o = function ( graph ){ + RoundNode.apply(this, arguments); + + this.attributes(["rdf"]) + .type("rdfs:Class"); + }; + o.prototype = Object.create(RoundNode.prototype); + o.prototype.constructor = o; + + return o; + }()); + + +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { + + var DatatypeNode = __webpack_require__(35); + + module.exports = (function (){ + + var o = function ( graph ){ + DatatypeNode.apply(this, arguments); + var dTypeString = "undefined"; + this.attributes(["datatype"]) + .type("rdfs:Datatype") + .styleClass("datatype"); + this.dType = function ( val ){ + if ( !arguments.length ) return dTypeString; + dTypeString = val; + + }; + }; + o.prototype = Object.create(DatatypeNode.prototype); + o.prototype.constructor = o; + + return o; + }()); + + +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { + + var RectangularNode = __webpack_require__(36); + + module.exports = (function (){ + + var o = function ( graph ){ + RectangularNode.apply(this, arguments); + }; + o.prototype = Object.create(RectangularNode.prototype); + o.prototype.constructor = o; + + return o; + }()); + + +/***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {var BaseNode = __webpack_require__(9); + var CenteringTextElement = __webpack_require__(14); + var drawTools = __webpack_require__(17)(); + var rectangularElementTools = __webpack_require__(37)(); + + module.exports = (function (){ + + var o = function ( graph ){ + BaseNode.apply(this, arguments); + + var that = this, + height = 20, + width = 60, + pinGroupElement, + haloGroupElement, + labelWidth = 80, + myWidth = 80, + defaultWidth = 80, + shapeElement, + textBlock, + smallestRadius = height / 2; + + that.renderType("rect"); + // Properties + this.height = function ( p ){ + if ( !arguments.length ) return height; + height = p; + return this; + }; + + this.width = function ( p ){ + if ( !arguments.length ) return width; + width = p; + return this; + }; + + this.getHalos = function (){ + return haloGroupElement; + }; + + // Functions + // for compatibility reasons // TODO resolve + this.actualRadius = function (){ + return smallestRadius; + }; + + this.distanceToBorder = function ( dx, dy ){ + return rectangularElementTools.distanceToBorder(that, dx, dy); + }; + + this.setHoverHighlighting = function ( enable ){ + that.nodeElement().selectAll("rect").classed("hovered", enable); + + var haloGroup = that.getHalos(); + if ( haloGroup ) { + var test = haloGroup.selectAll(".searchResultA"); + test.classed("searchResultA", false); + test.classed("searchResultB", true); + } + + }; + + + // overwrite the labelWith; + + + this.textWidth = function (){ + return labelWidth; + }; + this.width = function (){ + return labelWidth; + }; + + this.getMyWidth = function (){ + // use a simple heuristic + var text = that.labelForCurrentLanguage(); + myWidth = measureTextWidth(text, "text") + 20; + + // check for sub names; + var indicatorText = that.indicationString(); + var indicatorWidth = measureTextWidth(indicatorText, "subtext") + 20; + if ( indicatorWidth > myWidth ) + myWidth = indicatorWidth; + + return myWidth; + }; + + this.textWidth = function (){ + return that.width(); + }; + function measureTextWidth( text, textStyle ){ + // Set a default value + if ( !textStyle ) { + textStyle = "text"; + } + var d = d3.select("body") + .append("div") + .attr("class", textStyle) + .attr("id", "width-test") // tag this element to identify it + .attr("style", "position:absolute; float:left; white-space:nowrap; visibility:hidden;") + .text(text), + w = document.getElementById("width-test").offsetWidth; + d.remove(); + return w; + } + + this.toggleFocus = function (){ + that.focused(!that.focused()); + that.nodeElement().select("rect").classed("focused", that.focused()); + graph.resetSearchHighlight(); + graph.options().searchMenu().clearText(); + }; + + /** + * Draws the rectangular node. + * @param parentElement the element to which this node will be appended + * @param [additionalCssClasses] additional css classes + */ + this.draw = function ( parentElement, additionalCssClasses ){ + var cssClasses = that.collectCssClasses(); + + that.nodeElement(parentElement); + + if ( additionalCssClasses instanceof Array ) { + cssClasses = cssClasses.concat(additionalCssClasses); + } + + // set the value for that.width() + // update labelWidth Value; + if ( graph.options().dynamicLabelWidth() === true ) labelWidth = Math.min(that.getMyWidth(), graph.options().maxLabelWidth()); + else labelWidth = defaultWidth; + + width = labelWidth; + shapeElement = drawTools.appendRectangularClass(parentElement, that.width(), that.height(), cssClasses, that.labelForCurrentLanguage(), that.backgroundColor()); + + textBlock = new CenteringTextElement(parentElement, that.backgroundColor()); + textBlock.addText(that.labelForCurrentLanguage()); + + that.addMouseListeners(); + + if ( that.pinned() ) { + that.drawPin(); + } + if ( that.halo() ) { + that.drawHalo(false); + } + }; + + this.drawPin = function (){ + that.pinned(true); + // if (graph.options().dynamicLabelWidth()===true) labelWidth=that.getMyWidth(); + // else labelWidth=defaultWidth; + // width=labelWidth; + // console.log("this element label Width is "+labelWidth); + var dx = -0.5 * labelWidth + 5, + dy = -1.1 * height; + + pinGroupElement = drawTools.drawPin(that.nodeElement(), dx, dy, this.removePin, graph.options().showDraggerObject, graph.options().useAccuracyHelper()); + + }; + + this.removePin = function (){ + that.pinned(false); + if ( pinGroupElement ) { + pinGroupElement.remove(); + } + graph.updateStyle(); + }; + + this.removeHalo = function (){ + that.halo(false); + if ( haloGroupElement ) { + haloGroupElement.remove(); + haloGroupElement = null; + } + }; + + this.drawHalo = function ( pulseAnimation ){ + that.halo(true); + + var offset = 0; + haloGroupElement = drawTools.drawRectHalo(that, this.width(), this.height(), offset); + + if ( pulseAnimation === false ) { + var pulseItem = haloGroupElement.selectAll(".searchResultA"); + pulseItem.classed("searchResultA", false); + pulseItem.classed("searchResultB", true); + pulseItem.attr("animationRunning", false); + } + + if ( that.pinned() ) { + var selectedNode = pinGroupElement.node(); + var nodeContainer = selectedNode.parentNode; + nodeContainer.appendChild(selectedNode); + } + + }; + + this.updateTextElement = function (){ + textBlock.updateAllTextElements(); + + }; + + this.textBlock = function (){ + return textBlock; + }; + + this.redrawLabelText = function (){ + textBlock.remove(); + textBlock = new CenteringTextElement(that.nodeElement(), that.backgroundColor()); + textBlock.addText(that.labelForCurrentLanguage()); + that.animateDynamicLabelWidth(graph.options().dynamicLabelWidth()); + shapeElement.select("title").text(that.labelForCurrentLanguage()); + }; + + this.animateDynamicLabelWidth = function ( dynamic ){ + that.removeHalo(); + var height = that.height(); + if ( dynamic === true ) { + labelWidth = Math.min(that.getMyWidth(), graph.options().maxLabelWidth()); + shapeElement.transition().tween("attr", function (){ + }) + .ease('linear') + .duration(100) + .attr({ x: -labelWidth / 2, y: -height / 2, width: labelWidth, height: height }) + .each("end", function (){ + that.updateTextElement(); + }); + + } else { + labelWidth = defaultWidth; + that.updateTextElement(); + shapeElement.transition().tween("attr", function (){ + }) + .ease('linear') + .duration(100) + .attr({ x: -labelWidth / 2, y: -height / 2, width: labelWidth, height: height }); + + } + + // for the pin we dont need to differ between different widths -- they are already set + if ( that.pinned() === true && pinGroupElement ) { + + var dx = 0.5 * labelWidth - 10, + dy = -1.1 * height; + + pinGroupElement.transition() + .tween("attr.translate", function (){ + }) + .attr("transform", "translate(" + dx + "," + dy + ")") + .ease('linear') + .duration(100); + } + }; + + this.addTextLabelElement = function (){ + var parentElement = that.nodeElement(); + textBlock = new CenteringTextElement(parentElement, this.backgroundColor()); + textBlock.addText(that.labelForCurrentLanguage()); + }; + + + }; + o.prototype = Object.create(BaseNode.prototype); + o.prototype.constructor = o; + + return o; + }()); + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), +/* 37 */ +/***/ (function(module, exports) { + + var tools = {}; + module.exports = function (){ + return tools; + }; + + tools.distanceToBorder = function ( rect, dx, dy ){ + var width = rect.width(), + height = rect.height(); + + var innerDistance, + m_link = Math.abs(dy / dx), + m_rect = height / width; + + if ( m_link <= m_rect ) { + var timesX = dx / (width / 2), + rectY = dy / timesX; + innerDistance = Math.sqrt(Math.pow(width / 2, 2) + Math.pow(rectY, 2)); + } else { + var timesY = dy / (height / 2), + rectX = dx / timesY; + innerDistance = Math.sqrt(Math.pow(height / 2, 2) + Math.pow(rectX, 2)); + } + + return innerDistance; + }; + + +/***/ }), +/* 38 */ +/***/ (function(module, exports, __webpack_require__) { + + var DatatypeNode = __webpack_require__(35); + + module.exports = (function (){ + + var o = function ( graph ){ + DatatypeNode.apply(this, arguments); + + var superDrawFunction = this.draw, + superLabelFunction = this.label; + + this.attributes(["datatype"]) + .label("Literal") + .styleClass("literal") + .type("rdfs:Literal") + .iri("http://www.w3.org/2000/01/rdf-schema#Literal"); + + this.draw = function ( element ){ + superDrawFunction(element, ["dashed"]); + }; + + this.label = function ( p ){ + if ( !arguments.length ) return superLabelFunction(); + return this; + }; + }; + o.prototype = Object.create(DatatypeNode.prototype); + o.prototype.constructor = o; + + return o; + }()); + + +/***/ }), +/* 39 */ +/***/ (function(module, exports, __webpack_require__) { + + var RoundNode = __webpack_require__(8); + + module.exports = (function (){ + + var o = function ( graph ){ + RoundNode.apply(this, arguments); + + var superDrawFunction = this.draw; + + this.attributes(["rdf"]) + .label("Resource") + .radius(30) + .styleClass("rdfsresource") + .type("rdfs:Resource"); + + this.draw = function ( element ){ + superDrawFunction(element, ["rdf", "dashed"]); + }; + }; + o.prototype = Object.create(RoundNode.prototype); + o.prototype.constructor = o; + + return o; + }()); + + +/***/ }), +/* 40 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {var properties = []; + properties.push(__webpack_require__(41)); + properties.push(__webpack_require__(44)); + properties.push(__webpack_require__(45)); + properties.push(__webpack_require__(46)); + properties.push(__webpack_require__(47)); + properties.push(__webpack_require__(48)); + properties.push(__webpack_require__(49)); + properties.push(__webpack_require__(50)); + properties.push(__webpack_require__(51)); + properties.push(__webpack_require__(52)); + properties.push(__webpack_require__(53)); + properties.push(__webpack_require__(54)); + properties.push(__webpack_require__(55)); + properties.push(__webpack_require__(56)); + + var map = d3.map(properties, function ( Prototype ){ + return new Prototype().type(); + }); + + module.exports = function (){ + return map; + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { + + var BaseProperty = __webpack_require__(42); + + module.exports = (function (){ + + var o = function ( graph ){ + BaseProperty.apply(this, arguments); + + var superGenerateCardinalityText = this.generateCardinalityText; + + this.linkType("values-from") + .markerType("filled values-from") + .styleClass("allvaluesfromproperty") + .type("owl:allValuesFrom"); + + this.generateCardinalityText = function (){ + var cardinalityText = "A"; + + var superCardinalityText = superGenerateCardinalityText(); + if ( superCardinalityText ) { + cardinalityText += ", " + superCardinalityText; + } + + return cardinalityText; + }; + }; + o.prototype = Object.create(BaseProperty.prototype); + o.prototype.constructor = o; + + return o; + }()); + + + + +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {var BaseElement = __webpack_require__(10); + var CenteringTextElement = __webpack_require__(14); + var drawTools = __webpack_require__(17)(); + var forceLayoutNodeFunctions = __webpack_require__(13)(); + var rectangularElementTools = __webpack_require__(37)(); + var math = __webpack_require__(43)(); + + module.exports = (function (){ + + // Static variables + var labelHeight = 28, + labelWidth = 80, + smallestRadius = labelHeight / 2; + + + // Constructor, private variables and privileged methods + var Base = function ( graph ){ + BaseElement.apply(this, arguments); + + var that = this, + // Basic attributes + cardinality, + domain, + inverse, + link, + minCardinality, + maxCardinality, + range, + subproperties, + superproperties, + // Style attributes + linkType = "normal", + markerType = "filled", + labelVisible = true, + // Element containers + cardinalityElement, + labelElement, + linkGroup, + markerElement, + // Other + ignoreLocalHoverEvents, + fobj, + pinGroupElement, + haloGroupElement, + myWidth = 80, + defaultWidth = 80, + shapeElement, + textElement, + parent_labelObject, + backupFullIri, + + redundantProperties = []; + + + this.existingPropertyIRI = function ( url ){ + return graph.options().editSidebar().checkForExistingURL(url); + }; + + this.getHalos = function (){ + return haloGroupElement; + }; + + this.getPin = function (){ + return pinGroupElement; + }; + this.labelObject = function ( lo, once ){ + if ( !arguments.length ) { + return parent_labelObject; + } + else { + parent_labelObject = lo; + if ( that.inverse() && once !== true ) { + that.inverse().labelObject(lo, true); + } + + } + }; + this.hide = function ( val ){ + that.labelElement().classed("hidden", val); + that.linkGroup().classed("hidden", val); + if ( that.cardinalityElement() ) + that.cardinalityElement().classed("hidden", val); + }; + + // Properties + this.cardinality = function ( p ){ + if ( !arguments.length ) return cardinality; + cardinality = p; + return this; + }; + + this.cardinalityElement = function ( p ){ + if ( !arguments.length ) return cardinalityElement; + cardinalityElement = p; + return this; + }; + + this.domain = function ( p ){ + if ( !arguments.length ) return domain; + domain = p; + return this; + }; + + this.inverse = function ( p ){ + if ( !arguments.length ) return inverse; + inverse = p; + return this; + }; + + this.labelElement = function ( p ){ + if ( !arguments.length ) return labelElement; + labelElement = p; + return this; + }; + + this.labelVisible = function ( p ){ + if ( !arguments.length ) return labelVisible; + labelVisible = p; + return this; + }; + + this.link = function ( p ){ + if ( !arguments.length ) return link; + link = p; + return this; + }; + + this.linkGroup = function ( p ){ + if ( !arguments.length ) return linkGroup; + linkGroup = p; + return this; + }; + + this.linkType = function ( p ){ + if ( !arguments.length ) return linkType; + linkType = p; + return this; + }; + + this.markerElement = function ( p ){ + if ( !arguments.length ) return markerElement; + markerElement = p; + return this; + }; + + this.markerType = function ( p ){ + if ( !arguments.length ) return markerType; + markerType = p; + return this; + }; + + this.maxCardinality = function ( p ){ + if ( !arguments.length ) return maxCardinality; + maxCardinality = p; + return this; + }; + + this.minCardinality = function ( p ){ + if ( !arguments.length ) return minCardinality; + minCardinality = p; + return this; + }; + + this.range = function ( p ){ + if ( !arguments.length ) return range; + range = p; + return this; + }; + + this.redundantProperties = function ( p ){ + if ( !arguments.length ) return redundantProperties; + redundantProperties = p; + return this; + }; + + this.subproperties = function ( p ){ + if ( !arguments.length ) return subproperties; + subproperties = p; + return this; + }; + + this.superproperties = function ( p ){ + if ( !arguments.length ) return superproperties; + superproperties = p; + return this; + }; + + + // Functions + this.distanceToBorder = function ( dx, dy ){ + return rectangularElementTools.distanceToBorder(that, dx, dy); + }; + + this.linkHasMarker = function (){ + return linkType !== "dashed"; + }; + + this.markerId = function (){ + return "marker" + that.id(); + }; + + this.toggleFocus = function (){ + that.focused(!that.focused()); + labelElement.select("rect").classed("focused", that.focused()); + graph.resetSearchHighlight(); + graph.options().searchMenu().clearText(); + }; + this.getShapeElement = function (){ + return shapeElement; + }; + + this.textBlock = function (){ + return textElement; + }; + + this.redrawElement = function (){ + shapeElement.remove(); + textElement.remove(); + + that.drawLabel(that.labelElement()); + that.animateDynamicLabelWidth(graph.options().dynamicLabelWidth()); + + + // shapeElement=this.addRect(that.labelElement()); + // + // var equivalentsString = that.equivalentsString(); + // var suffixForFollowingEquivalents = equivalentsString ? "," : ""; + // + // textElement = new CenteringTextElement(labelContainer, this.backgroundColor()); + // textElement.addText(this.labelForCurrentLanguage(), "", suffixForFollowingEquivalents); + // textElement.addEquivalents(equivalentsString); + // textElement.addSubText(this.indicationString()); + + }; + + // Reused functions TODO refactor + this.draw = function ( labelGroup ){ + function attachLabel( property ){ + var labelContainer = labelGroup.append("g") + .datum(property) + .classed("label", true) + .attr("id", property.id()); + + property.drawLabel(labelContainer); + return labelContainer; + } + + if ( !that.labelVisible() ) { + return undefined; + } + if ( graph.options().dynamicLabelWidth() === true ) myWidth = Math.min(that.getMyWidth(), graph.options().maxLabelWidth()); + else myWidth = defaultWidth; + + that.labelElement(attachLabel(that)); + // Draw an inverse label and reposition both labels if necessary + if ( that.inverse() ) { + var yTransformation = (that.height() / 2) + 1 /* additional space */; + that.inverse() + .labelElement(attachLabel(that.inverse())); + + that.labelElement() + .attr("transform", "translate(" + 0 + ",-" + yTransformation + ")"); + that.inverse() + .labelElement() + .attr("transform", "translate(" + 0 + "," + yTransformation + ")"); + } + + if ( that.pinned() ) { + that.drawPin(); + } else if ( that.inverse() && that.inverse().pinned() ) { + that.inverse().drawPin(); + } + + if ( that.halo() ) + that.drawHalo(false); + + return that.labelElement(); + }; + + this.addRect = function ( labelContainer ){ + var rect = labelContainer.append("rect") + .classed(that.styleClass(), true) + .classed("property", true) + .attr("x", -that.width() / 2) + .attr("y", -that.height() / 2) + .attr("width", that.width()) + .attr("height", that.height()) + .on("mouseover", function (){ + onMouseOver(); + }) + .on("mouseout", function (){ + onMouseOut(); + }); + + rect.append("title") + .text(that.labelForCurrentLanguage()); + + if ( that.visualAttributes() ) { + rect.classed(that.visualAttributes(), true); + } + + var bgColor = that.backgroundColor(); + + if ( that.attributes().indexOf("deprecated") > -1 ) { + bgColor = undefined; + rect.classed("deprecatedproperty", true); + } else { + rect.classed("deprecatedproperty", false); + } + rect.style("fill", bgColor); + + return rect; + }; + this.drawLabel = function ( labelContainer ){ + shapeElement = this.addRect(labelContainer); + + var equivalentsString = that.equivalentsString(); + var suffixForFollowingEquivalents = equivalentsString ? "," : ""; + + var bgColor = that.backgroundColor(); + if ( that.attributes().indexOf("deprecated") > -1 ) { + bgColor = undefined; + } + textElement = new CenteringTextElement(labelContainer, bgColor); + textElement.addText(this.labelForCurrentLanguage(), "", suffixForFollowingEquivalents); + textElement.addEquivalents(equivalentsString); + textElement.addSubText(this.indicationString()); + }; + + this.equivalentsString = function (){ + var equivalentProperties = that.equivalents(); + if ( !equivalentProperties ) { + return; + } + + return equivalentProperties + .map(function ( property ){ + if ( property === undefined || typeof(property) === "string" ) { // @WORKAROUND + return "ERROR"; + } + return property.labelForCurrentLanguage(); + }) + .join(", "); + }; + + this.drawCardinality = function ( container ){ + var cardinalityText = this.generateCardinalityText(); + + if ( cardinalityText ) { + that.cardinalityElement(container); + if ( cardinalityText.indexOf("A") === 0 && cardinalityText.length === 1 ) { + + // replacing text elements to svg elements; + container.classed("cardinality", true) + .attr("text-anchor", "middle") + .append("path") + .classed("cardinality", true) + .attr("d", "m -8.8832678,-11.303355 -7.97e-4,0 0.717374,1.833297 8.22987151,21.371761 8.66826659,-21.2123526 0.797082,-1.9927054 0.02471,0 -0.8218553,1.9927054 -2.2517565,5.4201577 -12.4444429,8e-6 -2.2019394,-5.5795821 z") + .style("fill", "none") + .attr("transform", "matrix(0.5,0,0,0.5,0.5,0.5)"); + return true; + } else if ( cardinalityText.indexOf("E") === 0 && cardinalityText.length === 1 ) { + container.classed("cardinality", true) + .attr("text-anchor", "middle") + .append("path") + .classed("cardinality", true) + .attr("d", "m -5.5788451,-8.0958763 10.8749368,0 0,8.34681523 -9.5707468,0.040132 9.5707468,-0.040132 0,8.42707237 -10.9150654,0") + .style("fill", "none") + .attr("transform", "matrix(0.5,0,0,0.5,0.5,0.5)"); + return true; + } + else { + container.append("text") + .classed("cardinality", true) + .attr("text-anchor", "middle") + .attr("dy", "0.5ex") + .text(cardinalityText); + return true; // drawing successful + } + } else { + return false; + } + }; + + this.generateCardinalityText = function (){ + if ( that.cardinality() ) { + return that.cardinality(); + } else if ( that.minCardinality() || that.maxCardinality() ) { + var minBoundary = that.minCardinality() || "*"; + var maxBoundary = that.maxCardinality() || "*"; + return minBoundary + ".." + maxBoundary; + } + }; + + that.setHighlighting = function ( enable ){ + if ( that.labelElement && that.labelElement() ) { + that.labelElement().select("rect").classed("hovered", enable); + } + that.linkGroup().selectAll("path, text").classed("hovered", enable); + if ( that.markerElement() ) { + that.markerElement().select("path").classed("hovered", enable); + if ( that.cardinalityElement() ) { + that.cardinalityElement().selectAll("path").classed("hovered-MathSymbol", enable); + that.cardinalityElement().classed("hovered", enable); + } + } + var subAndSuperProperties = getSubAndSuperProperties(); + subAndSuperProperties.forEach(function ( property ){ + + if ( property.labelElement && property.labelElement() ) { + property.labelElement().select("rect") + .classed("indirect-highlighting", enable); + } + + }); + var inversed = false; + + if ( graph.ignoreOtherHoverEvents() === false ) { + if ( that.inverse() ) { + inversed = true; + } + + if ( graph.isTouchDevice() === false ) { + graph.activateHoverElementsForProperties(enable, that, inversed); + } + else { + that.labelElement().select("rect").classed("hovered", false); + that.linkGroup().selectAll("path, text").classed("hovered", false); + if ( that.markerElement() ) { + that.markerElement().select("path").classed("hovered", false); + if ( that.cardinalityElement() ) { + that.cardinalityElement().classed("hovered", false); + } + } + graph.activateHoverElementsForProperties(enable, that, inversed, true); + } + } + }; + + /** + * Combines the sub- and superproperties into a single array, because + * they're often used equivalently. + * @returns {Array} + */ + function getSubAndSuperProperties(){ + var properties = []; + + if ( that.subproperties() ) { + properties = properties.concat(that.subproperties()); + } + if ( that.superproperties() ) { + properties = properties.concat(that.superproperties()); + } + + return properties; + } + + /** + * Foregrounds the property, its inverse and the link. + */ + this.foreground = function (){ + // check for additional objects that we can highlight + if ( !that.labelElement() ) + return; + if ( that.labelElement().node().parentNode === null ) { + return; + } + var selectedLabelGroup = that.labelElement().node().parentNode, + labelContainer = selectedLabelGroup.parentNode, + selectedLinkGroup = that.linkGroup().node(), + linkContainer = that.linkGroup().node().parentNode; + if ( that.animationProcess() === false ) { + labelContainer.appendChild(selectedLabelGroup); + } + linkContainer.appendChild(selectedLinkGroup); + }; + + /** + * Foregrounds the sub- and superproperties of this property. + * This is separated from the foreground-function to prevent endless loops. + */ + function foregroundSubAndSuperProperties(){ + var subAndSuperProperties = getSubAndSuperProperties(); + + subAndSuperProperties.forEach(function ( property ){ + if ( property.foreground ) property.foreground(); + }); + } + + function onMouseOver(){ + if ( that.mouseEntered() || ignoreLocalHoverEvents === true ) { + return; + } + that.mouseEntered(true); + that.setHighlighting(true); + that.foreground(); + foregroundSubAndSuperProperties(); + } + + function onMouseOut(){ + that.mouseEntered(false); + that.setHighlighting(false); + } + + this.drawPin = function (){ + that.pinned(true); + if ( graph.options().dynamicLabelWidth() === true ) myWidth = that.getMyWidth(); + else myWidth = defaultWidth; + + if ( that.inverse() ) { + // check which element is rendered on top and add a pin to it + var tr_that = that.labelElement().attr("transform"); + var tr_inv = that.inverse().labelElement().attr("transform"); + + var thatY = /translate\(\s*([^\s,)]+)[ ,]([^\s,)]+)/.exec(tr_that)[2]; + var invY = /translate\(\s*([^\s,)]+)[ ,]([^\s,)]+)/.exec(tr_inv)[2]; + + if ( thatY < invY ) + pinGroupElement = drawTools.drawPin(that.labelElement(), -0.5 * that.width() + 10, -25, this.removePin, graph.options().showDraggerObject, graph.options().useAccuracyHelper()); + else + pinGroupElement = drawTools.drawPin(that.inverse().labelElement(), -0.5 * that.inverse().width() + 10, -25, this.removePin, graph.options().showDraggerObject, graph.options().useAccuracyHelper()); + + } + else { + pinGroupElement = drawTools.drawPin(that.labelElement(), -0.5 * that.width() + 10, -25, this.removePin, graph.options().showDraggerObject, graph.options().useAccuracyHelper()); + } + + + }; + + /** + * Removes the pin and refreshs the graph to update the force layout. + */ + this.removePin = function (){ + that.pinned(false); + if ( pinGroupElement ) { + pinGroupElement.remove(); + } + graph.updateStyle(); + }; + + this.removeHalo = function (){ + that.halo(false); + if ( haloGroupElement ) { + haloGroupElement.remove(); + haloGroupElement = null; + } + }; + + this.animationProcess = function (){ + var animRuns = false; + if ( that.getHalos() ) { + var haloGr = that.getHalos(); + var haloEls = haloGr.selectAll(".searchResultA"); + animRuns = haloGr.attr("animationRunning"); + + if ( typeof animRuns !== "boolean" ) { + // parse this to a boolean value + animRuns = (animRuns === 'true'); + } + if ( animRuns === false ) { + haloEls.classed("searchResultA", false); + haloEls.classed("searchResultB", true); + } + } + return animRuns; + }; + + this.drawHalo = function ( pulseAnimation ){ + that.halo(true); + var offset = 0; + if ( that.labelElement() && that.labelElement().node() ) { + var labelNode = that.labelElement().node(); + var labelContainer = labelNode.parentNode; + // do this only if animation is not running + if ( that.animationProcess() === false ) + labelContainer.appendChild(labelNode); + } + haloGroupElement = drawTools.drawRectHalo(that, that.width(), that.height(), offset); + if ( haloGroupElement ) { + var haloNode = haloGroupElement.node(); + var haloContainer = haloNode.parentNode; + haloContainer.appendChild(haloNode); + } + var selectedNode; + var nodeContainer; + if ( that.pinned() ) { + selectedNode = pinGroupElement.node(); + nodeContainer = selectedNode.parentNode; + nodeContainer.appendChild(selectedNode); + } + if ( that.inverse() && that.inverse().pinned() ) { + if ( that.inverse().getPin() ) { + selectedNode = that.inverse().getPin().node(); + nodeContainer = selectedNode.parentNode; + nodeContainer.appendChild(selectedNode); + } + } + if ( pulseAnimation === false ) { + var pulseItem = haloGroupElement.selectAll(".searchResultA"); + pulseItem.classed("searchResultA", false); + pulseItem.classed("searchResultB", true); + pulseItem.attr("animationRunning", false); + } + }; + + this.getMyWidth = function (){ + var text = that.labelForCurrentLanguage(); + myWidth = measureTextWidth(text, "text") + 20; + // check for sub names; + var indicatorText = that.indicationString(); + var indicatorWidth = measureTextWidth(indicatorText, "subtext") + 20; + if ( indicatorWidth > myWidth ) + myWidth = indicatorWidth; + + return myWidth; + }; + + function measureTextWidth( text, textStyle ){ + // Set a default value + if ( !textStyle ) { + textStyle = "text"; + } + var d = d3.select("body") + .append("div") + .attr("class", textStyle) + .attr("id", "width-test") // tag this element to identify it + .attr("style", "position:absolute; float:left; white-space:nowrap; visibility:hidden;") + .text(text), + w = document.getElementById("width-test").offsetWidth; + d.remove(); + return w; + } + + this.textWidth = function (){ + return myWidth; + }; + this.width = function (){ + return myWidth; + }; + + this.animateDynamicLabelWidth = function ( dynamic ){ + that.removeHalo(); + if ( shapeElement === undefined ) {// this handles setOperatorProperties which dont have a shapeElement! + return; + } + + var h = that.height(); + if ( dynamic === true ) { + myWidth = Math.min(that.getMyWidth(), graph.options().maxLabelWidth()); + shapeElement.transition().tween("attr", function (){ + }) + .ease('linear') + .duration(100) + .attr({ x: -myWidth / 2, y: -h / 2, width: myWidth, height: h }) + .each("end", function (){ + that.updateTextElement(); + }); + } else { + // Static width for property labels = 80 + myWidth = defaultWidth; + that.updateTextElement(); + shapeElement.transition().tween("attr", function (){ + }) + .ease('linear') + .duration(100) + .attr({ x: -myWidth / 2, y: -h / 2, width: myWidth, height: h }); + } + if ( that.pinned() === true && pinGroupElement ) { + var dx = -0.5 * myWidth + 10, + dy = -25; + pinGroupElement.transition() + .tween("attr.translate", function (){ + }) + .attr("transform", "translate(" + dx + "," + dy + ")") + .ease('linear') + .duration(100); + } + }; + + this.redrawLabelText = function (){ + textElement.remove(); + that.addTextLabelElement(); + that.animateDynamicLabelWidth(graph.options().dynamicLabelWidth()); + shapeElement.select("title").text(that.labelForCurrentLanguage()); + }; + + this.addTextLabelElement = function (){ + var labelContainer = that.labelElement(); + + var equivalentsString = that.equivalentsString(); + var suffixForFollowingEquivalents = equivalentsString ? "," : ""; + + textElement = new CenteringTextElement(labelContainer, this.backgroundColor()); + textElement.addText(this.labelForCurrentLanguage(), "", suffixForFollowingEquivalents); + textElement.addEquivalents(equivalentsString); + textElement.addSubText(this.indicationString()); + }; + + this.updateTextElement = function (){ + textElement.updateAllTextElements(); + }; + this.enableEditing = function ( autoEditing ){ + if ( autoEditing === false ) + return; + that.raiseDoubleClickEdit(true); + }; + + this.raiseDoubleClickEdit = function ( forceIRISync ){ + d3.selectAll(".foreignelements").remove(); + if ( that.labelElement() === undefined || this.type() === "owl:disjointWith" || this.type() === "rdfs:subClassOf" ) { + console.log("No Container found"); + return; + } + if ( fobj !== undefined ) { + that.labelElement().selectAll(".foreignelements").remove(); + } + backupFullIri = undefined; + graph.options().focuserModule().handle(undefined); + graph.options().focuserModule().handle(that); + that.editingTextElement = true; + ignoreLocalHoverEvents = true; + that.labelElement().selectAll("rect").classed("hoveredForEditing", true); + that.frozen(true); + graph.killDelayedTimer(); + graph.ignoreOtherHoverEvents(false); + fobj = that.labelElement().append("foreignObject") + .attr("x", -0.5 * that.textWidth()) + .attr("y", -13) + .attr("height", 25) + .attr("class", "foreignelements") + .on("dragstart", function (){ + return false; + }) // remove drag operations of text element) + .attr("width", that.textWidth() - 2); + // adding a Style to the fObject + // + // + // + var editText = fobj.append("xhtml:input") + .attr("class", "nodeEditSpan") + .attr("id", that.id()) + .attr("align", "center") + .attr("contentEditable", "true") + .on("dragstart", function (){ + return false; + }); // remove drag operations of text element) + + var bgColor = '#f00'; + var txtWidth = that.textWidth() - 2; + editText.style({ + // 'line-height': '30px', + 'align': 'center', + 'color': 'black', + 'width': txtWidth + "px", + 'background-color': bgColor, + 'border-bottom': '2px solid black' + }); + var txtNode = editText.node(); + txtNode.value = that.labelForCurrentLanguage(); + txtNode.focus(); + txtNode.select(); + if ( d3.event.stopPropagation ) d3.event.stopPropagation(); + if ( d3.event.sourceEvent && d3.event.sourceEvent.stopPropagation ) d3.event.sourceEvent.stopPropagation(); + + // add some events that relate to this object + editText.on("click", function (){ + if ( d3.event.stopPropagation ) d3.event.stopPropagation(); + if ( d3.event.sourceEvent && d3.event.sourceEvent.stopPropagation ) d3.event.sourceEvent.stopPropagation(); + + }); + // // remove hover Events for now; + editText.on("mouseout", function (){ + if ( d3.event.stopPropagation ) d3.event.stopPropagation(); + if ( d3.event.sourceEvent && d3.event.sourceEvent.stopPropagation ) d3.event.sourceEvent.stopPropagation(); + }); + editText.on("mousedown", function (){ + if ( d3.event.stopPropagation ) d3.event.stopPropagation(); + if ( d3.event.sourceEvent && d3.event.sourceEvent.stopPropagation ) d3.event.sourceEvent.stopPropagation(); + }) + .on("keydown", function (){ + + if ( d3.event.keyCode === 13 ) { + this.blur(); + that.frozen(false); // << releases the not after selection + that.locked(false); + } + }) + .on("keyup", function (){ + if ( forceIRISync ) { + var labelName = editText.node().value; + var resourceName = labelName.replaceAll(" ", "_"); + var syncedIRI = that.baseIri() + resourceName; + backupFullIri = syncedIRI; + + d3.select("#element_iriEditor").node().title = syncedIRI; + d3.select("#element_iriEditor").node().value = graph.options().prefixModule().getPrefixRepresentationForFullURI(syncedIRI); + } + d3.select("#element_labelEditor").node().value = editText.node().value; + + }) + .on("blur", function (){ + + + that.editingTextElement = false; + ignoreLocalHoverEvents = false; + that.labelElement().selectAll("rect").classed("hoveredForEditing", false); + var newLabel = editText.node().value; + that.labelElement().selectAll(".foreignelements").remove(); + // that.setLabelForCurrentLanguage(classNameConvention(editText.node().value)); + that.label(newLabel); + that.backupLabel(newLabel); + that.redrawLabelText(); + updateHoverElements(true); + graph.showHoverElementsAfterAnimation(that, false); + graph.ignoreOtherHoverEvents(false); + + + that.frozen(graph.paused()); + that.locked(graph.paused()); + that.domain().frozen(graph.paused()); + that.domain().locked(graph.paused()); + that.range().frozen(graph.paused()); + that.range().locked(graph.paused()); + graph.removeEditElements(); + if ( backupFullIri ) { + // console.log("Checking if element is Identical ?"); + var sanityCheckResult = graph.options().editSidebar().checkProperIriChange(that, backupFullIri); + if ( sanityCheckResult !== false ) { + graph.options().warningModule().showWarning("Already seen this property", + "Input IRI: " + backupFullIri + " for element: " + that.labelForCurrentLanguage() + " already been set", + "Continuing with duplicate property!", 1, false, sanityCheckResult); + } + that.iri(backupFullIri); + } + graph.options().focuserModule().handle(undefined); + graph.options().focuserModule().handle(that); + graph.updatePropertyDraggerElements(that); + + + }); // add a foreiner element to this thing; + + }; + + // update hover elements + function updateHoverElements( enable ){ + if ( graph.ignoreOtherHoverEvents() === false ) { + var inversed = false; + if ( that.inverse() ) { + inversed = true; + } + if ( enable === true ) { + graph.activateHoverElementsForProperties(enable, that, inversed); + } + } + } + + that.copyInformation = function ( other ){ + that.label(other.label()); + that.iri(other.iri()); + that.baseIri(other.baseIri()); + if ( other.type() === "owl:ObjectProperty" || + other.type() === "owl:DatatypeProperty" ) { + that.backupLabel(other.label()); + // console.log("copied backup label"+that.backupLabel()); + } + if ( other.backupLabel() !== undefined ) { + that.backupLabel(other.backupLabel()); + } + }; + + forceLayoutNodeFunctions.addTo(this); + }; + + Base.prototype = Object.create(BaseElement.prototype); + Base.prototype.constructor = Base; + + Base.prototype.height = function (){ + return labelHeight; + }; + + Base.prototype.width = function (){ + return labelWidth; + }; + + Base.prototype.actualRadius = function (){ + return smallestRadius; + }; + + Base.prototype.textWidth = Base.prototype.width; + + + return Base; + }()); + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {/** + * Contains a collection of mathematical functions with some additional data + * used for WebVOWL. + */ + module.exports = (function (){ + + var math = {}, + loopFunction = d3.svg.line() + .x(function ( d ){ + return d.x; + }) + .y(function ( d ){ + return d.y; + }) + .interpolate("cardinal") + .tension(-1); + + + /** + * Calculates the normal vector of the path between the two nodes. + * @param source the first node + * @param target the second node + * @param length the length of the calculated normal vector + * @returns {{x: number, y: number}} + */ + math.calculateNormalVector = function ( source, target, length ){ + var dx = target.x - source.x, + dy = target.y - source.y; + + var nx = -dy, + ny = dx; + + var vlength = Math.sqrt(nx * nx + ny * ny); + + var ratio = vlength !== 0 ? length / vlength : 0; + + return { "x": nx * ratio, "y": ny * ratio }; + }; + + /** + * Calculates the path for a link, if it is a loop. Currently only working for circlular nodes. + * @param link the link + * @returns {*} + */ + + + + math.getLoopPoints = function ( link ){ + var node = link.domain(), + label = link.label(); + + var fairShareLoopAngle = 360 / link.loops().length, + fairShareLoopAngleWithMargin = fairShareLoopAngle * 0.8, + loopAngle = Math.min(60, fairShareLoopAngleWithMargin); + + if ( label.increasedLoopAngle === true ) + loopAngle = 120; + + + var dx = label.x - node.x, + dy = label.y - node.y, + labelRadian = Math.atan2(dy, dx), + labelAngle = calculateAngle(labelRadian); + + var startAngle = labelAngle - loopAngle / 2, + endAngle = labelAngle + loopAngle / 2; + + + var arcFrom = calculateRadian(startAngle), + arcTo = calculateRadian(endAngle), + + x1 = Math.cos(arcFrom) * node.actualRadius(), + y1 = Math.sin(arcFrom) * node.actualRadius(), + + x2 = Math.cos(arcTo) * node.actualRadius(), + y2 = Math.sin(arcTo) * node.actualRadius(), + + fixPoint1 = { "x": node.x + x1, "y": node.y + y1 }, + fixPoint2 = { "x": node.x + x2, "y": node.y + y2 }; + + return [fixPoint1, fixPoint2]; + }; + math.calculateLoopPath = function ( link ){ + var node = link.domain(), + label = link.label(); + + + var fairShareLoopAngle = 360 / link.loops().length, + fairShareLoopAngleWithMargin = fairShareLoopAngle * 0.8, + loopAngle = Math.min(60, fairShareLoopAngleWithMargin); + + if ( label.increasedLoopAngle === true ) + loopAngle = 120; + + var dx = label.x - node.x, + dy = label.y - node.y, + labelRadian = Math.atan2(dy, dx), + labelAngle = calculateAngle(labelRadian); + + var startAngle = labelAngle - loopAngle / 2, + endAngle = labelAngle + loopAngle / 2; + + var arcFrom = calculateRadian(startAngle), + arcTo = calculateRadian(endAngle), + + x1 = Math.cos(arcFrom) * node.actualRadius(), + y1 = Math.sin(arcFrom) * node.actualRadius(), + + x2 = Math.cos(arcTo) * node.actualRadius(), + y2 = Math.sin(arcTo) * node.actualRadius(), + + fixPoint1 = { "x": node.x + x1, "y": node.y + y1 }, + fixPoint2 = { "x": node.x + x2, "y": node.y + y2 }; + + return loopFunction([fixPoint1, link.label(), fixPoint2]); + }; + + math.calculateLoopPoints = function ( link ){ + var node = link.domain(), + label = link.label(); + + var fairShareLoopAngle = 360 / link.loops().length, + fairShareLoopAngleWithMargin = fairShareLoopAngle * 0.8, + loopAngle = Math.min(60, fairShareLoopAngleWithMargin); + + var dx = label.x - node.x, + dy = label.y - node.y, + labelRadian = Math.atan2(dy, dx), + labelAngle = calculateAngle(labelRadian); + + var startAngle = labelAngle - loopAngle / 2, + endAngle = labelAngle + loopAngle / 2; + + var arcFrom = calculateRadian(startAngle), + arcTo = calculateRadian(endAngle), + + x1 = Math.cos(arcFrom) * node.actualRadius(), + y1 = Math.sin(arcFrom) * node.actualRadius(), + + x2 = Math.cos(arcTo) * (node.actualRadius()), + y2 = Math.sin(arcTo) * (node.actualRadius()), + + fixPoint1 = { "x": node.x + x1, "y": node.y + y1 }, + fixPoint2 = { "x": node.x + x2, "y": node.y + y2 }; + + return [fixPoint1, link.label(), fixPoint2]; + }; + + /** + * @param angle + * @returns {number} the radian of the angle + */ + function calculateRadian( angle ){ + angle = angle % 360; + if ( angle < 0 ) { + angle = angle + 360; + } + return (Math.PI * angle) / 180; + } + + /** + * @param radian + * @returns {number} the angle of the radian + */ + function calculateAngle( radian ){ + return radian * (180 / Math.PI); + } + + /** + * Calculates the point where the link between the source and target node + * intersects the border of the target node. + * @param source the source node + * @param target the target node + * @param additionalDistance additional distance the + * @returns {{x: number, y: number}} + */ + math.calculateIntersection = function ( source, target, additionalDistance ){ + var dx = target.x - source.x, + dy = target.y - source.y, + length = Math.sqrt(dx * dx + dy * dy); + + if ( length === 0 ) { + return { x: source.x, y: source.y }; + } + + var innerDistance = target.distanceToBorder(dx, dy); + + var ratio = (length - (innerDistance + additionalDistance)) / length, + x = dx * ratio + source.x, + y = dy * ratio + source.y; + + return { x: x, y: y }; + }; + + /** + * Calculates the position between the two points. + * @param firstPoint + * @param secondPoint + * @returns {{x: number, y: number}} + */ + math.calculateCenter = function ( firstPoint, secondPoint ){ + return { + x: (firstPoint.x + secondPoint.x) / 2, + y: (firstPoint.y + secondPoint.y) / 2 + }; + }; + + + return function (){ + /* Use a function here to keep a consistent style like webvowl.path.to.module() + * despite having just a single math object. */ + return math; + }; + })(); + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + + var BaseProperty = __webpack_require__(42); + + module.exports = (function (){ + + var o = function ( graph ){ + BaseProperty.apply(this, arguments); + + this.attributes(["datatype"]) + .styleClass("datatypeproperty") + .type("owl:DatatypeProperty"); + }; + o.prototype = Object.create(BaseProperty.prototype); + o.prototype.constructor = o; + + return o; + }()); + + +/***/ }), +/* 45 */ +/***/ (function(module, exports, __webpack_require__) { + + var BaseProperty = __webpack_require__(42); + + module.exports = (function (){ + + var o = function ( graph ){ + BaseProperty.apply(this, arguments); + + this.attributes(["deprecated"]) + .styleClass("deprecatedproperty") + .type("owl:DeprecatedProperty"); + }; + o.prototype = Object.create(BaseProperty.prototype); + o.prototype.constructor = o; + + return o; + }()); + + +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { + + var BaseProperty = __webpack_require__(42); + var CenteringTextElement = __webpack_require__(14); + + module.exports = (function (){ + + var o = function ( graph ){ + BaseProperty.apply(this, arguments); + + var label = "Disjoint With"; + var shapeElement; + // Disallow overwriting the label + this.label = function ( p ){ + if ( !arguments.length ) return label; + return this; + }; + + this.linkType("dashed") + .styleClass("disjointwith") + .type("owl:disjointWith"); + + this.drawLabel = function ( labelContainer ){ + shapeElement = this.addRect(labelContainer); + + labelContainer.append("circle") + .classed("symbol", true) + .classed("fineline", true) + .classed("embedded", true) + .attr("cx", -12.5) + .attr("r", 10); + + labelContainer.append("circle") + .classed("symbol", true) + .classed("fineline", true) + .classed("embedded", true) + .attr("cx", 12.5) + .attr("r", 10); + + var textElement = new CenteringTextElement(labelContainer, this.backgroundColor()); + if ( !graph.options().compactNotation() ) { + textElement.addSubText("disjoint"); + } + textElement.translation(0, 20); + }; + this.getShapeElement = function (){ + return shapeElement; + }; + this.markerElement = function (){ + return undefined; + }; + + }; + o.prototype = Object.create(BaseProperty.prototype); + o.prototype.constructor = o; + + return o; + }()); + + +/***/ }), +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { + + var BaseProperty = __webpack_require__(42); + + module.exports = (function (){ + + var o = function ( graph ){ + BaseProperty.apply(this, arguments); + + this.styleClass("equivalentproperty") + .type("owl:equivalentProperty"); + }; + o.prototype = Object.create(BaseProperty.prototype); + o.prototype.constructor = o; + + return o; + }()); + + +/***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { + + var BaseProperty = __webpack_require__(42); + + module.exports = (function (){ + + var o = function ( graph ){ + BaseProperty.apply(this, arguments); + + this.attributes(["functional"]) + .styleClass("functionalproperty") + .type("owl:FunctionalProperty"); + }; + o.prototype = Object.create(BaseProperty.prototype); + o.prototype.constructor = o; + + return o; + }()); + + +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { + + var BaseProperty = __webpack_require__(42); + + module.exports = (function (){ + + var o = function ( graph ){ + BaseProperty.apply(this, arguments); + + this.attributes(["inverse functional"]) + .styleClass("inversefunctionalproperty") + .type("owl:InverseFunctionalProperty"); + }; + o.prototype = Object.create(BaseProperty.prototype); + o.prototype.constructor = o; + + return o; + }()); + + +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { + + var BaseProperty = __webpack_require__(42); + + module.exports = (function (){ + + var o = function ( graph ){ + BaseProperty.apply(this, arguments); + + this.attributes(["object"]) + .styleClass("objectproperty") + .type("owl:ObjectProperty"); + }; + o.prototype = Object.create(BaseProperty.prototype); + o.prototype.constructor = o; + + return o; + }()); + + + + +/***/ }), +/* 51 */ +/***/ (function(module, exports, __webpack_require__) { + + var BaseProperty = __webpack_require__(42); + + module.exports = (function (){ + + var o = function ( graph ){ + BaseProperty.apply(this, arguments); + + var superGenerateCardinalityText = this.generateCardinalityText; + + this.linkType("values-from") + .markerType("filled values-from") + .styleClass("somevaluesfromproperty") + .type("owl:someValuesFrom"); + + this.generateCardinalityText = function (){ + var cardinalityText = "E"; + + var superCardinalityText = superGenerateCardinalityText(); + if ( superCardinalityText ) { + cardinalityText += ", " + superCardinalityText; + } + + return cardinalityText; + }; + }; + o.prototype = Object.create(BaseProperty.prototype); + o.prototype.constructor = o; + + return o; + }()); + + + + +/***/ }), +/* 52 */ +/***/ (function(module, exports, __webpack_require__) { + + var BaseProperty = __webpack_require__(42); + + module.exports = (function (){ + + var o = function ( graph ){ + BaseProperty.apply(this, arguments); + + this.attributes(["symmetric"]) + .styleClass("symmetricproperty") + .type("owl:SymmetricProperty"); + }; + o.prototype = Object.create(BaseProperty.prototype); + o.prototype.constructor = o; + + return o; + }()); + + +/***/ }), +/* 53 */ +/***/ (function(module, exports, __webpack_require__) { + + var BaseProperty = __webpack_require__(42); + + module.exports = (function (){ + + var o = function ( graph ){ + BaseProperty.apply(this, arguments); + + this.attributes(["transitive"]) + .styleClass("transitiveproperty") + .type("owl:TransitiveProperty"); + }; + o.prototype = Object.create(BaseProperty.prototype); + o.prototype.constructor = o; + + return o; + }()); + + +/***/ }), +/* 54 */ +/***/ (function(module, exports, __webpack_require__) { + + var BaseProperty = __webpack_require__(42); + + module.exports = (function (){ + + var o = function ( graph ){ + BaseProperty.apply(this, arguments); + + this.attributes(["rdf"]) + .styleClass("rdfproperty") + .type("rdf:Property"); + }; + o.prototype = Object.create(BaseProperty.prototype); + o.prototype.constructor = o; + + return o; + }()); + + +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { + + var BaseProperty = __webpack_require__(42); + + module.exports = (function (){ + + var o = function ( graph ){ + BaseProperty.apply(this, arguments); + + var that = this, + superDrawFunction = that.draw, + label = "Subclass of"; + + this.draw = function ( labelGroup ){ + that.labelVisible(!graph.options().compactNotation()); + return superDrawFunction(labelGroup); + }; + + // Disallow overwriting the label + this.label = function ( p ){ + if ( !arguments.length ) return label; + return this; + }; + + this.linkType("dotted") + .markerType("white") + .styleClass("subclass") + .type("rdfs:subClassOf"); + + that.baseIri("http://www.w3.org/2000/01/rdf-schema#"); + that.iri("http://www.w3.org/2000/01/rdf-schema#subClassOf"); + + }; + o.prototype = Object.create(BaseProperty.prototype); + o.prototype.constructor = o; + + return o; + }()); + + +/***/ }), +/* 56 */ +/***/ (function(module, exports, __webpack_require__) { + + var BaseProperty = __webpack_require__(42); + + module.exports = (function (){ + + var o = function ( graph ){ + BaseProperty.apply(this, arguments); + + this.labelVisible(false) + .linkType("dashed") + .markerType("white") + .styleClass("setoperatorproperty") + .type("setOperatorProperty"); + }; + o.prototype = Object.create(BaseProperty.prototype); + o.prototype.constructor = o; + + return o; + }()); + + +/***/ }), +/* 57 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {var _ = __webpack_require__(58); + var math = __webpack_require__(43)(); + var linkCreator = __webpack_require__(60)(); + var elementTools = __webpack_require__(63)(); + // add some maps for nodes and properties -- used for object generation + var nodePrototypeMap = __webpack_require__(5)(); + var propertyPrototypeMap = __webpack_require__(40)(); + + + module.exports = function ( graphContainerSelector ){ + var graph = {}, + CARDINALITY_HDISTANCE = 20, + CARDINALITY_VDISTANCE = 10, + curveFunction = d3.svg.line() + .x(function ( d ){ + return d.x; + }) + .y(function ( d ){ + return d.y; + }) + .interpolate("cardinal"), + options = __webpack_require__(64)(), + parser = __webpack_require__(65)(graph), + language = "default", + paused = false, + // Container for visual elements + graphContainer, + nodeContainer, + labelContainer, + cardinalityContainer, + linkContainer, + // Visual elements + nodeElements, + initialLoad = true, + updateRenderingDuringSimulation = false, + labelGroupElements, + linkGroups, + linkPathElements, + cardinalityElements, + // Internal data + classNodes, + labelNodes, + links, + properties, + unfilteredData, + // Graph behaviour + force, + dragBehaviour, + zoomFactor = 1.0, + centerGraphViewOnLoad = false, + transformAnimation = false, + graphTranslation = [0, 0], + graphUpdateRequired = false, + pulseNodeIds = [], + nodeArrayForPulse = [], + nodeMap = [], + locationId = 0, + defaultZoom = 1.0, + defaultTargetZoom = 0.8, + global_dof = -1, + touchDevice = false, + last_touch_time, + originalD3_dblClickFunction = null, + originalD3_touchZoomFunction = null, + + // editing elements + deleteGroupElement, + addDataPropertyGroupElement, + editContainer, + draggerLayer = null, + draggerObjectsArray = [], + delayedHider, + nodeFreezer, + hoveredNodeElement = null, + currentlySelectedNode = null, + hoveredPropertyElement = null, + draggingStarted = false, + frozenDomainForPropertyDragger, + frozenRangeForPropertyDragger, + + eP = 0, // id for new properties + eN = 0, // id for new Nodes + editMode = true, + debugContainer = d3.select("#FPS_Statistics"), + finishedLoadingSequence = false, + + ignoreOtherHoverEvents = false, + forceNotZooming = false, + now, then, // used for fps computation + showFPS = false, + seenEditorHint = false, + seenFilterWarning = false, + showFilterWarning = false, + + keepDetailsCollapsedOnLoading = true, + adjustingGraphSize = false, + showReloadButtonAfterLayoutOptimization = false, + zoom; + //var prefixModule=require("./prefixRepresentationModule")(graph); + var NodePrototypeMap = createLowerCasePrototypeMap(nodePrototypeMap); + var PropertyPrototypeMap = createLowerCasePrototypeMap(propertyPrototypeMap); + var classDragger = __webpack_require__(68)(graph); + var rangeDragger = __webpack_require__(69)(graph); + var domainDragger = __webpack_require__(70)(graph); + var shadowClone = __webpack_require__(71)(graph); + + graph.math = function (){ + return math; + }; + /** --------------------------------------------------------- **/ + /** -- getter and setter definitions -- **/ + /** --------------------------------------------------------- **/ + graph.isEditorMode = function (){ + return editMode; + }; + graph.getGlobalDOF = function (){ + return global_dof; + }; + graph.setGlobalDOF = function ( val ){ + global_dof = val; + }; + + graph.updateZoomSliderValueFromOutside = function (){ + graph.options().zoomSlider().updateZoomSliderValue(zoomFactor); + }; + + graph.setDefaultZoom = function ( val ){ + defaultZoom = val; + graph.reset(); + graph.options().zoomSlider().updateZoomSliderValue(defaultZoom); + }; + graph.setTargetZoom = function ( val ){ + defaultTargetZoom = val; + }; + graph.graphOptions = function (){ + return options; + }; + + graph.scaleFactor = function (){ + return zoomFactor; + }; + graph.translation = function (){ + return graphTranslation; + }; + + // Returns the visible nodes + graph.graphNodeElements = function (){ + return nodeElements; + }; + // Returns the visible Label Nodes + graph.graphLabelElements = function (){ + return labelNodes; + }; + + graph.graphLinkElements = function (){ + return links; + }; + + graph.setSliderZoom = function ( val ){ + + var cx = 0.5 * graph.options().width(); + var cy = 0.5 * graph.options().height(); + var cp = getWorldPosFromScreen(cx, cy, graphTranslation, zoomFactor); + var sP = [cp.x, cp.y, graph.options().height() / zoomFactor]; + var eP = [cp.x, cp.y, graph.options().height() / val]; + var pos_intp = d3.interpolateZoom(sP, eP); + + graphContainer.attr("transform", transform(sP, cx, cy)) + .transition() + .duration(1) + .attrTween("transform", function (){ + return function ( t ){ + return transform(pos_intp(t), cx, cy); + }; + }) + .each("end", function (){ + graphContainer.attr("transform", "translate(" + graphTranslation + ")scale(" + zoomFactor + ")"); + zoom.translate(graphTranslation); + zoom.scale(zoomFactor); + graph.options().zoomSlider().updateZoomSliderValue(zoomFactor); + }); + }; + + + graph.setZoom = function ( value ){ + zoom.scale(value); + }; + + graph.setTranslation = function ( translation ){ + zoom.translate([translation[0], translation[1]]); + }; + + graph.options = function (){ + return options; + }; + // search functionality + graph.getUpdateDictionary = function (){ + return parser.getDictionary(); + }; + + graph.language = function ( newLanguage ){ + if ( !arguments.length ) return language; + + // Just update if the language changes + if ( language !== newLanguage ) { + language = newLanguage || "default"; + redrawContent(); + recalculatePositions(); + graph.options().searchMenu().requestDictionaryUpdate(); + graph.resetSearchHighlight(); + } + return graph; + }; + + + /** --------------------------------------------------------- **/ + /** graph / rendering related functions **/ + /** --------------------------------------------------------- **/ + + // Initializes the graph. + function initializeGraph(){ + + options.graphContainerSelector(graphContainerSelector); + var moved = false; + force = d3.layout.force() + .on("tick", hiddenRecalculatePositions); + + dragBehaviour = d3.behavior.drag() + .origin(function ( d ){ + return d; + }) + .on("dragstart", function ( d ){ + d3.event.sourceEvent.stopPropagation(); // Prevent panning + graph.ignoreOtherHoverEvents(true); + if ( d.type && d.type() === "Class_dragger" ) { + classDragger.mouseButtonPressed = true; + clearTimeout(delayedHider); + classDragger.selectedViaTouch(true); + d.parentNode().locked(true); + draggingStarted = true; + } else if ( d.type && d.type() === "Range_dragger" ) { + graph.ignoreOtherHoverEvents(true); + clearTimeout(delayedHider); + frozenDomainForPropertyDragger = shadowClone.parentNode().domain(); + frozenRangeForPropertyDragger = shadowClone.parentNode().range(); + shadowClone.setInitialPosition(); + shadowClone.hideClone(false); + shadowClone.hideParentProperty(true); + shadowClone.updateElement(); + deleteGroupElement.classed("hidden", true); + addDataPropertyGroupElement.classed("hidden", true); + frozenDomainForPropertyDragger.frozen(true); + frozenDomainForPropertyDragger.locked(true); + frozenRangeForPropertyDragger.frozen(true); + frozenRangeForPropertyDragger.locked(true); + domainDragger.updateElement(); + domainDragger.mouseButtonPressed = true; + rangeDragger.updateElement(); + rangeDragger.mouseButtonPressed = true; + // shadowClone.setPosition(d.x, d.y); + + + } else if ( d.type && d.type() === "Domain_dragger" ) { + graph.ignoreOtherHoverEvents(true); + clearTimeout(delayedHider); + frozenDomainForPropertyDragger = shadowClone.parentNode().domain(); + frozenRangeForPropertyDragger = shadowClone.parentNode().range(); + shadowClone.setInitialPosition(); + shadowClone.hideClone(false); + shadowClone.hideParentProperty(true); + shadowClone.updateElement(); + deleteGroupElement.classed("hidden", true); + addDataPropertyGroupElement.classed("hidden", true); + + frozenDomainForPropertyDragger.frozen(true); + frozenDomainForPropertyDragger.locked(true); + frozenRangeForPropertyDragger.frozen(true); + frozenRangeForPropertyDragger.locked(true); + domainDragger.updateElement(); + domainDragger.mouseButtonPressed = true; + rangeDragger.updateElement(); + rangeDragger.mouseButtonPressed = true; + } + else { + d.locked(true); + moved = false; + } + }) + .on("drag", function ( d ){ + + if ( d.type && d.type() === "Class_dragger" ) { + clearTimeout(delayedHider); + classDragger.setPosition(d3.event.x, d3.event.y); + } else if ( d.type && d.type() === "Range_dragger" ) { + clearTimeout(delayedHider); + rangeDragger.setPosition(d3.event.x, d3.event.y); + shadowClone.setPosition(d3.event.x, d3.event.y); + domainDragger.updateElementViaRangeDragger(d3.event.x, d3.event.y); + } + else if ( d.type && d.type() === "Domain_dragger" ) { + clearTimeout(delayedHider); + domainDragger.setPosition(d3.event.x, d3.event.y); + shadowClone.setPositionDomain(d3.event.x, d3.event.y); + rangeDragger.updateElementViaDomainDragger(d3.event.x, d3.event.y); + } + + else { + d.px = d3.event.x; + d.py = d3.event.y; + force.resume(); + updateHaloRadius(); + moved = true; + if ( d.renderType && d.renderType() === "round" ) { + classDragger.setParentNode(d); + } + + } + }) + .on("dragend", function ( d ){ + graph.ignoreOtherHoverEvents(false); + if ( d.type && d.type() === "Class_dragger" ) { + var nX = classDragger.x; + var nY = classDragger.y; + clearTimeout(delayedHider); + classDragger.mouseButtonPressed = false; + classDragger.selectedViaTouch(false); + d.setParentNode(d.parentNode()); + + var draggerEndPos = [nX, nY]; + var targetNode = graph.getTargetNode(draggerEndPos); + if ( targetNode ) { + createNewObjectProperty(d.parentNode(), targetNode, draggerEndPos); + } + if ( touchDevice === false ) { + editElementHoverOut(); + } + draggingStarted = false; + } else if ( d.type && d.type() === "Range_dragger" ) { + graph.ignoreOtherHoverEvents(false); + frozenDomainForPropertyDragger.frozen(false); + frozenDomainForPropertyDragger.locked(false); + frozenRangeForPropertyDragger.frozen(false); + frozenRangeForPropertyDragger.locked(false); + rangeDragger.mouseButtonPressed = false; + domainDragger.mouseButtonPressed = false; + domainDragger.updateElement(); + rangeDragger.updateElement(); + shadowClone.hideClone(true); + var rX = rangeDragger.x; + var rY = rangeDragger.y; + var rangeDraggerEndPos = [rX, rY]; + var targetRangeNode = graph.getTargetNode(rangeDraggerEndPos); + if ( elementTools.isDatatype(targetRangeNode) === true ) { + targetRangeNode = null; + console.log("---------------TARGET NODE IS A DATATYPE/ LITERAL ------------"); + } + + if ( targetRangeNode === null ) { + d.reDrawEverthing(); + shadowClone.hideParentProperty(false); + } + else { + d.updateRange(targetRangeNode); + graph.update(); + shadowClone.hideParentProperty(false); + } + } else if ( d.type && d.type() === "Domain_dragger" ) { + graph.ignoreOtherHoverEvents(false); + frozenDomainForPropertyDragger.frozen(false); + frozenDomainForPropertyDragger.locked(false); + frozenRangeForPropertyDragger.frozen(false); + frozenRangeForPropertyDragger.locked(false); + rangeDragger.mouseButtonPressed = false; + domainDragger.mouseButtonPressed = false; + domainDragger.updateElement(); + rangeDragger.updateElement(); + shadowClone.hideClone(true); + + var dX = domainDragger.x; + var dY = domainDragger.y; + var domainDraggerEndPos = [dX, dY]; + var targetDomainNode = graph.getTargetNode(domainDraggerEndPos); + if ( elementTools.isDatatype(targetDomainNode) === true ) { + targetDomainNode = null; + console.log("---------------TARGET NODE IS A DATATYPE/ LITERAL ------------"); + } + shadowClone.hideClone(true); + if ( targetDomainNode === null ) { + d.reDrawEverthing(); + shadowClone.hideParentProperty(false); + } + else { + d.updateDomain(targetDomainNode); + graph.update(); + shadowClone.hideParentProperty(false); + } + } + + else { + d.locked(false); + var pnp = graph.options().pickAndPinModule(); + if ( pnp.enabled() === true && moved === true ) { + if ( d.id ) { // node + pnp.handle(d, true); + } + if ( d.property ) { + pnp.handle(d.property(), true); + } + } + } + }); + + // Apply the zooming factor. + zoom = d3.behavior.zoom() + .duration(150) + .scaleExtent([options.minMagnification(), options.maxMagnification()]) + .on("zoom", zoomed); + + draggerObjectsArray.push(classDragger); + draggerObjectsArray.push(rangeDragger); + draggerObjectsArray.push(domainDragger); + draggerObjectsArray.push(shadowClone); + force.stop(); + } + + graph.lazyRefresh = function (){ + redrawContent(); + recalculatePositions(); + }; + + graph.adjustingGraphSize = function ( val ){ + adjustingGraphSize = val; + }; + + graph.showReloadButtonAfterLayoutOptimization = function ( show ){ + showReloadButtonAfterLayoutOptimization = show; + }; + + + function hiddenRecalculatePositions(){ + finishedLoadingSequence = false; + if ( graph.options().loadingModule().successfullyLoadedOntology() === false ) { + force.stop(); + d3.select("#progressBarValue").node().innerHTML = ""; + graph.updateProgressBarMode(); + graph.options().loadingModule().showErrorDetailsMessage(hiddenRecalculatePositions); + if ( keepDetailsCollapsedOnLoading && adjustingGraphSize === false ) { + graph.options().loadingModule().collapseDetails("hiddenRecalculatePositions"); + } + return; + } + if ( updateRenderingDuringSimulation === false ) { + var value = 1.0 - 10 * force.alpha(); + var percent = parseInt(200 * value) + "%"; + graph.options().loadingModule().setPercentValue(percent); + d3.select("#progressBarValue").style("width", percent); + d3.select("#progressBarValue").node().innerHTML = percent; + + if ( value > 0.49 ) { + updateRenderingDuringSimulation = true; + // show graph container; + if ( graphContainer ) { + graphContainer.style("opacity", "1"); + percent = "100%"; + d3.select("#progressBarValue").style("width", percent); + d3.select("#progressBarValue").node().innerHTML = percent; + graph.options().ontologyMenu().append_message_toLastBulletPoint("done"); + d3.select("#reloadCachedOntology").classed("hidden", !showReloadButtonAfterLayoutOptimization); + if ( showFilterWarning === true && seenFilterWarning === false ) { + graph.options().warningModule().showFilterHint(); + seenFilterWarning = true; + } + } + + if ( initialLoad ) { + if ( graph.paused() === false ) + force.resume(); // resume force + initialLoad = false; + + } + + + finishedLoadingSequence = true; + if ( showFPS === true ) { + force.on("tick", recalculatePositionsWithFPS); + recalculatePositionsWithFPS(); + } + else { + force.on("tick", recalculatePositions); + recalculatePositions(); + } + + if ( centerGraphViewOnLoad === true && force.nodes().length > 0 ) { + if ( force.nodes().length < 10 ) graph.forceRelocationEvent(true); // uses dynamic zoomer; + else graph.forceRelocationEvent(); + centerGraphViewOnLoad = false; + // console.log("--------------------------------------") + } + + + graph.showEditorHintIfNeeded(); + + if ( graph.options().loadingModule().missingImportsWarning() === false ) { + graph.options().loadingModule().hideLoadingIndicator(); + graph.options().ontologyMenu().append_bulletPoint("Successfully loaded ontology"); + graph.options().loadingModule().setSuccessful(); + } else { + graph.options().loadingModule().showWarningDetailsMessage(); + graph.options().ontologyMenu().append_bulletPoint("Loaded ontology with warnings"); + } + } + } + } + + graph.showEditorHintIfNeeded = function (){ + if ( seenEditorHint === false && editMode === true ) { + seenEditorHint = true; + graph.options().warningModule().showEditorHint(); + } + }; + + graph.setForceTickFunctionWithFPS = function (){ + showFPS = true; + if ( force && finishedLoadingSequence === true ) { + force.on("tick", recalculatePositionsWithFPS); + } + + }; + graph.setDefaultForceTickFunction = function (){ + showFPS = false; + if ( force && finishedLoadingSequence === true ) { + force.on("tick", recalculatePositions); + } + }; + function recalculatePositionsWithFPS(){ + // compute the fps + + recalculatePositions(); + now = Date.now(); + var diff = now - then; + var fps = (1000 / (diff)).toFixed(2); + + debugContainer.node().innerHTML = "FPS: " + fps + "<br>" + "Nodes: " + force.nodes().length + "<br>" + "Links: " + force.links().length; + then = Date.now(); + + } + + function recalculatePositions(){ + // Set node positions + + + // add switch for edit mode to make this faster; + if ( !editMode ) { + nodeElements.attr("transform", function ( node ){ + return "translate(" + node.x + "," + node.y + ")"; + }); + + // Set label group positions + labelGroupElements.attr("transform", function ( label ){ + var position; + + // force centered positions on single-layered links + var link = label.link(); + if ( link.layers().length === 1 && !link.loops() ) { + var linkDomainIntersection = math.calculateIntersection(link.range(), link.domain(), 0); + var linkRangeIntersection = math.calculateIntersection(link.domain(), link.range(), 0); + position = math.calculateCenter(linkDomainIntersection, linkRangeIntersection); + label.x = position.x; + label.y = position.y; + } + return "translate(" + label.x + "," + label.y + ")"; + }); + // Set link paths and calculate additional information + linkPathElements.attr("d", function ( l ){ + if ( l.isLoop() ) { + return math.calculateLoopPath(l); + } + var curvePoint = l.label(); + var pathStart = math.calculateIntersection(curvePoint, l.domain(), 1); + var pathEnd = math.calculateIntersection(curvePoint, l.range(), 1); + + return curveFunction([pathStart, curvePoint, pathEnd]); + }); + + // Set cardinality positions + cardinalityElements.attr("transform", function ( property ){ + + var label = property.link().label(), + pos = math.calculateIntersection(label, property.range(), CARDINALITY_HDISTANCE), + normalV = math.calculateNormalVector(label, property.range(), CARDINALITY_VDISTANCE); + + return "translate(" + (pos.x + normalV.x) + "," + (pos.y + normalV.y) + ")"; + }); + + + updateHaloRadius(); + return; + } + + // TODO: this is Editor redraw function // we need to make this faster!! + + + nodeElements.attr("transform", function ( node ){ + return "translate(" + node.x + "," + node.y + ")"; + }); + + // Set label group positions + labelGroupElements.attr("transform", function ( label ){ + var position; + + // force centered positions on single-layered links + var link = label.link(); + if ( link.layers().length === 1 && !link.loops() ) { + var linkDomainIntersection = math.calculateIntersection(link.range(), link.domain(), 0); + var linkRangeIntersection = math.calculateIntersection(link.domain(), link.range(), 0); + position = math.calculateCenter(linkDomainIntersection, linkRangeIntersection); + label.x = position.x; + label.y = position.y; + label.linkRangeIntersection = linkRangeIntersection; + label.linkDomainIntersection = linkDomainIntersection; + if ( link.property().focused() === true || hoveredPropertyElement !== undefined ) { + rangeDragger.updateElement(); + domainDragger.updateElement(); + // shadowClone.setPosition(link.property().range().x,link.property().range().y); + // shadowClone.setPositionDomain(link.property().domain().x,link.property().domain().y); + } + } else { + label.linkDomainIntersection = math.calculateIntersection(link.label(), link.domain(), 0); + label.linkRangeIntersection = math.calculateIntersection(link.label(), link.range(), 0); + if ( link.property().focused() === true || hoveredPropertyElement !== undefined ) { + rangeDragger.updateElement(); + domainDragger.updateElement(); + // shadowClone.setPosition(link.property().range().x,link.property().range().y); + // shadowClone.setPositionDomain(link.property().domain().x,link.property().domain().y); + } + + } + return "translate(" + label.x + "," + label.y + ")"; + }); + // Set link paths and calculate additional information + linkPathElements.attr("d", function ( l ){ + if ( l.isLoop() ) { + + var ptrAr = math.getLoopPoints(l); + l.label().linkRangeIntersection = ptrAr[1]; + l.label().linkDomainIntersection = ptrAr[0]; + + if ( l.property().focused() === true || hoveredPropertyElement !== undefined ) { + rangeDragger.updateElement(); + domainDragger.updateElement(); + } + return math.calculateLoopPath(l); + } + var curvePoint = l.label(); + var pathStart = math.calculateIntersection(curvePoint, l.domain(), 1); + var pathEnd = math.calculateIntersection(curvePoint, l.range(), 1); + l.linkRangeIntersection = pathStart; + l.linkDomainIntersection = pathEnd; + if ( l.property().focused() === true || hoveredPropertyElement !== undefined ) { + domainDragger.updateElement(); + rangeDragger.updateElement(); + // shadowClone.setPosition(l.property().range().x,l.property().range().y); + // shadowClone.setPositionDomain(l.property().domain().x,l.property().domain().y); + } + return curveFunction([pathStart, curvePoint, pathEnd]); + }); + + // Set cardinality positions + cardinalityElements.attr("transform", function ( property ){ + + var label = property.link().label(), + pos = math.calculateIntersection(label, property.range(), CARDINALITY_HDISTANCE), + normalV = math.calculateNormalVector(label, property.range(), CARDINALITY_VDISTANCE); + + return "translate(" + (pos.x + normalV.x) + "," + (pos.y + normalV.y) + ")"; + }); + + if ( hoveredNodeElement ) { + setDeleteHoverElementPosition(hoveredNodeElement); + setAddDataPropertyHoverElementPosition(hoveredNodeElement); + if ( draggingStarted === false ) { + classDragger.setParentNode(hoveredNodeElement); + } + } + if ( hoveredPropertyElement ) { + setDeleteHoverElementPositionProperty(hoveredPropertyElement); + } + + updateHaloRadius(); + } + + graph.updatePropertyDraggerElements = function ( property ){ + if ( property.type() !== "owl:DatatypeProperty" ) { + + shadowClone.setParentProperty(property); + rangeDragger.setParentProperty(property); + rangeDragger.hideDragger(false); + rangeDragger.addMouseEvents(); + domainDragger.setParentProperty(property); + domainDragger.hideDragger(false); + domainDragger.addMouseEvents(); + + } + else { + rangeDragger.hideDragger(true); + domainDragger.hideDragger(true); + shadowClone.hideClone(true); + } + }; + + function addClickEvents(){ + function executeModules( selectedElement ){ + options.selectionModules().forEach(function ( module ){ + module.handle(selectedElement); + }); + } + + nodeElements.on("click", function ( clickedNode ){ + + // manaual double clicker // helper for iphone 6 etc... + if ( touchDevice === true && doubletap() === true ) { + d3.event.stopPropagation(); + if ( editMode === true ) { + clickedNode.raiseDoubleClickEdit(defaultIriValue(clickedNode)); + } + } + else { + executeModules(clickedNode); + } + }); + + nodeElements.on("dblclick", function ( clickedNode ){ + + d3.event.stopPropagation(); + if ( editMode === true ) { + clickedNode.raiseDoubleClickEdit(defaultIriValue(clickedNode)); + } + }); + + labelGroupElements.selectAll(".label").on("click", function ( clickedProperty ){ + executeModules(clickedProperty); + + // this is for enviroments that do not define dblClick function; + if ( touchDevice === true && doubletap() === true ) { + d3.event.stopPropagation(); + if ( editMode === true ) { + clickedProperty.raiseDoubleClickEdit(defaultIriValue(clickedProperty)); + } + } + + // currently removed the selection of an element to invoke the dragger + // if (editMode===true && clickedProperty.editingTextElement!==true) { + // return; + // // We say that Datatype properties are not allowed to have domain range draggers + // if (clickedProperty.focused() && clickedProperty.type() !== "owl:DatatypeProperty") { + // shadowClone.setParentProperty(clickedProperty); + // rangeDragger.setParentProperty(clickedProperty); + // rangeDragger.hideDragger(false); + // rangeDragger.addMouseEvents(); + // domainDragger.setParentProperty(clickedProperty); + // domainDragger.hideDragger(false); + // domainDragger.addMouseEvents(); + // + // if (clickedProperty.domain()===clickedProperty.range()){ + // clickedProperty.labelObject().increasedLoopAngle=true; + // recalculatePositions(); + // + // } + // + // } else if (clickedProperty.focused() && clickedProperty.type() === "owl:DatatypeProperty") { + // shadowClone.setParentProperty(clickedProperty); + // rangeDragger.setParentProperty(clickedProperty); + // rangeDragger.hideDragger(true); + // rangeDragger.addMouseEvents(); + // domainDragger.setParentProperty(clickedProperty); + // domainDragger.hideDragger(false); + // domainDragger.addMouseEvents(); + // + // } + // else { + // rangeDragger.hideDragger(true); + // domainDragger.hideDragger(true); + // if (clickedProperty.domain()===clickedProperty.range()){ + // clickedProperty.labelObject().increasedLoopAngle=false; + // recalculatePositions(); + // + // } + // } + // } + }); + labelGroupElements.selectAll(".label").on("dblclick", function ( clickedProperty ){ + d3.event.stopPropagation(); + if ( editMode === true ) { + clickedProperty.raiseDoubleClickEdit(defaultIriValue(clickedProperty)); + } + + }); + } + + function defaultIriValue( element ){ + // get the iri of that element; + if ( graph.options().getGeneralMetaObject().iri ) { + var str2Compare = graph.options().getGeneralMetaObject().iri + element.id(); + return element.iri() === str2Compare; + } + return false; + } + + /** Adjusts the containers current scale and position. */ + function zoomed(){ + if ( forceNotZooming === true ) { + zoom.translate(graphTranslation); + zoom.scale(zoomFactor); + return; + } + + + var zoomEventByMWheel = false; + if ( d3.event.sourceEvent ) { + if ( d3.event.sourceEvent.deltaY ) zoomEventByMWheel = true; + } + if ( zoomEventByMWheel === false ) { + if ( transformAnimation === true ) { + return; + } + zoomFactor = d3.event.scale; + graphTranslation = d3.event.translate; + graphContainer.attr("transform", "translate(" + graphTranslation + ")scale(" + zoomFactor + ")"); + updateHaloRadius(); + graph.options().zoomSlider().updateZoomSliderValue(zoomFactor); + return; + } + /** animate the transition **/ + zoomFactor = d3.event.scale; + graphTranslation = d3.event.translate; + graphContainer.transition() + .tween("attr.translate", function (){ + return function ( t ){ + transformAnimation = true; + var tr = d3.transform(graphContainer.attr("transform")); + graphTranslation[0] = tr.translate[0]; + graphTranslation[1] = tr.translate[1]; + zoomFactor = tr.scale[0]; + updateHaloRadius(); + graph.options().zoomSlider().updateZoomSliderValue(zoomFactor); + }; + }) + .each("end", function (){ + transformAnimation = false; + }) + .attr("transform", "translate(" + graphTranslation + ")scale(" + zoomFactor + ")") + .ease('linear') + .duration(250); + }// end of zoomed function + + function redrawGraph(){ + remove(); + + graphContainer = d3.selectAll(options.graphContainerSelector()) + .append("svg") + .classed("vowlGraph", true) + .attr("width", options.width()) + .attr("height", options.height()) + .call(zoom) + .append("g"); + // add touch and double click functions + + var svgGraph = d3.selectAll(".vowlGraph"); + originalD3_dblClickFunction = svgGraph.on("dblclick.zoom"); + originalD3_touchZoomFunction = svgGraph.on("touchstart"); + svgGraph.on("touchstart", touchzoomed); + if ( editMode === true ) { + svgGraph.on("dblclick.zoom", graph.modified_dblClickFunction); + } + else { + svgGraph.on("dblclick.zoom", originalD3_dblClickFunction); + } + + } + + function generateEditElements(){ + addDataPropertyGroupElement = editContainer.append('g') + .classed("hidden-in-export", true) + .classed("hidden", true) + .classed("addDataPropertyElement", true) + .attr("transform", "translate(" + 0 + "," + 0 + ")"); + + + addDataPropertyGroupElement.append("circle") + // .classed("deleteElement", true) + .attr("r", 12) + .attr("cx", 0) + .attr("cy", 0) + .append("title").text("Add Datatype Property"); + + addDataPropertyGroupElement.append("line") + // .classed("deleteElementIcon ",true) + .attr("x1", -8) + .attr("y1", 0) + .attr("x2", 8) + .attr("y2", 0) + .append("title").text("Add Datatype Property"); + + addDataPropertyGroupElement.append("line") + // .classed("deleteElementIcon",true) + .attr("x1", 0) + .attr("y1", -8) + .attr("x2", 0) + .attr("y2", 8) + .append("title").text("Add Datatype Property"); + + if ( graph.options().useAccuracyHelper() ) { + addDataPropertyGroupElement.append("circle") + .attr("r", 15) + .attr("cx", -7) + .attr("cy", 7) + .classed("superHiddenElement", true) + .classed("superOpacityElement", !graph.options().showDraggerObject()); + } + + + deleteGroupElement = editContainer.append('g') + .classed("hidden-in-export", true) + .classed("hidden", true) + .classed("deleteParentElement", true) + .attr("transform", "translate(" + 0 + "," + 0 + ")"); + + deleteGroupElement.append("circle") + .attr("r", 12) + .attr("cx", 0) + .attr("cy", 0) + .append("title").text("Delete This Node"); + + var crossLen = 5; + deleteGroupElement.append("line") + .attr("x1", -crossLen) + .attr("y1", -crossLen) + .attr("x2", crossLen) + .attr("y2", crossLen) + .append("title").text("Delete This Node"); + + deleteGroupElement.append("line") + .attr("x1", crossLen) + .attr("y1", -crossLen) + .attr("x2", -crossLen) + .attr("y2", crossLen) + .append("title").text("Delete This Node"); + + if ( graph.options().useAccuracyHelper() ) { + deleteGroupElement.append("circle") + .attr("r", 15) + .attr("cx", 7) + .attr("cy", -7) + .classed("superHiddenElement", true) + .classed("superOpacityElement", !graph.options().showDraggerObject()); + } + + + } + + graph.getUnfilteredData = function (){ + return unfilteredData; + }; + + graph.getClassDataForTtlExport = function (){ + var allNodes = unfilteredData.nodes; + var nodeData = []; + for ( var i = 0; i < allNodes.length; i++ ) { + if ( allNodes[i].type() !== "rdfs:Literal" && + allNodes[i].type() !== "rdfs:Datatype" && + allNodes[i].type() !== "owl:Thing" ) { + nodeData.push(allNodes[i]); + } + } + return nodeData; + }; + + graph.getPropertyDataForTtlExport = function (){ + var propertyData = []; + var allProperties = unfilteredData.properties; + for ( var i = 0; i < allProperties.length; i++ ) { + // currently using only the object properties + if ( allProperties[i].type() === "owl:ObjectProperty" || + allProperties[i].type() === "owl:DatatypeProperty" || + allProperties[i].type() === "owl:ObjectProperty" + + ) { + propertyData.push(allProperties[i]); + } else { + if ( allProperties[i].type() === "rdfs:subClassOf" ) { + allProperties[i].baseIri("http://www.w3.org/2000/01/rdf-schema#"); + allProperties[i].iri("http://www.w3.org/2000/01/rdf-schema#subClassOf"); + } + if ( allProperties[i].type() === "owl:disjointWith" ) { + allProperties[i].baseIri("http://www.w3.org/2002/07/owl#"); + allProperties[i].iri("http://www.w3.org/2002/07/owl#disjointWith"); + } + } + } + return propertyData; + }; + + graph.getAxiomsForTtlExport = function (){ + var axioms = []; + var allProperties = unfilteredData.properties; + for ( var i = 0; i < allProperties.length; i++ ) { + // currently using only the object properties + if ( allProperties[i].type() === "owl:ObjectProperty" || + allProperties[i].type() === "owl:DatatypeProperty" || + allProperties[i].type() === "owl:ObjectProperty" || + allProperties[i].type() === "rdfs:subClassOf" + ) { + } else { + } + } + return axioms; + }; + + + graph.getUnfilteredData = function (){ + return unfilteredData; + }; + + graph.getClassDataForTtlExport = function (){ + var allNodes = unfilteredData.nodes; + var nodeData = []; + for ( var i = 0; i < allNodes.length; i++ ) { + if ( allNodes[i].type() !== "rdfs:Literal" && + allNodes[i].type() !== "rdfs:Datatype" && + allNodes[i].type() !== "owl:Thing" ) { + nodeData.push(allNodes[i]); + } + } + return nodeData; + }; + + + function redrawContent(){ + var markerContainer; + + if ( !graphContainer ) { + return; + } + + // Empty the graph container + graphContainer.selectAll("*").remove(); + + // Last container -> elements of this container overlap others + linkContainer = graphContainer.append("g").classed("linkContainer", true); + cardinalityContainer = graphContainer.append("g").classed("cardinalityContainer", true); + labelContainer = graphContainer.append("g").classed("labelContainer", true); + nodeContainer = graphContainer.append("g").classed("nodeContainer", true); + + // adding editing Elements + var draggerPathLayer = graphContainer.append("g").classed("linkContainer", true); + draggerLayer = graphContainer.append("g").classed("editContainer", true); + editContainer = graphContainer.append("g").classed("editContainer", true); + + draggerPathLayer.classed("hidden-in-export", true); + editContainer.classed("hidden-in-export", true); + draggerLayer.classed("hidden-in-export", true); + + // Add an extra container for all markers + markerContainer = linkContainer.append("defs"); + var drElement = draggerLayer.selectAll(".node") + .data(draggerObjectsArray).enter() + .append("g") + .classed("node", true) + .classed("hidden-in-export", true) + .attr("id", function ( d ){ + return d.id(); + }) + .call(dragBehaviour); + drElement.each(function ( node ){ + node.svgRoot(d3.select(this)); + node.svgPathLayer(draggerPathLayer); + if ( node.type() === "shadowClone" ) { + node.drawClone(); + node.hideClone(true); + } else { + node.drawNode(); + node.hideDragger(true); + } + }); + generateEditElements(); + + + // Add an extra container for all markers + markerContainer = linkContainer.append("defs"); + + // Draw nodes + + if ( classNodes === undefined ) classNodes = []; + + nodeElements = nodeContainer.selectAll(".node") + .data(classNodes).enter() + .append("g") + .classed("node", true) + .attr("id", function ( d ){ + return d.id(); + }) + .call(dragBehaviour); + nodeElements.each(function ( node ){ + node.draw(d3.select(this)); + }); + + + if ( labelNodes === undefined ) labelNodes = []; + + // Draw label groups (property + inverse) + labelGroupElements = labelContainer.selectAll(".labelGroup") + .data(labelNodes).enter() + .append("g") + .classed("labelGroup", true) + .call(dragBehaviour); + + labelGroupElements.each(function ( label ){ + var success = label.draw(d3.select(this)); + label.property().labelObject(label); + // Remove empty groups without a label. + if ( !success ) { + d3.select(this).remove(); + } + }); + // Place subclass label groups on the bottom of all labels + labelGroupElements.each(function ( label ){ + // the label might be hidden e.g. in compact notation + if ( !this.parentNode ) { + return; + } + + if ( elementTools.isRdfsSubClassOf(label.property()) ) { + var parentNode = this.parentNode; + parentNode.insertBefore(this, parentNode.firstChild); + } + }); + if ( properties === undefined ) properties = []; + // Draw cardinality elements + cardinalityElements = cardinalityContainer.selectAll(".cardinality") + .data(properties).enter() + .append("g") + .classed("cardinality", true); + + cardinalityElements.each(function ( property ){ + var success = property.drawCardinality(d3.select(this)); + + // Remove empty groups without a label. + if ( !success ) { + d3.select(this).remove(); + } + }); + // Draw links + if ( links === undefined ) links = []; + linkGroups = linkContainer.selectAll(".link") + .data(links).enter() + .append("g") + .classed("link", true); + + linkGroups.each(function ( link ){ + link.draw(d3.select(this), markerContainer); + }); + linkPathElements = linkGroups.selectAll("path"); + // Select the path for direct access to receive a better performance + addClickEvents(); + } + + function remove(){ + if ( graphContainer ) { + // Select the parent element because the graph container is a group (e.g. for zooming) + d3.select(graphContainer.node().parentNode).remove(); + } + } + + initializeGraph(); // << call the initialization function + + graph.updateCanvasContainerSize = function (){ + if ( graphContainer ) { + var svgElement = d3.selectAll(".vowlGraph"); + svgElement.attr("width", options.width()); + svgElement.attr("height", options.height()); + graphContainer.attr("transform", "translate(" + graphTranslation + ")scale(" + zoomFactor + ")"); + } + }; + + // Loads all settings, removes the old graph (if it exists) and draws a new one. + graph.start = function (){ + force.stop(); + loadGraphData(true); + redrawGraph(); + graph.update(true); + + if ( graph.options().loadingModule().successfullyLoadedOntology() === false ) { + graph.options().loadingModule().setErrorMode(); + } + + }; + + // Updates only the style of the graph. + graph.updateStyle = function (){ + refreshGraphStyle(); + if ( graph.options().loadingModule().successfullyLoadedOntology() === false ) { + force.stop(); + } else { + force.start(); + } + }; + + graph.reload = function (){ + loadGraphData(); + graph.update(); + + }; + + graph.load = function (){ + force.stop(); + loadGraphData(); + refreshGraphData(); + for ( var i = 0; i < labelNodes.length; i++ ) { + var label = labelNodes[i]; + if ( label.property().x && label.property().y ) { + label.x = label.property().x; + label.y = label.property().y; + // also set the prev position of the label + label.px = label.x; + label.py = label.y; + } + } + graph.update(); + }; + + graph.fastUpdate = function (){ + // fast update function for editor calls; + // -- experimental ; + quick_refreshGraphData(); + updateNodeMap(); + force.start(); + redrawContent(); + graph.updatePulseIds(nodeArrayForPulse); + refreshGraphStyle(); + updateHaloStyles(); + + }; + + graph.getNodeMapForSearch = function (){ + return nodeMap; + }; + function updateNodeMap(){ + nodeMap = []; + var node; + for ( var j = 0; j < force.nodes().length; j++ ) { + node = force.nodes()[j]; + if ( node.id ) { + nodeMap[node.id()] = j; + // check for equivalents + var eqs = node.equivalents(); + if ( eqs.length > 0 ) { + for ( var e = 0; e < eqs.length; e++ ) { + var eqObject = eqs[e]; + nodeMap[eqObject.id()] = j; + } + } + } + if ( node.property ) { + nodeMap[node.property().id()] = j; + var inverse = node.inverse(); + if ( inverse ) { + nodeMap[inverse.id()] = j; + } + } + } + } + + function updateHaloStyles(){ + var haloElement; + var halo; + var node; + for ( var j = 0; j < force.nodes().length; j++ ) { + node = force.nodes()[j]; + if ( node.id ) { + haloElement = node.getHalos(); + if ( haloElement ) { + halo = haloElement.selectAll(".searchResultA"); + halo.classed("searchResultA", false); + halo.classed("searchResultB", true); + } + } + + if ( node.property ) { + haloElement = node.property().getHalos(); + if ( haloElement ) { + halo = haloElement.selectAll(".searchResultA"); + halo.classed("searchResultA", false); + halo.classed("searchResultB", true); + } + } + } + } + + // Updates the graphs displayed data and style. + graph.update = function ( init ){ + var validOntology = graph.options().loadingModule().successfullyLoadedOntology(); + if ( validOntology === false && (init && init === true) ) { + graph.options().loadingModule().collapseDetails(); + return; + } + if ( validOntology === false ) { + return; + } + + keepDetailsCollapsedOnLoading = false; + refreshGraphData(); + // update node map + updateNodeMap(); + + force.start(); + redrawContent(); + graph.updatePulseIds(nodeArrayForPulse); + refreshGraphStyle(); + updateHaloStyles(); + }; + + graph.paused = function ( p ){ + if ( !arguments.length ) return paused; + paused = p; + graph.updateStyle(); + return graph; + }; + // resetting the graph + graph.reset = function (){ + // window size + var w = 0.5 * graph.options().width(); + var h = 0.5 * graph.options().height(); + // computing initial translation for the graph due tue the dynamic default zoom level + var tx = w - defaultZoom * w; + var ty = h - defaultZoom * h; + zoom.translate([tx, ty]) + .scale(defaultZoom); + }; + + + graph.zoomOut = function (){ + + var minMag = options.minMagnification(), + maxMag = options.maxMagnification(); + var stepSize = (maxMag - minMag) / 10; + var val = zoomFactor - stepSize; + if ( val < minMag ) val = minMag; + + var cx = 0.5 * graph.options().width(); + var cy = 0.5 * graph.options().height(); + var cp = getWorldPosFromScreen(cx, cy, graphTranslation, zoomFactor); + var sP = [cp.x, cp.y, graph.options().height() / zoomFactor]; + var eP = [cp.x, cp.y, graph.options().height() / val]; + var pos_intp = d3.interpolateZoom(sP, eP); + + graphContainer.attr("transform", transform(sP, cx, cy)) + .transition() + .duration(250) + .attrTween("transform", function (){ + return function ( t ){ + return transform(pos_intp(t), cx, cy); + }; + }) + .each("end", function (){ + graphContainer.attr("transform", "translate(" + graphTranslation + ")scale(" + zoomFactor + ")"); + zoom.translate(graphTranslation); + zoom.scale(zoomFactor); + updateHaloRadius(); + options.zoomSlider().updateZoomSliderValue(zoomFactor); + }); + + }; + + graph.zoomIn = function (){ + var minMag = options.minMagnification(), + maxMag = options.maxMagnification(); + var stepSize = (maxMag - minMag) / 10; + var val = zoomFactor + stepSize; + if ( val > maxMag ) val = maxMag; + var cx = 0.5 * graph.options().width(); + var cy = 0.5 * graph.options().height(); + var cp = getWorldPosFromScreen(cx, cy, graphTranslation, zoomFactor); + var sP = [cp.x, cp.y, graph.options().height() / zoomFactor]; + var eP = [cp.x, cp.y, graph.options().height() / val]; + var pos_intp = d3.interpolateZoom(sP, eP); + + graphContainer.attr("transform", transform(sP, cx, cy)) + .transition() + .duration(250) + .attrTween("transform", function (){ + return function ( t ){ + return transform(pos_intp(t), cx, cy); + }; + }) + .each("end", function (){ + graphContainer.attr("transform", "translate(" + graphTranslation + ")scale(" + zoomFactor + ")"); + zoom.translate(graphTranslation); + zoom.scale(zoomFactor); + updateHaloRadius(); + options.zoomSlider().updateZoomSliderValue(zoomFactor); + }); + + + }; + + /** --------------------------------------------------------- **/ + /** -- data related handling -- **/ + /** --------------------------------------------------------- **/ + + var cachedJsonOBJ = null; + graph.clearAllGraphData = function (){ + if ( graph.graphNodeElements() && graph.graphNodeElements().length > 0 ) { + cachedJsonOBJ = graph.options().exportMenu().createJSON_exportObject(); + } else { + cachedJsonOBJ = null; + } + force.stop(); + if ( unfilteredData ) { + unfilteredData.nodes = []; + unfilteredData.properties = []; + } + }; + graph.getCachedJsonObj = function (){ + return cachedJsonOBJ; + }; + + // removes data when data could not be loaded + graph.clearGraphData = function (){ + force.stop(); + var sidebar = graph.options().sidebar(); + if ( sidebar ) + sidebar.clearOntologyInformation(); + if ( graphContainer ) + redrawGraph(); + }; + + function generateDictionary( data ){ + var i; + var originalDictionary = []; + var nodes = data.nodes; + for ( i = 0; i < nodes.length; i++ ) { + // check if node has a label + if ( nodes[i].labelForCurrentLanguage() !== undefined ) + originalDictionary.push(nodes[i]); + } + var props = data.properties; + for ( i = 0; i < props.length; i++ ) { + if ( props[i].labelForCurrentLanguage() !== undefined ) + originalDictionary.push(props[i]); + } + parser.setDictionary(originalDictionary); + + var literFilter = graph.options().literalFilter(); + var idsToRemove = literFilter.removedNodes(); + var originalDict = parser.getDictionary(); + var newDict = []; + + // go through the dictionary and remove the ids; + for ( i = 0; i < originalDict.length; i++ ) { + var dictElement = originalDict[i]; + var dictElementId; + if ( dictElement.property ) + dictElementId = dictElement.property().id(); + else + dictElementId = dictElement.id(); + // compare against the removed ids; + var addToDictionary = true; + for ( var j = 0; j < idsToRemove.length; j++ ) { + var currentId = idsToRemove[j]; + if ( currentId === dictElementId ) { + addToDictionary = false; + } + } + if ( addToDictionary === true ) { + newDict.push(dictElement); + } + } + // tell the parser that the dictionary is updated + parser.setDictionary(newDict); + + } + + graph.updateProgressBarMode = function (){ + var loadingModule = graph.options().loadingModule(); + + var state = loadingModule.getProgressBarMode(); + switch ( state ) { + case 0: + loadingModule.setErrorMode(); + break; + case 1: + loadingModule.setBusyMode(); + break; + case 2: + loadingModule.setPercentMode(); + break; + default: + loadingModule.setPercentMode(); + } + }; + + graph.setFilterWarning = function ( val ){ + showFilterWarning = val; + }; + function loadGraphData( init ){ + // reset the locate button and previously selected locations and other variables + + var loadingModule = graph.options().loadingModule(); + force.stop(); + + force.nodes([]); + force.links([]); + nodeArrayForPulse = []; + pulseNodeIds = []; + locationId = 0; + d3.select("#locateSearchResult").classed("highlighted", false); + d3.select("#locateSearchResult").node().title = "Nothing to locate"; + graph.clearGraphData(); + + if ( init ) { + force.stop(); + return; + } + + showFilterWarning = false; + parser.parse(options.data()); + unfilteredData = { + nodes: parser.nodes(), + properties: parser.properties() + }; + // fixing class and property id counter for the editor + eN = unfilteredData.nodes.length + 1; + eP = unfilteredData.properties.length + 1; + + initialLoad = true; + graph.options().warningModule().closeFilterHint(); + + // loading handler + updateRenderingDuringSimulation = true; + var validOntology = graph.options().loadingModule().successfullyLoadedOntology(); + if ( graphContainer && validOntology === true ) { + + updateRenderingDuringSimulation = false; + graph.options().ontologyMenu().append_bulletPoint("Generating visualization ... "); + loadingModule.setPercentMode(); + + if ( unfilteredData.nodes.length > 0 ) { + graphContainer.style("opacity", "0"); + force.on("tick", hiddenRecalculatePositions); + } else { + graphContainer.style("opacity", "1"); + if ( showFPS === true ) { + force.on("tick", recalculatePositionsWithFPS); + } + else { + force.on("tick", recalculatePositions); + } + } + + force.start(); + } else { + force.stop(); + graph.options().ontologyMenu().append_bulletPoint("Failed to load ontology"); + loadingModule.setErrorMode(); + } + // update prefixList( + // update general MetaOBJECT + graph.options().clearMetaObject(); + graph.options().clearGeneralMetaObject(); + graph.options().editSidebar().clearMetaObjectValue(); + if ( options.data() !== undefined ) { + var header = options.data().header; + if ( header ) { + if ( header.iri ) { + graph.options().addOrUpdateGeneralObjectEntry("iri", header.iri); + } + if ( header.title ) { + graph.options().addOrUpdateGeneralObjectEntry("title", header.title); + } + if ( header.author ) { + graph.options().addOrUpdateGeneralObjectEntry("author", header.author); + } + if ( header.version ) { + graph.options().addOrUpdateGeneralObjectEntry("version", header.version); + } + if ( header.description ) { + graph.options().addOrUpdateGeneralObjectEntry("description", header.description); + } + if ( header.prefixList ) { + var pL = header.prefixList; + for ( var pr in pL ) { + if ( pL.hasOwnProperty(pr) ) { + var val = pL[pr]; + graph.options().addPrefix(pr, val); + } + } + } + // get other metadata; + if ( header.other ) { + var otherObjects = header.other; + for ( var name in otherObjects ) { + if ( otherObjects.hasOwnProperty(name) ) { + var otherObj = otherObjects[name]; + if ( otherObj.hasOwnProperty("identifier") && otherObj.hasOwnProperty("value") ) { + graph.options().addOrUpdateMetaObjectEntry(otherObj.identfier, otherObj.value); + } + } + } + } + } + } + // update more meta OBJECT + // Initialize filters with data to replicate consecutive filtering + var initializationData = _.clone(unfilteredData); + options.filterModules().forEach(function ( module ){ + initializationData = filterFunction(module, initializationData, true); + }); + // generate dictionary here ; + generateDictionary(unfilteredData); + + parser.parseSettings(); + graphUpdateRequired = parser.settingsImported(); + centerGraphViewOnLoad = true; + if ( parser.settingsImportGraphZoomAndTranslation() === true ) { + centerGraphViewOnLoad = false; + } + graph.options().searchMenu().requestDictionaryUpdate(); + graph.options().editSidebar().updateGeneralOntologyInfo(); + graph.options().editSidebar().updatePrefixUi(); + graph.options().editSidebar().updateElementWidth(); + } + + graph.handleOnLoadingError = function (){ + force.stop(); + graph.clearGraphData(); + graph.options().ontologyMenu().append_bulletPoint("Failed to load ontology"); + d3.select("#progressBarValue").node().innherHTML = ""; + d3.select("#progressBarValue").classed("busyProgressBar", false); + graph.options().loadingModule().setErrorMode(); + graph.options().loadingModule().showErrorDetailsMessage(); + }; + + function quick_refreshGraphData(){ + links = linkCreator.createLinks(properties); + labelNodes = links.map(function ( link ){ + return link.label(); + }); + + storeLinksOnNodes(classNodes, links); + setForceLayoutData(classNodes, labelNodes, links); + } + + //Applies the data of the graph options object and parses it. The graph is not redrawn. + function refreshGraphData(){ + var shouldExecuteEmptyFilter = options.literalFilter().enabled(); + graph.executeEmptyLiteralFilter(); + options.literalFilter().enabled(shouldExecuteEmptyFilter); + + var preprocessedData = _.clone(unfilteredData); + + // Filter the data + options.filterModules().forEach(function ( module ){ + preprocessedData = filterFunction(module, preprocessedData); + }); + options.focuserModule().handle(undefined, true); + classNodes = preprocessedData.nodes; + properties = preprocessedData.properties; + links = linkCreator.createLinks(properties); + labelNodes = links.map(function ( link ){ + return link.label(); + }); + storeLinksOnNodes(classNodes, links); + setForceLayoutData(classNodes, labelNodes, links); + // for (var i = 0; i < classNodes.length; i++) { + // if (classNodes[i].setRectangularRepresentation) + // classNodes[i].setRectangularRepresentation(graph.options().rectangularRepresentation()); + // } + } + + function filterFunction( module, data, initializing ){ + links = linkCreator.createLinks(data.properties); + storeLinksOnNodes(data.nodes, links); + + if ( initializing ) { + if ( module.initialize ) { + module.initialize(data.nodes, data.properties); + } + } + module.filter(data.nodes, data.properties); + return { + nodes: module.filteredNodes(), + properties: module.filteredProperties() + }; + } + + + /** --------------------------------------------------------- **/ + /** -- force-layout related functions -- **/ + /** --------------------------------------------------------- **/ + function storeLinksOnNodes( nodes, links ){ + for ( var i = 0, nodesLength = nodes.length; i < nodesLength; i++ ) { + var node = nodes[i], + connectedLinks = []; + + // look for properties where this node is the domain or range + for ( var j = 0, linksLength = links.length; j < linksLength; j++ ) { + var link = links[j]; + + if ( link.domain() === node || link.range() === node ) { + connectedLinks.push(link); + } + } + node.links(connectedLinks); + } + } + + function setForceLayoutData( classNodes, labelNodes, links ){ + var d3Links = []; + links.forEach(function ( link ){ + d3Links = d3Links.concat(link.linkParts()); + }); + + var d3Nodes = [].concat(classNodes).concat(labelNodes); + setPositionOfOldLabelsOnNewLabels(force.nodes(), labelNodes); + + force.nodes(d3Nodes) + .links(d3Links); + } + + // The label nodes are positioned randomly, because they are created from scratch if the data changes and lose + // their position information. With this hack the position of old labels is copied to the new labels. + function setPositionOfOldLabelsOnNewLabels( oldLabelNodes, labelNodes ){ + labelNodes.forEach(function ( labelNode ){ + for ( var i = 0; i < oldLabelNodes.length; i++ ) { + var oldNode = oldLabelNodes[i]; + if ( oldNode.equals(labelNode) ) { + labelNode.x = oldNode.x; + labelNode.y = oldNode.y; + labelNode.px = oldNode.px; + labelNode.py = oldNode.py; + break; + } + } + }); + } + + // Applies all options that don't change the graph data. + function refreshGraphStyle(){ + zoom = zoom.scaleExtent([options.minMagnification(), options.maxMagnification()]); + if ( graphContainer ) { + zoom.event(graphContainer); + } + + force.charge(function ( element ){ + var charge = options.charge(); + if ( elementTools.isLabel(element) ) { + charge *= 0.8; + } + return charge; + }) + .size([options.width(), options.height()]) + .linkDistance(calculateLinkPartDistance) + .gravity(options.gravity()) + .linkStrength(options.linkStrength()); // Flexibility of links + + force.nodes().forEach(function ( n ){ + n.frozen(paused); + }); + } + + function calculateLinkPartDistance( linkPart ){ + var link = linkPart.link(); + + if ( link.isLoop() ) { + return options.loopDistance(); + } + + // divide by 2 to receive the length for a single link part + var linkPartDistance = getVisibleLinkDistance(link) / 2; + linkPartDistance += linkPart.domain().actualRadius(); + linkPartDistance += linkPart.range().actualRadius(); + return linkPartDistance; + } + + function getVisibleLinkDistance( link ){ + if ( elementTools.isDatatype(link.domain()) || elementTools.isDatatype(link.range()) ) { + return options.datatypeDistance(); + } else { + return options.classDistance(); + } + } + + /** --------------------------------------------------------- **/ + /** -- animation functions for the nodes -- **/ + /** --------------------------------------------------------- **/ + + graph.animateDynamicLabelWidth = function (){ + var wantedWidth = options.dynamicLabelWidth(); + var i; + for ( i = 0; i < classNodes.length; i++ ) { + var nodeElement = classNodes[i]; + if ( elementTools.isDatatype(nodeElement) ) { + nodeElement.animateDynamicLabelWidth(wantedWidth); + } + } + for ( i = 0; i < properties.length; i++ ) { + properties[i].animateDynamicLabelWidth(wantedWidth); + } + }; + + + /** --------------------------------------------------------- **/ + /** -- halo and localization functions -- **/ + /** --------------------------------------------------------- **/ + function updateHaloRadius(){ + if ( pulseNodeIds && pulseNodeIds.length > 0 ) { + var forceNodes = force.nodes(); + for ( var i = 0; i < pulseNodeIds.length; i++ ) { + var node = forceNodes[pulseNodeIds[i]]; + if ( node ) { + if ( node.property ) { + // match search strings with property label + if ( node.property().inverse ) { + var searchString = graph.options().searchMenu().getSearchString().toLowerCase(); + var name = node.property().labelForCurrentLanguage().toLowerCase(); + if ( name === searchString ) computeDistanceToCenter(node); + else { + node.property().removeHalo(); + if ( node.property().inverse() ) { + if ( !node.property().inverse().getHalos() ) + node.property().inverse().drawHalo(); + computeDistanceToCenter(node, true); + } + if ( node.property().equivalents() ) { + var eq = node.property().equivalents(); + for ( var e = 0; e < eq.length; e++ ) { + if ( !eq[e].getHalos() ) + eq[e].drawHalo(); + } + if ( !node.property().getHalos() ) + node.property().drawHalo(); + computeDistanceToCenter(node, false); + + } + } + } + } + computeDistanceToCenter(node); + } + } + } + } + + function getScreenCoords( x, y, translate, scale ){ + var xn = translate[0] + x * scale; + var yn = translate[1] + y * scale; + return { x: xn, y: yn }; + } + + function getClickedScreenCoords( x, y, translate, scale ){ + var xn = (x - translate[0]) / scale; + var yn = (y - translate[1]) / scale; + return { x: xn, y: yn }; + } + + + function computeDistanceToCenter( node, inverse ){ + var container = node; + var w = graph.options().width(); + var h = graph.options().height(); + var posXY = getScreenCoords(node.x, node.y, graphTranslation, zoomFactor); + + var highlightOfInv = false; + + if ( inverse && inverse === true ) { + highlightOfInv = true; + posXY = getScreenCoords(node.x, node.y + 20, graphTranslation, zoomFactor); + } + var x = posXY.x; + var y = posXY.y; + var nodeIsRect = false; + var halo; + var roundHalo; + var rectHalo; + var borderPoint_x = 0; + var borderPoint_y = 0; + var defaultRadius; + var offset = 15; + var radius; + + if ( node.property && highlightOfInv === true ) { + if ( node.property().inverse() ) { + rectHalo = node.property().inverse().getHalos().select("rect"); + + } else { + if ( node.property().getHalos() ) + rectHalo = node.property().getHalos().select("rect"); + else { + node.property().drawHalo(); + rectHalo = node.property().getHalos().select("rect"); + } + } + rectHalo.classed("hidden", true); + if ( node.property().inverse() ) { + if ( node.property().inverse().getHalos() ) { + roundHalo = node.property().inverse().getHalos().select("circle"); + } + } else { + roundHalo = node.property().getHalos().select("circle"); + } + if ( roundHalo.node() === null ) { + radius = node.property().inverse().width() + 15; + + roundHalo = node.property().inverse().getHalos().append("circle") + .classed("searchResultB", true) + .classed("searchResultA", false) + .attr("r", radius + 15); + + } + halo = roundHalo; // swap the halo to be round + nodeIsRect = true; + container = node.property().inverse(); + } + + if ( node.id ) { + if ( !node.getHalos() ) return; // something went wrong before + halo = node.getHalos().select("rect"); + if ( halo.node() === null ) { + // this is a round node + nodeIsRect = false; + roundHalo = node.getHalos().select("circle"); + defaultRadius = node.actualRadius(); + roundHalo.attr("r", defaultRadius + offset); + halo = roundHalo; + } else { // this is a rect node + nodeIsRect = true; + rectHalo = node.getHalos().select("rect"); + rectHalo.classed("hidden", true); + roundHalo = node.getHalos().select("circle"); + if ( roundHalo.node() === null ) { + radius = node.width(); + roundHalo = node.getHalos().append("circle") + .classed("searchResultB", true) + .classed("searchResultA", false) + .attr("r", radius + offset); + } + halo = roundHalo; + } + } + if ( node.property && !inverse ) { + if ( !node.property().getHalos() ) return; // something went wrong before + rectHalo = node.property().getHalos().select("rect"); + rectHalo.classed("hidden", true); + + roundHalo = node.property().getHalos().select("circle"); + if ( roundHalo.node() === null ) { + radius = node.property().width(); + + roundHalo = node.property().getHalos().append("circle") + .classed("searchResultB", true) + .classed("searchResultA", false) + .attr("r", radius + 15); + + } + halo = roundHalo; // swap the halo to be round + nodeIsRect = true; + container = node.property(); + } + + if ( x < 0 || x > w || y < 0 || y > h ) { + // node outside viewport; + // check for quadrant and get the correct boarder point (intersection with viewport) + if ( x < 0 && y < 0 ) { + borderPoint_x = 0; + borderPoint_y = 0; + } else if ( x > 0 && x < w && y < 0 ) { + borderPoint_x = x; + borderPoint_y = 0; + } else if ( x > w && y < 0 ) { + borderPoint_x = w; + borderPoint_y = 0; + } else if ( x > w && y > 0 && y < h ) { + borderPoint_x = w; + borderPoint_y = y; + } else if ( x > w && y > h ) { + borderPoint_x = w; + borderPoint_y = h; + } else if ( x > 0 && x < w && y > h ) { + borderPoint_x = x; + borderPoint_y = h; + } else if ( x < 0 && y > h ) { + borderPoint_x = 0; + borderPoint_y = h; + } else if ( x < 0 && y > 0 && y < h ) { + borderPoint_x = 0; + borderPoint_y = y; + } + // kill all pulses of nodes that are outside the viewport + container.getHalos().select("rect").classed("searchResultA", false); + container.getHalos().select("circle").classed("searchResultA", false); + container.getHalos().select("rect").classed("searchResultB", true); + container.getHalos().select("circle").classed("searchResultB", true); + halo.classed("hidden", false); + // compute in pixel coordinates length of difference vector + var borderRadius_x = borderPoint_x - x; + var borderRadius_y = borderPoint_y - y; + + var len = borderRadius_x * borderRadius_x + borderRadius_y * borderRadius_y; + len = Math.sqrt(len); + + var normedX = borderRadius_x / len; + var normedY = borderRadius_y / len; + + len = len + 20; // add 20 px; + + // re-normalized vector + var newVectorX = normedX * len + x; + var newVectorY = normedY * len + y; + // compute world coordinates of this point + var wX = (newVectorX - graphTranslation[0]) / zoomFactor; + var wY = (newVectorY - graphTranslation[1]) / zoomFactor; + + // compute distance in world coordinates + var dx = wX - node.x; + var dy = wY - node.y; + if ( highlightOfInv === true ) + dy = wY - node.y - 20; + + if ( highlightOfInv === false && node.property && node.property().inverse() ) + dy = wY - node.y + 20; + + var newRadius = Math.sqrt(dx * dx + dy * dy); + halo = container.getHalos().select("circle"); + // sanity checks and setting new halo radius + if ( !nodeIsRect ) { + defaultRadius = node.actualRadius() + offset; + if ( newRadius < defaultRadius ) { + newRadius = defaultRadius; + } + halo.attr("r", newRadius); + } else { + defaultRadius = 0.5 * container.width(); + if ( newRadius < defaultRadius ) + newRadius = defaultRadius; + halo.attr("r", newRadius); + } + } else { // node is in viewport , render original; + // reset the halo to original radius + defaultRadius = node.actualRadius() + 15; + if ( !nodeIsRect ) { + halo.attr("r", defaultRadius); + } else { // this is rectangular node render as such + halo = container.getHalos().select("rect"); + halo.classed("hidden", false); + //halo.classed("searchResultB", true); + //halo.classed("searchResultA", false); + var aCircHalo = container.getHalos().select("circle"); + aCircHalo.classed("hidden", true); + + container.getHalos().select("rect").classed("hidden", false); + container.getHalos().select("circle").classed("hidden", true); + } + } + } + + function transform( p, cx, cy ){ + // one iteration step for the locate target animation + zoomFactor = graph.options().height() / p[2]; + graphTranslation = [(cx - p[0] * zoomFactor), (cy - p[1] * zoomFactor)]; + updateHaloRadius(); + // update the values in case the user wants to break the animation + zoom.translate(graphTranslation); + zoom.scale(zoomFactor); + graph.options().zoomSlider().updateZoomSliderValue(zoomFactor); + return "translate(" + graphTranslation[0] + "," + graphTranslation[1] + ")scale(" + zoomFactor + ")"; + } + + graph.zoomToElementInGraph = function ( element ){ + targetLocationZoom(element); + }; + graph.updateHaloRadius = function ( element ){ + computeDistanceToCenter(element); + }; + + function targetLocationZoom( target ){ + // store the original information + var cx = 0.5 * graph.options().width(); + var cy = 0.5 * graph.options().height(); + var cp = getWorldPosFromScreen(cx, cy, graphTranslation, zoomFactor); + var sP = [cp.x, cp.y, graph.options().height() / zoomFactor]; + + var zoomLevel = Math.max(defaultZoom + 0.5 * defaultZoom, defaultTargetZoom); + var eP = [target.x, target.y, graph.options().height() / zoomLevel]; + var pos_intp = d3.interpolateZoom(sP, eP); + + var lenAnimation = pos_intp.duration; + if ( lenAnimation > 2500 ) { + lenAnimation = 2500; + } + + graphContainer.attr("transform", transform(sP, cx, cy)) + .transition() + .duration(lenAnimation) + .attrTween("transform", function (){ + return function ( t ){ + return transform(pos_intp(t), cx, cy); + }; + }) + .each("end", function (){ + graphContainer.attr("transform", "translate(" + graphTranslation + ")scale(" + zoomFactor + ")"); + zoom.translate(graphTranslation); + zoom.scale(zoomFactor); + updateHaloRadius(); + }); + } + + function getWorldPosFromScreen( x, y, translate, scale ){ + var temp = scale[0], xn, yn; + if ( temp ) { + xn = (x - translate[0]) / temp; + yn = (y - translate[1]) / temp; + } else { + xn = (x - translate[0]) / scale; + yn = (y - translate[1]) / scale; + } + return { x: xn, y: yn }; + } + + graph.locateSearchResult = function (){ + if ( pulseNodeIds && pulseNodeIds.length > 0 ) { + // move the center of the viewport to this location + if ( transformAnimation === true ) return; // << prevents incrementing the location id if we are in an animation + var node = force.nodes()[pulseNodeIds[locationId]]; + locationId++; + locationId = locationId % pulseNodeIds.length; + if ( node.id ) node.foreground(); + if ( node.property ) node.property().foreground(); + + targetLocationZoom(node); + } + }; + + graph.resetSearchHighlight = function (){ + // get all nodes (handle also already filtered nodes ) + pulseNodeIds = []; + nodeArrayForPulse = []; + // clear from stored nodes + var nodes = unfilteredData.nodes; + var props = unfilteredData.properties; + var j; + for ( j = 0; j < nodes.length; j++ ) { + var node = nodes[j]; + if ( node.removeHalo ) + node.removeHalo(); + } + for ( j = 0; j < props.length; j++ ) { + var prop = props[j]; + if ( prop.removeHalo ) + prop.removeHalo(); + } + }; + + graph.updatePulseIds = function ( nodeIdArray ){ + pulseNodeIds = []; + for ( var i = 0; i < nodeIdArray.length; i++ ) { + var selectedId = nodeIdArray[i]; + var forceId = nodeMap[selectedId]; + if ( forceId !== undefined ) { + var le_node = force.nodes()[forceId]; + if ( le_node.id ) { + if ( pulseNodeIds.indexOf(forceId) === -1 ) { + pulseNodeIds.push(forceId); + } + } + if ( le_node.property ) { + if ( pulseNodeIds.indexOf(forceId) === -1 ) { + pulseNodeIds.push(forceId); + } + } + } + } + locationId = 0; + if ( pulseNodeIds.length > 0 ) { + d3.select("#locateSearchResult").classed("highlighted", true); + d3.select("#locateSearchResult").node().title = "Locate search term"; + } + else { + d3.select("#locateSearchResult").classed("highlighted", false); + d3.select("#locateSearchResult").node().title = "Nothing to locate"; + } + + }; + + graph.highLightNodes = function ( nodeIdArray ){ + if ( nodeIdArray.length === 0 ) { + return; // nothing to highlight + } + pulseNodeIds = []; + nodeArrayForPulse = nodeIdArray; + var missedIds = []; + + // identify the force id to highlight + for ( var i = 0; i < nodeIdArray.length; i++ ) { + var selectedId = nodeIdArray[i]; + var forceId = nodeMap[selectedId]; + if ( forceId !== undefined ) { + var le_node = force.nodes()[forceId]; + if ( le_node.id ) { + if ( pulseNodeIds.indexOf(forceId) === -1 ) { + pulseNodeIds.push(forceId); + le_node.foreground(); + le_node.drawHalo(); + } + } + if ( le_node.property ) { + if ( pulseNodeIds.indexOf(forceId) === -1 ) { + pulseNodeIds.push(forceId); + le_node.property().foreground(); + le_node.property().drawHalo(); + } + } + } + else { + missedIds.push(selectedId); + } + } + + if ( missedIds.length === nodeIdArray.length ) { + + } + // store the highlight on the missed nodes; + var s_nodes = unfilteredData.nodes; + var s_props = unfilteredData.properties; + for ( i = 0; i < missedIds.length; i++ ) { + var missedId = missedIds[i]; + // search for this in the nodes; + for ( var n = 0; n < s_nodes.length; n++ ) { + var nodeId = s_nodes[n].id(); + if ( nodeId === missedId ) { + s_nodes[n].drawHalo(); + } + } + for ( var p = 0; p < s_props.length; p++ ) { + var propId = s_props[p].id(); + if ( propId === missedId ) { + s_props[p].drawHalo(); + } + } + } + if ( missedIds.length === nodeIdArray.length ) { + d3.select("#locateSearchResult").classed("highlighted", false); + } + else { + d3.select("#locateSearchResult").classed("highlighted", true); + } + locationId = 0; + updateHaloRadius(); + }; + + graph.hideHalos = function (){ + var haloElements = d3.selectAll(".searchResultA,.searchResultB"); + haloElements.classed("hidden", true); + return haloElements; + }; + + function nodeInViewport( node, property ){ + + var w = graph.options().width(); + var h = graph.options().height(); + var posXY = getScreenCoords(node.x, node.y, graphTranslation, zoomFactor); + var x = posXY.x; + var y = posXY.y; + + var retVal = !(x < 0 || x > w || y < 0 || y > h); + return retVal; + } + + graph.getBoundingBoxForTex = function (){ + var halos = graph.hideHalos(); + var bbox = graphContainer.node().getBoundingClientRect(); + halos.classed("hidden", false); + var w = graph.options().width(); + var h = graph.options().height(); + + // get the graph coordinates + var topLeft = getWorldPosFromScreen(0, 0, graphTranslation, zoomFactor); + var botRight = getWorldPosFromScreen(w, h, graphTranslation, zoomFactor); + + + var t_topLeft = getWorldPosFromScreen(bbox.left, bbox.top, graphTranslation, zoomFactor); + var t_botRight = getWorldPosFromScreen(bbox.right, bbox.bottom, graphTranslation, zoomFactor); + + // tighten up the bounding box; + + var tX = Math.max(t_topLeft.x, topLeft.x); + var tY = Math.max(t_topLeft.y, topLeft.y); + + var bX = Math.min(t_botRight.x, botRight.x); + var bY = Math.min(t_botRight.y, botRight.y); + + + // tighten further; + var allForceNodes = force.nodes(); + var numNodes = allForceNodes.length; + var visibleNodes = []; + var bbx; + + + var contentBBox = { tx: 1000000000000, ty: 1000000000000, bx: -1000000000000, by: -1000000000000 }; + + for ( var i = 0; i < numNodes; i++ ) { + var node = allForceNodes[i]; + if ( node ) { + if ( node.property ) { + if ( nodeInViewport(node, true) ) { + if ( node.property().labelElement() === undefined ) continue; + bbx = node.property().labelElement().node().getBoundingClientRect(); + if ( bbx ) { + contentBBox.tx = Math.min(contentBBox.tx, bbx.left); + contentBBox.bx = Math.max(contentBBox.bx, bbx.right); + contentBBox.ty = Math.min(contentBBox.ty, bbx.top); + contentBBox.by = Math.max(contentBBox.by, bbx.bottom); + } + } + } else { + if ( nodeInViewport(node, false) ) { + bbx = node.nodeElement().node().getBoundingClientRect(); + if ( bbx ) { + contentBBox.tx = Math.min(contentBBox.tx, bbx.left); + contentBBox.bx = Math.max(contentBBox.bx, bbx.right); + contentBBox.ty = Math.min(contentBBox.ty, bbx.top); + contentBBox.by = Math.max(contentBBox.by, bbx.bottom); + } + } + } + } + } + + var tt_topLeft = getWorldPosFromScreen(contentBBox.tx, contentBBox.ty, graphTranslation, zoomFactor); + var tt_botRight = getWorldPosFromScreen(contentBBox.bx, contentBBox.by, graphTranslation, zoomFactor); + + tX = Math.max(tX, tt_topLeft.x); + tY = Math.max(tY, tt_topLeft.y); + + bX = Math.min(bX, tt_botRight.x); + bY = Math.min(bY, tt_botRight.y); + // y axis flip for tex + return [tX, -tY, bX, -bY]; + + }; + + var updateTargetElement = function (){ + var bbox = graphContainer.node().getBoundingClientRect(); + + + // get the graph coordinates + var bboxOffset = 50; // default radius of a node; + var topLeft = getWorldPosFromScreen(bbox.left, bbox.top, graphTranslation, zoomFactor); + var botRight = getWorldPosFromScreen(bbox.right, bbox.bottom, graphTranslation, zoomFactor); + + var w = graph.options().width(); + if ( graph.options().leftSidebar().isSidebarVisible() === true ) + w -= 200; + var h = graph.options().height(); + topLeft.x += bboxOffset; + topLeft.y -= bboxOffset; + botRight.x -= bboxOffset; + botRight.y += bboxOffset; + + var g_w = botRight.x - topLeft.x; + var g_h = botRight.y - topLeft.y; + + // endpoint position calculations + var posX = 0.5 * (topLeft.x + botRight.x); + var posY = 0.5 * (topLeft.y + botRight.y); + var cx = 0.5 * w, + cy = 0.5 * h; + + if ( graph.options().leftSidebar().isSidebarVisible() === true ) + cx += 200; + var cp = getWorldPosFromScreen(cx, cy, graphTranslation, zoomFactor); + + // zoom factor calculations and fail safes; + var newZoomFactor = 1.0; // fail save if graph and window are squares + //get the smaller one + var a = w / g_w; + var b = h / g_h; + if ( a < b ) newZoomFactor = a; + else newZoomFactor = b; + + + // fail saves + if ( newZoomFactor > zoom.scaleExtent()[1] ) { + newZoomFactor = zoom.scaleExtent()[1]; + } + if ( newZoomFactor < zoom.scaleExtent()[0] ) { + newZoomFactor = zoom.scaleExtent()[0]; + } + + // apply Zooming + var sP = [cp.x, cp.y, h / zoomFactor]; + var eP = [posX, posY, h / newZoomFactor]; + + + var pos_intp = d3.interpolateZoom(sP, eP); + return [pos_intp, cx, cy]; + + }; + + graph.forceRelocationEvent = function ( dynamic ){ + // we need to kill the halo to determine the bounding box; + var halos = graph.hideHalos(); + var bbox = graphContainer.node().getBoundingClientRect(); + halos.classed("hidden", false); + + // get the graph coordinates + var bboxOffset = 50; // default radius of a node; + var topLeft = getWorldPosFromScreen(bbox.left, bbox.top, graphTranslation, zoomFactor); + var botRight = getWorldPosFromScreen(bbox.right, bbox.bottom, graphTranslation, zoomFactor); + + var w = graph.options().width(); + if ( graph.options().leftSidebar().isSidebarVisible() === true ) + w -= 200; + var h = graph.options().height(); + topLeft.x += bboxOffset; + topLeft.y -= bboxOffset; + botRight.x -= bboxOffset; + botRight.y += bboxOffset; + + var g_w = botRight.x - topLeft.x; + var g_h = botRight.y - topLeft.y; + + // endpoint position calculations + var posX = 0.5 * (topLeft.x + botRight.x); + var posY = 0.5 * (topLeft.y + botRight.y); + var cx = 0.5 * w, + cy = 0.5 * h; + + if ( graph.options().leftSidebar().isSidebarVisible() === true ) + cx += 200; + var cp = getWorldPosFromScreen(cx, cy, graphTranslation, zoomFactor); + + // zoom factor calculations and fail safes; + var newZoomFactor = 1.0; // fail save if graph and window are squares + //get the smaller one + var a = w / g_w; + var b = h / g_h; + if ( a < b ) newZoomFactor = a; + else newZoomFactor = b; + + + // fail saves + if ( newZoomFactor > zoom.scaleExtent()[1] ) { + newZoomFactor = zoom.scaleExtent()[1]; + } + if ( newZoomFactor < zoom.scaleExtent()[0] ) { + newZoomFactor = zoom.scaleExtent()[0]; + } + + // apply Zooming + var sP = [cp.x, cp.y, h / zoomFactor]; + var eP = [posX, posY, h / newZoomFactor]; + + + var pos_intp = d3.interpolateZoom(sP, eP); + var lenAnimation = pos_intp.duration; + if ( lenAnimation > 2500 ) { + lenAnimation = 2500; + } + graphContainer.attr("transform", transform(sP, cx, cy)) + .transition() + .duration(lenAnimation) + .attrTween("transform", function (){ + return function ( t ){ + if ( dynamic ) { + var param = updateTargetElement(); + var nV = param[0](t); + return transform(nV, cx, cy); + } + return transform(pos_intp(t), cx, cy); + }; + }) + .each("end", function (){ + if ( dynamic ) { + return; + } + + graphContainer.attr("transform", "translate(" + graphTranslation + ")scale(" + zoomFactor + ")"); + zoom.translate(graphTranslation); + zoom.scale(zoomFactor); + graph.options().zoomSlider().updateZoomSliderValue(zoomFactor); + + + }); + }; + + + graph.isADraggerActive = function (){ + if ( classDragger.mouseButtonPressed === true || + domainDragger.mouseButtonPressed === true || + rangeDragger.mouseButtonPressed === true ) { + return true; + } + return false; + }; + + /** --------------------------------------------------------- **/ + /** -- VOWL EDITOR create/ edit /delete functions -- **/ + /** --------------------------------------------------------- **/ + + graph.changeNodeType = function ( element ){ + + var typeString = d3.select("#typeEditor").node().value; + + if ( graph.classesSanityCheck(element, typeString) === false ) { + // call reselection to restore previous type selection + graph.options().editSidebar().updateSelectionInformation(element); + return; + } + + var prototype = NodePrototypeMap.get(typeString.toLowerCase()); + var aNode = new prototype(graph); + + aNode.x = element.x; + aNode.y = element.y; + aNode.px = element.x; + aNode.py = element.y; + aNode.id(element.id()); + aNode.copyInformation(element); + + if ( typeString === "owl:Thing" ) { + aNode.label("Thing"); + } + else if ( elementTools.isDatatype(element) === false ) { + if ( element.backupLabel() !== undefined ) { + aNode.label(element.backupLabel()); + } else if ( aNode.backupLabel() !== undefined ) { + aNode.label(aNode.backupLabel()); + } else { + aNode.label("NewClass"); + } + } + + if ( typeString === "rdfs:Datatype" ) { + if ( aNode.dType() === "undefined" ) + aNode.label("undefined"); + else { + var identifier = aNode.dType().split(":")[1]; + aNode.label(identifier); + } + } + var i; + // updates the property domain and range + for ( i = 0; i < unfilteredData.properties.length; i++ ) { + if ( unfilteredData.properties[i].domain() === element ) { + // unfilteredData.properties[i].toString(); + unfilteredData.properties[i].domain(aNode); + } + if ( unfilteredData.properties[i].range() === element ) { + unfilteredData.properties[i].range(aNode); + // unfilteredData.properties[i].toString(); + } + } + + // update for fastUpdate: + for ( i = 0; i < properties.length; i++ ) { + if ( properties[i].domain() === element ) { + // unfilteredData.properties[i].toString(); + properties[i].domain(aNode); + } + if ( properties[i].range() === element ) { + properties[i].range(aNode); + // unfilteredData.properties[i].toString(); + } + } + + var remId = unfilteredData.nodes.indexOf(element); + if ( remId !== -1 ) + unfilteredData.nodes.splice(remId, 1); + remId = classNodes.indexOf(element); + if ( remId !== -1 ) + classNodes.splice(remId, 1); + // very important thing for selection!; + addNewNodeElement(aNode); + // handle focuser! + options.focuserModule().handle(aNode); + generateDictionary(unfilteredData); + graph.getUpdateDictionary(); + element = null; + }; + + + graph.changePropertyType = function ( element ){ + var typeString = d3.select("#typeEditor").node().value; + + // create warning + if ( graph.sanityCheckProperty(element.domain(), element.range(), typeString) === false ) return false; + + var propPrototype = PropertyPrototypeMap.get(typeString.toLowerCase()); + var aProp = new propPrototype(graph); + aProp.copyInformation(element); + aProp.id(element.id()); + + element.domain().removePropertyElement(element); + element.range().removePropertyElement(element); + aProp.domain(element.domain()); + aProp.range(element.range()); + + if ( element.backupLabel() !== undefined ) { + aProp.label(element.backupLabel()); + } else { + aProp.label("newObjectProperty"); + } + + if ( aProp.type() === "rdfs:subClassOf" ) { + aProp.iri("http://www.w3.org/2000/01/rdf-schema#subClassOf"); + } else { + if ( element.iri() === "http://www.w3.org/2000/01/rdf-schema#subClassOf" ) + aProp.iri(graph.options().getGeneralMetaObjectProperty('iri') + aProp.id()); + + } + + + if ( graph.propertyCheckExistenceChecker(aProp, element.domain(), element.range()) === false ) { + graph.options().editSidebar().updateSelectionInformation(element); + return; + } + // // TODO: change its base IRI to proper value + // var ontoIRI="http://someTest.de"; + // aProp.baseIri(ontoIRI); + // aProp.iri(aProp.baseIri()+aProp.id()); + + + // add this to the data; + unfilteredData.properties.push(aProp); + if ( properties.indexOf(aProp) === -1 ) + properties.push(aProp); + var remId = unfilteredData.properties.indexOf(element); + if ( remId !== -1 ) + unfilteredData.properties.splice(remId, 1); + if ( properties.indexOf(aProp) === -1 ) + properties.push(aProp); + remId = properties.indexOf(element); + if ( remId !== -1 ) + properties.splice(remId, 1); + graph.fastUpdate(); + aProp.domain().addProperty(aProp); + aProp.range().addProperty(aProp); + if ( element.labelObject() && aProp.labelObject() ) { + aProp.labelObject().x = element.labelObject().x; + aProp.labelObject().px = element.labelObject().px; + aProp.labelObject().y = element.labelObject().y; + aProp.labelObject().py = element.labelObject().py; + } + + options.focuserModule().handle(aProp); + element = null; + }; + + graph.removeEditElements = function (){ + // just added to be called form outside + removeEditElements(); + }; + + function removeEditElements(){ + rangeDragger.hideDragger(true); + domainDragger.hideDragger(true); + shadowClone.hideClone(true); + + classDragger.hideDragger(true); + if ( addDataPropertyGroupElement ) + addDataPropertyGroupElement.classed("hidden", true); + if ( deleteGroupElement ) + deleteGroupElement.classed("hidden", true); + + + if ( hoveredNodeElement ) { + if ( hoveredNodeElement.pinned() === false ) { + hoveredNodeElement.locked(graph.paused()); + hoveredNodeElement.frozen(graph.paused()); + } + } + if ( hoveredPropertyElement ) { + if ( hoveredPropertyElement.pinned() === false ) { + hoveredPropertyElement.locked(graph.paused()); + hoveredPropertyElement.frozen(graph.paused()); + } + } + + + } + + graph.editorMode = function ( val ){ + var create_entry = d3.select("#empty"); + var create_container = d3.select("#emptyContainer"); + + var modeOfOpString = d3.select("#modeOfOperationString").node(); + if ( !arguments.length ) { + create_entry.node().checked = editMode; + if ( editMode === false ) { + create_container.node().title = "Enable editing in modes menu to create a new ontology"; + create_entry.node().title = "Enable editing in modes menu to create a new ontology"; + create_entry.style("pointer-events", "none"); + } else { + create_container.node().title = "Creates a new empty ontology"; + create_entry.node().title = "Creates a new empty ontology"; + d3.select("#useAccuracyHelper").style("color", "#2980b9"); + d3.select("#useAccuracyHelper").style("pointer-events", "auto"); + create_entry.node().disabled = false; + create_entry.style("pointer-events", "auto"); + } + + return editMode; + } + graph.options().setEditorModeForDefaultObject(val); + + // if (seenEditorHint===false && val===true){ + // seenEditorHint=true; + // graph.options().warningModule().showEditorHint(); + // } + editMode = val; + + if ( create_entry ) { + create_entry.classed("disabled", !editMode); + if ( !editMode ) { + create_container.node().title = "Enable editing in modes menu to create a new ontology"; + create_entry.node().title = "Enable editing in modes menu to create a new ontology"; + create_entry.node().disabled = true; + d3.select("#useAccuracyHelper").style("color", "#979797"); + d3.select("#useAccuracyHelper").style("pointer-events", "none"); + create_entry.style("pointer-events", "none"); + } else { + create_container.node().title = "Creates a new empty ontology"; + create_entry.node().title = "Creates a new empty ontology"; + d3.select("#useAccuracyHelper").style("color", "#2980b9"); + d3.select("#useAccuracyHelper").style("pointer-events", "auto"); + create_entry.style("pointer-events", "auto"); + } + } + + // adjust compact notation + // selector = compactNotationOption; + // box =ModuleCheckbox + var compactNotationContainer = d3.select("#compactnotationModuleCheckbox"); + if ( compactNotationContainer ) { + compactNotationContainer.classed("disabled", !editMode); + if ( !editMode ) { + compactNotationContainer.node().title = ""; + compactNotationContainer.node().disabled = false; + compactNotationContainer.style("pointer-events", "auto"); + d3.select("#compactNotationOption").style("color", ""); + d3.select("#compactNotationOption").node().title = ""; + options.literalFilter().enabled(true); + graph.update(); + } else { + // if editor Mode + //1) uncheck the element + d3.select("#compactNotationOption").node().title = "Compact notation can only be used in view mode"; + compactNotationContainer.node().disabled = true; + compactNotationContainer.node().checked = false; + options.compactNotationModule().enabled(false); + options.literalFilter().enabled(false); + graph.executeCompactNotationModule(); + graph.executeEmptyLiteralFilter(); + graph.lazyRefresh(); + compactNotationContainer.style("pointer-events", "none"); + d3.select("#compactNotationOption").style("color", "#979797"); + } + } + + if ( modeOfOpString ) { + if ( touchDevice === true ) { + modeOfOpString.innerHTML = "touch able device detected"; + } else { + modeOfOpString.innerHTML = "point & click device detected"; + } + } + var svgGraph = d3.selectAll(".vowlGraph"); + + if ( editMode === true ) { + options.leftSidebar().showSidebar(options.leftSidebar().getSidebarVisibility(), true); + options.leftSidebar().hideCollapseButton(false); + graph.options().editSidebar().updatePrefixUi(); + graph.options().editSidebar().updateElementWidth(); + svgGraph.on("dblclick.zoom", graph.modified_dblClickFunction); + + } else { + svgGraph.on("dblclick.zoom", originalD3_dblClickFunction); + options.leftSidebar().showSidebar(0); + options.leftSidebar().hideCollapseButton(true); + // hide hovered edit elements + removeEditElements(); + } + options.sidebar().updateShowedInformation(); + options.editSidebar().updateElementWidth(); + + }; + + function createLowerCasePrototypeMap( prototypeMap ){ + return d3.map(prototypeMap.values(), function ( Prototype ){ + return new Prototype().type().toLowerCase(); + }); + } + + function createNewNodeAtPosition( pos ){ + var aNode, prototype; + var forceUpdate = true; + // create a node of that id; + + var typeToCreate = d3.select("#defaultClass").node().title; + prototype = NodePrototypeMap.get(typeToCreate.toLowerCase()); + aNode = new prototype(graph); + var autoEditElement = false; + if ( typeToCreate === "owl:Thing" ) { + aNode.label("Thing"); + } + else { + aNode.label("NewClass"); + autoEditElement = true; + } + aNode.x = pos.x; + aNode.y = pos.y; + aNode.px = aNode.x; + aNode.py = aNode.y; + aNode.id("Class" + eN++); + // aNode.paused(true); + + aNode.baseIri(d3.select("#iriEditor").node().value); + aNode.iri(aNode.baseIri() + aNode.id()); + addNewNodeElement(aNode, forceUpdate); + options.focuserModule().handle(aNode, true); + aNode.frozen(graph.paused()); + aNode.locked(graph.paused()); + aNode.enableEditing(autoEditElement); + } + + + function addNewNodeElement( element ){ + unfilteredData.nodes.push(element); + if ( classNodes.indexOf(element) === -1 ) + classNodes.push(element); + + generateDictionary(unfilteredData); + graph.getUpdateDictionary(); + graph.fastUpdate(); + } + + graph.getTargetNode = function ( position ){ + var dx = position[0]; + var dy = position[1]; + var tN = null; + var minDist = 1000000000000; + // This is a bit OVERKILL for the computation of one node >> TODO: KD-TREE SEARCH + unfilteredData.nodes.forEach(function ( el ){ + var cDist = Math.sqrt((el.x - dx) * (el.x - dx) + (el.y - dy) * (el.y - dy)); + if ( cDist < minDist ) { + minDist = cDist; + tN = el; + } + }); + if ( hoveredNodeElement ) { + var offsetDist = hoveredNodeElement.actualRadius() + 30; + if ( minDist > offsetDist ) return null; + if ( tN.renderType() === "rect" ) return null; + if ( tN === hoveredNodeElement && minDist <= hoveredNodeElement.actualRadius() ) { + return tN; + } else if ( tN === hoveredNodeElement && minDist > hoveredNodeElement.actualRadius() ) { + return null; + } + return tN; + } + else { + + if ( minDist > (tN.actualRadius() + 30) ) + return null; + else return tN; + + } + }; + + graph.genericPropertySanityCheck = function ( domain, range, typeString, header, action ){ + if ( domain === range && typeString === "rdfs:subClassOf" ) { + graph.options().warningModule().showWarning(header, + "rdfs:subClassOf can not be created as loops (domain == range)", + action, 1, false); + return false; + } + if ( domain === range && typeString === "owl:disjointWith" ) { + graph.options().warningModule().showWarning(header, + "owl:disjointWith can not be created as loops (domain == range)", + action, 1, false); + return false; + } + // allProps[i].type()==="owl:allValuesFrom" || + // allProps[i].type()==="owl:someValuesFrom" + if ( domain.type() === "owl:Thing" && typeString === "owl:allValuesFrom" ) { + graph.options().warningModule().showWarning(header, + "owl:allValuesFrom can not originate from owl:Thing", + action, 1, false); + return false; + } + if ( domain.type() === "owl:Thing" && typeString === "owl:someValuesFrom" ) { + graph.options().warningModule().showWarning(header, + "owl:someValuesFrom can not originate from owl:Thing", + action, 1, false); + return false; + } + + if ( range.type() === "owl:Thing" && typeString === "owl:allValuesFrom" ) { + graph.options().warningModule().showWarning(header, + "owl:allValuesFrom can not be connected to owl:Thing", + action, 1, false); + return false; + } + if ( range.type() === "owl:Thing" && typeString === "owl:someValuesFrom" ) { + graph.options().warningModule().showWarning(header, + "owl:someValuesFrom can not be connected to owl:Thing", + action, 1, false); + return false; + } + + return true; // we can Change the domain or range + }; + + graph.checkIfIriClassAlreadyExist = function ( url ){ + // search for a class node with this url + var allNodes = unfilteredData.nodes; + for ( var i = 0; i < allNodes.length; i++ ) { + if ( elementTools.isDatatype(allNodes[i]) === true || allNodes[i].type() === "owl:Thing" ) + continue; + + // now we are a real class; + //get class IRI + var classIRI = allNodes[i].iri(); + + // this gives me the node for halo + if ( url === classIRI ) { + return allNodes[i]; + } + } + return false; + }; + + graph.classesSanityCheck = function ( classElement, targetType ){ + // this is added due to someValuesFrom properties + // we should not be able to change a classElement to a owl:Thing + // when it has a property attached to it that uses these restrictions + // + + if ( targetType === "owl:Class" ) return true; + + else { + // collect all properties which have that one as a domain or range + var allProps = unfilteredData.properties; + for ( var i = 0; i < allProps.length; i++ ) { + if ( allProps[i].range() === classElement || allProps[i].domain() === classElement ) { + // check for the type of that property + if ( allProps[i].type() === "owl:someValuesFrom" ) { + graph.options().warningModule().showWarning("Can not change class type", + "The element has a property that is of type owl:someValuesFrom", + "Element type not changed!", 1, true); + return false; + } + if ( allProps[i].type() === "owl:allValuesFrom" ) { + graph.options().warningModule().showWarning("Can not change class type", + "The element has a property that is of type owl:allValuesFrom", + "Element type not changed!", 1, true); + return false; + } + } + } + + + } + return true; + }; + + graph.propertyCheckExistenceChecker = function ( property, domain, range ){ + var allProps = unfilteredData.properties; + var i; + if ( property.type() === "rdfs:subClassOf" || property.type() === "owl:disjointWith" ) { + + for ( i = 0; i < allProps.length; i++ ) { + if ( allProps[i] === property ) continue; + if ( allProps[i].domain() === domain && allProps[i].range() === range && allProps[i].type() === property.type() ) { + graph.options().warningModule().showWarning("Warning", + "This triple already exist!", + "Element not created!", 1, false); + return false; + } + if ( allProps[i].domain() === range && allProps[i].range() === domain && allProps[i].type() === property.type() ) { + graph.options().warningModule().showWarning("Warning", + "Inverse assignment already exist! ", + "Element not created!", 1, false); + return false; + } + } + return true; + } + return true; + }; + + // graph.checkForTripleDuplicate=function(property){ + // var domain=property.domain(); + // var range=property.range(); + // console.log("checking for duplicates"); + // var b1= domain.isPropertyAssignedToThisElement(property); + // var b2= range.isPropertyAssignedToThisElement(property); + // + // console.log("test domain results in "+ b1); + // console.log("test range results in "+ b1); + // + // if (b1 && b2 ){ + // graph.options().warningModule().showWarning("Warning", + // "This triple already exist!", + // "Element not created!",1,false); + // return false; + // } + // return true; + // }; + + graph.sanityCheckProperty = function ( domain, range, typeString ){ + + // check for duplicate triple in the element; + + + if ( typeString === "owl:objectProperty" && graph.options().objectPropertyFilter().enabled() === true ) { + graph.options().warningModule().showWarning("Warning", + "Object properties are filtered out in the visualization!", + "Element not created!", 1, false); + return false; + } + + if ( typeString === "owl:disjointWith" && graph.options().disjointPropertyFilter().enabled() === true ) { + graph.options().warningModule().showWarning("Warning", + "owl:disjointWith properties are filtered out in the visualization!", + "Element not created!", 1, false); + return false; + } + + + if ( domain === range && typeString === "rdfs:subClassOf" ) { + graph.options().warningModule().showWarning("Warning", + "rdfs:subClassOf can not be created as loops (domain == range)", + "Element not created!", 1, false); + return false; + } + if ( domain === range && typeString === "owl:disjointWith" ) { + graph.options().warningModule().showWarning("Warning", + "owl:disjointWith can not be created as loops (domain == range)", + "Element not created!", 1, false); + return false; + } + + if ( domain.type() === "owl:Thing" && typeString === "owl:someValuesFrom" ) { + graph.options().warningModule().showWarning("Warning", + "owl:someValuesFrom can not originate from owl:Thing", + "Element not created!", 1, false); + return false; + } + if ( domain.type() === "owl:Thing" && typeString === "owl:allValuesFrom" ) { + graph.options().warningModule().showWarning("Warning", + "owl:allValuesFrom can not originate from owl:Thing", + "Element not created!", 1, false); + return false; + } + + if ( range.type() === "owl:Thing" && typeString === "owl:allValuesFrom" ) { + graph.options().warningModule().showWarning("Warning", + "owl:allValuesFrom can not be connected to owl:Thing", + "Element not created!", 1, false); + return false; + } + if ( range.type() === "owl:Thing" && typeString === "owl:someValuesFrom" ) { + graph.options().warningModule().showWarning("Warning", + "owl:someValuesFrom can not be connected to owl:Thing", + "Element not created!", 1, false); + return false; + } + return true; // we can create a property + }; + + function createNewObjectProperty( domain, range, draggerEndposition ){ + // check type of the property that we want to create; + + var defaultPropertyName = d3.select("#defaultProperty").node().title; + + // check if we are allow to create that property + if ( graph.sanityCheckProperty(domain, range, defaultPropertyName) === false ) return false; + + + var propPrototype = PropertyPrototypeMap.get(defaultPropertyName.toLowerCase()); + var aProp = new propPrototype(graph); + aProp.id("objectProperty" + eP++); + aProp.domain(domain); + aProp.range(range); + aProp.label("newObjectProperty"); + aProp.baseIri(d3.select("#iriEditor").node().value); + aProp.iri(aProp.baseIri() + aProp.id()); + + // check for duplicate; + if ( graph.propertyCheckExistenceChecker(aProp, domain, range) === false ) { + // delete aProp; + // hope for garbage collection here -.- + return false; + } + + var autoEditElement = false; + + if ( defaultPropertyName === "owl:objectProperty" ) { + autoEditElement = true; + } + var pX = 0.49 * (domain.x + range.x); + var pY = 0.49 * (domain.y + range.y); + + if ( domain === range ) { + // we use the dragger endposition to determine an angle to put the loop there; + var dirD_x = draggerEndposition[0] - domain.x; + var dirD_y = draggerEndposition[1] - domain.y; + + // normalize; + var len = Math.sqrt(dirD_x * dirD_x + dirD_y * dirD_y); + // it should be very hard to set the position on the same sport but why not handling this + var nx = dirD_x / len; + var ny = dirD_y / len; + // is Nan in javascript like in c len==len returns false when it is not a number? + if ( isNaN(len) ) { + nx = 0; + ny = -1; + } + + // get domain actual raidus + var offset = 2 * domain.actualRadius() + 50; + pX = domain.x + offset * nx; + pY = domain.y + offset * ny; + } + + // add this property to domain and range; + domain.addProperty(aProp); + range.addProperty(aProp); + + + // add this to the data; + unfilteredData.properties.push(aProp); + if ( properties.indexOf(aProp) === -1 ) + properties.push(aProp); + graph.fastUpdate(); + aProp.labelObject().x = pX; + aProp.labelObject().px = pX; + aProp.labelObject().y = pY; + aProp.labelObject().py = pY; + + aProp.frozen(graph.paused()); + aProp.locked(graph.paused()); + domain.frozen(graph.paused()); + domain.locked(graph.paused()); + range.frozen(graph.paused()); + range.locked(graph.paused()); + + + generateDictionary(unfilteredData); + graph.getUpdateDictionary(); + + options.focuserModule().handle(aProp); + graph.activateHoverElementsForProperties(true, aProp, false, touchDevice); + aProp.labelObject().increasedLoopAngle = true; + aProp.enableEditing(autoEditElement); + } + + graph.createDataTypeProperty = function ( node ){ + // random postion issues; + clearTimeout(nodeFreezer); + // tells user when element is filtered out + if ( graph.options().datatypeFilter().enabled() === true ) { + graph.options().warningModule().showWarning("Warning", + "Datatype properties are filtered out in the visualization!", + "Element not created!", 1, false); + return; + } + + + var aNode, prototype; + + // create a default datatype Node >> HERE LITERAL; + var defaultDatatypeName = d3.select("#defaultDatatype").node().title; + if ( defaultDatatypeName === "rdfs:Literal" ) { + prototype = NodePrototypeMap.get("rdfs:literal"); + aNode = new prototype(graph); + aNode.label("Literal"); + aNode.iri("http://www.w3.org/2000/01/rdf-schema#Literal"); + aNode.baseIri("http://www.w3.org/2000/01/rdf-schema#"); + } else { + prototype = NodePrototypeMap.get("rdfs:datatype"); + aNode = new prototype(graph); + var identifier = ""; + if ( defaultDatatypeName === "undefined" ) { + identifier = "undefined"; + + aNode.label(identifier); + // TODO : HANDLER FOR UNDEFINED DATATYPES!!<<<>>>>>>>>>>>.. + aNode.iri("http://www.undefinedDatatype.org/#" + identifier); + aNode.baseIri("http://www.undefinedDatatype.org/#"); + aNode.dType(defaultDatatypeName); + } else { + identifier = defaultDatatypeName.split(":")[1]; + aNode.label(identifier); + aNode.dType(defaultDatatypeName); + aNode.iri("http://www.w3.org/2001/XMLSchema#" + identifier); + aNode.baseIri("http://www.w3.org/2001/XMLSchema#"); + } + } + + + var nX = node.x - node.actualRadius() - 100; + var nY = node.y + node.actualRadius() + 100; + + aNode.x = nX; + aNode.y = nY; + aNode.px = aNode.x; + aNode.py = aNode.y; + aNode.id("NodeId" + eN++); + // add this property to the nodes; + unfilteredData.nodes.push(aNode); + if ( classNodes.indexOf(aNode) === -1 ) + classNodes.push(aNode); + + + // add also the datatype Property to it + var propPrototype = PropertyPrototypeMap.get("owl:datatypeproperty"); + var aProp = new propPrototype(graph); + aProp.id("datatypeProperty" + eP++); + + // create the connection + aProp.domain(node); + aProp.range(aNode); + aProp.label("newDatatypeProperty"); + + + // TODO: change its base IRI to proper value + var ontoIri = d3.select("#iriEditor").node().value; + aProp.baseIri(ontoIri); + aProp.iri(ontoIri + aProp.id()); + // add this to the data; + unfilteredData.properties.push(aProp); + if ( properties.indexOf(aProp) === -1 ) + properties.push(aProp); + graph.fastUpdate(); + generateDictionary(unfilteredData); + graph.getUpdateDictionary(); + + nodeFreezer = setTimeout(function (){ + if ( node && node.frozen() === true && node.pinned() === false && graph.paused() === false ) { + node.frozen(graph.paused()); + node.locked(graph.paused()); + } + }, 1000); + options.focuserModule().handle(undefined); + if ( node ) { + node.frozen(true); + node.locked(true); + } + }; + + graph.removeNodesViaResponse = function ( nodesToRemove, propsToRemove ){ + var i, remId; + // splice them; + for ( i = 0; i < propsToRemove.length; i++ ) { + remId = unfilteredData.properties.indexOf(propsToRemove[i]); + if ( remId !== -1 ) + unfilteredData.properties.splice(remId, 1); + remId = properties.indexOf(propsToRemove[i]); + if ( remId !== -1 ) + properties.splice(remId, 1); + propsToRemove[i] = null; + } + for ( i = 0; i < nodesToRemove.length; i++ ) { + remId = unfilteredData.nodes.indexOf(nodesToRemove[i]); + if ( remId !== -1 ) { + unfilteredData.nodes.splice(remId, 1); + } + remId = classNodes.indexOf(nodesToRemove[i]); + if ( remId !== -1 ) + classNodes.splice(remId, 1); + nodesToRemove[i] = null; + } + graph.fastUpdate(); + generateDictionary(unfilteredData); + graph.getUpdateDictionary(); + options.focuserModule().handle(undefined); + nodesToRemove = null; + propsToRemove = null; + + }; + + graph.removeNodeViaEditor = function ( node ){ + var propsToRemove = []; + var nodesToRemove = []; + var datatypes = 0; + + var remId; + + nodesToRemove.push(node); + for ( var i = 0; i < unfilteredData.properties.length; i++ ) { + if ( unfilteredData.properties[i].domain() === node || unfilteredData.properties[i].range() === node ) { + propsToRemove.push(unfilteredData.properties[i]); + if ( unfilteredData.properties[i].type().toLocaleLowerCase() === "owl:datatypeproperty" && + unfilteredData.properties[i].range() !== node ) { + nodesToRemove.push(unfilteredData.properties[i].range()); + datatypes++; + } + } + } + var removedItems = propsToRemove.length + nodesToRemove.length; + if ( removedItems > 2 ) { + var text = "You are about to delete 1 class and " + propsToRemove.length + " properties"; + if ( datatypes !== 0 ) { + text = "You are about to delete 1 class, " + datatypes + " datatypes and " + propsToRemove.length + " properties"; + } + + + graph.options().warningModule().responseWarning( + "Removing elements", + text, + "Awaiting response!", graph.removeNodesViaResponse, [nodesToRemove, propsToRemove], false); + + + // + // if (confirm("Remove :\n"+propsToRemove.length + " properties\n"+nodesToRemove.length+" classes? ")===false){ + // return; + // }else{ + // // todo : store for undo delete button ; + // } + } else { + // splice them; + for ( i = 0; i < propsToRemove.length; i++ ) { + remId = unfilteredData.properties.indexOf(propsToRemove[i]); + if ( remId !== -1 ) + unfilteredData.properties.splice(remId, 1); + remId = properties.indexOf(propsToRemove[i]); + if ( remId !== -1 ) + properties.splice(remId, 1); + propsToRemove[i] = null; + } + for ( i = 0; i < nodesToRemove.length; i++ ) { + remId = unfilteredData.nodes.indexOf(nodesToRemove[i]); + if ( remId !== -1 ) + unfilteredData.nodes.splice(remId, 1); + remId = classNodes.indexOf(nodesToRemove[i]); + if ( remId !== -1 ) + classNodes.splice(remId, 1); + nodesToRemove[i] = null; + } + graph.fastUpdate(); + generateDictionary(unfilteredData); + graph.getUpdateDictionary(); + options.focuserModule().handle(undefined); + nodesToRemove = null; + propsToRemove = null; + } + }; + + graph.removePropertyViaEditor = function ( property ){ + property.domain().removePropertyElement(property); + property.range().removePropertyElement(property); + var remId; + + if ( property.type().toLocaleLowerCase() === "owl:datatypeproperty" ) { + var datatype = property.range(); + remId = unfilteredData.nodes.indexOf(property.range()); + if ( remId !== -1 ) + unfilteredData.nodes.splice(remId, 1); + remId = classNodes.indexOf(property.range()); + if ( remId !== -1 ) + classNodes.splice(remId, 1); + datatype = null; + } + remId = unfilteredData.properties.indexOf(property); + if ( remId !== -1 ) + unfilteredData.properties.splice(remId, 1); + remId = properties.indexOf(property); + if ( remId !== -1 ) + properties.splice(remId, 1); + if ( property.inverse() ) { + // so we have inverse + property.inverse().inverse(0); + + } + + + hoveredPropertyElement = undefined; + graph.fastUpdate(); + generateDictionary(unfilteredData); + graph.getUpdateDictionary(); + options.focuserModule().handle(undefined); + property = null; + }; + + graph.executeColorExternalsModule = function (){ + options.colorExternalsModule().filter(unfilteredData.nodes, unfilteredData.properties); + }; + + graph.executeCompactNotationModule = function (){ + if ( unfilteredData ) { + options.compactNotationModule().filter(unfilteredData.nodes, unfilteredData.properties); + } + + }; + graph.executeEmptyLiteralFilter = function (){ + + if ( unfilteredData && unfilteredData.nodes.length > 1 ) { + options.literalFilter().filter(unfilteredData.nodes, unfilteredData.properties); + unfilteredData.nodes = options.literalFilter().filteredNodes(); + unfilteredData.properties = options.literalFilter().filteredProperties(); + } + + }; + + + /** --------------------------------------------------------- **/ + /** -- animation functions for the nodes -- **/ + /** --------------------------------------------------------- **/ + + graph.animateDynamicLabelWidth = function (){ + var wantedWidth = options.dynamicLabelWidth(); + var i; + for ( i = 0; i < classNodes.length; i++ ) { + var nodeElement = classNodes[i]; + if ( elementTools.isDatatype(nodeElement) ) { + nodeElement.animateDynamicLabelWidth(wantedWidth); + } + } + for ( i = 0; i < properties.length; i++ ) { + properties[i].animateDynamicLabelWidth(wantedWidth); + } + }; + + + /** --------------------------------------------------------- **/ + /** -- Touch behaviour functions -- **/ + /** --------------------------------------------------------- **/ + + graph.setTouchDevice = function ( val ){ + touchDevice = val; + }; + + graph.isTouchDevice = function (){ + return touchDevice; + }; + + graph.modified_dblClickFunction = function (){ + + d3.event.stopPropagation(); + d3.event.preventDefault(); + // get position where we want to add the node; + var grPos = getClickedScreenCoords(d3.event.clientX, d3.event.clientY, graph.translation(), graph.scaleFactor()); + createNewNodeAtPosition(grPos); + }; + + function doubletap(){ + var touch_time = d3.event.timeStamp; + var numTouchers = 1; + if ( d3.event && d3.event.touches && d3.event.touches.length ) + numTouchers = d3.event.touches.length; + + if ( touch_time - last_touch_time < 300 && numTouchers === 1 ) { + d3.event.stopPropagation(); + if ( editMode === true ) { + //graph.modified_dblClickFunction(); + d3.event.preventDefault(); + d3.event.stopPropagation(); + last_touch_time = touch_time; + return true; + } + } + last_touch_time = touch_time; + return false; + } + + + function touchzoomed(){ + forceNotZooming = true; + + + var touch_time = d3.event.timeStamp; + if ( touch_time - last_touch_time < 300 && d3.event.touches.length === 1 ) { + d3.event.stopPropagation(); + + if ( editMode === true ) { + //graph.modified_dblClickFunction(); + d3.event.preventDefault(); + d3.event.stopPropagation(); + zoom.translate(graphTranslation); + zoom.scale(zoomFactor); + graph.modified_dblTouchFunction(); + } + else { + forceNotZooming = false; + if ( originalD3_touchZoomFunction ) + originalD3_touchZoomFunction(); + } + return; + } + forceNotZooming = false; + last_touch_time = touch_time; + // TODO: WORK AROUND TO CHECK FOR ORIGINAL FUNCTION + if ( originalD3_touchZoomFunction ) + originalD3_touchZoomFunction(); + } + + graph.modified_dblTouchFunction = function ( d ){ + d3.event.stopPropagation(); + d3.event.preventDefault(); + var xy; + if ( editMode === true ) { + xy = d3.touches(d3.selectAll(".vowlGraph").node()); + } + var grPos = getClickedScreenCoords(xy[0][0], xy[0][1], graph.translation(), graph.scaleFactor()); + createNewNodeAtPosition(grPos); + }; + + /** --------------------------------------------------------- **/ + /** -- Hover and Selection functions, adding edit elements -- **/ + /** --------------------------------------------------------- **/ + + graph.ignoreOtherHoverEvents = function ( val ){ + if ( !arguments.length ) { + return ignoreOtherHoverEvents; + } + else ignoreOtherHoverEvents = val; + }; + + function delayedHiddingHoverElements( tbh ){ + if ( tbh === true ) return; + if ( hoveredNodeElement ) { + if ( hoveredNodeElement.editingTextElement === true ) return; + delayedHider = setTimeout(function (){ + deleteGroupElement.classed("hidden", true); + addDataPropertyGroupElement.classed("hidden", true); + classDragger.hideDragger(true); + if ( hoveredNodeElement && hoveredNodeElement.pinned() === false && graph.paused() === false && hoveredNodeElement.editingTextElement === false ) { + hoveredNodeElement.frozen(false); + hoveredNodeElement.locked(false); + } + }, 1000); + } + if ( hoveredPropertyElement ) { + if ( hoveredPropertyElement.editingTextElement === true ) return; + delayedHider = setTimeout(function (){ + deleteGroupElement.classed("hidden", true); + addDataPropertyGroupElement.classed("hidden", true); + classDragger.hideDragger(true); + rangeDragger.hideDragger(true); + domainDragger.hideDragger(true); + shadowClone.hideClone(true); + if ( hoveredPropertyElement && hoveredPropertyElement.focused() === true && graph.options().drawPropertyDraggerOnHover() === true ) { + hoveredPropertyElement.labelObject().increasedLoopAngle = false; + // lazy update + recalculatePositions(); + } + + if ( hoveredPropertyElement && hoveredPropertyElement.pinned() === false && graph.paused() === false && hoveredPropertyElement.editingTextElement === false ) { + hoveredPropertyElement.frozen(false); + hoveredPropertyElement.locked(false); + } + }, 1000); + } + + } + + + // TODO : experimental code for updating dynamic label with and its hover element + graph.hideHoverPropertyElementsForAnimation = function (){ + deleteGroupElement.classed("hidden", true); + }; + graph.showHoverElementsAfterAnimation = function ( property, inversed ){ + setDeleteHoverElementPositionProperty(property, inversed); + deleteGroupElement.classed("hidden", false); + + }; + + function editElementHoverOnHidden(){ + classDragger.nodeElement.classed("classDraggerNodeHovered", true); + classDragger.nodeElement.classed("classDraggerNode", false); + editElementHoverOn(); + } + + function editElementHoverOutHidden(){ + classDragger.nodeElement.classed("classDraggerNodeHovered", false); + classDragger.nodeElement.classed("classDraggerNode", true); + editElementHoverOut(); + } + + function editElementHoverOn( touch ){ + if ( touch === true ) return; + clearTimeout(delayedHider); // ignore touch behaviour + + } + + graph.killDelayedTimer = function (){ + clearTimeout(delayedHider); + clearTimeout(nodeFreezer); + }; + + + function editElementHoverOut( tbh ){ + if ( hoveredNodeElement ) { + if ( graph.ignoreOtherHoverEvents() === true || tbh === true || hoveredNodeElement.editingTextElement === true ) return; + delayedHider = setTimeout(function (){ + if ( graph.isADraggerActive() === true ) return; + deleteGroupElement.classed("hidden", true); + addDataPropertyGroupElement.classed("hidden", true); + classDragger.hideDragger(true); + if ( hoveredNodeElement && hoveredNodeElement.pinned() === false && graph.paused() === false ) { + hoveredNodeElement.frozen(false); + hoveredNodeElement.locked(false); + } + + }, 1000); + } + if ( hoveredPropertyElement ) { + if ( graph.ignoreOtherHoverEvents() === true || tbh === true || hoveredPropertyElement.editingTextElement === true ) return; + delayedHider = setTimeout(function (){ + if ( graph.isADraggerActive() === true ) return; + deleteGroupElement.classed("hidden", true); + addDataPropertyGroupElement.classed("hidden", true); + classDragger.hideDragger(true); + if ( hoveredPropertyElement && hoveredPropertyElement.pinned() === false && graph.paused() === false ) { + hoveredPropertyElement.frozen(false); + hoveredPropertyElement.locked(false); + } + + }, 1000); + } + } + + graph.activateHoverElementsForProperties = function ( val, property, inversed, touchBehaviour ){ + if ( editMode === false ) return; // nothing to do; + + if ( touchBehaviour === undefined ) + touchBehaviour = false; + + if ( val === true ) { + clearTimeout(delayedHider); + if ( hoveredPropertyElement ) { + if ( hoveredPropertyElement.domain() === hoveredPropertyElement.range() ) { + hoveredPropertyElement.labelObject().increasedLoopAngle = false; + recalculatePositions(); + } + } + + hoveredPropertyElement = property; + if ( graph.options().drawPropertyDraggerOnHover() === true ) { + + + if ( property.type() !== "owl:DatatypeProperty" ) { + if ( property.domain() === property.range() ) { + property.labelObject().increasedLoopAngle = true; + recalculatePositions(); + } + shadowClone.setParentProperty(property, inversed); + rangeDragger.setParentProperty(property, inversed); + rangeDragger.hideDragger(false); + rangeDragger.addMouseEvents(); + domainDragger.setParentProperty(property, inversed); + domainDragger.hideDragger(false); + domainDragger.addMouseEvents(); + + + } else if ( property.type() === "owl:DatatypeProperty" ) { + shadowClone.setParentProperty(property, inversed); + rangeDragger.setParentProperty(property, inversed); + rangeDragger.hideDragger(true); + rangeDragger.addMouseEvents(); + domainDragger.setParentProperty(property, inversed); + domainDragger.hideDragger(false); + domainDragger.addMouseEvents(); + } + } + else { // hide when we dont want that option + if ( graph.options().drawPropertyDraggerOnHover() === true ) { + rangeDragger.hideDragger(true); + domainDragger.hideDragger(true); + shadowClone.hideClone(true); + if ( property.domain() === property.range() ) { + property.labelObject().increasedLoopAngle = false; + recalculatePositions(); + } + } + } + + if ( hoveredNodeElement ) { + if ( hoveredNodeElement && hoveredNodeElement.pinned() === false && graph.paused() === false ) { + hoveredNodeElement.frozen(false); + hoveredNodeElement.locked(false); + } + } + hoveredNodeElement = undefined; + deleteGroupElement.classed("hidden", false); + setDeleteHoverElementPositionProperty(property, inversed); + deleteGroupElement.selectAll("*").on("click", function (){ + if ( touchBehaviour && property.focused() === false ) { + graph.options().focuserModule().handle(property); + return; + } + graph.removePropertyViaEditor(property); + d3.event.stopPropagation(); + }); + classDragger.hideDragger(true); + addDataPropertyGroupElement.classed("hidden", true); + } else { + delayedHiddingHoverElements(); + } + }; + + graph.updateDraggerElements = function (){ + + // set opacity style for all elements + + rangeDragger.draggerObject.classed("superOpacityElement", !graph.options().showDraggerObject()); + domainDragger.draggerObject.classed("superOpacityElement", !graph.options().showDraggerObject()); + classDragger.draggerObject.classed("superOpacityElement", !graph.options().showDraggerObject()); + + nodeContainer.selectAll(".superHiddenElement").classed("superOpacityElement", !graph.options().showDraggerObject()); + labelContainer.selectAll(".superHiddenElement").classed("superOpacityElement", !graph.options().showDraggerObject()); + + deleteGroupElement.selectAll(".superHiddenElement").classed("superOpacityElement", !graph.options().showDraggerObject()); + addDataPropertyGroupElement.selectAll(".superHiddenElement").classed("superOpacityElement", !graph.options().showDraggerObject()); + + + }; + + function setAddDataPropertyHoverElementPosition( node ){ + var delX, delY = 0; + if ( node.renderType() === "round" ) { + var scale = 0.5 * Math.sqrt(2.0); + var oX = scale * node.actualRadius(); + var oY = scale * node.actualRadius(); + delX = node.x - oX; + delY = node.y + oY; + addDataPropertyGroupElement.attr("transform", "translate(" + delX + "," + delY + ")"); + } + } + + function setDeleteHoverElementPosition( node ){ + var delX, delY = 0; + if ( node.renderType() === "round" ) { + var scale = 0.5 * Math.sqrt(2.0); + var oX = scale * node.actualRadius(); + var oY = scale * node.actualRadius(); + delX = node.x + oX; + delY = node.y - oY; + } else { + delX = node.x + 0.5 * node.width() + 6; + delY = node.y - 0.5 * node.height() - 6; + } + deleteGroupElement.attr("transform", "translate(" + delX + "," + delY + ")"); + } + + function setDeleteHoverElementPositionProperty( property, inversed ){ + if ( property && property.labelElement() ) { + var pos = [property.labelObject().x, property.labelObject().y]; + var widthElement = parseFloat(property.getShapeElement().attr("width")); + var heightElement = parseFloat(property.getShapeElement().attr("height")); + var delX = pos[0] + 0.5 * widthElement + 6; + var delY = pos[1] - 0.5 * heightElement - 6; + // this is the lower element + if ( property.labelElement().attr("transform") === "translate(0,15)" ) + delY += 15; + // this is upper element + if ( property.labelElement().attr("transform") === "translate(0,-15)" ) + delY -= 15; + deleteGroupElement.attr("transform", "translate(" + delX + "," + delY + ")"); + } else { + deleteGroupElement.classed("hidden", true);// hide when there is no property + } + + + } + + graph.activateHoverElements = function ( val, node, touchBehaviour ){ + if ( editMode === false ) { + return; // nothing to do; + } + if ( touchBehaviour === undefined ) touchBehaviour = false; + if ( val === true ) { + if ( graph.options().drawPropertyDraggerOnHover() === true ) { + rangeDragger.hideDragger(true); + domainDragger.hideDragger(true); + shadowClone.hideClone(true); + } + // make them visible + clearTimeout(delayedHider); + clearTimeout(nodeFreezer); + if ( hoveredNodeElement && node.pinned() === false && graph.paused() === false ) { + hoveredNodeElement.frozen(false); + hoveredNodeElement.locked(false); + } + hoveredNodeElement = node; + if ( node && node.frozen() === false && node.pinned() === false ) { + node.frozen(true); + node.locked(false); + } + if ( hoveredPropertyElement && hoveredPropertyElement.focused() === false ) { + hoveredPropertyElement.labelObject().increasedLoopAngle = false; + recalculatePositions(); + // update the loopAngles; + + } + hoveredPropertyElement = undefined; + deleteGroupElement.classed("hidden", false); + setDeleteHoverElementPosition(node); + + + deleteGroupElement.selectAll("*").on("click", function (){ + if ( touchBehaviour && node.focused() === false ) { + graph.options().focuserModule().handle(node); + return; + } + graph.removeNodeViaEditor(node); + d3.event.stopPropagation(); + }) + .on("mouseover", function (){ + editElementHoverOn(node, touchBehaviour); + }) + .on("mouseout", function (){ + editElementHoverOut(node, touchBehaviour); + }); + + addDataPropertyGroupElement.classed("hidden", true); + classDragger.nodeElement.on("mouseover", editElementHoverOn) + .on("mouseout", editElementHoverOut); + classDragger.draggerObject.on("mouseover", editElementHoverOnHidden) + .on("mouseout", editElementHoverOutHidden); + + // add the dragger element; + if ( node.renderType() === "round" ) { + classDragger.svgRoot(draggerLayer); + classDragger.setParentNode(node); + classDragger.hideDragger(false); + addDataPropertyGroupElement.classed("hidden", false); + setAddDataPropertyHoverElementPosition(node); + addDataPropertyGroupElement.selectAll("*").on("click", function (){ + if ( touchBehaviour && node.focused() === false ) { + graph.options().focuserModule().handle(node); + return; + } + graph.createDataTypeProperty(node); + d3.event.stopPropagation(); + }) + .on("mouseover", function (){ + editElementHoverOn(node, touchBehaviour); + }) + .on("mouseout", function (){ + editElementHoverOut(node, touchBehaviour); + }); + } else { + classDragger.hideDragger(true); + + } + + } else { + delayedHiddingHoverElements(node, touchBehaviour); + + } + }; + + + return graph; + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), +/* 58 */ +/***/ (function(module, exports, __webpack_require__) { + + var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(global, module) {/** + * @license + * Lodash (Custom Build) <https://lodash.com/> + * Build: `lodash core -o ./dist/lodash.core.js` + * Copyright OpenJS Foundation and other contributors <https://openjsf.org/> + * Released under MIT license <https://lodash.com/license> + * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + ;(function() { + + /** Used as a safe reference for `undefined` in pre-ES5 environments. */ + var undefined; + + /** Used as the semantic version number. */ + var VERSION = '4.17.15'; + + /** Error message constants. */ + var FUNC_ERROR_TEXT = 'Expected a function'; + + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + + /** Used to compose bitmasks for function metadata. */ + var WRAP_BIND_FLAG = 1, + WRAP_PARTIAL_FLAG = 32; + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + numberTag = '[object Number]', + objectTag = '[object Object]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + stringTag = '[object String]'; + + /** Used to match HTML entities and HTML characters. */ + var reUnescapedHtml = /[&<>"']/g, + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; + + /** Used to map characters to HTML entities. */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); + + /** Detect free variable `exports`. */ + var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + + /*--------------------------------------------------------------------------*/ + + /** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ + function arrayPush(array, values) { + array.push.apply(array, values); + return array; + } + + /** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.reduce` and `_.reduceRight`, without support + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} accumulator The initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ + function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initAccum + ? (initAccum = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ + function baseValues(object, props) { + return baseMap(props, function(key) { + return object[key]; + }); + } + + /** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + var escapeHtmlChar = basePropertyOf(htmlEscapes); + + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + + /*--------------------------------------------------------------------------*/ + + /** Used for built-in method references. */ + var arrayProto = Array.prototype, + objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Used to generate unique IDs. */ + var idCounter = 0; + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString = objectProto.toString; + + /** Used to restore the original `_` reference in `_.noConflict`. */ + var oldDash = root._; + + /** Built-in value references. */ + var objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeIsFinite = root.isFinite, + nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object which wraps `value` to enable implicit method + * chain sequences. Methods that operate on and return arrays, collections, + * and functions can be chained together. Methods that retrieve a single value + * or may return a primitive value will automatically end the chain sequence + * and return the unwrapped value. Otherwise, the value must be unwrapped + * with `_#value`. + * + * Explicit chain sequences, which must be unwrapped with `_#value`, may be + * enabled using `_.chain`. + * + * The execution of chained methods is lazy, that is, it's deferred until + * `_#value` is implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. + * Shortcut fusion is an optimization to merge iteratee calls; this avoids + * the creation of intermediate arrays and can greatly reduce the number of + * iteratee executions. Sections of a chain sequence qualify for shortcut + * fusion if the section is applied to an array and iteratees accept only + * one argument. The heuristic for whether a section qualifies for shortcut + * fusion is subject to change. + * + * Chaining is supported in custom builds as long as the `_#value` method is + * directly or indirectly included in the build. + * + * In addition to lodash methods, wrappers have `Array` and `String` methods. + * + * The wrapper `Array` methods are: + * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` + * + * The wrapper `String` methods are: + * `replace` and `split` + * + * The wrapper methods that support shortcut fusion are: + * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, + * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` + * + * The chainable wrapper methods are: + * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, + * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, + * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, + * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, + * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, + * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, + * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, + * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, + * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, + * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, + * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, + * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, + * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, + * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, + * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, + * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, + * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, + * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, + * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, + * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, + * `zipObject`, `zipObjectDeep`, and `zipWith` + * + * The wrapper methods that are **not** chainable by default are: + * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, + * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, + * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, + * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, + * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, + * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, + * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, + * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, + * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, + * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, + * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, + * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, + * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, + * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, + * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, + * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, + * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, + * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, + * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, + * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, + * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, + * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, + * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, + * `upperFirst`, `value`, and `words` + * + * @name _ + * @constructor + * @category Seq + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2, 3]); + * + * // Returns an unwrapped value. + * wrapped.reduce(_.add); + * // => 6 + * + * // Returns a wrapped value. + * var squares = wrapped.map(square); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash(value) { + return value instanceof LodashWrapper + ? value + : new LodashWrapper(value); + } + + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ + var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; + }()); + + /** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable explicit method chain sequences. + */ + function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + } + + LodashWrapper.prototype = baseCreate(lodash.prototype); + LodashWrapper.prototype.constructor = LodashWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function baseAssignValue(object, key, value) { + object[key] = value; + } + + /** + * The base implementation of `_.delay` and `_.defer` which accepts `args` + * to provide to `func`. + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Array} args The arguments to provide to `func`. + * @returns {number|Object} Returns the timer id or timeout object. + */ + function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEach = createBaseEach(baseForOwn); + + /** + * The base implementation of `_.every` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ + function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; + } + + /** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ + function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? (current === current && !false) + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; + } + + /** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; + } + + /** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ + function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; + } + + /** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseFor = createBaseFor(); + + /** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); + } + + /** + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from `props`. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the function names. + */ + function baseFunctions(object, props) { + return baseFilter(props, function(key) { + return isFunction(object[key]); + }); + } + + /** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function baseGetTag(value) { + return objectToString(value); + } + + /** + * The base implementation of `_.gt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + */ + function baseGt(value, other) { + return value > other; + } + + /** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ + var baseIsArguments = noop; + + /** + * The base implementation of `_.isDate` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + */ + function baseIsDate(value) { + return isObjectLike(value) && baseGetTag(value) == dateTag; + } + + /** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); + } + + /** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : baseGetTag(object), + othTag = othIsArr ? arrayTag : baseGetTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + stack || (stack = []); + var objStack = find(stack, function(entry) { + return entry[0] == object; + }); + var othStack = find(stack, function(entry) { + return entry[0] == other; + }); + if (objStack && othStack) { + return objStack[1] == other; + } + stack.push([object, other]); + stack.push([other, object]); + if (isSameTag && !objIsObj) { + var result = (objIsArr) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + stack.pop(); + return result; + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + var result = equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + stack.pop(); + return result; + } + } + if (!isSameTag) { + return false; + } + var result = equalObjects(object, other, bitmask, customizer, equalFunc, stack); + stack.pop(); + return result; + } + + /** + * The base implementation of `_.isRegExp` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + */ + function baseIsRegExp(value) { + return isObjectLike(value) && baseGetTag(value) == regexpTag; + } + + /** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ + function baseIteratee(func) { + if (typeof func == 'function') { + return func; + } + if (func == null) { + return identity; + } + return (typeof func == 'object' ? baseMatches : baseProperty)(func); + } + + /** + * The base implementation of `_.lt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + */ + function baseLt(value, other) { + return value < other; + } + + /** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; + } + + /** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatches(source) { + var props = nativeKeys(source); + return function(object) { + var length = props.length; + if (object == null) { + return !length; + } + object = Object(object); + while (length--) { + var key = props[length]; + if (!(key in object && + baseIsEqual(source[key], object[key], COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG) + )) { + return false; + } + } + return true; + }; + } + + /** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. + */ + function basePick(object, props) { + object = Object(object); + return reduce(props, function(result, key) { + if (key in object) { + result[key] = object[key]; + } + return result; + }, {}); + } + + /** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ + function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); + } + + /** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; + } + + /** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ + function copyArray(source) { + return baseSlice(source, 0, source.length); + } + + /** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; + } + + /** + * The base implementation of `wrapperValue` which returns the result of + * performing a sequence of actions on the unwrapped `value`, where each + * successive action is supplied the return value of the previous. + * + * @private + * @param {*} value The unwrapped value. + * @param {Array} actions Actions to perform to resolve the unwrapped value. + * @returns {*} Returns the resolved value. + */ + function baseWrapperValue(value, actions) { + var result = value; + return reduce(actions, function(result, action) { + return action.func.apply(action.thisArg, arrayPush([result], action.args)); + }, result); + } + + /** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ + function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = false; + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = false; + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; + } + + /** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ + function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; + } + + /** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ + function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); + } + + /** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; + } + + /** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } + + /** + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. + */ + function createCtor(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); + + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; + } + + /** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. + */ + function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = baseIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + } + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; + } + + /** + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. + * @returns {Function} Returns the new wrapped function. + */ + function createPartial(func, bitmask, thisArg, partials) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return fn.apply(isBind ? thisArg : this, args); + } + return wrapper; + } + + /** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ + function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? [] : undefined; + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + var compared; + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!baseSome(other, function(othValue, othIndex) { + if (!indexOf(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + return result; + } + + /** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + } + return false; + } + + /** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = keys(object), + objLength = objProps.length, + othProps = keys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + var result = true; + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + var compared; + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + return result; + } + + /** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); + } + + /** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenable(value) { + return isArray(value) || isArguments(value); + } + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); + } + + /** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; + } + + /** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; + } + + /** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ + function objectToString(value) { + return nativeObjectToString.call(value); + } + + /** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ + function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return func.apply(this, otherArgs); + }; + } + + /** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var setToString = identity; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + return baseFilter(array, Boolean); + } + + /** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ + function concat() { + var length = arguments.length; + if (!length) { + return []; + } + var args = Array(length - 1), + array = arguments[0], + index = length; + + while (index--) { + args[index - 1] = arguments[index]; + } + return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); + } + + /** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ + function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, baseIteratee(predicate, 3), index); + } + + /** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ + function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; + } + + /** + * Recursively flattens `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] + */ + function flattenDeep(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, INFINITY) : []; + } + + /** + * Gets the first element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias first + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.head([1, 2, 3]); + * // => 1 + * + * _.head([]); + * // => undefined + */ + function head(array) { + return (array && array.length) ? array[0] : undefined; + } + + /** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ + function indexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (typeof fromIndex == 'number') { + fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex; + } else { + fromIndex = 0; + } + var index = (fromIndex || 0) - 1, + isReflexive = value === value; + + while (++index < length) { + var other = array[index]; + if ((isReflexive ? other === value : other !== other)) { + return index; + } + } + return -1; + } + + /** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ + function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; + } + + /** + * Creates a slice of `array` from `start` up to, but not including, `end`. + * + * **Note:** This method is used instead of + * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are + * returned. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function slice(array, start, end) { + var length = array == null ? 0 : array.length; + start = start == null ? 0 : +start; + end = end === undefined ? length : +end; + return length ? baseSlice(array, start, end) : []; + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Seq + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; + * + * var youngest = _ + * .chain(users) + * .sortBy('age') + * .map(function(o) { + * return o.user + ' is ' + o.age; + * }) + * .head() + * .value(); + * // => 'pebbles is 1' + */ + function chain(value) { + var result = lodash(value); + result.__chain__ = true; + return result; + } + + /** + * This method invokes `interceptor` and returns `value`. The interceptor + * is invoked with one argument; (value). The purpose of this method is to + * "tap into" a method chain sequence in order to modify intermediate results. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns `value`. + * @example + * + * _([1, 2, 3]) + * .tap(function(array) { + * // Mutate input array. + * array.pop(); + * }) + * .reverse() + * .value(); + * // => [2, 1] + */ + function tap(value, interceptor) { + interceptor(value); + return value; + } + + /** + * This method is like `_.tap` except that it returns the result of `interceptor`. + * The purpose of this method is to "pass thru" values replacing intermediate + * results in a method chain sequence. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns the result of `interceptor`. + * @example + * + * _(' abc ') + * .chain() + * .trim() + * .thru(function(value) { + * return [value]; + * }) + * .value(); + * // => ['abc'] + */ + function thru(value, interceptor) { + return interceptor(value); + } + + /** + * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. + * + * @name chain + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * // A sequence without explicit chaining. + * _(users).head(); + * // => { 'user': 'barney', 'age': 36 } + * + * // A sequence with explicit chaining. + * _(users) + * .chain() + * .head() + * .pick('user') + * .value(); + * // => { 'user': 'barney' } + */ + function wrapperChain() { + return chain(this); + } + + /** + * Executes the chain sequence to resolve the unwrapped value. + * + * @name value + * @memberOf _ + * @since 0.1.0 + * @alias toJSON, valueOf + * @category Seq + * @returns {*} Returns the resolved unwrapped value. + * @example + * + * _([1, 2, 3]).value(); + * // => [1, 2, 3] + */ + function wrapperValue() { + return baseWrapperValue(this.__wrapped__, this.__actions__); + } + + /*------------------------------------------------------------------------*/ + + /** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * **Note:** This method returns `true` for + * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because + * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of + * elements of empty collections. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false + */ + function every(collection, predicate, guard) { + predicate = guard ? undefined : predicate; + return baseEvery(collection, baseIteratee(predicate)); + } + + /** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * **Note:** Unlike `_.remove`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + */ + function filter(collection, predicate) { + return baseFilter(collection, baseIteratee(predicate)); + } + + /** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ + var find = createFind(findIndex); + + /** + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight + * @example + * + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forEach(collection, iteratee) { + return baseEach(collection, baseIteratee(iteratee)); + } + + /** + * Creates an array of values by running each element in `collection` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + * @example + * + * function square(n) { + * return n * n; + * } + * + * _.map([4, 8], square); + * // => [16, 64] + * + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */ + function map(collection, iteratee) { + return baseMap(collection, baseIteratee(iteratee)); + } + + /** + * Reduces `collection` to a value which is the accumulated result of running + * each element in `collection` thru `iteratee`, where each successive + * invocation is supplied the return value of the previous. If `accumulator` + * is not given, the first element of `collection` is used as the initial + * value. The iteratee is invoked with four arguments: + * (accumulator, value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.reduce`, `_.reduceRight`, and `_.transform`. + * + * The guarded methods are: + * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, + * and `sortBy` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduceRight + * @example + * + * _.reduce([1, 2], function(sum, n) { + * return sum + n; + * }, 0); + * // => 3 + * + * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * return result; + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) + */ + function reduce(collection, iteratee, accumulator) { + return baseReduce(collection, baseIteratee(iteratee), accumulator, arguments.length < 3, baseEach); + } + + /** + * Gets the size of `collection` by returning its length for array-like + * values or the number of own enumerable string keyed properties for objects. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @returns {number} Returns the collection size. + * @example + * + * _.size([1, 2, 3]); + * // => 3 + * + * _.size({ 'a': 1, 'b': 2 }); + * // => 2 + * + * _.size('pebbles'); + * // => 7 + */ + function size(collection) { + if (collection == null) { + return 0; + } + collection = isArrayLike(collection) ? collection : nativeKeys(collection); + return collection.length; + } + + /** + * Checks if `predicate` returns truthy for **any** element of `collection`. + * Iteration is stopped once `predicate` returns truthy. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.some(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.some(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.some(users, 'active'); + * // => true + */ + function some(collection, predicate, guard) { + predicate = guard ? undefined : predicate; + return baseSome(collection, baseIteratee(predicate)); + } + + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, [function(o) { return o.user; }]); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] + */ + function sortBy(collection, iteratee) { + var index = 0; + iteratee = baseIteratee(iteratee); + + return baseMap(baseMap(collection, function(value, key, collection) { + return { 'value': value, 'index': index++, 'criteria': iteratee(value, key, collection) }; + }).sort(function(object, other) { + return compareAscending(object.criteria, other.criteria) || (object.index - other.index); + }), baseProperty('value')); + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery(element).on('click', _.before(5, addContactToList)); + * // => Allows adding up to 4 contacts to the list. + */ + function before(n, func) { + var result; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; + } + + /** + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and `partials` prepended to the arguments it receives. + * + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. + * + * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" + * property of bound functions. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * function greet(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * + * var object = { 'user': 'fred' }; + * + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // Bound with placeholders. + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' + */ + var bind = baseRest(function(func, thisArg, partials) { + return createPartial(func, WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG, thisArg, partials); + }); + + /** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one millisecond. + */ + var defer = baseRest(function(func, args) { + return baseDelay(func, 1, args); + }); + + /** + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => Logs 'later' after one second. + */ + var delay = baseRest(function(func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); + }); + + /** + * Creates a function that negates the result of the predicate `func`. The + * `func` predicate is invoked with the `this` binding and arguments of the + * created function. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} predicate The predicate to negate. + * @returns {Function} Returns the new negated function. + * @example + * + * function isEven(n) { + * return n % 2 == 0; + * } + * + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] + */ + function negate(predicate) { + if (typeof predicate != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + var args = arguments; + return !predicate.apply(this, args); + }; + } + + /** + * Creates a function that is restricted to invoking `func` once. Repeat calls + * to the function return the value of the first invocation. The `func` is + * invoked with the `this` binding and arguments of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // => `createApplication` is invoked once + */ + function once(func) { + return before(2, func); + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @see _.cloneDeep + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ + function clone(value) { + if (!isObject(value)) { + return value; + } + return isArray(value) ? copyArray(value) : copyObject(value, nativeKeys(value)); + } + + /** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + function eq(value, other) { + return value === other || (value !== value && other !== other); + } + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); + }; + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray = Array.isArray; + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + + /** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || + (isObjectLike(value) && baseGetTag(value) == boolTag); + } + + /** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */ + var isDate = baseIsDate; + + /** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ + function isEmpty(value) { + if (isArrayLike(value) && + (isArray(value) || isString(value) || + isFunction(value.splice) || isArguments(value))) { + return !value.length; + } + return !nativeKeys(value).length; + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ + function isEqual(value, other) { + return baseIsEqual(value, other); + } + + /** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @example + * + * _.isFinite(3); + * // => true + * + * _.isFinite(Number.MIN_VALUE); + * // => true + * + * _.isFinite(Infinity); + * // => false + * + * _.isFinite('3'); + * // => false + */ + function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return value != null && typeof value == 'object'; + } + + /** + * Checks if `value` is `NaN`. + * + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // An `NaN` primitive is the only value that is not equal to itself. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. + return isNumber(value) && value != +value; + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a number, else `false`. + * @example + * + * _.isNumber(3); + * // => true + * + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false + */ + function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && baseGetTag(value) == numberTag); + } + + /** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */ + var isRegExp = baseIsRegExp; + + /** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ + function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); + } + + /** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ + function isUndefined(value) { + return value === undefined; + } + + /** + * Converts `value` to an array. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {Array} Returns the converted array. + * @example + * + * _.toArray({ 'a': 1, 'b': 2 }); + * // => [1, 2] + * + * _.toArray('abc'); + * // => ['a', 'b', 'c'] + * + * _.toArray(1); + * // => [] + * + * _.toArray(null); + * // => [] + */ + function toArray(value) { + if (!isArrayLike(value)) { + return values(value); + } + return value.length ? copyArray(value) : []; + } + + /** + * Converts `value` to an integer. + * + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */ + var toInteger = Number; + + /** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ + var toNumber = Number; + + /** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + function toString(value) { + if (typeof value == 'string') { + return value; + } + return value == null ? '' : (value + ''); + } + + /*------------------------------------------------------------------------*/ + + /** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ + var assign = createAssigner(function(object, source) { + copyObject(source, nativeKeys(source), object); + }); + + /** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assign + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assignIn({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } + */ + var assignIn = createAssigner(function(object, source) { + copyObject(source, nativeKeysIn(source), object); + }); + + /** + * Creates an object that inherits from the `prototype` object. If a + * `properties` object is given, its own enumerable string keyed properties + * are assigned to the created object. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ + function create(prototype, properties) { + var result = baseCreate(prototype); + return properties == null ? result : assign(result, properties); + } + + /** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaultsDeep + * @example + * + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var defaults = baseRest(function(object, sources) { + object = Object(object); + + var index = -1; + var length = sources.length; + var guard = length > 2 ? sources[2] : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + length = 1; + } + + while (++index < length) { + var source = sources[index]; + var props = keysIn(source); + var propsIndex = -1; + var propsLength = props.length; + + while (++propsIndex < propsLength) { + var key = props[propsIndex]; + var value = object[key]; + + if (value === undefined || + (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { + object[key] = source[key]; + } + } + } + + return object; + }); + + /** + * Checks if `path` is a direct property of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b'); + * // => true + * + * _.has(object, ['a', 'b']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ + function has(object, path) { + return object != null && hasOwnProperty.call(object, path); + } + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + var keys = nativeKeys; + + /** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ + var keysIn = nativeKeysIn; + + /** + * Creates an object composed of the picked `object` properties. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ + var pick = flatRest(function(object, paths) { + return object == null ? {} : basePick(object, paths); + }); + + /** + * This method is like `_.get` except that if the resolved value is a + * function it's invoked with the `this` binding of its parent object and + * its result is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to resolve. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; + * + * _.result(object, 'a[0].b.c1'); + * // => 3 + * + * _.result(object, 'a[0].b.c2'); + * // => 4 + * + * _.result(object, 'a[0].b.c3', 'default'); + * // => 'default' + * + * _.result(object, 'a[0].b.c3', _.constant('default')); + * // => 'default' + */ + function result(object, path, defaultValue) { + var value = object == null ? undefined : object[path]; + if (value === undefined) { + value = defaultValue; + } + return isFunction(value) ? value.call(object) : value; + } + + /** + * Creates an array of the own enumerable string keyed property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] + */ + function values(object) { + return object == null ? [] : baseValues(object, keys(object)); + } + + /*------------------------------------------------------------------------*/ + + /** + * Converts the characters "&", "<", ">", '"', and "'" in `string` to their + * corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional + * characters use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. See + * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * When working with HTML you should always + * [quote attribute values](http://wonko.com/post/html-escaping) to reduce + * XSS vectors. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ + function escape(string) { + string = toString(string); + return (string && reHasUnescapedHtml.test(string)) + ? string.replace(reUnescapedHtml, escapeHtmlChar) + : string; + } + + /*------------------------------------------------------------------------*/ + + /** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ + function identity(value) { + return value; + } + + /** + * Creates a function that invokes `func` with the arguments of the created + * function. If `func` is a property name, the created function returns the + * property value for a given element. If `func` is an array or object, the + * created function returns `true` for elements that contain the equivalent + * source properties, otherwise it returns `false`. + * + * @static + * @since 4.0.0 + * @memberOf _ + * @category Util + * @param {*} [func=_.identity] The value to convert to a callback. + * @returns {Function} Returns the callback. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); + * // => [{ 'user': 'barney', 'age': 36, 'active': true }] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, _.iteratee(['user', 'fred'])); + * // => [{ 'user': 'fred', 'age': 40 }] + * + * // The `_.property` iteratee shorthand. + * _.map(users, _.iteratee('user')); + * // => ['barney', 'fred'] + * + * // Create custom iteratee shorthands. + * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { + * return !_.isRegExp(func) ? iteratee(func) : function(string) { + * return func.test(string); + * }; + * }); + * + * _.filter(['abc', 'def'], /ef/); + * // => ['def'] + */ + var iteratee = baseIteratee; + + /** + * Creates a function that performs a partial deep comparison between a given + * object and `source`, returning `true` if the given object has equivalent + * property values, else `false`. + * + * **Note:** The created function is equivalent to `_.isMatch` with `source` + * partially applied. + * + * Partial comparisons will match empty array and empty object `source` + * values against any array or object value, respectively. See `_.isEqual` + * for a list of supported value comparisons. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Util + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + * @example + * + * var objects = [ + * { 'a': 1, 'b': 2, 'c': 3 }, + * { 'a': 4, 'b': 5, 'c': 6 } + * ]; + * + * _.filter(objects, _.matches({ 'a': 4, 'c': 6 })); + * // => [{ 'a': 4, 'b': 5, 'c': 6 }] + */ + function matches(source) { + return baseMatches(assign({}, source)); + } + + /** + * Adds all own enumerable string keyed function properties of a source + * object to the destination object. If `object` is a function, then methods + * are added to its prototype as well. + * + * **Note:** Use `_.runInContext` to create a pristine `lodash` function to + * avoid conflicts caused by modifying the original. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {Function|Object} [object=lodash] The destination object. + * @param {Object} source The object of functions to add. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.chain=true] Specify whether mixins are chainable. + * @returns {Function|Object} Returns `object`. + * @example + * + * function vowels(string) { + * return _.filter(string, function(v) { + * return /[aeiou]/i.test(v); + * }); + * } + * + * _.mixin({ 'vowels': vowels }); + * _.vowels('fred'); + * // => ['e'] + * + * _('fred').vowels().value(); + * // => ['e'] + * + * _.mixin({ 'vowels': vowels }, { 'chain': false }); + * _('fred').vowels(); + * // => ['e'] + */ + function mixin(object, source, options) { + var props = keys(source), + methodNames = baseFunctions(source, props); + + if (options == null && + !(isObject(source) && (methodNames.length || !props.length))) { + options = source; + source = object; + object = this; + methodNames = baseFunctions(source, keys(source)); + } + var chain = !(isObject(options) && 'chain' in options) || !!options.chain, + isFunc = isFunction(object); + + baseEach(methodNames, function(methodName) { + var func = source[methodName]; + object[methodName] = func; + if (isFunc) { + object.prototype[methodName] = function() { + var chainAll = this.__chain__; + if (chain || chainAll) { + var result = object(this.__wrapped__), + actions = result.__actions__ = copyArray(this.__actions__); + + actions.push({ 'func': func, 'args': arguments, 'thisArg': object }); + result.__chain__ = chainAll; + return result; + } + return func.apply(object, arrayPush([this.value()], arguments)); + }; + } + }); + + return object; + } + + /** + * Reverts the `_` variable to its previous value and returns a reference to + * the `lodash` function. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @returns {Function} Returns the `lodash` function. + * @example + * + * var lodash = _.noConflict(); + */ + function noConflict() { + if (root._ === this) { + root._ = oldDash; + } + return this; + } + + /** + * This method returns `undefined`. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Util + * @example + * + * _.times(2, _.noop); + * // => [undefined, undefined] + */ + function noop() { + // No operation performed. + } + + /** + * Generates a unique ID. If `prefix` is given, the ID is appended to it. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {string} [prefix=''] The value to prefix the ID with. + * @returns {string} Returns the unique ID. + * @example + * + * _.uniqueId('contact_'); + * // => 'contact_104' + * + * _.uniqueId(); + * // => '105' + */ + function uniqueId(prefix) { + var id = ++idCounter; + return toString(prefix) + id; + } + + /*------------------------------------------------------------------------*/ + + /** + * Computes the maximum value of `array`. If `array` is empty or falsey, + * `undefined` is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {*} Returns the maximum value. + * @example + * + * _.max([4, 2, 8, 6]); + * // => 8 + * + * _.max([]); + * // => undefined + */ + function max(array) { + return (array && array.length) + ? baseExtremum(array, identity, baseGt) + : undefined; + } + + /** + * Computes the minimum value of `array`. If `array` is empty or falsey, + * `undefined` is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {*} Returns the minimum value. + * @example + * + * _.min([4, 2, 8, 6]); + * // => 2 + * + * _.min([]); + * // => undefined + */ + function min(array) { + return (array && array.length) + ? baseExtremum(array, identity, baseLt) + : undefined; + } + + /*------------------------------------------------------------------------*/ + + // Add methods that return wrapped values in chain sequences. + lodash.assignIn = assignIn; + lodash.before = before; + lodash.bind = bind; + lodash.chain = chain; + lodash.compact = compact; + lodash.concat = concat; + lodash.create = create; + lodash.defaults = defaults; + lodash.defer = defer; + lodash.delay = delay; + lodash.filter = filter; + lodash.flatten = flatten; + lodash.flattenDeep = flattenDeep; + lodash.iteratee = iteratee; + lodash.keys = keys; + lodash.map = map; + lodash.matches = matches; + lodash.mixin = mixin; + lodash.negate = negate; + lodash.once = once; + lodash.pick = pick; + lodash.slice = slice; + lodash.sortBy = sortBy; + lodash.tap = tap; + lodash.thru = thru; + lodash.toArray = toArray; + lodash.values = values; + + // Add aliases. + lodash.extend = assignIn; + + // Add methods to `lodash.prototype`. + mixin(lodash, lodash); + + /*------------------------------------------------------------------------*/ + + // Add methods that return unwrapped values in chain sequences. + lodash.clone = clone; + lodash.escape = escape; + lodash.every = every; + lodash.find = find; + lodash.forEach = forEach; + lodash.has = has; + lodash.head = head; + lodash.identity = identity; + lodash.indexOf = indexOf; + lodash.isArguments = isArguments; + lodash.isArray = isArray; + lodash.isBoolean = isBoolean; + lodash.isDate = isDate; + lodash.isEmpty = isEmpty; + lodash.isEqual = isEqual; + lodash.isFinite = isFinite; + lodash.isFunction = isFunction; + lodash.isNaN = isNaN; + lodash.isNull = isNull; + lodash.isNumber = isNumber; + lodash.isObject = isObject; + lodash.isRegExp = isRegExp; + lodash.isString = isString; + lodash.isUndefined = isUndefined; + lodash.last = last; + lodash.max = max; + lodash.min = min; + lodash.noConflict = noConflict; + lodash.noop = noop; + lodash.reduce = reduce; + lodash.result = result; + lodash.size = size; + lodash.some = some; + lodash.uniqueId = uniqueId; + + // Add aliases. + lodash.each = forEach; + lodash.first = head; + + mixin(lodash, (function() { + var source = {}; + baseForOwn(lodash, function(func, methodName) { + if (!hasOwnProperty.call(lodash.prototype, methodName)) { + source[methodName] = func; + } + }); + return source; + }()), { 'chain': false }); + + /*------------------------------------------------------------------------*/ + + /** + * The semantic version number. + * + * @static + * @memberOf _ + * @type {string} + */ + lodash.VERSION = VERSION; + + // Add `Array` methods to `lodash.prototype`. + baseEach(['pop', 'join', 'replace', 'reverse', 'split', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { + var func = (/^(?:replace|split)$/.test(methodName) ? String.prototype : arrayProto)[methodName], + chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru', + retUnwrapped = /^(?:pop|join|replace|shift)$/.test(methodName); + + lodash.prototype[methodName] = function() { + var args = arguments; + if (retUnwrapped && !this.__chain__) { + var value = this.value(); + return func.apply(isArray(value) ? value : [], args); + } + return this[chainName](function(value) { + return func.apply(isArray(value) ? value : [], args); + }); + }; + }); + + // Add chain sequence methods to the `lodash` wrapper. + lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; + + /*--------------------------------------------------------------------------*/ + + // Some AMD build optimizers, like r.js, check for condition patterns like: + if (true) { + // Expose Lodash on the global object to prevent errors when Lodash is + // loaded by a script tag in the presence of an AMD loader. + // See http://requirejs.org/docs/errors.html#mismatch for more details. + // Use `_.noConflict` to remove Lodash from the global object. + root._ = lodash; + + // Define as an anonymous module so, through path mapping, it can be + // referenced as the "underscore" module. + !(__WEBPACK_AMD_DEFINE_RESULT__ = function() { + return lodash; + }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } + // Check for `exports` after `define` in case a build optimizer adds it. + else if (freeModule) { + // Export for Node.js. + (freeModule.exports = lodash)._ = lodash; + // Export for CommonJS support. + freeExports._ = lodash; + } + else { + // Export to the global object. + root._ = lodash; + } + }.call(this)); + + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(59)(module))) + +/***/ }), +/* 59 */ +/***/ (function(module, exports) { + + module.exports = function(module) { + if(!module.webpackPolyfill) { + module.deprecate = function() {}; + module.paths = []; + // module.parent = undefined by default + module.children = []; + module.webpackPolyfill = 1; + } + return module; + } + + +/***/ }), +/* 60 */ +/***/ (function(module, exports, __webpack_require__) { + + var ArrowLink = __webpack_require__(61); + var BoxArrowLink = __webpack_require__(22); + var PlainLink = __webpack_require__(23); + var OwlDisjointWith = __webpack_require__(46); + var SetOperatorProperty = __webpack_require__(56); + + /** + * Stores the passed properties in links. + * @returns {Function} + */ + module.exports = (function (){ + var linkCreator = {}; + + /** + * Creates links from the passed properties. + * @param properties + */ + linkCreator.createLinks = function ( properties ){ + var links = groupPropertiesToLinks(properties); + + for ( var i = 0, l = links.length; i < l; i++ ) { + var link = links[i]; + + countAndSetLayers(link, links); + countAndSetLoops(link, links); + } + + return links; + }; + + /** + * Creates links of properties and - if existing - their inverses. + * @param properties the properties + * @returns {Array} + */ + function groupPropertiesToLinks( properties ){ + var links = [], + property, + addedProperties = __webpack_require__(62)(); + + for ( var i = 0, l = properties.length; i < l; i++ ) { + property = properties[i]; + + if ( !addedProperties.has(property) ) { + var link = createLink(property); + + property.link(link); + if ( property.inverse() ) { + property.inverse().link(link); + } + + links.push(link); + + addedProperties.add(property); + if ( property.inverse() ) { + addedProperties.add(property.inverse()); + } + } + } + + return links; + } + + function countAndSetLayers( link, allLinks ){ + var layer, + layers, + i, l; + + if ( typeof link.layers() === "undefined" ) { + layers = []; + + // Search for other links that are another layer + for ( i = 0, l = allLinks.length; i < l; i++ ) { + var otherLink = allLinks[i]; + if ( link.domain() === otherLink.domain() && link.range() === otherLink.range() || + link.domain() === otherLink.range() && link.range() === otherLink.domain() ) { + layers.push(otherLink); + } + } + + // Set the results on each of the layers + for ( i = 0, l = layers.length; i < l; ++i ) { + layer = layers[i]; + + layer.layerIndex(i); + layer.layers(layers); + } + } + } + + function countAndSetLoops( link, allLinks ){ + var loop, + loops, + i, l; + + if ( typeof link.loops() === "undefined" ) { + loops = []; + + // Search for other links that are also loops of the same node + for ( i = 0, l = allLinks.length; i < l; i++ ) { + var otherLink = allLinks[i]; + if ( link.domain() === otherLink.domain() && link.domain() === otherLink.range() ) { + loops.push(otherLink); + } + } + + // Set the results on each of the loops + for ( i = 0, l = loops.length; i < l; ++i ) { + loop = loops[i]; + + loop.loopIndex(i); + loop.loops(loops); + } + } + } + + function createLink( property ){ + var domain = property.domain(); + var range = property.range(); + + if ( property instanceof OwlDisjointWith ) { + return new PlainLink(domain, range, property); + } else if ( property instanceof SetOperatorProperty ) { + return new BoxArrowLink(domain, range, property); + } + return new ArrowLink(domain, range, property); + } + + return function (){ + // Return a function to keep module interfaces consistent + return linkCreator; + }; + })(); + + +/***/ }), +/* 61 */ +/***/ (function(module, exports, __webpack_require__) { + + var PlainLink = __webpack_require__(23); + + + module.exports = ArrowLink; + + function ArrowLink( domain, range, property ){ + PlainLink.apply(this, arguments); + } + + ArrowLink.prototype = Object.create(PlainLink.prototype); + ArrowLink.prototype.constructor = ArrowLink; + + + ArrowLink.prototype.draw = function ( linkGroup, markerContainer ){ + var property = this.label().property(); + var inverse = this.label().inverse(); + + createPropertyMarker(markerContainer, property); + if ( inverse ) { + createInverseMarker(markerContainer, inverse); + } + + PlainLink.prototype.draw.apply(this, arguments); + + // attach the markers to the link + linkGroup.attr("marker-end", "url(#" + property.markerId() + ")"); + if ( inverse ) { + linkGroup.attr("marker-start", "url(#" + inverse.markerId() + ")"); + } + }; + + function createPropertyMarker( markerContainer, property ){ + var marker = appendBasicMarker(markerContainer, property); + //marker.attr("refX", 12); + var m1X = -12; + var m1Y = 8; + var m2X = -12; + var m2Y = -8; + marker.append("path") + //.attr("d", "M0,-8L12,0L0,8Z") + .attr("d", "M0,0L " + m1X + "," + m1Y + "L" + m2X + "," + m2Y + "L" + 0 + "," + 0) + .classed(property.markerType(), true); + + property.markerElement(marker); + } + + function createInverseMarker( markerContainer, inverse ){ + var m1X = -12; + var m1Y = 8; + var m2X = -12; + var m2Y = -8; + var inverseMarker = appendBasicMarker(markerContainer, inverse); + inverseMarker.append("path") + //.attr("d", "M12,-8L0,0L12,8Z") + .attr("d", "M0,0L " + -m1X + "," + -m1Y + "L" + -m2X + "," + -m2Y + "L" + 0 + "," + 0) + .classed(inverse.markerType(), true); + + inverse.markerElement(inverseMarker); + } + + function appendBasicMarker( markerContainer, property ){ + return markerContainer.append("marker") + .datum(property) + .attr("id", property.markerId()) + + .attr("viewBox", "-14 -10 28 20") + .attr("markerWidth", 10) + .attr("markerHeight", 10) + //.attr("markerUnits", "userSpaceOnUse") + .attr("orient", "auto"); + } + + +/***/ }), +/* 62 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {/** + * A simple incomplete encapsulation of the d3 set, which is able to store webvowl + * elements by using their id. + */ + module.exports = function ( array ){ + + var set = {}, + d3Set = d3.set(array); + + set.has = function ( webvowlElement ){ + return d3Set.has(webvowlElement.id()); + }; + + set.add = function ( webvowlElement ){ + return d3Set.add(webvowlElement.id()); + }; + + set.remove = function ( webvowlElement ){ + return d3Set.remove(webvowlElement.id()); + }; + + set.empty = function (){ + return d3Set.empty(); + }; + + set.size = function (){ + return d3Set.size(); + }; + + return set; + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), +/* 63 */ +/***/ (function(module, exports, __webpack_require__) { + + var BaseProperty = __webpack_require__(42); + var BaseNode = __webpack_require__(9); + var DatatypeNode = __webpack_require__(35); + var Thing = __webpack_require__(31); + var ObjectProperty = __webpack_require__(50); + var DatatypeProperty = __webpack_require__(44); + var RdfsSubClassOf = __webpack_require__(55); + var Label = __webpack_require__(24); + + + var tools = {}; + module.exports = function (){ + return tools; + }; + + tools.isLabel = function ( element ){ + return element instanceof Label; + }; + + tools.isNode = function ( element ){ + return element instanceof BaseNode; + }; + + tools.isDatatype = function ( node ){ + return node instanceof DatatypeNode; + }; + + tools.isThing = function ( node ){ + return node instanceof Thing; + }; + + tools.isProperty = function ( element ){ + return element instanceof BaseProperty; + }; + + tools.isObjectProperty = function ( element ){ + return element instanceof ObjectProperty; + }; + + tools.isDatatypeProperty = function ( element ){ + return element instanceof DatatypeProperty; + }; + + tools.isRdfsSubClassOf = function ( property ){ + return property instanceof RdfsSubClassOf; + }; + + +/***/ }), +/* 64 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {module.exports = function (){ + var options = {}, + data, + graphContainerSelector, + classDistance = 200, + datatypeDistance = 120, + loopDistance = 150, + charge = -500, + gravity = 0.025, + linkStrength = 1, + height = 600, + width = 800, + selectionModules = [], + filterModules = [], + minMagnification = 0.01, + maxMagnification = 4, + compactNotation = false, + dynamicLabelWidth = true, + // some filters + literalFilter, + // menus + gravityMenu, + filterMenu, + loadingModule, + modeMenu, + pausedMenu, + pickAndPinModule, + resetMenu, + searchMenu, + ontologyMenu, + sidebar, + leftSidebar, + editSidebar, + navigationMenu, + exportMenu, + graphObject, + zoomSlider, + datatypeFilter, + focuserModule, + colorExternalsModule, + compactNotationModule, + objectPropertyFilter, + subclassFilter, + setOperatorFilter, + maxLabelWidth = 120, + metadataObject = {}, + generalOntologyMetaData = {}, + disjointPropertyFilter, + rectangularRep = false, + warningModule, + prefixModule, + drawPropertyDraggerOnHover = true, + showDraggerObject = false, + directInputModule, + scaleNodesByIndividuals = true, + useAccuracyHelper = true, + showRenderingStatistic = true, + showInputModality = false, + hideDebugOptions = true, + nodeDegreeFilter, + debugMenu, + + supportedDatatypes = ["rdfs:Literal", "xsd:boolean", "xsd:double", "xsd:integer", "xsd:string", "undefined"], + supportedClasses = ["owl:Thing", "owl:Class", "owl:DeprecatedClass"], + supportedProperties = ["owl:objectProperty", + "rdfs:subClassOf", + "owl:disjointWith", + "owl:allValuesFrom", + "owl:someValuesFrom" + ], + prefixList = { + rdf: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', + rdfs: 'http://www.w3.org/2000/01/rdf-schema#', + owl: 'http://www.w3.org/2002/07/owl#', + xsd: 'http://www.w3.org/2001/XMLSchema#', + dc: 'http://purl.org/dc/elements/1.1/#', + xml: 'http://www.w3.org/XML/1998/namespace' + }; + + options.clearMetaObject = function (){ + generalOntologyMetaData = {}; + }; + options.clearGeneralMetaObject = function (){ + generalOntologyMetaData = {}; + }; + + options.debugMenu = function ( val ){ + if ( !arguments.length ) return debugMenu; + debugMenu = val; + }; + + options.getHideDebugFeatures = function (){ + return hideDebugOptions; + }; + options.executeHiddenDebugFeatuers = function (){ + hideDebugOptions = !hideDebugOptions; + d3.selectAll(".debugOption").classed("hidden", hideDebugOptions); + if ( hideDebugOptions === false ) { + graphObject.setForceTickFunctionWithFPS(); + } + else { + graphObject.setDefaultForceTickFunction(); + } + if ( debugMenu ) { + debugMenu.updateSettings(); + } + options.setHideDebugFeaturesForDefaultObject(hideDebugOptions); + }; + + + options.addOrUpdateGeneralObjectEntry = function ( property, value ){ + if ( generalOntologyMetaData.hasOwnProperty(property) ) { + //console.log("Updating Property:"+ property); + if ( property === "iri" ) { + if ( validURL(value) === false ) { + warningModule.showWarning("Invalid Ontology IRI", "Input IRI does not represent an URL", "Restoring previous IRI for ontology", 1, false); + return false; + } + } + generalOntologyMetaData[property] = value; + } else { + generalOntologyMetaData[property] = value; + } + return true; + }; + + options.getGeneralMetaObjectProperty = function ( property ){ + if ( generalOntologyMetaData.hasOwnProperty(property) ) { + return generalOntologyMetaData[property]; + } + }; + + options.getGeneralMetaObject = function (){ + return generalOntologyMetaData; + }; + + options.addOrUpdateMetaObjectEntry = function ( property, value ){ + + if ( metadataObject.hasOwnProperty(property) ) { + metadataObject[property] = value; + } else { + metadataObject[property] = value; + } + }; + + options.getMetaObjectProperty = function ( property ){ + if ( metadataObject.hasOwnProperty(property) ) { + return metadataObject[property]; + } + }; + options.getMetaObject = function (){ + return metadataObject; + }; + + + options.prefixList = function (){ + return prefixList; + }; + options.addPrefix = function ( prefix, url ){ + prefixList[prefix] = url; + }; + + function validURL( str ){ + var urlregex = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/; + return urlregex.test(str); + } + + options.updatePrefix = function ( oldPrefix, newPrefix, oldURL, newURL ){ + if ( oldPrefix === newPrefix && oldURL === newURL ) { + // console.log("Nothing to update"); + return true; + } + if ( oldPrefix === newPrefix && oldURL !== newURL && validURL(newURL) === true ) { + // console.log("Update URL"); + prefixList[oldPrefix] = newURL; + } else if ( oldPrefix === newPrefix && oldURL !== newURL && validURL(newURL) === false ) { + if ( validURL(newURL) === false ) { + warningModule.showWarning("Invalid Prefix IRI", "Input IRI does not represent an IRI", "You should enter a valid IRI in form of a URL", 1, false); + return false; + } + + return false; + } + if ( oldPrefix !== newPrefix && validURL(newURL) === true ) { + + // sanity check + if ( prefixList.hasOwnProperty(newPrefix) ) { + // console.log("Already have this prefix!"); + warningModule.showWarning("Prefix Already Exist", "Prefix: " + newPrefix + " is already defined", "You should use an other one", 1, false); + return false; + } + options.removePrefix(oldPrefix); + options.addPrefix(newPrefix, newURL); + editSidebar.updateEditDeleteButtonIds(oldPrefix, newPrefix); + return true; + } + + // console.log("Is new URL ("+newURL+") valid? >> "+validURL(newURL)); + if ( validURL(newURL) === false ) { + warningModule.showWarning("Invalid Prefix IRI", "Input IRI does not represent an URL", "You should enter a valid URL", 1, false); + + } + return false; + }; + + options.removePrefix = function ( prefix ){ + delete prefixList[prefix]; + }; + + + options.supportedDatatypes = function (){ + return supportedDatatypes; + }; + options.supportedClasses = function (){ + return supportedClasses; + }; + options.supportedProperties = function (){ + return supportedProperties; + }; + + options.datatypeFilter = function ( val ){ + if ( !arguments.length ) return datatypeFilter; + datatypeFilter = val; + }; + + options.showDraggerObject = function ( val ){ + if ( !arguments.length ) { + return showDraggerObject; + } + showDraggerObject = val; + }; + options.useAccuracyHelper = function ( val ){ + if ( !arguments.length ) { + return useAccuracyHelper; + } + useAccuracyHelper = val; + }; + options.showAccuracyHelper = function ( val ){ + if ( !arguments.length ) { + return options.showDraggerObject(); + } + options.showDraggerObject(val); + }; + options.showRenderingStatistic = function ( val ){ + if ( !arguments.length ) { + return showRenderingStatistic; + } + showRenderingStatistic = val; + }; + options.showInputModality = function ( val ){ + if ( !arguments.length ) { + return showInputModality; + } + showInputModality = val; + }; + + options.drawPropertyDraggerOnHover = function ( val ){ + if ( !arguments.length ) return drawPropertyDraggerOnHover; + drawPropertyDraggerOnHover = val; + }; + + options.warningModule = function ( val ){ + if ( !arguments.length ) return warningModule; + warningModule = val; + }; + options.directInputModule = function ( val ){ + if ( !arguments.length ) return directInputModule; + directInputModule = val; + }; + options.prefixModule = function ( val ){ + if ( !arguments.length ) return prefixModule; + prefixModule = val; + }; + + options.focuserModule = function ( val ){ + if ( !arguments.length ) return focuserModule; + focuserModule = val; + }; + options.colorExternalsModule = function ( val ){ + if ( !arguments.length ) return colorExternalsModule; + colorExternalsModule = val; + }; + options.compactNotationModule = function ( val ){ + if ( !arguments.length ) return compactNotationModule; + compactNotationModule = val; + }; + + options.maxLabelWidth = function ( val ){ + if ( !arguments.length ) return maxLabelWidth; + maxLabelWidth = val; + }; + options.objectPropertyFilter = function ( val ){ + if ( !arguments.length ) return objectPropertyFilter; + objectPropertyFilter = val; + }; + options.disjointPropertyFilter = function ( val ){ + if ( !arguments.length ) return disjointPropertyFilter; + disjointPropertyFilter = val; + }; + options.subclassFilter = function ( val ){ + if ( !arguments.length ) return subclassFilter; + subclassFilter = val; + }; + options.setOperatorFilter = function ( val ){ + if ( !arguments.length ) return setOperatorFilter; + setOperatorFilter = val; + }; + options.leftSidebar = function ( val ){ + if ( !arguments.length ) return leftSidebar; + leftSidebar = val; + }; + options.editSidebar = function ( val ){ + if ( !arguments.length ) return editSidebar; + editSidebar = val; + }; + + options.zoomSlider = function ( val ){ + if ( !arguments.length ) return zoomSlider; + zoomSlider = val; + }; + + options.graphObject = function ( val ){ + if ( !arguments.length ) return graphObject; + graphObject = val; + }; + + + var defaultOptionsConfig = {}; + defaultOptionsConfig.sidebar = "1"; + defaultOptionsConfig.doc = -1; + defaultOptionsConfig.cd = 200; + defaultOptionsConfig.dd = 120; + defaultOptionsConfig.editorMode = "false"; + defaultOptionsConfig.filter_datatypes = "false"; + defaultOptionsConfig.filter_objectProperties = "false"; + defaultOptionsConfig.filter_sco = "false"; + defaultOptionsConfig.filter_disjoint = "true"; + defaultOptionsConfig.filter_setOperator = "false"; + defaultOptionsConfig.mode_dynamic = "true"; + defaultOptionsConfig.mode_scaling = "true"; + defaultOptionsConfig.mode_compact = "false"; + defaultOptionsConfig.mode_colorExt = "true"; + defaultOptionsConfig.mode_multiColor = "false"; + defaultOptionsConfig.debugFeatures = "false"; + defaultOptionsConfig.rect = 0; + + + options.initialConfig = function (){ + var initCfg = {}; + initCfg.sidebar = "1"; + initCfg.doc = -1; + initCfg.cd = 200; + initCfg.dd = 120; + initCfg.editorMode = "false"; + initCfg.filter_datatypes = "false"; + initCfg.filter_objectProperties = "false"; + initCfg.filter_sco = "false"; + initCfg.filter_disjoint = "true"; + initCfg.filter_setOperator = "false"; + initCfg.mode_dynamic = "true"; + initCfg.mode_scaling = "true"; + initCfg.mode_compact = "false"; + initCfg.mode_colorExt = "true"; + initCfg.mode_multiColor = "false"; + initCfg.mode_pnp = "false"; + initCfg.debugFeatures = "false"; + initCfg.rect = 0; + return initCfg; + }; + + options.setEditorModeForDefaultObject = function ( val ){ + defaultOptionsConfig.editorMode = String(val); + }; + options.setHideDebugFeaturesForDefaultObject = function ( val ){ + defaultOptionsConfig.debugFeatures = String(!val); + }; + + function updateConfigObject(){ + defaultOptionsConfig.sidebar = options.sidebar().getSidebarVisibility(); + defaultOptionsConfig.cd = options.classDistance(); + defaultOptionsConfig.dd = options.datatypeDistance(); + defaultOptionsConfig.filter_datatypes = String(options.filterMenu().getCheckBoxValue("datatypeFilterCheckbox")); + defaultOptionsConfig.filter_sco = String(options.filterMenu().getCheckBoxValue("subclassFilterCheckbox")); + defaultOptionsConfig.filter_disjoint = String(options.filterMenu().getCheckBoxValue("disjointFilterCheckbox")); + defaultOptionsConfig.filter_setOperator = String(options.filterMenu().getCheckBoxValue("setoperatorFilterCheckbox")); + defaultOptionsConfig.filter_objectProperties = String(options.filterMenu().getCheckBoxValue("objectPropertyFilterCheckbox")); + defaultOptionsConfig.mode_dynamic = String(options.dynamicLabelWidth()); + defaultOptionsConfig.mode_scaling = String(options.modeMenu().getCheckBoxValue("nodescalingModuleCheckbox")); + defaultOptionsConfig.mode_compact = String(options.modeMenu().getCheckBoxValue("compactnotationModuleCheckbox")); + defaultOptionsConfig.mode_colorExt = String(options.modeMenu().getCheckBoxValue("colorexternalsModuleCheckbox")); + defaultOptionsConfig.mode_multiColor = String(options.modeMenu().colorModeState()); + defaultOptionsConfig.mode_pnp = String(options.modeMenu().getCheckBoxValue("pickandpinModuleCheckbox")); + defaultOptionsConfig.rect = 0; + } + + options.defaultConfig = function (){ + updateConfigObject(); + return defaultOptionsConfig; + }; + + options.exportMenu = function ( val ){ + if ( !arguments.length ) return exportMenu; + exportMenu = val; + }; + + options.rectangularRepresentation = function ( val ){ + if ( !arguments.length ) { + return rectangularRep; + } else { + var intVal = parseInt(val); + if ( intVal === 0 ) { + rectangularRep = false; + } else { + rectangularRep = true; + } + } + }; + + options.dynamicLabelWidth = function ( val ){ + if ( !arguments.length ) + return dynamicLabelWidth; + else { + dynamicLabelWidth = val; + } + }; + options.sidebar = function ( s ){ + if ( !arguments.length ) return sidebar; + sidebar = s; + return options; + + }; + + options.navigationMenu = function ( m ){ + if ( !arguments.length ) return navigationMenu; + navigationMenu = m; + return options; + + }; + + options.ontologyMenu = function ( m ){ + if ( !arguments.length ) return ontologyMenu; + ontologyMenu = m; + return options; + }; + + options.searchMenu = function ( m ){ + if ( !arguments.length ) return searchMenu; + searchMenu = m; + return options; + }; + + options.resetMenu = function ( m ){ + if ( !arguments.length ) return resetMenu; + resetMenu = m; + return options; + }; + + options.pausedMenu = function ( m ){ + if ( !arguments.length ) return pausedMenu; + pausedMenu = m; + return options; + }; + + options.pickAndPinModule = function ( m ){ + if ( !arguments.length ) return pickAndPinModule; + pickAndPinModule = m; + return options; + }; + + options.gravityMenu = function ( m ){ + if ( !arguments.length ) return gravityMenu; + gravityMenu = m; + return options; + }; + + options.filterMenu = function ( m ){ + if ( !arguments.length ) return filterMenu; + filterMenu = m; + return options; + }; + + options.modeMenu = function ( m ){ + if ( !arguments.length ) return modeMenu; + modeMenu = m; + return options; + }; + + options.charge = function ( p ){ + if ( !arguments.length ) return charge; + charge = +p; + return options; + }; + + options.classDistance = function ( p ){ + if ( !arguments.length ) return classDistance; + classDistance = +p; + return options; + }; + + options.compactNotation = function ( p ){ + + if ( !arguments.length ) return compactNotation; + compactNotation = p; + return options; + }; + + options.data = function ( p ){ + if ( !arguments.length ) return data; + data = p; + return options; + }; + + options.datatypeDistance = function ( p ){ + if ( !arguments.length ) return datatypeDistance; + datatypeDistance = +p; + return options; + }; + + options.filterModules = function ( p ){ + if ( !arguments.length ) return filterModules; + filterModules = p; + return options; + }; + + options.graphContainerSelector = function ( p ){ + if ( !arguments.length ) return graphContainerSelector; + graphContainerSelector = p; + return options; + }; + + options.gravity = function ( p ){ + if ( !arguments.length ) return gravity; + gravity = +p; + return options; + }; + + options.height = function ( p ){ + if ( !arguments.length ) return height; + height = +p; + return options; + }; + + options.linkStrength = function ( p ){ + if ( !arguments.length ) return linkStrength; + linkStrength = +p; + return options; + }; + + options.loopDistance = function ( p ){ + if ( !arguments.length ) return loopDistance; + loopDistance = p; + return options; + }; + + options.minMagnification = function ( p ){ + if ( !arguments.length ) return minMagnification; + minMagnification = +p; + return options; + }; + + options.maxMagnification = function ( p ){ + if ( !arguments.length ) return maxMagnification; + maxMagnification = +p; + return options; + }; + + options.scaleNodesByIndividuals = function ( p ){ + if ( !arguments.length ) return scaleNodesByIndividuals; + scaleNodesByIndividuals = p; + return options; + }; + + options.selectionModules = function ( p ){ + if ( !arguments.length ) return selectionModules; + selectionModules = p; + return options; + }; + + options.width = function ( p ){ + if ( !arguments.length ) return width; + width = +p; + return options; + }; + + options.literalFilter = function ( p ){ + if ( !arguments.length ) return literalFilter; + literalFilter = p; + return options; + }; + options.nodeDegreeFilter = function ( p ){ + if ( !arguments.length ) return nodeDegreeFilter; + nodeDegreeFilter = p; + return options; + }; + + options.loadingModule = function ( p ){ + if ( !arguments.length ) return loadingModule; + loadingModule = p; + return options; + }; + + // define url loadable options; + // update all set values in the default object + options.setOptionsFromURL = function ( opts, changeEditFlag ){ + if ( opts.sidebar !== undefined ) sidebar.showSidebar(parseInt(opts.sidebar), true); + if ( opts.doc ) { + var asInt = parseInt(opts.doc); + filterMenu.setDegreeSliderValue(asInt); + graphObject.setGlobalDOF(asInt); + // reset the value to be -1; + defaultOptionsConfig.doc = -1; + } + var settingFlag = false; + if ( opts.editorMode ) { + if ( opts.editorMode === "true" ) settingFlag = true; + d3.select("#editorModeModuleCheckbox").node().checked = settingFlag; + + if ( changeEditFlag && changeEditFlag === true ) { + graphObject.editorMode(settingFlag); + } + + // update config object + defaultOptionsConfig.editorMode = opts.editorMode; + + } + if ( opts.cd ) { // class distance + options.classDistance(opts.cd); // class distance + defaultOptionsConfig.cd = opts.cd; + } + if ( opts.dd ) { // data distance + options.datatypeDistance(opts.dd); + defaultOptionsConfig.cd = opts.cd; + } + if ( opts.cd || opts.dd ) options.gravityMenu().reset(); // reset the values so the slider is updated; + + + settingFlag = false; + if ( opts.filter_datatypes ) { + if ( opts.filter_datatypes === "true" ) settingFlag = true; + filterMenu.setCheckBoxValue("datatypeFilterCheckbox", settingFlag); + defaultOptionsConfig.filter_datatypes = opts.filter_datatypes; + } + if ( opts.debugFeatures ) { + if ( opts.debugFeatures === "true" ) settingFlag = true; + hideDebugOptions = settingFlag; + if ( options.getHideDebugFeatures() === false ) { + options.executeHiddenDebugFeatuers(); + } + defaultOptionsConfig.debugFeatures = opts.debugFeatures; + } + + settingFlag = false; + if ( opts.filter_objectProperties ) { + if ( opts.filter_objectProperties === "true" ) settingFlag = true; + filterMenu.setCheckBoxValue("objectPropertyFilterCheckbox", settingFlag); + defaultOptionsConfig.filter_objectProperties = opts.filter_objectProperties; + } + settingFlag = false; + if ( opts.filter_sco ) { + if ( opts.filter_sco === "true" ) settingFlag = true; + filterMenu.setCheckBoxValue("subclassFilterCheckbox", settingFlag); + defaultOptionsConfig.filter_sco = opts.filter_sco; + } + settingFlag = false; + if ( opts.filter_disjoint ) { + if ( opts.filter_disjoint === "true" ) settingFlag = true; + filterMenu.setCheckBoxValue("disjointFilterCheckbox", settingFlag); + defaultOptionsConfig.filter_disjoint = opts.filter_disjoint; + } + settingFlag = false; + if ( opts.filter_setOperator ) { + if ( opts.filter_setOperator === "true" ) settingFlag = true; + filterMenu.setCheckBoxValue("setoperatorFilterCheckbox", settingFlag); + defaultOptionsConfig.filter_setOperator = opts.filter_setOperator; + } + filterMenu.updateSettings(); + + // modesMenu + settingFlag = false; + if ( opts.mode_dynamic ) { + if ( opts.mode_dynamic === "true" ) settingFlag = true; + modeMenu.setDynamicLabelWidth(settingFlag); + dynamicLabelWidth = settingFlag; + defaultOptionsConfig.mode_dynamic = opts.mode_dynamic; + } + // settingFlag=false; + // THIS SHOULD NOT BE SET USING THE OPTIONS ON THE URL + // if (opts.mode_picnpin) { + // graph.options().filterMenu().setCheckBoxValue("pickandpin ModuleCheckbox", settingFlag); + // } + + settingFlag = false; + if ( opts.mode_pnp ) { + if ( opts.mode_pnp === "true" ) settingFlag = true; + modeMenu.setCheckBoxValue("pickandpinModuleCheckbox", settingFlag); + defaultOptionsConfig.mode_pnp = opts.mode_pnp; + } + + settingFlag = false; + if ( opts.mode_scaling ) { + if ( opts.mode_scaling === "true" ) settingFlag = true; + modeMenu.setCheckBoxValue("nodescalingModuleCheckbox", settingFlag); + defaultOptionsConfig.mode_scaling = opts.mode_scaling; + } + + settingFlag = false; + if ( opts.mode_compact ) { + if ( opts.mode_compact === "true" ) settingFlag = true; + modeMenu.setCheckBoxValue("compactnotationModuleCheckbox", settingFlag); + defaultOptionsConfig.mode_compact = opts.mode_compact; + } + + settingFlag = false; + if ( opts.mode_colorExt ) { + if ( opts.mode_colorExt === "true" ) settingFlag = true; + modeMenu.setCheckBoxValue("colorexternalsModuleCheckbox", settingFlag); + defaultOptionsConfig.mode_colorExt = opts.mode_colorExt; + } + + settingFlag = false; + if ( opts.mode_multiColor ) { + if ( opts.mode_multiColor === "true" ) settingFlag = true; + modeMenu.setColorSwitchStateUsingURL(settingFlag); + defaultOptionsConfig.mode_multiColor = opts.mode_multiColor; + } + modeMenu.updateSettingsUsingURL(); + options.rectangularRepresentation(opts.rect); + }; + + return options; + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), +/* 65 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {var OwlDisjointWith = __webpack_require__(46); + var attributeParser = __webpack_require__(66)(); + var equivalentPropertyMerger = __webpack_require__(67)(); + var nodePrototypeMap = __webpack_require__(5)(); + var propertyPrototypeMap = __webpack_require__(40)(); + + /** + * Encapsulates the parsing and preparation logic of the input data. + * @param graph the graph object that will be passed to the elements + * @returns {{}} + */ + module.exports = function ( graph ){ + var parser = {}, + nodes, + properties, + classMap, + settingsData, + settingsImported = false, + settingsImportGraphZoomAndTranslation = false, + dictionary = [], + propertyMap; + + parser.getDictionary = function (){ + return dictionary; + }; + + parser.setDictionary = function ( d ){ + dictionary = d; + }; + + parser.settingsImported = function (){ + return settingsImported; + }; + parser.settingsImportGraphZoomAndTranslation = function (){ + return settingsImportGraphZoomAndTranslation; + }; + + parser.parseSettings = function (){ + settingsImported = true; + settingsImportGraphZoomAndTranslation = false; + + if ( !settingsData ) { + settingsImported = false; + return; + } + /** global settings **********************************************************/ + if ( settingsData.global ) { + if ( settingsData.global.zoom ) { + var zoomFactor = settingsData.global.zoom; + graph.setZoom(zoomFactor); + settingsImportGraphZoomAndTranslation = true; + } + + if ( settingsData.global.translation ) { + var translation = settingsData.global.translation; + graph.setTranslation(translation); + settingsImportGraphZoomAndTranslation = true; + } + + if ( settingsData.global.paused ) { + var paused = settingsData.global.paused; + graph.options().pausedMenu().setPauseValue(paused); + } + } + /** Gravity Settings **********************************************************/ + if ( settingsData.gravity ) { + if ( settingsData.gravity.classDistance ) { + var classDistance = settingsData.gravity.classDistance; + graph.options().classDistance(classDistance); + } + if ( settingsData.gravity.datatypeDistance ) { + var datatypeDistance = settingsData.gravity.datatypeDistance; + graph.options().datatypeDistance(datatypeDistance); + } + graph.options().gravityMenu().reset(); // reads the options values and sets the gui values + } + + + // shared variable declaration + + var i; + var id; + var checked; + /** Filter Settings **********************************************************/ + if ( settingsData.filter ) { + // checkbox settings + if ( settingsData.filter.checkBox ) { + var filter_cb = settingsData.filter.checkBox; + for ( i = 0; i < filter_cb.length; i++ ) { + id = filter_cb[i].id; + checked = filter_cb[i].checked; + graph.options().filterMenu().setCheckBoxValue(id, checked); + } + } + // node degree filter settings + if ( settingsData.filter.degreeSliderValue ) { + var degreeSliderValue = settingsData.filter.degreeSliderValue; + graph.options().filterMenu().setDegreeSliderValue(degreeSliderValue); + } + graph.options().filterMenu().updateSettings(); + } + + /** Modes Setting **********************************************************/ + if ( settingsData.modes ) { + // checkbox settings + if ( settingsData.modes.checkBox ) { + var modes_cb = settingsData.modes.checkBox; + for ( i = 0; i < modes_cb.length; i++ ) { + id = modes_cb[i].id; + checked = modes_cb[i].checked; + graph.options().modeMenu().setCheckBoxValue(id, checked); + } + } + // color switch settings + var state = settingsData.modes.colorSwitchState; + // state could be undefined + if ( state === true || state === false ) { + graph.options().modeMenu().setColorSwitchState(state); + } + graph.options().modeMenu().updateSettings(); + } + graph.updateStyle(); // updates graph representation(setting charges and distances) + }; + + + /** + * Parses the ontology data and preprocesses it (e.g. connecting inverse properties and so on). + * @param ontologyData the loaded ontology json file + */ + parser.parse = function ( ontologyData ){ + if ( !ontologyData ) { + nodes = []; + properties = []; + dictionary = []; + return; + } + dictionary = []; + if ( ontologyData.settings ) settingsData = ontologyData.settings; + else settingsData = undefined; + + var classes = combineClasses(ontologyData.class, ontologyData.classAttribute), + datatypes = combineClasses(ontologyData.datatype, ontologyData.datatypeAttribute), + combinedClassesAndDatatypes = classes.concat(datatypes), + unparsedProperties = ontologyData.property || [], + combinedProperties; + + // Inject properties for unions, intersections, ... + addSetOperatorProperties(combinedClassesAndDatatypes, unparsedProperties); + combinedProperties = combineProperties(unparsedProperties, ontologyData.propertyAttribute); + classMap = mapElements(combinedClassesAndDatatypes); + propertyMap = mapElements(combinedProperties); + mergeRangesOfEquivalentProperties(combinedProperties, combinedClassesAndDatatypes); + + // Process the graph data + convertTypesToIris(combinedClassesAndDatatypes, ontologyData.namespace); + convertTypesToIris(combinedProperties, ontologyData.namespace); + nodes = createNodeStructure(combinedClassesAndDatatypes, classMap); + properties = createPropertyStructure(combinedProperties, classMap, propertyMap); + }; + + /** + * @return {Array} the preprocessed nodes + */ + parser.nodes = function (){ + return nodes; + }; + + /** + * @returns {Array} the preprocessed properties + */ + parser.properties = function (){ + return properties; + }; + + /** + * Combines the passed objects with its attributes and prototypes. This also applies + * attributes defined in the base of the prototype. + */ + function combineClasses( baseObjects, attributes ){ + var combinations = []; + var prototypeMap = createLowerCasePrototypeMap(nodePrototypeMap); + + if ( baseObjects ) { + baseObjects.forEach(function ( element ){ + var matchingAttribute; + + if ( attributes ) { + // Look for an attribute with the same id and merge them + for ( var i = 0; i < attributes.length; i++ ) { + var attribute = attributes[i]; + if ( element.id === attribute.id ) { + matchingAttribute = attribute; + break; + } + } + addAdditionalAttributes(element, matchingAttribute); + } + + // Then look for a prototype to add its properties + var Prototype = prototypeMap.get(element.type.toLowerCase()); + + if ( Prototype ) { + addAdditionalAttributes(element, Prototype); // TODO might be unnecessary + + var node = new Prototype(graph); + node.annotations(element.annotations) + .baseIri(element.baseIri) + .comment(element.comment) + .complement(element.complement) + .disjointUnion(element.disjointUnion) + .description(element.description) + .equivalents(element.equivalent) + .id(element.id) + .intersection(element.intersection) + .label(element.label) + // .type(element.type) Ignore, because we predefined it + .union(element.union) + .iri(element.iri); + if ( element.pos ) { + node.x = element.pos[0]; + node.y = element.pos[1]; + node.px = node.x; + node.py = node.y; + } + //class element pin + var elementPinned = element.pinned; + if ( elementPinned === true ) { + node.pinned(true); + graph.options().pickAndPinModule().addPinnedElement(node); + } + // Create node objects for all individuals + if ( element.individuals ) { + element.individuals.forEach(function ( individual ){ + var individualNode = new Prototype(graph); + individualNode.label(individual.labels) + .iri(individual.iri); + + node.individuals().push(individualNode); + }); + } + + if ( element.attributes ) { + var deduplicatedAttributes = d3.set(element.attributes.concat(node.attributes())); + node.attributes(deduplicatedAttributes.values()); + } + combinations.push(node); + } else { + console.error("Unknown element type: " + element.type); + } + }); + } + + return combinations; + } + + function combineProperties( baseObjects, attributes ){ + var combinations = []; + var prototypeMap = createLowerCasePrototypeMap(propertyPrototypeMap); + + if ( baseObjects ) { + baseObjects.forEach(function ( element ){ + var matchingAttribute; + + if ( attributes ) { + // Look for an attribute with the same id and merge them + for ( var i = 0; i < attributes.length; i++ ) { + var attribute = attributes[i]; + if ( element.id === attribute.id ) { + matchingAttribute = attribute; + break; + } + } + addAdditionalAttributes(element, matchingAttribute); + } + + // Then look for a prototype to add its properties + var Prototype = prototypeMap.get(element.type.toLowerCase()); + + if ( Prototype ) { + // Create the matching object and set the properties + var property = new Prototype(graph); + property.annotations(element.annotations) + .baseIri(element.baseIri) + .cardinality(element.cardinality) + .comment(element.comment) + .domain(element.domain) + .description(element.description) + .equivalents(element.equivalent) + .id(element.id) + .inverse(element.inverse) + .label(element.label) + .minCardinality(element.minCardinality) + .maxCardinality(element.maxCardinality) + .range(element.range) + .subproperties(element.subproperty) + .superproperties(element.superproperty) + // .type(element.type) Ignore, because we predefined it + .iri(element.iri); + + // adding property position + if ( element.pos ) { + property.x = element.pos[0]; + property.y = element.pos[1]; + property.px = element.pos[0]; + property.py = element.pos[1]; + } + var elementPinned = element.pinned; + if ( elementPinned === true ) { + property.pinned(true); + graph.options().pickAndPinModule().addPinnedElement(property); + } + + + if ( element.attributes ) { + var deduplicatedAttributes = d3.set(element.attributes.concat(property.attributes())); + property.attributes(deduplicatedAttributes.values()); + } + combinations.push(property); + } else { + console.error("Unknown element type: " + element.type); + } + + }); + } + + return combinations; + } + + function createLowerCasePrototypeMap( prototypeMap ){ + return d3.map(prototypeMap.values(), function ( Prototype ){ + return new Prototype().type().toLowerCase(); + }); + } + + function mergeRangesOfEquivalentProperties( properties, nodes ){ + // pass clones of arrays into the merger to keep the current functionality of this module + var newNodes = equivalentPropertyMerger.merge(properties.slice(), nodes.slice(), propertyMap, classMap, graph); + + // replace all the existing nodes and map the nodes again + nodes.length = 0; + Array.prototype.push.apply(nodes, newNodes); + classMap = mapElements(nodes); + } + + /** + * Checks all attributes which have to be rewritten. + * For example: + * <b>equivalent</b> is filled with only ID's of the corresponding nodes. It would be better to used the + * object instead of the ID so we swap the ID's with the correct object reference and can delete it from drawing + * because it is not necessary. + */ + function createNodeStructure( rawNodes, classMap ){ + var nodes = []; + + // Set the default values + var maxIndividualCount = 0; + rawNodes.forEach(function ( node ){ + maxIndividualCount = Math.max(maxIndividualCount, node.individuals().length); + node.visible(true); + }); + + rawNodes.forEach(function ( node ){ + // Merge and connect the equivalent nodes + processEquivalentIds(node, classMap); + + attributeParser.parseClassAttributes(node); + + node.maxIndividualCount(maxIndividualCount); + }); + + // Collect all nodes that should be displayed + rawNodes.forEach(function ( node ){ + if ( node.visible() ) { + nodes.push(node); + } + }); + + return nodes; + } + + /** + * Sets the disjoint attribute of the nodes if a disjoint label is found. + * @param property + */ + function processDisjoints( property ){ + if ( property instanceof OwlDisjointWith === false ) { + return; + } + + var domain = property.domain(), + range = property.range(); + + // Check the domain. + if ( !domain.disjointWith() ) { + domain.disjointWith([]); + } + + // Check the range. + if ( !range.disjointWith() ) { + range.disjointWith([]); + } + + domain.disjointWith().push(property.range()); + range.disjointWith().push(property.domain()); + } + + /** + * Connect all properties and also their sub- and superproperties. + * We iterate over the rawProperties array because it is way faster than iterating + * over an object and its attributes. + * + * @param rawProperties the properties + * @param classMap a map of all classes + * @param propertyMap the properties in a map + */ + function createPropertyStructure( rawProperties, classMap, propertyMap ){ + var properties = []; + // Set default values + rawProperties.forEach(function ( property ){ + property.visible(true); + }); + + // Connect properties + rawProperties.forEach(function ( property ){ + var domain, + range, + domainObject, + rangeObject, + inverse; + + /* Skip properties that have no information about their domain and range, like + inverse properties with optional inverse and optional domain and range attributes */ + if ( (property.domain() && property.range()) || property.inverse() ) { + + var inversePropertyId = findId(property.inverse()); + // Look if an inverse property exists + if ( inversePropertyId ) { + inverse = propertyMap[inversePropertyId]; + if ( !inverse ) { + console.warn("No inverse property was found for id: " + inversePropertyId); + property.inverse(undefined); + } + } + + // Either domain and range are set on this property or at the inverse + if ( typeof property.domain() !== "undefined" && typeof property.range() !== "undefined" ) { + domain = findId(property.domain()); + range = findId(property.range()); + + domainObject = classMap[domain]; + rangeObject = classMap[range]; + } else if ( inverse ) { + // Domain and range need to be switched + domain = findId(inverse.range()); + range = findId(inverse.domain()); + + domainObject = classMap[domain]; + rangeObject = classMap[range]; + } else { + console.warn("Domain and range not found for property: " + property.id()); + } + + // Set the references on this property + property.domain(domainObject); + property.range(rangeObject); + + // Also set the attributes of the inverse property + if ( inverse ) { + property.inverse(inverse); + inverse.inverse(property); + + // Switch domain and range + inverse.domain(rangeObject); + inverse.range(domainObject); + } + } + // Reference sub- and superproperties + referenceSubOrSuperProperties(property.subproperties()); + referenceSubOrSuperProperties(property.superproperties()); + }); + + // Merge equivalent properties and process disjoints. + rawProperties.forEach(function ( property ){ + processEquivalentIds(property, propertyMap); + processDisjoints(property); + + attributeParser.parsePropertyAttributes(property); + }); + // Add additional information to the properties + rawProperties.forEach(function ( property ){ + // Properties of merged classes should point to/from the visible equivalent class + var propertyWasRerouted = false; + + if ( property.domain() === undefined ) { + console.warn("No Domain was found for id:" + property.id()); + return; + } + + if ( wasNodeMerged(property.domain()) ) { + property.domain(property.domain().equivalentBase()); + propertyWasRerouted = true; + } + if ( property.range() === undefined ) { + console.warn("No range was found for id:" + property.id()); + return; + } + if ( wasNodeMerged(property.range()) ) { + property.range(property.range().equivalentBase()); + propertyWasRerouted = true; + } + // But there should not be two equal properties between the same domain and range + var equalProperty = getOtherEqualProperty(rawProperties, property); + + if ( propertyWasRerouted && equalProperty ) { + property.visible(false); + + equalProperty.redundantProperties().push(property); + } + + // Hide property if source or target node is hidden + if ( !property.domain().visible() || !property.range().visible() ) { + property.visible(false); + } + + // Collect all properties that should be displayed + if ( property.visible() ) { + properties.push(property); + } + }); + return properties; + } + + function referenceSubOrSuperProperties( subOrSuperPropertiesArray ){ + var i, l; + + if ( !subOrSuperPropertiesArray ) { + return; + } + + for ( i = 0, l = subOrSuperPropertiesArray.length; i < l; ++i ) { + var subOrSuperPropertyId = findId(subOrSuperPropertiesArray[i]); + var subOrSuperProperty = propertyMap[subOrSuperPropertyId]; + + if ( subOrSuperProperty ) { + // Replace id with object + subOrSuperPropertiesArray[i] = subOrSuperProperty; + } else { + console.warn("No sub-/superproperty was found for id: " + subOrSuperPropertyId); + } + } + } + + function wasNodeMerged( node ){ + return !node.visible() && node.equivalentBase(); + } + + function getOtherEqualProperty( properties, referenceProperty ){ + var i, l, property; + + for ( i = 0, l = properties.length; i < l; i++ ) { + property = properties[i]; + + if ( referenceProperty === property ) { + continue; + } + if ( referenceProperty.domain() !== property.domain() || + referenceProperty.range() !== property.range() ) { + continue; + } + + // Check for an equal IRI, if non existent compare label and type + if ( referenceProperty.iri() && property.iri() ) { + if ( referenceProperty.iri() === property.iri() ) { + return property; + } + } else if ( referenceProperty.type() === property.type() && + referenceProperty.defaultLabel() === property.defaultLabel() ) { + return property; + } + } + + return undefined; + } + + /** + * Generates and adds properties for links to set operators. + * @param classes unprocessed classes + * @param properties unprocessed properties + */ + function addSetOperatorProperties( classes, properties ){ + function addProperties( domainId, rangeIds, operatorType ){ + if ( !rangeIds ) { + return; + } + + rangeIds.forEach(function ( rangeId, index ){ + var property = { + id: "GENERATED-" + operatorType + "-" + domainId + "-" + rangeId + "-" + index, + type: "setOperatorProperty", + domain: domainId, + range: rangeId + }; + + properties.push(property); + }); + } + + classes.forEach(function ( clss ){ + addProperties(clss.id(), clss.complement(), "COMPLEMENT"); + addProperties(clss.id(), clss.intersection(), "INTERSECTION"); + addProperties(clss.id(), clss.union(), "UNION"); + addProperties(clss.id(), clss.disjointUnion(), "DISJOINTUNION"); + }); + } + + /** + * Replaces the ids of equivalent nodes/properties with the matching objects, cross references them + * and tags them as processed. + * @param element a node or a property + * @param elementMap a map where nodes/properties can be looked up + */ + function processEquivalentIds( element, elementMap ){ + var eqIds = element.equivalents(); + + if ( !eqIds || element.equivalentBase() ) { + return; + } + + // Replace ids with the corresponding objects + for ( var i = 0, l = eqIds.length; i < l; ++i ) { + var eqId = findId(eqIds[i]); + var eqObject = elementMap[eqId]; + + if ( eqObject ) { + // Cross reference both objects + eqObject.equivalents(eqObject.equivalents()); + eqObject.equivalents().push(element); + eqObject.equivalentBase(element); + eqIds[i] = eqObject; + + // Hide other equivalent nodes + eqObject.visible(false); + } else { + console.warn("No class/property was found for equivalent id: " + eqId); + } + } + } + + /** + * Tries to convert the type to an iri and sets it. + * @param elements classes or properties + * @param namespaces an array of namespaces + */ + function convertTypesToIris( elements, namespaces ){ + elements.forEach(function ( element ){ + if ( typeof element.iri() === "string" ) { + element.iri(replaceNamespace(element.iri(), namespaces)); + } + }); + } + + /** + * Creates a map by mapping the array with the passed function. + * @param array the array + * @returns {{}} + */ + function mapElements( array ){ + var map = {}; + for ( var i = 0, length = array.length; i < length; i++ ) { + var element = array[i]; + map[element.id()] = element; + } + return map; + } + + /** + * Adds the attributes of the additional object to the base object, but doesn't + * overwrite existing ones. + * + * @param base the base object + * @param addition the object with additional data + * @returns the combination is also returned + */ + function addAdditionalAttributes( base, addition ){ + // Check for an undefined value + addition = addition || {}; + + for ( var addAttribute in addition ) { + // Add the attribute if it doesn't exist + if ( !(addAttribute in base) && addition.hasOwnProperty(addAttribute) ) { + base[addAttribute] = addition[addAttribute]; + } + } + return base; + } + + /** + * Replaces the namespace (and the separator) if one exists and returns the new value. + * @param address the address with a namespace in it + * @param namespaces an array of namespaces + * @returns {string} the processed address with the (possibly) replaced namespace + */ + function replaceNamespace( address, namespaces ){ + var separatorIndex = address.indexOf(":"); + if ( separatorIndex === -1 ) { + return address; + } + var namespaceName = address.substring(0, separatorIndex); + + for ( var i = 0, length = namespaces.length; i < length; ++i ) { + var namespace = namespaces[i]; + if ( namespaceName === namespace.name ) { + return namespace.iri + address.substring(separatorIndex + 1); + } + } + + return address; + } + + /** + * Looks whether the passed object is already the id or if it was replaced + * with the object that belongs to the id. + * @param object an id, a class or a property + * @returns {string} the id of the passed object or undefined + */ + function findId( object ){ + if ( !object ) { + return undefined; + } else if ( typeof object === "string" ) { + return object; + } else if ( "id" in object ) { + return object.id(); + } else { + console.warn("No Id was found for this object: " + object); + return undefined; + } + } + + return parser; + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), +/* 66 */ +/***/ (function(module, exports) { + + /** + * Parses the attributes an element has and sets the corresponding attributes. + * @returns {Function} + */ + module.exports = (function (){ + var attributeParser = {}, + // Style + ANONYMOUS = "anonymous", + DATATYPE = "datatype", + DEPRECATED = "deprecated", + EXTERNAL = "external", + OBJECT = "object", + RDF = "rdf", + // Representations + ASYMMETRIC = "asymmetric", + FUNCTIONAL = "functional", + INVERSE_FUNCTIONAL = "inverse functional", + IRREFLEXIVE = "irreflexive", + KEY = "key", + REFLEXIVE = "reflexive", + SYMMETRIC = "symmetric", + TRANSITIVE = "transitive", + // Attribute groups + VISUAL_ATTRIBUTE_GROUPS = [ + [DEPRECATED, DATATYPE, OBJECT, RDF], + [ANONYMOUS] + ], + CLASS_INDICATIONS = [DEPRECATED, EXTERNAL], + PROPERTY_INDICATIONS = [ASYMMETRIC, FUNCTIONAL, INVERSE_FUNCTIONAL, IRREFLEXIVE, KEY, REFLEXIVE, SYMMETRIC, + TRANSITIVE]; + + /** + * Parses and sets the attributes of a class. + * @param clazz + */ + attributeParser.parseClassAttributes = function ( clazz ){ + if ( !(clazz.attributes() instanceof Array) ) { + return; + } + + parseVisualAttributes(clazz); + parseClassIndications(clazz); + }; + + function parseVisualAttributes( element ){ + VISUAL_ATTRIBUTE_GROUPS.forEach(function ( attributeGroup ){ + setVisualAttributeOfGroup(element, attributeGroup); + }); + } + + function setVisualAttributeOfGroup( element, group ){ + var i, l, attribute; + + for ( i = 0, l = group.length; i < l; i++ ) { + attribute = group[i]; + if ( element.attributes().indexOf(attribute) >= 0 ) { + element.visualAttributes().push(attribute); + + // Just a single attribute is possible + break; + } + } + } + + function parseClassIndications( clazz ){ + var i, l, indication; + + for ( i = 0, l = CLASS_INDICATIONS.length; i < l; i++ ) { + indication = CLASS_INDICATIONS[i]; + + if ( clazz.attributes().indexOf(indication) >= 0 ) { + clazz.indications().push(indication); + } + } + } + + /** + * Parses and sets the attributes of a property. + * @param property + */ + attributeParser.parsePropertyAttributes = function ( property ){ + if ( !(property.attributes() instanceof Array) ) { + return; + } + + parseVisualAttributes(property); + parsePropertyIndications(property); + }; + + function parsePropertyIndications( property ){ + var i, l, indication; + + for ( i = 0, l = PROPERTY_INDICATIONS.length; i < l; i++ ) { + indication = PROPERTY_INDICATIONS[i]; + + if ( property.attributes().indexOf(indication) >= 0 ) { + property.indications().push(indication); + } + } + } + + + return function (){ + // Return a function to keep module interfaces consistent + return attributeParser; + }; + })(); + + +/***/ }), +/* 67 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {var OwlThing = __webpack_require__(31); + var RdfsLiteral = __webpack_require__(38); + var elementTools = __webpack_require__(63)(); + + var equivalentPropertyMerger = {}; + module.exports = function (){ + return equivalentPropertyMerger; + }; + + var PREFIX = "GENERATED-MERGED_RANGE-"; + var OBJECT_PROPERTY_DEFAULT_RANGE_TYPE = "owl:Thing"; + var DATA_PROPERTY_DEFAULT_RANGE_TYPE = "rdfs:Literal"; + + + equivalentPropertyMerger.merge = function ( properties, nodes, propertyMap, nodeMap, graph ){ + var totalNodeIdsToHide = d3.set(); + var processedPropertyIds = d3.set(); + var mergeNodes = []; + + for ( var i = 0; i < properties.length; i++ ) { + var property = properties[i]; + var equivalents = property.equivalents().map(createIdToPropertyMapper(propertyMap)); + + if ( equivalents.length === 0 || processedPropertyIds.has(property.id()) ) { + continue; + } + + var propertyWithEquivalents = equivalents.concat(property); + + var mergeNode = findMergeNode(propertyWithEquivalents, nodeMap); + if ( !mergeNode ) { + if ( mergeNode !== undefined ) { + mergeNode = createDefaultMergeNode(property, graph); + mergeNodes.push(mergeNode); + } + } + + var nodeIdsToHide = replaceRangesAndCollectNodesToHide(propertyWithEquivalents, mergeNode, properties, + processedPropertyIds); + for ( var j = 0; j < nodeIdsToHide.length; j++ ) { + totalNodeIdsToHide.add(nodeIdsToHide[j]); + } + } + + return filterVisibleNodes(nodes.concat(mergeNodes), totalNodeIdsToHide); + }; + + + function createIdToPropertyMapper( propertyMap ){ + return function ( id ){ + return propertyMap[id]; + }; + } + + function findMergeNode( propertyWithEquivalents, nodeMap ){ + var typeMap = mapPropertiesRangesToType(propertyWithEquivalents, nodeMap); + var typeSet = d3.set(typeMap.keys()); + + // default types are the fallback values and should be ignored for the type determination + typeSet.remove(OBJECT_PROPERTY_DEFAULT_RANGE_TYPE); + typeSet.remove(DATA_PROPERTY_DEFAULT_RANGE_TYPE); + + // exactly one type to chose from -> take the node of this type as range + if ( typeSet.size() === 1 ) { + var type = typeSet.values()[0]; + var ranges = typeMap.get(type); + + if ( ranges.length === 1 ) { + return ranges[0]; + } + } + } + + function mapPropertiesRangesToType( properties, nodeMap ){ + var typeMap = d3.map(); + + properties.forEach(function ( property ){ + if ( property === undefined ) //@ WORKAROUND + return; + + var range = nodeMap[property.range()]; + var type = range.type(); + + if ( !typeMap.has(type) ) { + typeMap.set(type, []); + } + + typeMap.get(type).push(range); + }); + + return typeMap; + } + + function createDefaultMergeNode( property, graph ){ + var range; + + if ( elementTools.isDatatypeProperty(property) ) { + range = new RdfsLiteral(graph); + } else { + range = new OwlThing(graph); + } + range.id(PREFIX + property.id()); + + return range; + } + + function replaceRangesAndCollectNodesToHide( propertyWithEquivalents, mergeNode, properties, processedPropertyIds ){ + var nodesToHide = []; + + propertyWithEquivalents.forEach(function ( property ){ + + if ( property === undefined || mergeNode === undefined ) // @ WORKAROUND + return; + var oldRangeId = property.range(); + property.range(mergeNode.id()); + if ( !isDomainOrRangeOfOtherProperty(oldRangeId, properties) ) { + nodesToHide.push(oldRangeId); + } + + processedPropertyIds.add(property.id()); + }); + + return nodesToHide; + } + + function isDomainOrRangeOfOtherProperty( nodeId, properties ){ + for ( var i = 0; i < properties.length; i++ ) { + var property = properties[i]; + if ( property.domain() === nodeId || property.range() === nodeId ) { + return true; + } + } + + return false; + } + + function filterVisibleNodes( nodes, nodeIdsToHide ){ + var filteredNodes = []; + + nodes.forEach(function ( node ){ + if ( !nodeIdsToHide.has(node.id()) ) { + filteredNodes.push(node); + } + }); + + return filteredNodes; + } + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), +/* 68 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {module.exports = function ( graph ){ + /** variable defs **/ + var Class_dragger = {}; + Class_dragger.nodeId = 10001; + Class_dragger.parent = undefined; + Class_dragger.x = 0; + Class_dragger.y = 0; + Class_dragger.rootElement = undefined; + Class_dragger.rootNodeLayer = undefined; + Class_dragger.pathLayer = undefined; + Class_dragger.mouseEnteredVar = false; + Class_dragger.mouseButtonPressed = false; + Class_dragger.nodeElement = undefined; + Class_dragger.draggerObject = undefined; + Class_dragger.pathElement = undefined; + Class_dragger.typus = "Class_dragger"; + + Class_dragger.type = function (){ + return Class_dragger.typus; + }; + + Class_dragger.parentNode = function (){ + return Class_dragger.parent; + }; + + Class_dragger.hideClass_dragger = function ( val ){ + Class_dragger.pathElement.classed("hidden", val); + Class_dragger.nodeElement.classed("hidden", val); + Class_dragger.draggerObject.classed("hidden", val); + }; + + Class_dragger.setParentNode = function ( parentNode ){ + Class_dragger.parent = parentNode; + + if ( Class_dragger.mouseButtonPressed === false ) { + if ( Class_dragger.parent.actualRadius && Class_dragger.parent.actualRadius() ) { + Class_dragger.x = Class_dragger.parent.x + 10 + Class_dragger.parent.actualRadius(); + Class_dragger.y = Class_dragger.parent.y + 10 + Class_dragger.parent.actualRadius(); + } else { + Class_dragger.x = Class_dragger.parent.x + 60; + Class_dragger.y = Class_dragger.parent.y + 60; + } + } + Class_dragger.updateElement(); + }; + + Class_dragger.hideDragger = function ( val ){ + if ( Class_dragger.pathElement ) Class_dragger.pathElement.classed("hidden", val); + if ( Class_dragger.nodeElement ) Class_dragger.nodeElement.classed("hidden", val); + if ( Class_dragger.draggerObject ) Class_dragger.draggerObject.classed("hidden", val); + + }; + /** BASE HANDLING FUNCTIONS ------------------------------------------------- **/ + Class_dragger.id = function ( index ){ + if ( !arguments.length ) { + return Class_dragger.nodeId; + } + Class_dragger.nodeId = index; + }; + + Class_dragger.svgPathLayer = function ( layer ){ + Class_dragger.pathLayer = layer.append('g'); + }; + + Class_dragger.svgRoot = function ( root ){ + if ( !arguments.length ) + return Class_dragger.rootElement; + Class_dragger.rootElement = root; + Class_dragger.rootNodeLayer = Class_dragger.rootElement.append('g'); + Class_dragger.addMouseEvents(); + }; + + /** DRAWING FUNCTIONS ------------------------------------------------- **/ + Class_dragger.drawNode = function (){ + Class_dragger.pathElement = Class_dragger.pathLayer.append('line') + .classed("classNodeDragPath", true); + Class_dragger.pathElement.attr("x1", 0) + .attr("y1", 0) + .attr("x2", 0) + .attr("y2", 0); + + // var lineData = [ + // {"x": 0, "y": 0}, + // {"x": 0, "y": 40}, + // {"x": -40, "y": 0}, + // {"x": 0, "y": -40}, + // {"x": 0, "y": 0} + // ]; + + var lineData = [ + { "x": -40, "y": 0 }, // start + { "x": -20, "y": -10 }, + { "x": 20, "y": -50 }, + { "x": -10, "y": 0 }, // center + { "x": 20, "y": 50 }, + { "x": -20, "y": 10 }, + { "x": -40, "y": 0 } + ]; + + + var lineFunction = d3.svg.line() + .x(function ( d ){ + return d.x; + }) + .y(function ( d ){ + return d.y; + }) + .interpolate("basis-closed"); + var pathData = "M 20,40 C 0,15 0,-15 20,-40 L -40,0 Z"; + // var pathData="M 20,40 C 0,15 0,-15 20,-40 20,-40 -35.22907,-23.905556 -45.113897,0.06313453 -35.22907,20.095453 20,40 20,40 Z"; + // var pathData="M 39.107144,51.25 C 0,17.362169 0,-13.75 39.285715,-49.821429 c 0,0 -69.58321,34.511175 -100.714286,50.35714329 C -22.96643,20.324376 39.107144,51.25 39.107144,51.25 Z"; + + Class_dragger.nodeElement = Class_dragger.rootNodeLayer.append('path').attr("d", pathData); + Class_dragger.nodeElement.classed("classDraggerNode", true); + Class_dragger.draggerObject = Class_dragger.rootNodeLayer.append("circle"); + if ( graph.options().useAccuracyHelper() ) { + Class_dragger.draggerObject.attr("r", 40) + .attr("cx", 0) + .attr("cy", 0) + .classed("superHiddenElement", true); + Class_dragger.draggerObject.classed("superOpacityElement", !graph.options().showDraggerObject()); + } + + + }; + + Class_dragger.updateElement = function (){ + + // Class_dragger.pathLayer.attr("transform", "translate(" + Class_dragger.x + "," + Class_dragger.y + ")"); + // Class_dragger.rootElement.attr("transform", "translate(" + Class_dragger.x + "," + Class_dragger.y + ")"); + if ( Class_dragger.pathElement ) { + + // compute start point ; + + + var sX = Class_dragger.parent.x, + sY = Class_dragger.parent.y, + eX = Class_dragger.x, + eY = Class_dragger.y; + + + // this is used only when you dont have a proper layout ordering; + var dirX = eX - sX; + var dirY = eY - sY; + var len = Math.sqrt((dirX * dirX) + (dirY * dirY)); + + var nX = dirX / len; + var nY = dirY / len; + + var ppX = sX + nX * Class_dragger.parent.actualRadius(); + var ppY = sY + nY * Class_dragger.parent.actualRadius(); + + var ncx = nX * 15; + var ncy = nY * 15; + Class_dragger.draggerObject.attr("cx", ncx) + .attr("cy", ncy); + + Class_dragger.pathElement.attr("x1", ppX) + .attr("y1", ppY) + .attr("x2", eX) + .attr("y2", eY); + } + var angle = Math.atan2(Class_dragger.parent.y - Class_dragger.y, Class_dragger.parent.x - Class_dragger.x) * 180 / Math.PI; + + Class_dragger.nodeElement.attr("transform", "translate(" + Class_dragger.x + "," + Class_dragger.y + ")" + "rotate(" + angle + ")"); + Class_dragger.draggerObject.attr("transform", "translate(" + Class_dragger.x + "," + Class_dragger.y + ")"); + // console.log("update Elmenent root element"+Class_dragger.x + "," + Class_dragger.y ); + // + // Class_dragger.nodeElement.attr("transform", function (d) { + // return "rotate(" + angle + ")"; + // }); + }; + + /** MOUSE HANDLING FUNCTIONS ------------------------------------------------- **/ + + Class_dragger.addMouseEvents = function (){ + // console.log("adding mouse events"); + Class_dragger.rootNodeLayer.selectAll("*").on("mouseover", Class_dragger.onMouseOver) + .on("mouseout", Class_dragger.onMouseOut) + .on("click", function (){ + }) + .on("dblclick", function (){ + }) + .on("mousedown", Class_dragger.mouseDown) + .on("mouseup", Class_dragger.mouseUp); + }; + + Class_dragger.mouseDown = function (){ + Class_dragger.nodeElement.style("cursor", "move"); + Class_dragger.nodeElement.classed("classDraggerNodeHovered", true); + Class_dragger.mouseButtonPressed = true; + console.log("Mouse DOWN from Dragger"); + }; + + Class_dragger.mouseUp = function (){ + Class_dragger.nodeElement.style("cursor", "auto"); + Class_dragger.mouseButtonPressed = false; + console.log("Mouse UP from Dragger"); + }; + + + Class_dragger.mouseEntered = function ( p ){ + if ( !arguments.length ) return Class_dragger.mouseEnteredVar; + Class_dragger.mouseEnteredVar = p; + return Class_dragger; + }; + + Class_dragger.selectedViaTouch = function ( val ){ + Class_dragger.nodeElement.classed("classDraggerNode", !val); + Class_dragger.nodeElement.classed("classDraggerNodeHovered", val); + + }; + + Class_dragger.onMouseOver = function (){ + if ( Class_dragger.mouseEntered() ) { + return; + } + Class_dragger.nodeElement.classed("classDraggerNode", false); + Class_dragger.nodeElement.classed("classDraggerNodeHovered", true); + var selectedNode = Class_dragger.rootElement.node(), + nodeContainer = selectedNode.parentNode; + nodeContainer.appendChild(selectedNode); + + Class_dragger.mouseEntered(true); + + }; + Class_dragger.onMouseOut = function (){ + if ( Class_dragger.mouseButtonPressed === true ) + return; + Class_dragger.nodeElement.classed("classDraggerNodeHovered", false); + Class_dragger.nodeElement.classed("classDraggerNode", true); + Class_dragger.mouseEntered(false); + }; + + Class_dragger.setPosition = function ( x, y ){ + + Class_dragger.x = x; + Class_dragger.y = y; + Class_dragger.updateElement(); + }; + + Class_dragger.setAdditionalClassForClass_dragger = function ( name, val ){ + // console.log("Class_dragger should sett the class here") + // Class_dragger.nodeElement.classed(name,val); + + }; + return Class_dragger; + }; + + + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), +/* 69 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {module.exports = function ( graph ){ + /** variable defs **/ + var Range_dragger = {}; + Range_dragger.nodeId = 10002; + Range_dragger.parent = undefined; + Range_dragger.x = 0; + Range_dragger.y = 0; + Range_dragger.rootElement = undefined; + Range_dragger.rootNodeLayer = undefined; + Range_dragger.pathLayer = undefined; + Range_dragger.mouseEnteredVar = false; + Range_dragger.mouseButtonPressed = false; + Range_dragger.nodeElement = undefined; + Range_dragger.draggerObject = undefined; + + Range_dragger.pathElement = undefined; + Range_dragger.typus = "Range_dragger"; + + Range_dragger.type = function (){ + return Range_dragger.typus; + }; + + // TODO: We need the endPoint of the Link here! + Range_dragger.parentNode = function (){ + return Range_dragger.parent; + }; + + Range_dragger.hide_dragger = function ( val ){ + Range_dragger.pathElement.classed("hidden", val); + Range_dragger.nodeElement.classed("hidden", val); + Range_dragger.draggerObject.classed("hidden", val); + }; + Range_dragger.hideDragger = function ( val ){ + if ( Range_dragger.pathElement ) Range_dragger.pathElement.classed("hidden", val); + if ( Range_dragger.nodeElement ) Range_dragger.nodeElement.classed("hidden", val); + if ( Range_dragger.draggerObject ) Range_dragger.draggerObject.classed("hidden", val); + + + }; + + Range_dragger.reDrawEverthing = function (){ + Range_dragger.setParentProperty(Range_dragger.parent); + }; + Range_dragger.updateRange = function ( newRange ){ + + if ( graph.genericPropertySanityCheck(Range_dragger.parent.domain(), newRange, + Range_dragger.parent.type(), + "Could not update range", "Restoring previous range") === false ) return; + + // check for triple duplicates! + + if ( graph.propertyCheckExistenceChecker(Range_dragger.parent, Range_dragger.parent.domain(), newRange) === false ) + return; + if ( Range_dragger.parent.labelElement() === undefined ) return; + if ( Range_dragger.parent.labelElement().attr("transform") === "translate(0,15)" || + Range_dragger.parent.labelElement().attr("transform") === "translate(0,-15)" ) { + var prop = Range_dragger.parent; + Range_dragger.parent.inverse().inverse(null); + Range_dragger.parent.inverse(null); + prop.range(newRange); + } + + else { + Range_dragger.parent.range(newRange); + } + // update the position of the new range + var rX = newRange.x; + var rY = newRange.y; + + var dX = Range_dragger.parent.domain().x; + var dY = Range_dragger.parent.domain().y; + + + // center + var cX = 0.49 * (dX + rX); + var cY = 0.49 * (dY + rY); + // put position there; + Range_dragger.parent.labelElement().x = cX; + Range_dragger.parent.labelElement().px = cX; + Range_dragger.parent.labelElement().y = cY; + Range_dragger.parent.labelElement().py = cY; + + }; + + Range_dragger.setParentProperty = function ( parentProperty, inversed ){ + Range_dragger.parent = parentProperty; + var iP; + var renElem; + Range_dragger.isLoopProperty = false; + if ( parentProperty.domain() === parentProperty.range() ) Range_dragger.isLoopProperty = true; + Range_dragger.parent = parentProperty; + renElem = parentProperty.labelObject(); + if ( inversed === true ) { + if ( parentProperty.labelElement() && parentProperty.labelElement().attr("transform") === "translate(0,15)" ) { + iP = renElem.linkDomainIntersection; + if ( renElem.linkDomainIntersection ) { + Range_dragger.x = iP.x; + Range_dragger.y = iP.y; + } + } else { + iP = renElem.linkRangeIntersection; + if ( renElem.linkRangeIntersection ) { + Range_dragger.x = iP.x; + Range_dragger.y = iP.y; + } + } + } + else { + iP = renElem.linkRangeIntersection; + if ( renElem.linkRangeIntersection ) { + Range_dragger.x = iP.x; + Range_dragger.y = iP.y; + } + } + + Range_dragger.updateElement(); + }; + + + /** BASE HANDLING FUNCTIONS ------------------------------------------------- **/ + Range_dragger.id = function ( index ){ + if ( !arguments.length ) { + return Range_dragger.nodeId; + } + Range_dragger.nodeId = index; + }; + + Range_dragger.svgPathLayer = function ( layer ){ + Range_dragger.pathLayer = layer.append('g'); + }; + + Range_dragger.svgRoot = function ( root ){ + if ( !arguments.length ) + return Range_dragger.rootElement; + Range_dragger.rootElement = root; + Range_dragger.rootNodeLayer = Range_dragger.rootElement.append('g'); + Range_dragger.addMouseEvents(); + }; + + /** DRAWING FUNCTIONS ------------------------------------------------- **/ + Range_dragger.drawNode = function (){ + Range_dragger.pathElement = Range_dragger.pathLayer.append('line') + .classed("classNodeDragPath", true); + Range_dragger.pathElement.attr("x1", 0) + .attr("y1", 0) + .attr("x2", 0) + .attr("y2", 0); + + // var lineData = [ + // {"x": 0, "y": 0}, + // {"x": 0, "y": 40}, + // {"x": -40, "y": 0}, + // {"x": 0, "y": -40}, + // {"x": 0, "y": 0} + // ]; + + var lineData = [ + { "x": -40, "y": 0 }, // start + { "x": -20, "y": -10 }, + { "x": 20, "y": -50 }, + { "x": -10, "y": 0 }, // center + { "x": 20, "y": 50 }, + { "x": -20, "y": 10 }, + { "x": -40, "y": 0 } + ]; + + + var lineFunction = d3.svg.line() + .x(function ( d ){ + return d.x; + }) + .y(function ( d ){ + return d.y; + }) + .interpolate("basis-closed"); + var pathData = "M 61,40 C 41,15 41,-15 61,-40 L 1,0 Z"; + + Range_dragger.nodeElement = Range_dragger.rootNodeLayer.append('path').attr("d", pathData); + Range_dragger.nodeElement.classed("classDraggerNode", true); + if ( graph.options().useAccuracyHelper() ) { + Range_dragger.draggerObject = Range_dragger.rootNodeLayer.append("circle"); + Range_dragger.draggerObject.attr("r", 40) + .attr("cx", 0) + .attr("cy", 0) + .classed("superHiddenElement", true); + Range_dragger.draggerObject.classed("superOpacityElement", !graph.options().showDraggerObject()); + } + + + }; + + Range_dragger.updateElementViaDomainDragger = function ( x, y ){ + + var range_x = x; + var range_y = y; + + var dex = Range_dragger.parent.range().x; + var dey = Range_dragger.parent.range().y; + + var dir_X = x - dex; + var dir_Y = y - dey; + + var len = Math.sqrt(dir_X * dir_X + dir_Y * dir_Y); + + var nX = dir_X / len; + var nY = dir_Y / len; + + + var ep_range_x = dex + nX * Range_dragger.parent.range().actualRadius(); + var ep_range_y = dey + nY * Range_dragger.parent.range().actualRadius(); + + + var dx = range_x - ep_range_x; + var dy = range_y - ep_range_y; + len = Math.sqrt(dx * dx + dy * dy); + nX = dx / len; + nY = dy / len; + + var angle = Math.atan2(ep_range_y - range_y, ep_range_x - range_x) * 180 / Math.PI + 180; + Range_dragger.nodeElement.attr("transform", "translate(" + ep_range_x + "," + ep_range_y + ")" + "rotate(" + angle + ")"); + var doX = ep_range_x + nX * 40; + var doY = ep_range_y + nY * 40; + Range_dragger.draggerObject.attr("transform", "translate(" + doX + "," + doY + ")"); + + }; + + + Range_dragger.updateElement = function (){ + if ( Range_dragger.mouseButtonPressed === true || Range_dragger.parent === undefined ) return; + + var range = Range_dragger.parent.range(); + var iP = Range_dragger.parent.labelObject().linkRangeIntersection; + if ( Range_dragger.parent.labelElement() === undefined ) return; + var offsetForLoop = 48; + if ( Range_dragger.parent.labelElement().attr("transform") === "translate(0,15)" ) { + range = Range_dragger.parent.inverse().domain(); + iP = Range_dragger.parent.labelObject().linkDomainIntersection; + offsetForLoop = -48; + } + + if ( iP === undefined ) return; + var range_x = range.x; + var range_y = range.y; + + var ep_range_x = iP.x; + var ep_range_y = iP.y; + // offset for dragger object + var dx = range_x - ep_range_x; + var dy = range_y - ep_range_y; + var len = Math.sqrt(dx * dx + dy * dy); + var nX = dx / len; + var nY = dy / len; + var angle = Math.atan2(ep_range_y - range_y, ep_range_x - range_x) * 180 / Math.PI; + + var doX = ep_range_x - nX * 40; + var doY = ep_range_y - nY * 40; + + if ( Range_dragger.isLoopProperty === true ) + angle -= offsetForLoop; + + + Range_dragger.nodeElement.attr("transform", "translate(" + ep_range_x + "," + ep_range_y + ")" + "rotate(" + angle + ")"); + Range_dragger.draggerObject.attr("transform", "translate(" + doX + "," + doY + ")"); + + + }; + + /** MOUSE HANDLING FUNCTIONS ------------------------------------------------- **/ + + Range_dragger.addMouseEvents = function (){ + var rootLayer = Range_dragger.rootNodeLayer.selectAll("*"); + rootLayer.on("mouseover", Range_dragger.onMouseOver) + .on("mouseout", Range_dragger.onMouseOut) + .on("click", function (){ + }) + .on("dblclick", function (){ + }) + .on("mousedown", Range_dragger.mouseDown) + .on("mouseup", Range_dragger.mouseUp); + }; + + Range_dragger.mouseDown = function (){ + Range_dragger.nodeElement.style("cursor", "move"); + Range_dragger.nodeElement.classed("classDraggerNodeHovered", true); + Range_dragger.mouseButtonPressed = true; + }; + + Range_dragger.mouseUp = function (){ + Range_dragger.nodeElement.style("cursor", "auto"); + Range_dragger.nodeElement.classed("classDraggerNodeHovered", false); + Range_dragger.mouseButtonPressed = false; + }; + + + Range_dragger.mouseEntered = function ( p ){ + if ( !arguments.length ) return Range_dragger.mouseEnteredVar; + Range_dragger.mouseEnteredVar = p; + return Range_dragger; + }; + + Range_dragger.selectedViaTouch = function ( val ){ + Range_dragger.nodeElement.classed("classDraggerNode", !val); + Range_dragger.nodeElement.classed("classDraggerNodeHovered", val); + + }; + + Range_dragger.onMouseOver = function (){ + if ( Range_dragger.mouseEntered() ) { + return; + } + Range_dragger.nodeElement.classed("classDraggerNode", false); + Range_dragger.nodeElement.classed("classDraggerNodeHovered", true); + var selectedNode = Range_dragger.rootElement.node(), + nodeContainer = selectedNode.parentNode; + nodeContainer.appendChild(selectedNode); + + Range_dragger.mouseEntered(true); + + }; + Range_dragger.onMouseOut = function (){ + if ( Range_dragger.mouseButtonPressed === true ) + return; + Range_dragger.nodeElement.classed("classDraggerNodeHovered", false); + Range_dragger.nodeElement.classed("classDraggerNode", true); + Range_dragger.mouseEntered(false); + }; + + Range_dragger.setPosition = function ( x, y ){ + var range_x = Range_dragger.parent.domain().x; + var range_y = Range_dragger.parent.domain().y; + + // var position of the rangeEndPoint + var ep_range_x = x; + var ep_range_y = y; + + // offset for dragger object + var dx = range_x - ep_range_x; + var dy = range_y - ep_range_y; + + var len = Math.sqrt(dx * dx + dy * dy); + + var nX = dx / len; + var nY = dy / len; + + + var angle = Math.atan2(dy, dx) * 180 / Math.PI; + var doX = ep_range_x + nX * 40; + var doY = ep_range_y + nY * 40; + Range_dragger.nodeElement.attr("transform", "translate(" + ep_range_x + "," + ep_range_y + ")" + "rotate(" + angle + ")"); + Range_dragger.draggerObject.attr("transform", "translate(" + doX + "," + doY + ")"); + Range_dragger.x = x; + Range_dragger.y = y; + + }; + + Range_dragger.setAdditionalClassForClass_dragger = function ( name, val ){ + + }; + return Range_dragger; + }; + + + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), +/* 70 */ +/***/ (function(module, exports) { + + module.exports = function ( graph ){ + /** variable defs **/ + var Domain_dragger = {}; + Domain_dragger.nodeId = 10002; + Domain_dragger.parent = undefined; + Domain_dragger.x = 0; + Domain_dragger.y = 0; + Domain_dragger.rootElement = undefined; + Domain_dragger.rootNodeLayer = undefined; + Domain_dragger.pathLayer = undefined; + Domain_dragger.mouseEnteredVar = false; + Domain_dragger.mouseButtonPressed = false; + Domain_dragger.nodeElement = undefined; + Domain_dragger.draggerObject = undefined; + + Domain_dragger.pathElement = undefined; + Domain_dragger.typus = "Domain_dragger"; + + Domain_dragger.type = function (){ + return Domain_dragger.typus; + }; + + + // TODO: We need the endPoint of the Link here! + Domain_dragger.parentNode = function (){ + return Domain_dragger.parent; + }; + + Domain_dragger.hide_dragger = function ( val ){ + Domain_dragger.pathElement.classed("hidden", val); + Domain_dragger.nodeElement.classed("hidden", val); + Domain_dragger.draggerObject.classed("hidden", val); + }; + + Domain_dragger.reDrawEverthing = function (){ + Domain_dragger.setParentProperty(Domain_dragger.parent); + }; + Domain_dragger.updateDomain = function ( newDomain ){ + + if ( graph.genericPropertySanityCheck(Domain_dragger.parent.range(), newDomain, Domain_dragger.parent.type(), + "Could not update domain", "Restoring previous domain") === false ) { + Domain_dragger.updateElement(); + return; + } + + if ( graph.propertyCheckExistenceChecker(Domain_dragger.parent, newDomain, Domain_dragger.parent.range()) === false ) + return; + + + if ( Domain_dragger.parent.labelElement() === undefined ) { + Domain_dragger.updateElement(); + return; + } + if ( Domain_dragger.parent.labelElement().attr("transform") === "translate(0,15)" || + Domain_dragger.parent.labelElement().attr("transform") === "translate(0,-15)" ) { + var prop = Domain_dragger.parent; + Domain_dragger.parent.inverse().inverse(null); + Domain_dragger.parent.inverse(null); + console.log("SPLITTING ITEMS!"); + prop.domain(newDomain); + } + else { + Domain_dragger.parent.domain(newDomain); + } + + // update the position of the new range + var rX = Domain_dragger.parent.range().x; + var rY = Domain_dragger.parent.range().y; + var dX = newDomain.x; + var dY = newDomain.y; + + // center + var cX = 0.49 * (dX + rX); + var cY = 0.49 * (dY + rY); + // put position there; + Domain_dragger.parent.labelObject().x = cX; + Domain_dragger.parent.labelObject().px = cX; + Domain_dragger.parent.labelObject().y = cY; + Domain_dragger.parent.labelObject().py = cY; + Domain_dragger.updateElement(); + + }; + + Domain_dragger.setParentProperty = function ( parentProperty, inverted ){ + Domain_dragger.invertedProperty = inverted; + var renElem; + var iP; + Domain_dragger.isLoopProperty = false; + if ( parentProperty.domain() === parentProperty.range() ) + Domain_dragger.isLoopProperty = true; + + Domain_dragger.parent = parentProperty; + renElem = parentProperty.labelObject(); + if ( inverted === true ) { + + // this is the lower element + if ( parentProperty.labelElement() && parentProperty.labelElement().attr("transform") === "translate(0,15)" ) { + // console.log("This is the lower element!"); + iP = renElem.linkRangeIntersection; + if ( renElem.linkRangeIntersection ) { + Domain_dragger.x = iP.x; + Domain_dragger.y = iP.y; + } + } + else { + // console.log("This is the upper element"); + iP = renElem.linkDomainIntersection; + if ( renElem.linkDomainIntersection ) { + Domain_dragger.x = iP.x; + Domain_dragger.y = iP.y; + } + } + } + else { + // console.log("This is single element"); + iP = renElem.linkDomainIntersection; + if ( renElem.linkDomainIntersection ) { + Domain_dragger.x = iP.x; + Domain_dragger.y = iP.y; + } + } + Domain_dragger.updateElement(); + + }; + + Domain_dragger.hideDragger = function ( val ){ + if ( Domain_dragger.pathElement ) Domain_dragger.pathElement.classed("hidden", val); + if ( Domain_dragger.nodeElement ) Domain_dragger.nodeElement.classed("hidden", val); + if ( Domain_dragger.draggerObject ) Domain_dragger.draggerObject.classed("hidden", val); + + + }; + /** BASE HANDLING FUNCTIONS ------------------------------------------------- **/ + Domain_dragger.id = function ( index ){ + if ( !arguments.length ) { + return Domain_dragger.nodeId; + } + Domain_dragger.nodeId = index; + }; + + Domain_dragger.svgPathLayer = function ( layer ){ + Domain_dragger.pathLayer = layer.append('g'); + }; + + Domain_dragger.svgRoot = function ( root ){ + if ( !arguments.length ) + return Domain_dragger.rootElement; + Domain_dragger.rootElement = root; + Domain_dragger.rootNodeLayer = Domain_dragger.rootElement.append('g'); + Domain_dragger.addMouseEvents(); + }; + + /** DRAWING FUNCTIONS ------------------------------------------------- **/ + Domain_dragger.drawNode = function (){ + Domain_dragger.pathElement = Domain_dragger.pathLayer.append('line') + .classed("classNodeDragPath", true); + Domain_dragger.pathElement.attr("x1", 0) + .attr("y1", 0) + .attr("x2", 0) + .attr("y2", 0); + + var pathData = "M 10,40 C -10,15 -10,-15 10,-40 -8.8233455,-13.641384 -36.711107,-5.1228436 -50,0 -36.696429,4.9079017 -8.6403157,13.745728 10,40 Z"; + Domain_dragger.nodeElement = Domain_dragger.rootNodeLayer.append('path').attr("d", pathData); + Domain_dragger.nodeElement.classed("classDraggerNode", true); + if ( graph.options().useAccuracyHelper() ) { + Domain_dragger.draggerObject = Domain_dragger.rootNodeLayer.append("circle"); + Domain_dragger.draggerObject.attr("r", 40) + .attr("cx", 0) + .attr("cy", 0) + .classed("superHiddenElement", true); + Domain_dragger.draggerObject.classed("superOpacityElement", !graph.options().showDraggerObject()); + } + + + }; + Domain_dragger.updateElementViaRangeDragger = function ( x, y ){ + var range_x = x; + var range_y = y; + + var dex = Domain_dragger.parent.domain().x; + var dey = Domain_dragger.parent.domain().y; + + var dir_X = x - dex; + var dir_Y = y - dey; + + var len = Math.sqrt(dir_X * dir_X + dir_Y * dir_Y); + + var nX = dir_X / len; + var nY = dir_Y / len; + + + var ep_range_x = dex + nX * Domain_dragger.parent.domain().actualRadius(); + var ep_range_y = dey + nY * Domain_dragger.parent.domain().actualRadius(); + + var angle = Math.atan2(ep_range_y - range_y, ep_range_x - range_x) * 180 / Math.PI; + + Domain_dragger.nodeElement.attr("transform", "translate(" + ep_range_x + "," + ep_range_y + ")" + "rotate(" + angle + ")"); + var dox = ep_range_x + nX * 20; + var doy = ep_range_y + nY * 20; + Domain_dragger.draggerObject.attr("transform", "translate(" + dox + "," + doy + ")"); + }; + + + Domain_dragger.updateElement = function (){ + if ( Domain_dragger.mouseButtonPressed === true || Domain_dragger.parent === undefined ) return; + + var domain = Domain_dragger.parent.domain(); + var iP = Domain_dragger.parent.labelObject().linkDomainIntersection; + if ( Domain_dragger.parent.labelElement() === undefined ) return; + if ( Domain_dragger.parent.labelElement().attr("transform") === "translate(0,15)" ) { + Domain_dragger.parent.inverse().domain(); + iP = Domain_dragger.parent.labelObject().linkRangeIntersection; + + } + var range_x = domain.x; + var range_y = domain.y; + + + if ( iP === undefined ) return; + var ep_range_x = iP.x; + var ep_range_y = iP.y; + + var dx = range_x - ep_range_x; + var dy = range_y - ep_range_y; + var len = Math.sqrt(dx * dx + dy * dy); + + var nX = dx / len; + var nY = dy / len; + + var dox = ep_range_x - nX * 20; + var doy = ep_range_y - nY * 20; + var angle = Math.atan2(ep_range_y - range_y, ep_range_x - range_x) * 180 / Math.PI + 180; + + Domain_dragger.nodeElement.attr("transform", "translate(" + ep_range_x + "," + ep_range_y + ")" + "rotate(" + angle + ")"); + Domain_dragger.draggerObject.attr("transform", "translate(" + dox + "," + doy + ")"); + }; + + /** MOUSE HANDLING FUNCTIONS ------------------------------------------------- **/ + + Domain_dragger.addMouseEvents = function (){ + var rootLayer = Domain_dragger.rootNodeLayer.selectAll("*"); + rootLayer.on("mouseover", Domain_dragger.onMouseOver) + .on("mouseout", Domain_dragger.onMouseOut) + .on("click", function (){ + }) + .on("dblclick", function (){ + }) + .on("mousedown", Domain_dragger.mouseDown) + .on("mouseup", Domain_dragger.mouseUp); + }; + + Domain_dragger.mouseDown = function (){ + Domain_dragger.nodeElement.style("cursor", "move"); + Domain_dragger.nodeElement.classed("classDraggerNodeHovered", true); + Domain_dragger.mouseButtonPressed = true; + }; + + Domain_dragger.mouseUp = function (){ + Domain_dragger.nodeElement.style("cursor", "auto"); + Domain_dragger.nodeElement.classed("classDraggerNodeHovered", false); + Domain_dragger.mouseButtonPressed = false; + }; + + + Domain_dragger.mouseEntered = function ( p ){ + if ( !arguments.length ) return Domain_dragger.mouseEnteredVar; + Domain_dragger.mouseEnteredVar = p; + return Domain_dragger; + }; + + Domain_dragger.selectedViaTouch = function ( val ){ + Domain_dragger.nodeElement.classed("classDraggerNode", !val); + Domain_dragger.nodeElement.classed("classDraggerNodeHovered", val); + + }; + + Domain_dragger.onMouseOver = function (){ + if ( Domain_dragger.mouseEntered() ) { + return; + } + Domain_dragger.nodeElement.classed("classDraggerNode", false); + Domain_dragger.nodeElement.classed("classDraggerNodeHovered", true); + var selectedNode = Domain_dragger.rootElement.node(), + nodeContainer = selectedNode.parentNode; + nodeContainer.appendChild(selectedNode); + + Domain_dragger.mouseEntered(true); + + }; + Domain_dragger.onMouseOut = function (){ + if ( Domain_dragger.mouseButtonPressed === true ) + return; + Domain_dragger.nodeElement.classed("classDraggerNodeHovered", false); + Domain_dragger.nodeElement.classed("classDraggerNode", true); + Domain_dragger.mouseEntered(false); + }; + + Domain_dragger.setPosition = function ( x, y ){ + var range_x = Domain_dragger.parent.range().x; + var range_y = Domain_dragger.parent.range().y; + + // var position of the rangeEndPoint + var ep_range_x = x; + var ep_range_y = y; + + // offset for dragger object + var dx = range_x - ep_range_x; + var dy = range_y - ep_range_y; + + var len = Math.sqrt(dx * dx + dy * dy); + + var nX = dx / len; + var nY = dy / len; + var dox = ep_range_x + nX * 20; + var doy = ep_range_y + nY * 20; + + var angle = Math.atan2(range_y - ep_range_y, range_x - ep_range_x) * 180 / Math.PI + 180; + + Domain_dragger.nodeElement.attr("transform", "translate(" + ep_range_x + "," + ep_range_y + ")" + "rotate(" + angle + ")"); + Domain_dragger.draggerObject.attr("transform", "translate(" + dox + "," + doy + ")"); + + Domain_dragger.x = x; + Domain_dragger.y = y; + + }; + + Domain_dragger.setAdditionalClassForClass_dragger = function ( name, val ){ + // console.log("Class_dragger should sett the class here") + // Class_dragger.nodeElement.classed(name,val); + + }; + return Domain_dragger; + }; + + + + +/***/ }), +/* 71 */ +/***/ (function(module, exports, __webpack_require__) { + + var CenteringTextElement = __webpack_require__(14); + var elementTools = __webpack_require__(63)(); + var math = __webpack_require__(43)(); + module.exports = function ( graph ){ + /** variable defs **/ + var ShadowClone = {}; + ShadowClone.nodeId = 10003; + ShadowClone.parent = undefined; + ShadowClone.s_x = 0; + ShadowClone.s_y = 0; + ShadowClone.e_x = 0; + ShadowClone.e_y = 0; + ShadowClone.rootElement = undefined; + ShadowClone.rootNodeLayer = undefined; + ShadowClone.pathLayer = undefined; + ShadowClone.nodeElement = undefined; + ShadowClone.pathElement = undefined; + ShadowClone.typus = "shadowClone"; + + + ShadowClone.type = function (){ + return ShadowClone.typus; + }; + + // TODO: We need the endPoint of the Link here! + ShadowClone.parentNode = function (){ + return ShadowClone.parent; + }; + + ShadowClone.setParentProperty = function ( parentProperty, inverted ){ + ShadowClone.invertedProperty = inverted; + ShadowClone.parent = parentProperty; + var renElment; + if ( inverted === true ) { + renElment = parentProperty.inverse().labelObject(); + if ( renElment.linkRangeIntersection && renElment.linkDomainIntersection ) { + var iiP_range = renElment.linkDomainIntersection; + var iiP_domain = renElment.linkRangeIntersection; + ShadowClone.s_x = iiP_domain.x; + ShadowClone.s_y = iiP_domain.y; + ShadowClone.e_x = iiP_range.x; + ShadowClone.e_y = iiP_range.y; + } + } + else { + renElment = parentProperty.labelObject(); + + if ( renElment.linkRangeIntersection && renElment.linkDomainIntersection ) { + var iP_range = renElment.linkRangeIntersection; + var iP_domain = renElment.linkDomainIntersection; + ShadowClone.s_x = iP_domain.x; + ShadowClone.s_y = iP_domain.y; + ShadowClone.e_x = iP_range.x; + ShadowClone.e_y = iP_range.y; + } + + } + + ShadowClone.rootNodeLayer.remove(); + ShadowClone.rootNodeLayer = ShadowClone.rootElement.append('g'); + ShadowClone.rootNodeLayer.datum(parentProperty); + + // ShadowClone.pathElement.remove(); + // ShadowClone.pathElement = ShadowClone.pathLayer.append('line'); + // + // ShadowClone.pathElement.attr("x1", ShadowClone.s_x) + // .attr("y1", ShadowClone.s_y) + // .attr("x2", ShadowClone.e_x) + // .attr("y2", ShadowClone.e_y); + ShadowClone.pathElement.remove(); + ShadowClone.pathElement = ShadowClone.pathLayer.append('line'); + ShadowClone.markerElement = ShadowClone.pathLayer.append("marker"); + ShadowClone.markerElement.attr("id", "shadowCloneMarker"); + ShadowClone.pathElement.attr("x1", ShadowClone.e_x) + .attr("y1", ShadowClone.e_y) + .attr("x2", ShadowClone.s_x) + .attr("y2", ShadowClone.s_y); + ShadowClone.pathElement.classed(parentProperty.linkType(), true); + + if ( parentProperty.markerElement() ) { + ShadowClone.markerElement.attr("viewBox", parentProperty.markerElement().attr("viewBox")) + .attr("markerWidth", parentProperty.markerElement().attr("markerWidth")) + .attr("markerHeight", parentProperty.markerElement().attr("markerHeight")) + .attr("orient", parentProperty.markerElement().attr("orient")); + + var markerPath = parentProperty.markerElement().select("path"); + ShadowClone.markerElement.append("path") + .attr("d", markerPath.attr("d")) + .classed(parentProperty.markerType(), true); + + ShadowClone.pathElement.attr("marker-end", "url(#" + "shadowCloneMarker" + ")"); + ShadowClone.markerElement.classed("hidden", !elementTools.isDatatypeProperty(parentProperty)); + } + var rect = ShadowClone.rootNodeLayer.append("rect") + .classed(parentProperty.styleClass(), true) + .classed("property", true) + .attr("x", -parentProperty.width() / 2) + .attr("y", -parentProperty.height() / 2) + .attr("width", parentProperty.width()) + .attr("height", parentProperty.height()); + + if ( parentProperty.visualAttributes() ) { + rect.classed(parentProperty.visualAttributes(), true); + } + rect.classed("datatype", false); + var bgColor = parentProperty.backgroundColor(); + + if ( parentProperty.attributes().indexOf("deprecated") > -1 ) { + bgColor = undefined; + rect.classed("deprecatedproperty", true); + } else { + rect.classed("deprecatedproperty", false); + } + rect.style("fill", bgColor); + + // add Text; + var equivalentsString = parentProperty.equivalentsString(); + var suffixForFollowingEquivalents = equivalentsString ? "," : ""; + + + var textElement = new CenteringTextElement(ShadowClone.rootNodeLayer, bgColor); + textElement.addText(parentProperty.labelForCurrentLanguage(), "", suffixForFollowingEquivalents); + textElement.addEquivalents(equivalentsString); + textElement.addSubText(parentProperty.indicationString()); + + + var cx = 0.5 * (ShadowClone.s_x + ShadowClone.e_x); + var cy = 0.5 * (ShadowClone.s_y + ShadowClone.e_y); + ShadowClone.rootNodeLayer.attr("transform", "translate(" + cx + "," + cy + ")"); + ShadowClone.rootNodeLayer.classed("hidden", true); + ShadowClone.pathElement.classed("hidden", true); + + + }; + + ShadowClone.hideClone = function ( val ){ + if ( ShadowClone.rootNodeLayer ) ShadowClone.rootNodeLayer.classed("hidden", val); + if ( ShadowClone.pathElement ) ShadowClone.pathElement.classed("hidden", val); + }; + + ShadowClone.hideParentProperty = function ( val ){ + + var labelObj = ShadowClone.parent.labelObject(); + if ( labelObj ) { + if ( ShadowClone.parent.labelElement().attr("transform") === "translate(0,15)" || + ShadowClone.parent.labelElement().attr("transform") === "translate(0,-15)" ) + ShadowClone.parent.inverse().hide(val); + + + } + ShadowClone.parent.hide(val); + + + }; + + /** BASE HANDLING FUNCTIONS ------------------------------------------------- **/ + ShadowClone.id = function ( index ){ + if ( !arguments.length ) { + return ShadowClone.nodeId; + } + ShadowClone.nodeId = index; + }; + + ShadowClone.svgPathLayer = function ( layer ){ + ShadowClone.pathLayer = layer.append('g'); + }; + + ShadowClone.svgRoot = function ( root ){ + if ( !arguments.length ) + return ShadowClone.rootElement; + ShadowClone.rootElement = root; + ShadowClone.rootNodeLayer = ShadowClone.rootElement.append('g'); + + }; + + /** DRAWING FUNCTIONS ------------------------------------------------- **/ + ShadowClone.drawClone = function (){ + ShadowClone.pathElement = ShadowClone.pathLayer.append('line'); + + ShadowClone.pathElement.attr("x1", 0) + .attr("y1", 0) + .attr("x2", 0) + .attr("y2", 0); + + }; + + + ShadowClone.updateElement = function (){ + ShadowClone.pathElement.attr("x1", ShadowClone.e_x) + .attr("y1", ShadowClone.e_y) + .attr("x2", ShadowClone.s_x) + .attr("y2", ShadowClone.s_y); + + var cx = 0.5 * (ShadowClone.s_x + ShadowClone.e_x); + var cy = 0.5 * (ShadowClone.s_y + ShadowClone.e_y); + ShadowClone.rootNodeLayer.attr("transform", "translate(" + cx + "," + cy + ")"); + }; + + ShadowClone.setInitialPosition = function (){ + + var renElment = ShadowClone.parent.labelObject(); + if ( renElment.linkRangeIntersection && renElment.linkDomainIntersection ) { + var iP_range = renElment.linkRangeIntersection; + var iP_domain = renElment.linkDomainIntersection; + ShadowClone.e_x = iP_domain.x; + ShadowClone.e_y = iP_domain.y; + ShadowClone.s_x = iP_range.x; + ShadowClone.s_y = iP_range.y; + } + ShadowClone.updateElement(); + return; + // + // var rex=ShadowClone.parent.range().x; + // var rey=ShadowClone.parent.range().y; + // + // + // var dex=ShadowClone.parent.domain().x; + // var dey=ShadowClone.parent.domain().y; + // + // + // var dir_X= rex-dex; + // var dir_Y= rey-dey; + // + // var len=Math.sqrt(dir_X*dir_X+dir_Y*dir_Y); + // var nX=dir_X/len; + // var nY=dir_Y/len; + // ShadowClone.s_x=rex-nX*ShadowClone.parent.range().actualRadius(); + // ShadowClone.s_y=rey-nY*ShadowClone.parent.range().actualRadius(); + // + // ShadowClone.e_x=dex+nX*ShadowClone.parent.domain().actualRadius(); + // ShadowClone.e_y=dey+nY*ShadowClone.parent.domain().actualRadius(); + // ShadowClone.updateElement(); + + }; + ShadowClone.setPositionDomain = function ( e_x, e_y ){ + + var rex = ShadowClone.parent.range().x; + var rey = ShadowClone.parent.range().y; + + + if ( elementTools.isDatatype(ShadowClone.parent.range()) === true ) { + var intersection = math.calculateIntersection({ x: e_x, y: e_y }, ShadowClone.parent.range(), 0); + ShadowClone.s_x = intersection.x; + ShadowClone.s_y = intersection.y; + } else { + var dir_X = rex - e_x; + var dir_Y = rey - e_y; + + var len = Math.sqrt(dir_X * dir_X + dir_Y * dir_Y); + + var nX = dir_X / len; + var nY = dir_Y / len; + ShadowClone.s_x = rex - nX * ShadowClone.parent.range().actualRadius(); + ShadowClone.s_y = rey - nY * ShadowClone.parent.range().actualRadius(); + + } + + + ShadowClone.e_x = e_x; + ShadowClone.e_y = e_y; + ShadowClone.updateElement(); + }; + + ShadowClone.setPosition = function ( s_x, s_y ){ + ShadowClone.s_x = s_x; + ShadowClone.s_y = s_y; + + // add normalized dir; + + var dex = ShadowClone.parent.domain().x; + var dey = ShadowClone.parent.domain().y; + + var dir_X = s_x - dex; + var dir_Y = s_y - dey; + + var len = Math.sqrt(dir_X * dir_X + dir_Y * dir_Y); + + var nX = dir_X / len; + var nY = dir_Y / len; + + + ShadowClone.e_x = dex + nX * ShadowClone.parent.domain().actualRadius(); + ShadowClone.e_y = dey + nY * ShadowClone.parent.domain().actualRadius(); + + + ShadowClone.updateElement(); + + + }; + + + /** MOUSE HANDLING FUNCTIONS ------------------------------------------------- **/ + + return ShadowClone; + }; + + + + +/***/ }), +/* 72 */ +/***/ (function(module, exports) { + + module.exports = function ( graph ){ + /** variable defs **/ + var prefixRepresentationModule = {}; + + var currentPrefixModel; + + prefixRepresentationModule.updatePrefixModel = function (){ + currentPrefixModel = graph.options().prefixList(); + }; + + + prefixRepresentationModule.validURL = function ( url ){ + return validURL(url); + }; + function validURL( str ){ + var urlregex = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/; + return urlregex.test(str); + } + + function splitURLIntoBaseAndResource( fullURL ){ + var splitedURL = { base: "", resource: "" }; + if ( fullURL === undefined ) { + splitedURL = { base: "ERROR", resource: "NOT FOUND" }; + return splitedURL; + } + + var resource, base; + // check if there is a last hashTag + if ( fullURL.indexOf("#") > -1 ) { + resource = fullURL.substring(fullURL.lastIndexOf('#') + 1); + base = fullURL.substring(0, fullURL.length - resource.length); + // overwrite base if it is ontologyIri; + if ( base === graph.options().getGeneralMetaObjectProperty('iri') ) { + base = ":"; + } + splitedURL.base = base; + splitedURL.resource = resource; + } else { + resource = fullURL.substring(fullURL.lastIndexOf('/') + 1); + base = fullURL.substring(0, fullURL.length - resource.length); + // overwrite base if it is ontologyIri; + if ( base === graph.options().getGeneralMetaObjectProperty('iri') ) { + base = ":"; + } + splitedURL.base = base; + splitedURL.resource = resource; + } + return splitedURL; + } + + prefixRepresentationModule.getPrefixRepresentationForFullURI = function ( fullURL ){ + prefixRepresentationModule.updatePrefixModel(); + var splittedURL = splitURLIntoBaseAndResource(fullURL); + + // lazy approach , for + // loop over prefix model + for ( var name in currentPrefixModel ) { + if ( currentPrefixModel.hasOwnProperty(name) ) { + // THIS IS CASE SENSITIVE! + if ( currentPrefixModel[name] === splittedURL.base ) { + return name + ":" + splittedURL.resource; + } + } + } + + if ( splittedURL.base === ":" ) { + return ":" + splittedURL.resource; + } + + return fullURL; + }; + + + return prefixRepresentationModule; + }; + + + + +/***/ }), +/* 73 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {var _ = __webpack_require__(58); + + module.exports = function (){ + + var DEFAULT_STATE = true; + var COLOR_MODES = [ + { type: "same", range: [d3.rgb("#36C"), d3.rgb("#36C")] }, + { type: "gradient", range: [d3.rgb("#36C"), d3.rgb("#EE2867")] } // taken from LD-VOWL + ]; + + var filter = {}, + nodes, + properties, + enabled = DEFAULT_STATE, + filteredNodes, + filteredProperties, + colorModeType = "same"; + + + filter.filter = function ( untouchedNodes, untouchedProperties ){ + nodes = untouchedNodes; + properties = untouchedProperties; + + var externalElements = filterExternalElements(nodes.concat(properties)); + + if ( enabled ) { + setColorsForExternals(externalElements); + } else { + resetBackgroundColors(externalElements); + } + + filteredNodes = nodes; + filteredProperties = properties; + }; + + function filterExternalElements( elements ){ + return elements.filter(function ( element ){ + if ( element.visualAttributes().indexOf("deprecated") >= 0 ) { + // deprecated is the only attribute which has preference over external + return false; + } + + return element.attributes().indexOf("external") >= 0; + }); + } + + function setColorsForExternals( elements ){ + var iriMap = mapExternalsToBaseUri(elements); + var entries = iriMap.entries(); + + var colorScale = d3.scale.linear() + .domain([0, entries.length - 1]) + .range(_.find(COLOR_MODES, { type: colorModeType }).range) + .interpolate(d3.interpolateHsl); + + for ( var i = 0; i < entries.length; i++ ) { + var groupedElements = entries[i].value; + setBackgroundColorForElements(groupedElements, colorScale(i)); + } + } + + function mapExternalsToBaseUri( elements ){ + var map = d3.map(); + + elements.forEach(function ( element ){ + var baseIri = element.baseIri(); + + if ( !map.has(baseIri) ) { + map.set(baseIri, []); + } + map.get(baseIri).push(element); + }); + + return map; + } + + function setBackgroundColorForElements( elements, backgroundColor ){ + elements.forEach(function ( element ){ + element.backgroundColor(backgroundColor); + }); + } + + function resetBackgroundColors( elements ){ + console.log("Resetting color"); + elements.forEach(function ( element ){ + element.backgroundColor(null); + }); + } + + filter.colorModeType = function ( p ){ + if ( !arguments.length ) return colorModeType; + colorModeType = p; + return filter; + }; + + filter.enabled = function ( p ){ + if ( !arguments.length ) return enabled; + enabled = p; + return filter; + }; + + filter.reset = function (){ + enabled = DEFAULT_STATE; + }; + + + // Functions a filter must have + filter.filteredNodes = function (){ + return filteredNodes; + }; + + filter.filteredProperties = function (){ + return filteredProperties; + }; + + + return filter; + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), +/* 74 */ +/***/ (function(module, exports) { + + /** + * This module abuses the filter function a bit like the statistics module. Nothing is filtered. + * + * @returns {{}} + */ + + + module.exports = function ( graph ){ + + var DEFAULT_STATE = false; + + var filter = {}, + nodes, + properties, + enabled = DEFAULT_STATE, + filteredNodes, + filteredProperties; + + + /** + * If enabled, redundant details won't be drawn anymore. + * @param untouchedNodes + * @param untouchedProperties + */ + filter.filter = function ( untouchedNodes, untouchedProperties ){ + nodes = untouchedNodes; + properties = untouchedProperties; + graph.options().compactNotation(enabled); + filteredNodes = nodes; + filteredProperties = properties; + }; + + filter.enabled = function ( p ){ + if ( !arguments.length ) return enabled; + enabled = p; + return filter; + }; + + filter.reset = function (){ + enabled = DEFAULT_STATE; + }; + + + // Functions a filter must have + filter.filteredNodes = function (){ + return filteredNodes; + }; + + filter.filteredProperties = function (){ + return filteredProperties; + }; + + + return filter; + }; + + +/***/ }), +/* 75 */ +/***/ (function(module, exports, __webpack_require__) { + + var elementTools = __webpack_require__(63)(); + var filterTools = __webpack_require__(76)(); + + module.exports = function (){ + + var filter = {}, + nodes, + properties, + enabled = false, + filteredNodes, + filteredProperties; + + + /** + * If enabled, all datatypes and literals including connected properties are filtered. + * @param untouchedNodes + * @param untouchedProperties + */ + filter.filter = function ( untouchedNodes, untouchedProperties ){ + nodes = untouchedNodes; + properties = untouchedProperties; + + if ( this.enabled() ) { + removeDatatypesAndLiterals(); + } + + filteredNodes = nodes; + filteredProperties = properties; + }; + + function removeDatatypesAndLiterals(){ + var filteredData = filterTools.filterNodesAndTidy(nodes, properties, isNoDatatypeOrLiteral); + + nodes = filteredData.nodes; + properties = filteredData.properties; + } + + function isNoDatatypeOrLiteral( node ){ + return !elementTools.isDatatype(node); + } + + filter.enabled = function ( p ){ + if ( !arguments.length ) return enabled; + enabled = p; + return filter; + }; + + + // Functions a filter must have + filter.filteredNodes = function (){ + return filteredNodes; + }; + + filter.filteredProperties = function (){ + return filteredProperties; + }; + + + return filter; + }; + + +/***/ }), +/* 76 */ +/***/ (function(module, exports, __webpack_require__) { + + var elementTools = __webpack_require__(63)(); + + module.exports = (function (){ + + var tools = {}; + + /** + * Filters the passed nodes and removes dangling properties. + * @param nodes + * @param properties + * @param shouldKeepNode function that returns true if the node should be kept + * @returns {{nodes: Array, properties: Array}} the filtered nodes and properties + */ + tools.filterNodesAndTidy = function ( nodes, properties, shouldKeepNode ){ + var removedNodes = __webpack_require__(62)(), + cleanedNodes = [], + cleanedProperties = []; + + nodes.forEach(function ( node ){ + if ( shouldKeepNode(node) ) { + cleanedNodes.push(node); + } else { + removedNodes.add(node); + } + }); + + properties.forEach(function ( property ){ + if ( propertyHasVisibleNodes(removedNodes, property) ) { + cleanedProperties.push(property); + } else if ( elementTools.isDatatypeProperty(property) ) { + // Remove floating datatypes/literals, because they belong to their datatype property + var index = cleanedNodes.indexOf(property.range()); + if ( index >= 0 ) { + cleanedNodes.splice(index, 1); + } + } + }); + + return { + nodes: cleanedNodes, + properties: cleanedProperties + }; + }; + + /** + * Returns true, if the domain and the range of this property have not been removed. + * @param removedNodes + * @param property + * @returns {boolean} true if property isn't dangling + */ + function propertyHasVisibleNodes( removedNodes, property ){ + return !removedNodes.has(property.domain()) && !removedNodes.has(property.range()); + } + + + return function (){ + return tools; + }; + })(); + + +/***/ }), +/* 77 */ +/***/ (function(module, exports, __webpack_require__) { + + var OwlDisjointWith = __webpack_require__(46); + + module.exports = function (){ + + var filter = {}, + nodes, + properties, + // According to the specification enabled by default + enabled = true, + filteredNodes, + filteredProperties; + + + /** + * If enabled, all disjoint with properties are filtered. + * @param untouchedNodes + * @param untouchedProperties + */ + filter.filter = function ( untouchedNodes, untouchedProperties ){ + nodes = untouchedNodes; + properties = untouchedProperties; + + if ( this.enabled() ) { + removeDisjointWithProperties(); + } + + filteredNodes = nodes; + filteredProperties = properties; + }; + + function removeDisjointWithProperties(){ + var cleanedProperties = [], + i, l, property; + + for ( i = 0, l = properties.length; i < l; i++ ) { + property = properties[i]; + + if ( !(property instanceof OwlDisjointWith) ) { + cleanedProperties.push(property); + } + } + + properties = cleanedProperties; + } + + filter.enabled = function ( p ){ + if ( !arguments.length ) return enabled; + enabled = p; + return filter; + }; + + + // Functions a filter must have + filter.filteredNodes = function (){ + return filteredNodes; + }; + + filter.filteredProperties = function (){ + return filteredProperties; + }; + + + return filter; + }; + + +/***/ }), +/* 78 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {module.exports = function ( graph ){ + var focuser = {}, + focusedElement; + var elementTools = webvowl.util.elementTools(); + focuser.handle = function ( selectedElement, forced ){ + // Don't display details on a drag event, which will be prevented + if ( d3.event && d3.event.defaultPrevented && forced === undefined ) { + return; + } + + if ( focusedElement !== undefined ) { + focusedElement.toggleFocus(); + } + + if ( focusedElement !== selectedElement && selectedElement ) { + selectedElement.toggleFocus(); + focusedElement = selectedElement; + } else { + focusedElement = undefined; + } + if ( focusedElement && focusedElement.focused() ) { + graph.options().editSidebar().updateSelectionInformation(focusedElement); + if ( elementTools.isProperty(selectedElement) === true ) { + var inversed = false; + if ( selectedElement.inverse() ) { + inversed = true; + } + graph.activateHoverElementsForProperties(true, selectedElement, inversed, graph.isTouchDevice()); + } + else { + graph.activateHoverElements(true, selectedElement, graph.isTouchDevice()); + } + } + else { + graph.options().editSidebar().updateSelectionInformation(undefined); + graph.removeEditElements(); + } + }; + + /** + * Removes the focus if an element is focussed. + */ + focuser.reset = function (){ + if ( focusedElement ) { + focusedElement.toggleFocus(); + focusedElement = undefined; + } + }; + + return focuser; + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), +/* 79 */ +/***/ (function(module, exports) { + + /** @WORKAROUND CODE: + * clears empty literals that are provided by owl2vowl: 0.2.2x*/ + + + module.exports = function (){ + + var filter = {}, + enabled = true, + filteredNodes, + removedNodes, + filteredProperties; + + filter.enabled = function ( val ){ + if ( !arguments.length ) { + return enabled; + } + enabled = val; + }; + + filter.filter = function ( nodes, properties ){ + if ( enabled === false ) { + filteredNodes = nodes; + filteredProperties = properties; + removedNodes = []; + return; + } + var literalUsageMap = []; + var thingUsageMap = []; + var node; + for ( var i = 0; i < properties.length; i++ ) { + // get property range; + var prop = properties[i]; + + // checking for literals + if ( prop.range() ) { + node = prop.range(); + if ( node.type() === "rdfs:Literal" ) { + literalUsageMap[node.id()] = 1; + } + } + // checking for thing + if ( prop.range() ) { + node = prop.range(); + if ( node.type() === "owl:Thing" ) { + thingUsageMap[node.id()] = 1; + } + } + if ( prop.domain() ) { + node = prop.domain(); + if ( node.type() === "owl:Thing" ) { + thingUsageMap[node.id()] = 1; + } + } + + } + var nodesToRemove = []; + var newNodes = []; + // todo: test and make it faster + for ( i = 0; i < nodes.length; i++ ) { + var nodeId = nodes[i].id(); + if ( nodes[i].type() === "rdfs:Literal" ) { + if ( literalUsageMap[nodeId] === undefined ) { + nodesToRemove.push(nodeId); + } + else { + newNodes.push(nodes[i]); + } + // check for node type == OWL:THING + } else if ( nodes[i].type() === "owl:Thing" ) { + if ( thingUsageMap[nodeId] === undefined ) { + nodesToRemove.push(nodeId); + } + else { + newNodes.push(nodes[i]); + } + } else { + newNodes.push(nodes[i]); + } + } + + filteredNodes = newNodes; + filteredProperties = properties; + removedNodes = nodesToRemove; + }; + + + // Functions a filter must have + filter.filteredNodes = function (){ + return filteredNodes; + }; + + filter.removedNodes = function (){ + return removedNodes; + }; + + filter.filteredProperties = function (){ + return filteredProperties; + }; + + + return filter; + }; + + +/***/ }), +/* 80 */ +/***/ (function(module, exports, __webpack_require__) { + + var elementTools = __webpack_require__(63)(); + var filterTools = __webpack_require__(76)(); + + module.exports = function ( menu ){ + + var filter = {}, + nodes, + properties, + enabled = true, + filteredNodes, + filteredProperties, + maxDegreeSetter, + degreeGetter, + lastFiltedDegree, + degreeSetter; + + + var NODE_COUNT_LIMIT_FOR_AUTO_ENABLING = 50; + + + filter.initialize = function ( nodes, properties ){ + lastFiltedDegree = -1; + var maxLinkCount = findMaxLinkCount(nodes); + if ( maxDegreeSetter instanceof Function ) { + maxDegreeSetter(maxLinkCount); + } + + menu.setDefaultDegreeValue(findAutoDefaultDegree(nodes, properties, maxLinkCount)); + var defaultDegree = findDefaultDegree(maxLinkCount); + if ( degreeSetter instanceof Function ) { + degreeSetter(defaultDegree); + if ( defaultDegree > 0 ) { + menu.highlightForDegreeSlider(true); + menu.getGraphObject().setFilterWarning(true); + + } + } else { + console.error("No degree setter function set."); + } + }; + + function findAutoDefaultDegree( nodes, properties, maxDegree ){ + for ( var degree = 0; degree < maxDegree; degree++ ) { + var filteredData = filterByNodeDegree(nodes, properties, degree); + + if ( filteredData.nodes.length <= NODE_COUNT_LIMIT_FOR_AUTO_ENABLING ) { + return degree; + } + } + return 0; + } + + function findDefaultDegree( maxDegree ){ + var globalDegOfFilter = menu.getGraphObject().getGlobalDOF(); + if ( globalDegOfFilter >= 0 ) { + if ( globalDegOfFilter <= maxDegree ) { + return globalDegOfFilter; + } else { + menu.getGraphObject().setGlobalDOF(maxDegree); + return maxDegree; + } + } + return menu.getDefaultDegreeValue(); + } + + /** + * If enabled, all nodes are filter by their node degree. + * @param untouchedNodes + * @param untouchedProperties + */ + filter.filter = function ( untouchedNodes, untouchedProperties ){ + nodes = untouchedNodes; + properties = untouchedProperties; + + if ( this.enabled() ) { + if ( degreeGetter instanceof Function ) { + filterByNodeDegreeAndApply(degreeGetter()); + } else { + console.error("No degree query function set."); + } + } + + filteredNodes = nodes; + filteredProperties = properties; + + if ( filteredNodes.length === 0 ) { + degreeSetter(0); + filteredNodes = untouchedNodes; + filteredProperties = untouchedProperties; + } + lastFiltedDegree = degreeGetter(); + }; + + function findMaxLinkCount( nodes ){ + var maxLinkCount = 0; + for ( var i = 0, l = nodes.length; i < l; i++ ) { + var linksWithoutDatatypes = filterOutDatatypes(nodes[i].links()); + + maxLinkCount = Math.max(maxLinkCount, linksWithoutDatatypes.length); + } + return maxLinkCount; + } + + function filterOutDatatypes( links ){ + return links.filter(function ( link ){ + return !elementTools.isDatatypeProperty(link.property()); + }); + } + + function filterByNodeDegreeAndApply( minDegree ){ + var filteredData = filterByNodeDegree(nodes, properties, minDegree); + nodes = filteredData.nodes; + properties = filteredData.properties; + } + + function filterByNodeDegree( nodes, properties, minDegree ){ + return filterTools.filterNodesAndTidy(nodes, properties, hasRequiredDegree(minDegree)); + } + + function hasRequiredDegree( minDegree ){ + return function ( node ){ + return filterOutDatatypes(node.links()).length >= minDegree; + }; + } + + filter.setMaxDegreeSetter = function ( _maxDegreeSetter ){ + maxDegreeSetter = _maxDegreeSetter; + }; + + filter.setDegreeGetter = function ( _degreeGetter ){ + degreeGetter = _degreeGetter; + }; + + filter.setDegreeSetter = function ( _degreeSetter ){ + degreeSetter = _degreeSetter; + }; + + filter.enabled = function ( p ){ + if ( !arguments.length ) return enabled; + enabled = p; + return filter; + }; + + + // Functions a filter must have + filter.filteredNodes = function (){ + return filteredNodes; + }; + + filter.filteredProperties = function (){ + return filteredProperties; + }; + + + return filter; + }; + + +/***/ }), +/* 81 */ +/***/ (function(module, exports) { + + /** + * This module abuses the filter function a bit like the statistics module. Nothing is filtered. + * + * @returns {{}} + */ + module.exports = function ( graph ){ + + var DEFAULT_STATE = true; + + var filter = {}, + nodes, + properties, + enabled = DEFAULT_STATE, + filteredNodes, + filteredProperties; + + + /** + * If enabled, the scaling of nodes according to individuals will be enabled. + * @param untouchedNodes + * @param untouchedProperties + */ + filter.filter = function ( untouchedNodes, untouchedProperties ){ + nodes = untouchedNodes; + properties = untouchedProperties; + + graph.options().scaleNodesByIndividuals(enabled); + + filteredNodes = nodes; + filteredProperties = properties; + }; + + filter.enabled = function ( p ){ + if ( !arguments.length ) return enabled; + enabled = p; + return filter; + }; + + filter.reset = function (){ + enabled = DEFAULT_STATE; + }; + + + // Functions a filter must have + filter.filteredNodes = function (){ + return filteredNodes; + }; + + filter.filteredProperties = function (){ + return filteredProperties; + }; + + + return filter; + }; + + +/***/ }), +/* 82 */ +/***/ (function(module, exports, __webpack_require__) { + + var elementTools = __webpack_require__(63)(); + + + module.exports = function (){ + + var filter = {}, + nodes, + properties, + enabled = false, + filteredNodes, + filteredProperties; + + + /** + * If enabled, all object properties and things without any other property are filtered. + * @param untouchedNodes + * @param untouchedProperties + */ + filter.filter = function ( untouchedNodes, untouchedProperties ){ + nodes = untouchedNodes; + properties = untouchedProperties; + + if ( this.enabled() ) { + removeObjectProperties(); + } + + filteredNodes = nodes; + filteredProperties = properties; + }; + + function removeObjectProperties(){ + properties = properties.filter(isNoObjectProperty); + nodes = nodes.filter(isNoFloatingThing); + } + + function isNoObjectProperty( property ){ + return !elementTools.isObjectProperty(property); + } + + function isNoFloatingThing( node ){ + var isNoThing = !elementTools.isThing(node); + var hasNonFilteredProperties = hasPropertiesOtherThanObjectProperties(node, properties); + return isNoThing || hasNonFilteredProperties; + } + + function hasPropertiesOtherThanObjectProperties( node, properties ){ + for ( var i = 0; i < properties.length; i++ ) { + var property = properties[i]; + if ( property.domain() !== node && property.range() !== node ) { + continue; + } + + if ( isNoObjectProperty(property) ) { + return true; + } + } + + return false; + } + + filter.enabled = function ( p ){ + if ( !arguments.length ) return enabled; + enabled = p; + return filter; + }; + + + // Functions a filter must have + filter.filteredNodes = function (){ + return filteredNodes; + }; + + filter.filteredProperties = function (){ + return filteredProperties; + }; + + + return filter; + }; + + +/***/ }), +/* 83 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {var _ = __webpack_require__(84); + var elementTools = __webpack_require__(63)(); + + module.exports = function (){ + var pap = {}, + enabled = false, + pinnedElements = []; + + pap.addPinnedElement = function ( element ){ + // check if element is already in list + var indexInArray = pinnedElements.indexOf(element); + if ( indexInArray === -1 ) { + pinnedElements.push(element); + } + }; + + pap.handle = function ( selection, forced ){ + if ( !enabled ) { + return; + } + + if ( !forced ) { + if ( wasNotDragged() ) { + return; + } + } + if ( elementTools.isProperty(selection) ) { + if ( selection.inverse() && selection.inverse().pinned() ) { + return; + } else if ( hasNoParallelProperties(selection) ) { + return; + } + } + + if ( !selection.pinned() ) { + selection.drawPin(); + pap.addPinnedElement(selection); + } + }; + + function wasNotDragged(){ + return !d3.event.defaultPrevented; + } + + function hasNoParallelProperties( property ){ + return _.intersection(property.domain().links(), property.range().links()).length === 1; + } + + pap.enabled = function ( p ){ + if ( !arguments.length ) return enabled; + enabled = p; + return pap; + }; + + pap.reset = function (){ + pinnedElements.forEach(function ( element ){ + element.removePin(); + }); + // Clear the array of stored nodes + pinnedElements.length = 0; + }; + + return pap; + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), +/* 84 */ +/***/ (function(module, exports, __webpack_require__) { + + module.exports = { + 'chunk': __webpack_require__(85), + 'compact': __webpack_require__(105), + 'concat': __webpack_require__(106), + 'difference': __webpack_require__(114), + 'differenceBy': __webpack_require__(167), + 'differenceWith': __webpack_require__(229), + 'drop': __webpack_require__(230), + 'dropRight': __webpack_require__(231), + 'dropRightWhile': __webpack_require__(232), + 'dropWhile': __webpack_require__(234), + 'fill': __webpack_require__(235), + 'findIndex': __webpack_require__(239), + 'findLastIndex': __webpack_require__(240), + 'first': __webpack_require__(241), + 'flatten': __webpack_require__(243), + 'flattenDeep': __webpack_require__(244), + 'flattenDepth': __webpack_require__(245), + 'fromPairs': __webpack_require__(246), + 'head': __webpack_require__(242), + 'indexOf': __webpack_require__(247), + 'initial': __webpack_require__(248), + 'intersection': __webpack_require__(249), + 'intersectionBy': __webpack_require__(252), + 'intersectionWith': __webpack_require__(253), + 'join': __webpack_require__(254), + 'last': __webpack_require__(228), + 'lastIndexOf': __webpack_require__(255), + 'nth': __webpack_require__(257), + 'pull': __webpack_require__(259), + 'pullAll': __webpack_require__(260), + 'pullAllBy': __webpack_require__(263), + 'pullAllWith': __webpack_require__(264), + 'pullAt': __webpack_require__(265), + 'remove': __webpack_require__(272), + 'reverse': __webpack_require__(273), + 'slice': __webpack_require__(274), + 'sortedIndex': __webpack_require__(275), + 'sortedIndexBy': __webpack_require__(278), + 'sortedIndexOf': __webpack_require__(279), + 'sortedLastIndex': __webpack_require__(280), + 'sortedLastIndexBy': __webpack_require__(281), + 'sortedLastIndexOf': __webpack_require__(282), + 'sortedUniq': __webpack_require__(283), + 'sortedUniqBy': __webpack_require__(285), + 'tail': __webpack_require__(286), + 'take': __webpack_require__(287), + 'takeRight': __webpack_require__(288), + 'takeRightWhile': __webpack_require__(289), + 'takeWhile': __webpack_require__(290), + 'union': __webpack_require__(291), + 'unionBy': __webpack_require__(295), + 'unionWith': __webpack_require__(296), + 'uniq': __webpack_require__(297), + 'uniqBy': __webpack_require__(298), + 'uniqWith': __webpack_require__(299), + 'unzip': __webpack_require__(300), + 'unzipWith': __webpack_require__(301), + 'without': __webpack_require__(302), + 'xor': __webpack_require__(303), + 'xorBy': __webpack_require__(305), + 'xorWith': __webpack_require__(306), + 'zip': __webpack_require__(307), + 'zipObject': __webpack_require__(308), + 'zipObjectDeep': __webpack_require__(312), + 'zipWith': __webpack_require__(314) + }; + + +/***/ }), +/* 85 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseSlice = __webpack_require__(86), + isIterateeCall = __webpack_require__(87), + toInteger = __webpack_require__(100); + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeCeil = Math.ceil, + nativeMax = Math.max; + + /** + * Creates an array of elements split into groups the length of `size`. + * If `array` can't be split evenly, the final chunk will be the remaining + * elements. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to process. + * @param {number} [size=1] The length of each chunk + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the new array of chunks. + * @example + * + * _.chunk(['a', 'b', 'c', 'd'], 2); + * // => [['a', 'b'], ['c', 'd']] + * + * _.chunk(['a', 'b', 'c', 'd'], 3); + * // => [['a', 'b', 'c'], ['d']] + */ + function chunk(array, size, guard) { + if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { + size = 1; + } else { + size = nativeMax(toInteger(size), 0); + } + var length = array == null ? 0 : array.length; + if (!length || size < 1) { + return []; + } + var index = 0, + resIndex = 0, + result = Array(nativeCeil(length / size)); + + while (index < length) { + result[resIndex++] = baseSlice(array, index, (index += size)); + } + return result; + } + + module.exports = chunk; + + +/***/ }), +/* 86 */ +/***/ (function(module, exports) { + + /** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; + } + + module.exports = baseSlice; + + +/***/ }), +/* 87 */ +/***/ (function(module, exports, __webpack_require__) { + + var eq = __webpack_require__(88), + isArrayLike = __webpack_require__(89), + isIndex = __webpack_require__(99), + isObject = __webpack_require__(97); + + /** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; + } + + module.exports = isIterateeCall; + + +/***/ }), +/* 88 */ +/***/ (function(module, exports) { + + /** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + function eq(value, other) { + return value === other || (value !== value && other !== other); + } + + module.exports = eq; + + +/***/ }), +/* 89 */ +/***/ (function(module, exports, __webpack_require__) { + + var isFunction = __webpack_require__(90), + isLength = __webpack_require__(98); + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + + module.exports = isArrayLike; + + +/***/ }), +/* 90 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseGetTag = __webpack_require__(91), + isObject = __webpack_require__(97); + + /** `Object#toString` result references. */ + var asyncTag = '[object AsyncFunction]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + proxyTag = '[object Proxy]'; + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + } + + module.exports = isFunction; + + +/***/ }), +/* 91 */ +/***/ (function(module, exports, __webpack_require__) { + + var Symbol = __webpack_require__(92), + getRawTag = __webpack_require__(95), + objectToString = __webpack_require__(96); + + /** `Object#toString` result references. */ + var nullTag = '[object Null]', + undefinedTag = '[object Undefined]'; + + /** Built-in value references. */ + var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + + /** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); + } + + module.exports = baseGetTag; + + +/***/ }), +/* 92 */ +/***/ (function(module, exports, __webpack_require__) { + + var root = __webpack_require__(93); + + /** Built-in value references. */ + var Symbol = root.Symbol; + + module.exports = Symbol; + + +/***/ }), +/* 93 */ +/***/ (function(module, exports, __webpack_require__) { + + var freeGlobal = __webpack_require__(94); + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); + + module.exports = root; + + +/***/ }), +/* 94 */ +/***/ (function(module, exports) { + + /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + + module.exports = freeGlobal; + + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) + +/***/ }), +/* 95 */ +/***/ (function(module, exports, __webpack_require__) { + + var Symbol = __webpack_require__(92); + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString = objectProto.toString; + + /** Built-in value references. */ + var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + + /** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ + function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; + } + + module.exports = getRawTag; + + +/***/ }), +/* 96 */ +/***/ (function(module, exports) { + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString = objectProto.toString; + + /** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ + function objectToString(value) { + return nativeObjectToString.call(value); + } + + module.exports = objectToString; + + +/***/ }), +/* 97 */ +/***/ (function(module, exports) { + + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); + } + + module.exports = isObject; + + +/***/ }), +/* 98 */ +/***/ (function(module, exports) { + + /** Used as references for various `Number` constants. */ + var MAX_SAFE_INTEGER = 9007199254740991; + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + module.exports = isLength; + + +/***/ }), +/* 99 */ +/***/ (function(module, exports) { + + /** Used as references for various `Number` constants. */ + var MAX_SAFE_INTEGER = 9007199254740991; + + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); + } + + module.exports = isIndex; + + +/***/ }), +/* 100 */ +/***/ (function(module, exports, __webpack_require__) { + + var toFinite = __webpack_require__(101); + + /** + * Converts `value` to an integer. + * + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */ + function toInteger(value) { + var result = toFinite(value), + remainder = result % 1; + + return result === result ? (remainder ? result - remainder : result) : 0; + } + + module.exports = toInteger; + + +/***/ }), +/* 101 */ +/***/ (function(module, exports, __webpack_require__) { + + var toNumber = __webpack_require__(102); + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0, + MAX_INTEGER = 1.7976931348623157e+308; + + /** + * Converts `value` to a finite number. + * + * @static + * @memberOf _ + * @since 4.12.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted number. + * @example + * + * _.toFinite(3.2); + * // => 3.2 + * + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toFinite('3.2'); + * // => 3.2 + */ + function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + return value === value ? value : 0; + } + + module.exports = toFinite; + + +/***/ }), +/* 102 */ +/***/ (function(module, exports, __webpack_require__) { + + var isObject = __webpack_require__(97), + isSymbol = __webpack_require__(103); + + /** Used as references for various `Number` constants. */ + var NAN = 0 / 0; + + /** Used to match leading and trailing whitespace. */ + var reTrim = /^\s+|\s+$/g; + + /** Used to detect bad signed hexadecimal string values. */ + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + + /** Used to detect binary string values. */ + var reIsBinary = /^0b[01]+$/i; + + /** Used to detect octal string values. */ + var reIsOctal = /^0o[0-7]+$/i; + + /** Built-in method references without a dependency on `root`. */ + var freeParseInt = parseInt; + + /** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ + function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); + } + + module.exports = toNumber; + + +/***/ }), +/* 103 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseGetTag = __webpack_require__(91), + isObjectLike = __webpack_require__(104); + + /** `Object#toString` result references. */ + var symbolTag = '[object Symbol]'; + + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); + } + + module.exports = isSymbol; + + +/***/ }), +/* 104 */ +/***/ (function(module, exports) { + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return value != null && typeof value == 'object'; + } + + module.exports = isObjectLike; + + +/***/ }), +/* 105 */ +/***/ (function(module, exports) { + + /** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result[resIndex++] = value; + } + } + return result; + } + + module.exports = compact; + + +/***/ }), +/* 106 */ +/***/ (function(module, exports, __webpack_require__) { + + var arrayPush = __webpack_require__(107), + baseFlatten = __webpack_require__(108), + copyArray = __webpack_require__(113), + isArray = __webpack_require__(112); + + /** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ + function concat() { + var length = arguments.length; + if (!length) { + return []; + } + var args = Array(length - 1), + array = arguments[0], + index = length; + + while (index--) { + args[index - 1] = arguments[index]; + } + return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); + } + + module.exports = concat; + + +/***/ }), +/* 107 */ +/***/ (function(module, exports) { + + /** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ + function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; + } + + module.exports = arrayPush; + + +/***/ }), +/* 108 */ +/***/ (function(module, exports, __webpack_require__) { + + var arrayPush = __webpack_require__(107), + isFlattenable = __webpack_require__(109); + + /** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ + function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; + } + + module.exports = baseFlatten; + + +/***/ }), +/* 109 */ +/***/ (function(module, exports, __webpack_require__) { + + var Symbol = __webpack_require__(92), + isArguments = __webpack_require__(110), + isArray = __webpack_require__(112); + + /** Built-in value references. */ + var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; + + /** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); + } + + module.exports = isFlattenable; + + +/***/ }), +/* 110 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseIsArguments = __webpack_require__(111), + isObjectLike = __webpack_require__(104); + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Built-in value references. */ + var propertyIsEnumerable = objectProto.propertyIsEnumerable; + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); + }; + + module.exports = isArguments; + + +/***/ }), +/* 111 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseGetTag = __webpack_require__(91), + isObjectLike = __webpack_require__(104); + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]'; + + /** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ + function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; + } + + module.exports = baseIsArguments; + + +/***/ }), +/* 112 */ +/***/ (function(module, exports) { + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray = Array.isArray; + + module.exports = isArray; + + +/***/ }), +/* 113 */ +/***/ (function(module, exports) { + + /** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ + function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; + } + + module.exports = copyArray; + + +/***/ }), +/* 114 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseDifference = __webpack_require__(115), + baseFlatten = __webpack_require__(108), + baseRest = __webpack_require__(157), + isArrayLikeObject = __webpack_require__(166); + + /** + * Creates an array of `array` values not included in the other given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * **Note:** Unlike `_.pullAll`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.without, _.xor + * @example + * + * _.difference([2, 1], [2, 3]); + * // => [1] + */ + var difference = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) + : []; + }); + + module.exports = difference; + + +/***/ }), +/* 115 */ +/***/ (function(module, exports, __webpack_require__) { + + var SetCache = __webpack_require__(116), + arrayIncludes = __webpack_require__(148), + arrayIncludesWith = __webpack_require__(153), + arrayMap = __webpack_require__(154), + baseUnary = __webpack_require__(155), + cacheHas = __webpack_require__(156); + + /** Used as the size to enable large array optimizations. */ + var LARGE_ARRAY_SIZE = 200; + + /** + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + */ + function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; + + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee == null ? value : iteratee(value); + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; + } + + module.exports = baseDifference; + + +/***/ }), +/* 116 */ +/***/ (function(module, exports, __webpack_require__) { + + var MapCache = __webpack_require__(117), + setCacheAdd = __webpack_require__(146), + setCacheHas = __webpack_require__(147); + + /** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ + function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } + } + + // Add methods to `SetCache`. + SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; + SetCache.prototype.has = setCacheHas; + + module.exports = SetCache; + + +/***/ }), +/* 117 */ +/***/ (function(module, exports, __webpack_require__) { + + var mapCacheClear = __webpack_require__(118), + mapCacheDelete = __webpack_require__(140), + mapCacheGet = __webpack_require__(143), + mapCacheHas = __webpack_require__(144), + mapCacheSet = __webpack_require__(145); + + /** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + // Add methods to `MapCache`. + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype['delete'] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; + + module.exports = MapCache; + + +/***/ }), +/* 118 */ +/***/ (function(module, exports, __webpack_require__) { + + var Hash = __webpack_require__(119), + ListCache = __webpack_require__(132), + Map = __webpack_require__(139); + + /** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ + function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; + } + + module.exports = mapCacheClear; + + +/***/ }), +/* 119 */ +/***/ (function(module, exports, __webpack_require__) { + + var hashClear = __webpack_require__(120), + hashDelete = __webpack_require__(128), + hashGet = __webpack_require__(129), + hashHas = __webpack_require__(130), + hashSet = __webpack_require__(131); + + /** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + // Add methods to `Hash`. + Hash.prototype.clear = hashClear; + Hash.prototype['delete'] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; + + module.exports = Hash; + + +/***/ }), +/* 120 */ +/***/ (function(module, exports, __webpack_require__) { + + var nativeCreate = __webpack_require__(121); + + /** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; + } + + module.exports = hashClear; + + +/***/ }), +/* 121 */ +/***/ (function(module, exports, __webpack_require__) { + + var getNative = __webpack_require__(122); + + /* Built-in method references that are verified to be native. */ + var nativeCreate = getNative(Object, 'create'); + + module.exports = nativeCreate; + + +/***/ }), +/* 122 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseIsNative = __webpack_require__(123), + getValue = __webpack_require__(127); + + /** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ + function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; + } + + module.exports = getNative; + + +/***/ }), +/* 123 */ +/***/ (function(module, exports, __webpack_require__) { + + var isFunction = __webpack_require__(90), + isMasked = __webpack_require__(124), + isObject = __webpack_require__(97), + toSource = __webpack_require__(126); + + /** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + + /** Used to detect host constructors (Safari). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; + + /** Used for built-in method references. */ + var funcProto = Function.prototype, + objectProto = Object.prototype; + + /** Used to resolve the decompiled source of functions. */ + var funcToString = funcProto.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); + + /** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ + function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); + } + + module.exports = baseIsNative; + + +/***/ }), +/* 124 */ +/***/ (function(module, exports, __webpack_require__) { + + var coreJsData = __webpack_require__(125); + + /** Used to detect methods masquerading as native. */ + var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; + }()); + + /** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ + function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); + } + + module.exports = isMasked; + + +/***/ }), +/* 125 */ +/***/ (function(module, exports, __webpack_require__) { + + var root = __webpack_require__(93); + + /** Used to detect overreaching core-js shims. */ + var coreJsData = root['__core-js_shared__']; + + module.exports = coreJsData; + + +/***/ }), +/* 126 */ +/***/ (function(module, exports) { + + /** Used for built-in method references. */ + var funcProto = Function.prototype; + + /** Used to resolve the decompiled source of functions. */ + var funcToString = funcProto.toString; + + /** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; + } + + module.exports = toSource; + + +/***/ }), +/* 127 */ +/***/ (function(module, exports) { + + /** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function getValue(object, key) { + return object == null ? undefined : object[key]; + } + + module.exports = getValue; + + +/***/ }), +/* 128 */ +/***/ (function(module, exports) { + + /** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; + } + + module.exports = hashDelete; + + +/***/ }), +/* 129 */ +/***/ (function(module, exports, __webpack_require__) { + + var nativeCreate = __webpack_require__(121); + + /** Used to stand-in for `undefined` hash values. */ + var HASH_UNDEFINED = '__lodash_hash_undefined__'; + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; + } + + module.exports = hashGet; + + +/***/ }), +/* 130 */ +/***/ (function(module, exports, __webpack_require__) { + + var nativeCreate = __webpack_require__(121); + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); + } + + module.exports = hashHas; + + +/***/ }), +/* 131 */ +/***/ (function(module, exports, __webpack_require__) { + + var nativeCreate = __webpack_require__(121); + + /** Used to stand-in for `undefined` hash values. */ + var HASH_UNDEFINED = '__lodash_hash_undefined__'; + + /** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ + function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; + } + + module.exports = hashSet; + + +/***/ }), +/* 132 */ +/***/ (function(module, exports, __webpack_require__) { + + var listCacheClear = __webpack_require__(133), + listCacheDelete = __webpack_require__(134), + listCacheGet = __webpack_require__(136), + listCacheHas = __webpack_require__(137), + listCacheSet = __webpack_require__(138); + + /** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + // Add methods to `ListCache`. + ListCache.prototype.clear = listCacheClear; + ListCache.prototype['delete'] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; + + module.exports = ListCache; + + +/***/ }), +/* 133 */ +/***/ (function(module, exports) { + + /** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ + function listCacheClear() { + this.__data__ = []; + this.size = 0; + } + + module.exports = listCacheClear; + + +/***/ }), +/* 134 */ +/***/ (function(module, exports, __webpack_require__) { + + var assocIndexOf = __webpack_require__(135); + + /** Used for built-in method references. */ + var arrayProto = Array.prototype; + + /** Built-in value references. */ + var splice = arrayProto.splice; + + /** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; + } + + module.exports = listCacheDelete; + + +/***/ }), +/* 135 */ +/***/ (function(module, exports, __webpack_require__) { + + var eq = __webpack_require__(88); + + /** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; + } + + module.exports = assocIndexOf; + + +/***/ }), +/* 136 */ +/***/ (function(module, exports, __webpack_require__) { + + var assocIndexOf = __webpack_require__(135); + + /** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; + } + + module.exports = listCacheGet; + + +/***/ }), +/* 137 */ +/***/ (function(module, exports, __webpack_require__) { + + var assocIndexOf = __webpack_require__(135); + + /** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; + } + + module.exports = listCacheHas; + + +/***/ }), +/* 138 */ +/***/ (function(module, exports, __webpack_require__) { + + var assocIndexOf = __webpack_require__(135); + + /** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ + function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; + } + + module.exports = listCacheSet; + + +/***/ }), +/* 139 */ +/***/ (function(module, exports, __webpack_require__) { + + var getNative = __webpack_require__(122), + root = __webpack_require__(93); + + /* Built-in method references that are verified to be native. */ + var Map = getNative(root, 'Map'); + + module.exports = Map; + + +/***/ }), +/* 140 */ +/***/ (function(module, exports, __webpack_require__) { + + var getMapData = __webpack_require__(141); + + /** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; + } + + module.exports = mapCacheDelete; + + +/***/ }), +/* 141 */ +/***/ (function(module, exports, __webpack_require__) { + + var isKeyable = __webpack_require__(142); + + /** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; + } + + module.exports = getMapData; + + +/***/ }), +/* 142 */ +/***/ (function(module, exports) { + + /** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ + function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); + } + + module.exports = isKeyable; + + +/***/ }), +/* 143 */ +/***/ (function(module, exports, __webpack_require__) { + + var getMapData = __webpack_require__(141); + + /** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function mapCacheGet(key) { + return getMapData(this, key).get(key); + } + + module.exports = mapCacheGet; + + +/***/ }), +/* 144 */ +/***/ (function(module, exports, __webpack_require__) { + + var getMapData = __webpack_require__(141); + + /** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function mapCacheHas(key) { + return getMapData(this, key).has(key); + } + + module.exports = mapCacheHas; + + +/***/ }), +/* 145 */ +/***/ (function(module, exports, __webpack_require__) { + + var getMapData = __webpack_require__(141); + + /** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ + function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; + } + + module.exports = mapCacheSet; + + +/***/ }), +/* 146 */ +/***/ (function(module, exports) { + + /** Used to stand-in for `undefined` hash values. */ + var HASH_UNDEFINED = '__lodash_hash_undefined__'; + + /** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ + function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; + } + + module.exports = setCacheAdd; + + +/***/ }), +/* 147 */ +/***/ (function(module, exports) { + + /** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ + function setCacheHas(value) { + return this.__data__.has(value); + } + + module.exports = setCacheHas; + + +/***/ }), +/* 148 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseIndexOf = __webpack_require__(149); + + /** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; + } + + module.exports = arrayIncludes; + + +/***/ }), +/* 149 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseFindIndex = __webpack_require__(150), + baseIsNaN = __webpack_require__(151), + strictIndexOf = __webpack_require__(152); + + /** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOf(array, value, fromIndex) { + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); + } + + module.exports = baseIndexOf; + + +/***/ }), +/* 150 */ +/***/ (function(module, exports) { + + /** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; + } + + module.exports = baseFindIndex; + + +/***/ }), +/* 151 */ +/***/ (function(module, exports) { + + /** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ + function baseIsNaN(value) { + return value !== value; + } + + module.exports = baseIsNaN; + + +/***/ }), +/* 152 */ +/***/ (function(module, exports) { + + /** + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + module.exports = strictIndexOf; + + +/***/ }), +/* 153 */ +/***/ (function(module, exports) { + + /** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; + } + + module.exports = arrayIncludesWith; + + +/***/ }), +/* 154 */ +/***/ (function(module, exports) { + + /** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; + } + + module.exports = arrayMap; + + +/***/ }), +/* 155 */ +/***/ (function(module, exports) { + + /** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ + function baseUnary(func) { + return function(value) { + return func(value); + }; + } + + module.exports = baseUnary; + + +/***/ }), +/* 156 */ +/***/ (function(module, exports) { + + /** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function cacheHas(cache, key) { + return cache.has(key); + } + + module.exports = cacheHas; + + +/***/ }), +/* 157 */ +/***/ (function(module, exports, __webpack_require__) { + + var identity = __webpack_require__(158), + overRest = __webpack_require__(159), + setToString = __webpack_require__(161); + + /** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ + function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); + } + + module.exports = baseRest; + + +/***/ }), +/* 158 */ +/***/ (function(module, exports) { + + /** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ + function identity(value) { + return value; + } + + module.exports = identity; + + +/***/ }), +/* 159 */ +/***/ (function(module, exports, __webpack_require__) { + + var apply = __webpack_require__(160); + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeMax = Math.max; + + /** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ + function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; + } + + module.exports = overRest; + + +/***/ }), +/* 160 */ +/***/ (function(module, exports) { + + /** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ + function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); + } + + module.exports = apply; + + +/***/ }), +/* 161 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseSetToString = __webpack_require__(162), + shortOut = __webpack_require__(165); + + /** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var setToString = shortOut(baseSetToString); + + module.exports = setToString; + + +/***/ }), +/* 162 */ +/***/ (function(module, exports, __webpack_require__) { + + var constant = __webpack_require__(163), + defineProperty = __webpack_require__(164), + identity = __webpack_require__(158); + + /** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); + }; + + module.exports = baseSetToString; + + +/***/ }), +/* 163 */ +/***/ (function(module, exports) { + + /** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new constant function. + * @example + * + * var objects = _.times(2, _.constant({ 'a': 1 })); + * + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] + * + * console.log(objects[0] === objects[1]); + * // => true + */ + function constant(value) { + return function() { + return value; + }; + } + + module.exports = constant; + + +/***/ }), +/* 164 */ +/***/ (function(module, exports, __webpack_require__) { + + var getNative = __webpack_require__(122); + + var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} + }()); + + module.exports = defineProperty; + + +/***/ }), +/* 165 */ +/***/ (function(module, exports) { + + /** Used to detect hot functions by number of calls within a span of milliseconds. */ + var HOT_COUNT = 800, + HOT_SPAN = 16; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeNow = Date.now; + + /** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ + function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; + } + + module.exports = shortOut; + + +/***/ }), +/* 166 */ +/***/ (function(module, exports, __webpack_require__) { + + var isArrayLike = __webpack_require__(89), + isObjectLike = __webpack_require__(104); + + /** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + + module.exports = isArrayLikeObject; + + +/***/ }), +/* 167 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseDifference = __webpack_require__(115), + baseFlatten = __webpack_require__(108), + baseIteratee = __webpack_require__(168), + baseRest = __webpack_require__(157), + isArrayLikeObject = __webpack_require__(166), + last = __webpack_require__(228); + + /** + * This method is like `_.difference` except that it accepts `iteratee` which + * is invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * **Note:** Unlike `_.pullAllBy`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2] + * + * // The `_.property` iteratee shorthand. + * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var differenceBy = baseRest(function(array, values) { + var iteratee = last(values); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), baseIteratee(iteratee, 2)) + : []; + }); + + module.exports = differenceBy; + + +/***/ }), +/* 168 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseMatches = __webpack_require__(169), + baseMatchesProperty = __webpack_require__(211), + identity = __webpack_require__(158), + isArray = __webpack_require__(112), + property = __webpack_require__(225); + + /** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ + function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); + } + + module.exports = baseIteratee; + + +/***/ }), +/* 169 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseIsMatch = __webpack_require__(170), + getMatchData = __webpack_require__(208), + matchesStrictComparable = __webpack_require__(210); + + /** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; + } + + module.exports = baseMatches; + + +/***/ }), +/* 170 */ +/***/ (function(module, exports, __webpack_require__) { + + var Stack = __webpack_require__(171), + baseIsEqual = __webpack_require__(177); + + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + + /** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ + function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) + : result + )) { + return false; + } + } + } + return true; + } + + module.exports = baseIsMatch; + + +/***/ }), +/* 171 */ +/***/ (function(module, exports, __webpack_require__) { + + var ListCache = __webpack_require__(132), + stackClear = __webpack_require__(172), + stackDelete = __webpack_require__(173), + stackGet = __webpack_require__(174), + stackHas = __webpack_require__(175), + stackSet = __webpack_require__(176); + + /** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; + } + + // Add methods to `Stack`. + Stack.prototype.clear = stackClear; + Stack.prototype['delete'] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; + + module.exports = Stack; + + +/***/ }), +/* 172 */ +/***/ (function(module, exports, __webpack_require__) { + + var ListCache = __webpack_require__(132); + + /** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ + function stackClear() { + this.__data__ = new ListCache; + this.size = 0; + } + + module.exports = stackClear; + + +/***/ }), +/* 173 */ +/***/ (function(module, exports) { + + /** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; + } + + module.exports = stackDelete; + + +/***/ }), +/* 174 */ +/***/ (function(module, exports) { + + /** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function stackGet(key) { + return this.__data__.get(key); + } + + module.exports = stackGet; + + +/***/ }), +/* 175 */ +/***/ (function(module, exports) { + + /** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function stackHas(key) { + return this.__data__.has(key); + } + + module.exports = stackHas; + + +/***/ }), +/* 176 */ +/***/ (function(module, exports, __webpack_require__) { + + var ListCache = __webpack_require__(132), + Map = __webpack_require__(139), + MapCache = __webpack_require__(117); + + /** Used as the size to enable large array optimizations. */ + var LARGE_ARRAY_SIZE = 200; + + /** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ + function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; + } + + module.exports = stackSet; + + +/***/ }), +/* 177 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseIsEqualDeep = __webpack_require__(178), + isObjectLike = __webpack_require__(104); + + /** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); + } + + module.exports = baseIsEqual; + + +/***/ }), +/* 178 */ +/***/ (function(module, exports, __webpack_require__) { + + var Stack = __webpack_require__(171), + equalArrays = __webpack_require__(179), + equalByTag = __webpack_require__(181), + equalObjects = __webpack_require__(185), + getTag = __webpack_require__(203), + isArray = __webpack_require__(112), + isBuffer = __webpack_require__(194), + isTypedArray = __webpack_require__(196); + + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + objectTag = '[object Object]'; + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); + } + + module.exports = baseIsEqualDeep; + + +/***/ }), +/* 179 */ +/***/ (function(module, exports, __webpack_require__) { + + var SetCache = __webpack_require__(116), + arraySome = __webpack_require__(180), + cacheHas = __webpack_require__(156); + + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + + /** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ + function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; + } + + module.exports = equalArrays; + + +/***/ }), +/* 180 */ +/***/ (function(module, exports) { + + /** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; + } + + module.exports = arraySome; + + +/***/ }), +/* 181 */ +/***/ (function(module, exports, __webpack_require__) { + + var Symbol = __webpack_require__(92), + Uint8Array = __webpack_require__(182), + eq = __webpack_require__(88), + equalArrays = __webpack_require__(179), + mapToArray = __webpack_require__(183), + setToArray = __webpack_require__(184); + + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + + /** `Object#toString` result references. */ + var boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + mapTag = '[object Map]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]'; + + var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]'; + + /** Used to convert symbols to primitives and strings. */ + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + + /** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; + } + + module.exports = equalByTag; + + +/***/ }), +/* 182 */ +/***/ (function(module, exports, __webpack_require__) { + + var root = __webpack_require__(93); + + /** Built-in value references. */ + var Uint8Array = root.Uint8Array; + + module.exports = Uint8Array; + + +/***/ }), +/* 183 */ +/***/ (function(module, exports) { + + /** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ + function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; + } + + module.exports = mapToArray; + + +/***/ }), +/* 184 */ +/***/ (function(module, exports) { + + /** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ + function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; + } + + module.exports = setToArray; + + +/***/ }), +/* 185 */ +/***/ (function(module, exports, __webpack_require__) { + + var getAllKeys = __webpack_require__(186); + + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1; + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; + } + + module.exports = equalObjects; + + +/***/ }), +/* 186 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseGetAllKeys = __webpack_require__(187), + getSymbols = __webpack_require__(188), + keys = __webpack_require__(191); + + /** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); + } + + module.exports = getAllKeys; + + +/***/ }), +/* 187 */ +/***/ (function(module, exports, __webpack_require__) { + + var arrayPush = __webpack_require__(107), + isArray = __webpack_require__(112); + + /** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ + function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); + } + + module.exports = baseGetAllKeys; + + +/***/ }), +/* 188 */ +/***/ (function(module, exports, __webpack_require__) { + + var arrayFilter = __webpack_require__(189), + stubArray = __webpack_require__(190); + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Built-in value references. */ + var propertyIsEnumerable = objectProto.propertyIsEnumerable; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeGetSymbols = Object.getOwnPropertySymbols; + + /** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); + }; + + module.exports = getSymbols; + + +/***/ }), +/* 189 */ +/***/ (function(module, exports) { + + /** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; + } + + module.exports = arrayFilter; + + +/***/ }), +/* 190 */ +/***/ (function(module, exports) { + + /** + * This method returns a new empty array. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {Array} Returns the new empty array. + * @example + * + * var arrays = _.times(2, _.stubArray); + * + * console.log(arrays); + * // => [[], []] + * + * console.log(arrays[0] === arrays[1]); + * // => false + */ + function stubArray() { + return []; + } + + module.exports = stubArray; + + +/***/ }), +/* 191 */ +/***/ (function(module, exports, __webpack_require__) { + + var arrayLikeKeys = __webpack_require__(192), + baseKeys = __webpack_require__(199), + isArrayLike = __webpack_require__(89); + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); + } + + module.exports = keys; + + +/***/ }), +/* 192 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseTimes = __webpack_require__(193), + isArguments = __webpack_require__(110), + isArray = __webpack_require__(112), + isBuffer = __webpack_require__(194), + isIndex = __webpack_require__(99), + isTypedArray = __webpack_require__(196); + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ + function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; + } + + module.exports = arrayLikeKeys; + + +/***/ }), +/* 193 */ +/***/ (function(module, exports) { + + /** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ + function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; + } + + module.exports = baseTimes; + + +/***/ }), +/* 194 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(93), + stubFalse = __webpack_require__(195); + + /** Detect free variable `exports`. */ + var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = freeModule && freeModule.exports === freeExports; + + /** Built-in value references. */ + var Buffer = moduleExports ? root.Buffer : undefined; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; + + /** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ + var isBuffer = nativeIsBuffer || stubFalse; + + module.exports = isBuffer; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(59)(module))) + +/***/ }), +/* 195 */ +/***/ (function(module, exports) { + + /** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ + function stubFalse() { + return false; + } + + module.exports = stubFalse; + + +/***/ }), +/* 196 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseIsTypedArray = __webpack_require__(197), + baseUnary = __webpack_require__(155), + nodeUtil = __webpack_require__(198); + + /* Node.js helper references. */ + var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + + /** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ + var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + + module.exports = isTypedArray; + + +/***/ }), +/* 197 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseGetTag = __webpack_require__(91), + isLength = __webpack_require__(98), + isObjectLike = __webpack_require__(104); + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + weakMapTag = '[object WeakMap]'; + + var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + + /** Used to identify `toStringTag` values of typed arrays. */ + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = + typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = + typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = + typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = + typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = + typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = + typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = + typedArrayTags[errorTag] = typedArrayTags[funcTag] = + typedArrayTags[mapTag] = typedArrayTags[numberTag] = + typedArrayTags[objectTag] = typedArrayTags[regexpTag] = + typedArrayTags[setTag] = typedArrayTags[stringTag] = + typedArrayTags[weakMapTag] = false; + + /** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ + function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; + } + + module.exports = baseIsTypedArray; + + +/***/ }), +/* 198 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(94); + + /** Detect free variable `exports`. */ + var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = freeModule && freeModule.exports === freeExports; + + /** Detect free variable `process` from Node.js. */ + var freeProcess = moduleExports && freeGlobal.process; + + /** Used to access faster Node.js helpers. */ + var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; + + if (types) { + return types; + } + + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} + }()); + + module.exports = nodeUtil; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(59)(module))) + +/***/ }), +/* 199 */ +/***/ (function(module, exports, __webpack_require__) { + + var isPrototype = __webpack_require__(200), + nativeKeys = __webpack_require__(201); + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; + } + + module.exports = baseKeys; + + +/***/ }), +/* 200 */ +/***/ (function(module, exports) { + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; + } + + module.exports = isPrototype; + + +/***/ }), +/* 201 */ +/***/ (function(module, exports, __webpack_require__) { + + var overArg = __webpack_require__(202); + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeKeys = overArg(Object.keys, Object); + + module.exports = nativeKeys; + + +/***/ }), +/* 202 */ +/***/ (function(module, exports) { + + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + + module.exports = overArg; + + +/***/ }), +/* 203 */ +/***/ (function(module, exports, __webpack_require__) { + + var DataView = __webpack_require__(204), + Map = __webpack_require__(139), + Promise = __webpack_require__(205), + Set = __webpack_require__(206), + WeakMap = __webpack_require__(207), + baseGetTag = __webpack_require__(91), + toSource = __webpack_require__(126); + + /** `Object#toString` result references. */ + var mapTag = '[object Map]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + setTag = '[object Set]', + weakMapTag = '[object WeakMap]'; + + var dataViewTag = '[object DataView]'; + + /** Used to detect maps, sets, and weakmaps. */ + var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + + /** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + var getTag = baseGetTag; + + // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. + if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; + } + + module.exports = getTag; + + +/***/ }), +/* 204 */ +/***/ (function(module, exports, __webpack_require__) { + + var getNative = __webpack_require__(122), + root = __webpack_require__(93); + + /* Built-in method references that are verified to be native. */ + var DataView = getNative(root, 'DataView'); + + module.exports = DataView; + + +/***/ }), +/* 205 */ +/***/ (function(module, exports, __webpack_require__) { + + var getNative = __webpack_require__(122), + root = __webpack_require__(93); + + /* Built-in method references that are verified to be native. */ + var Promise = getNative(root, 'Promise'); + + module.exports = Promise; + + +/***/ }), +/* 206 */ +/***/ (function(module, exports, __webpack_require__) { + + var getNative = __webpack_require__(122), + root = __webpack_require__(93); + + /* Built-in method references that are verified to be native. */ + var Set = getNative(root, 'Set'); + + module.exports = Set; + + +/***/ }), +/* 207 */ +/***/ (function(module, exports, __webpack_require__) { + + var getNative = __webpack_require__(122), + root = __webpack_require__(93); + + /* Built-in method references that are verified to be native. */ + var WeakMap = getNative(root, 'WeakMap'); + + module.exports = WeakMap; + + +/***/ }), +/* 208 */ +/***/ (function(module, exports, __webpack_require__) { + + var isStrictComparable = __webpack_require__(209), + keys = __webpack_require__(191); + + /** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ + function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; + } + + module.exports = getMatchData; + + +/***/ }), +/* 209 */ +/***/ (function(module, exports, __webpack_require__) { + + var isObject = __webpack_require__(97); + + /** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ + function isStrictComparable(value) { + return value === value && !isObject(value); + } + + module.exports = isStrictComparable; + + +/***/ }), +/* 210 */ +/***/ (function(module, exports) { + + /** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ + function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; + } + + module.exports = matchesStrictComparable; + + +/***/ }), +/* 211 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseIsEqual = __webpack_require__(177), + get = __webpack_require__(212), + hasIn = __webpack_require__(222), + isKey = __webpack_require__(215), + isStrictComparable = __webpack_require__(209), + matchesStrictComparable = __webpack_require__(210), + toKey = __webpack_require__(221); + + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + + /** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); + }; + } + + module.exports = baseMatchesProperty; + + +/***/ }), +/* 212 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseGet = __webpack_require__(213); + + /** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ + function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; + } + + module.exports = get; + + +/***/ }), +/* 213 */ +/***/ (function(module, exports, __webpack_require__) { + + var castPath = __webpack_require__(214), + toKey = __webpack_require__(221); + + /** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ + function baseGet(object, path) { + path = castPath(path, object); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; + } + + module.exports = baseGet; + + +/***/ }), +/* 214 */ +/***/ (function(module, exports, __webpack_require__) { + + var isArray = __webpack_require__(112), + isKey = __webpack_require__(215), + stringToPath = __webpack_require__(216), + toString = __webpack_require__(219); + + /** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @param {Object} [object] The object to query keys on. + * @returns {Array} Returns the cast property path array. + */ + function castPath(value, object) { + if (isArray(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString(value)); + } + + module.exports = castPath; + + +/***/ }), +/* 215 */ +/***/ (function(module, exports, __webpack_require__) { + + var isArray = __webpack_require__(112), + isSymbol = __webpack_require__(103); + + /** Used to match property names within property paths. */ + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/; + + /** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ + function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); + } + + module.exports = isKey; + + +/***/ }), +/* 216 */ +/***/ (function(module, exports, __webpack_require__) { + + var memoizeCapped = __webpack_require__(217); + + /** Used to match property names within property paths. */ + var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + + /** Used to match backslashes in property paths. */ + var reEscapeChar = /\\(\\)?/g; + + /** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ + var stringToPath = memoizeCapped(function(string) { + var result = []; + if (string.charCodeAt(0) === 46 /* . */) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; + }); + + module.exports = stringToPath; + + +/***/ }), +/* 217 */ +/***/ (function(module, exports, __webpack_require__) { + + var memoize = __webpack_require__(218); + + /** Used as the maximum memoize cache size. */ + var MAX_MEMOIZE_SIZE = 500; + + /** + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. + */ + function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); + + var cache = result.cache; + return result; + } + + module.exports = memoizeCapped; + + +/***/ }), +/* 218 */ +/***/ (function(module, exports, __webpack_require__) { + + var MapCache = __webpack_require__(117); + + /** Error message constants. */ + var FUNC_ERROR_TEXT = 'Expected a function'; + + /** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `clear`, `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ + function memoize(func, resolver) { + if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result) || cache; + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; + } + + // Expose `MapCache`. + memoize.Cache = MapCache; + + module.exports = memoize; + + +/***/ }), +/* 219 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseToString = __webpack_require__(220); + + /** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + function toString(value) { + return value == null ? '' : baseToString(value); + } + + module.exports = toString; + + +/***/ }), +/* 220 */ +/***/ (function(module, exports, __webpack_require__) { + + var Symbol = __webpack_require__(92), + arrayMap = __webpack_require__(154), + isArray = __webpack_require__(112), + isSymbol = __webpack_require__(103); + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0; + + /** Used to convert symbols to primitives and strings. */ + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + + /** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ + function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + module.exports = baseToString; + + +/***/ }), +/* 221 */ +/***/ (function(module, exports, __webpack_require__) { + + var isSymbol = __webpack_require__(103); + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0; + + /** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ + function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + module.exports = toKey; + + +/***/ }), +/* 222 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseHasIn = __webpack_require__(223), + hasPath = __webpack_require__(224); + + /** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ + function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); + } + + module.exports = hasIn; + + +/***/ }), +/* 223 */ +/***/ (function(module, exports) { + + /** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHasIn(object, key) { + return object != null && key in Object(object); + } + + module.exports = baseHasIn; + + +/***/ }), +/* 224 */ +/***/ (function(module, exports, __webpack_require__) { + + var castPath = __webpack_require__(214), + isArguments = __webpack_require__(110), + isArray = __webpack_require__(112), + isIndex = __webpack_require__(99), + isLength = __webpack_require__(98), + toKey = __webpack_require__(221); + + /** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ + function hasPath(object, path, hasFunc) { + path = castPath(path, object); + + var index = -1, + length = path.length, + result = false; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); + } + + module.exports = hasPath; + + +/***/ }), +/* 225 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseProperty = __webpack_require__(226), + basePropertyDeep = __webpack_require__(227), + isKey = __webpack_require__(215), + toKey = __webpack_require__(221); + + /** + * Creates a function that returns the value at `path` of a given object. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + * @example + * + * var objects = [ + * { 'a': { 'b': 2 } }, + * { 'a': { 'b': 1 } } + * ]; + * + * _.map(objects, _.property('a.b')); + * // => [2, 1] + * + * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); + * // => [1, 2] + */ + function property(path) { + return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); + } + + module.exports = property; + + +/***/ }), +/* 226 */ +/***/ (function(module, exports) { + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + module.exports = baseProperty; + + +/***/ }), +/* 227 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseGet = __webpack_require__(213); + + /** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; + } + + module.exports = basePropertyDeep; + + +/***/ }), +/* 228 */ +/***/ (function(module, exports) { + + /** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ + function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; + } + + module.exports = last; + + +/***/ }), +/* 229 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseDifference = __webpack_require__(115), + baseFlatten = __webpack_require__(108), + baseRest = __webpack_require__(157), + isArrayLikeObject = __webpack_require__(166), + last = __webpack_require__(228); + + /** + * This method is like `_.difference` except that it accepts `comparator` + * which is invoked to compare elements of `array` to `values`. The order and + * references of result values are determined by the first array. The comparator + * is invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.pullAllWith`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * + * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); + * // => [{ 'x': 2, 'y': 1 }] + */ + var differenceWith = baseRest(function(array, values) { + var comparator = last(values); + if (isArrayLikeObject(comparator)) { + comparator = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) + : []; + }); + + module.exports = differenceWith; + + +/***/ }), +/* 230 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseSlice = __webpack_require__(86), + toInteger = __webpack_require__(100); + + /** + * Creates a slice of `array` with `n` elements dropped from the beginning. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.drop([1, 2, 3]); + * // => [2, 3] + * + * _.drop([1, 2, 3], 2); + * // => [3] + * + * _.drop([1, 2, 3], 5); + * // => [] + * + * _.drop([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function drop(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, n < 0 ? 0 : n, length); + } + + module.exports = drop; + + +/***/ }), +/* 231 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseSlice = __webpack_require__(86), + toInteger = __webpack_require__(100); + + /** + * Creates a slice of `array` with `n` elements dropped from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropRight([1, 2, 3]); + * // => [1, 2] + * + * _.dropRight([1, 2, 3], 2); + * // => [1] + * + * _.dropRight([1, 2, 3], 5); + * // => [] + * + * _.dropRight([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function dropRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + module.exports = dropRight; + + +/***/ }), +/* 232 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseIteratee = __webpack_require__(168), + baseWhile = __webpack_require__(233); + + /** + * Creates a slice of `array` excluding elements dropped from the end. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.dropRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney'] + * + * // The `_.matches` iteratee shorthand. + * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropRightWhile(users, ['active', false]); + * // => objects for ['barney'] + * + * // The `_.property` iteratee shorthand. + * _.dropRightWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, baseIteratee(predicate, 3), true, true) + : []; + } + + module.exports = dropRightWhile; + + +/***/ }), +/* 233 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseSlice = __webpack_require__(86); + + /** + * The base implementation of methods like `_.dropWhile` and `_.takeWhile` + * without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to query. + * @param {Function} predicate The function invoked per iteration. + * @param {boolean} [isDrop] Specify dropping elements instead of taking them. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the slice of `array`. + */ + function baseWhile(array, predicate, isDrop, fromRight) { + var length = array.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length) && + predicate(array[index], index, array)) {} + + return isDrop + ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) + : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); + } + + module.exports = baseWhile; + + +/***/ }), +/* 234 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseIteratee = __webpack_require__(168), + baseWhile = __webpack_require__(233); + + /** + * Creates a slice of `array` excluding elements dropped from the beginning. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.dropWhile(users, function(o) { return !o.active; }); + * // => objects for ['pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.dropWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropWhile(users, ['active', false]); + * // => objects for ['pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.dropWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, baseIteratee(predicate, 3), true) + : []; + } + + module.exports = dropWhile; + + +/***/ }), +/* 235 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseFill = __webpack_require__(236), + isIterateeCall = __webpack_require__(87); + + /** + * Fills elements of `array` with `value` from `start` up to, but not + * including, `end`. + * + * **Note:** This method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Array + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.fill(array, 'a'); + * console.log(array); + * // => ['a', 'a', 'a'] + * + * _.fill(Array(3), 2); + * // => [2, 2, 2] + * + * _.fill([4, 6, 8, 10], '*', 1, 3); + * // => [4, '*', '*', 10] + */ + function fill(array, value, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { + start = 0; + end = length; + } + return baseFill(array, value, start, end); + } + + module.exports = fill; + + +/***/ }), +/* 236 */ +/***/ (function(module, exports, __webpack_require__) { + + var toInteger = __webpack_require__(100), + toLength = __webpack_require__(237); + + /** + * The base implementation of `_.fill` without an iteratee call guard. + * + * @private + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + */ + function baseFill(array, value, start, end) { + var length = array.length; + + start = toInteger(start); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (end === undefined || end > length) ? length : toInteger(end); + if (end < 0) { + end += length; + } + end = start > end ? 0 : toLength(end); + while (start < end) { + array[start++] = value; + } + return array; + } + + module.exports = baseFill; + + +/***/ }), +/* 237 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseClamp = __webpack_require__(238), + toInteger = __webpack_require__(100); + + /** Used as references for the maximum length and index of an array. */ + var MAX_ARRAY_LENGTH = 4294967295; + + /** + * Converts `value` to an integer suitable for use as the length of an + * array-like object. + * + * **Note:** This method is based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toLength(3.2); + * // => 3 + * + * _.toLength(Number.MIN_VALUE); + * // => 0 + * + * _.toLength(Infinity); + * // => 4294967295 + * + * _.toLength('3.2'); + * // => 3 + */ + function toLength(value) { + return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; + } + + module.exports = toLength; + + +/***/ }), +/* 238 */ +/***/ (function(module, exports) { + + /** + * The base implementation of `_.clamp` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + */ + function baseClamp(number, lower, upper) { + if (number === number) { + if (upper !== undefined) { + number = number <= upper ? number : upper; + } + if (lower !== undefined) { + number = number >= lower ? number : lower; + } + } + return number; + } + + module.exports = baseClamp; + + +/***/ }), +/* 239 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseFindIndex = __webpack_require__(150), + baseIteratee = __webpack_require__(168), + toInteger = __webpack_require__(100); + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeMax = Math.max; + + /** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ + function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, baseIteratee(predicate, 3), index); + } + + module.exports = findIndex; + + +/***/ }), +/* 240 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseFindIndex = __webpack_require__(150), + baseIteratee = __webpack_require__(168), + toInteger = __webpack_require__(100); + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeMax = Math.max, + nativeMin = Math.min; + + /** + * This method is like `_.findIndex` except that it iterates over elements + * of `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); + * // => 2 + * + * // The `_.matches` iteratee shorthand. + * _.findLastIndex(users, { 'user': 'barney', 'active': true }); + * // => 0 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastIndex(users, ['active', false]); + * // => 2 + * + * // The `_.property` iteratee shorthand. + * _.findLastIndex(users, 'active'); + * // => 0 + */ + function findLastIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length - 1; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = fromIndex < 0 + ? nativeMax(length + index, 0) + : nativeMin(index, length - 1); + } + return baseFindIndex(array, baseIteratee(predicate, 3), index, true); + } + + module.exports = findLastIndex; + + +/***/ }), +/* 241 */ +/***/ (function(module, exports, __webpack_require__) { + + module.exports = __webpack_require__(242); + + +/***/ }), +/* 242 */ +/***/ (function(module, exports) { + + /** + * Gets the first element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias first + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.head([1, 2, 3]); + * // => 1 + * + * _.head([]); + * // => undefined + */ + function head(array) { + return (array && array.length) ? array[0] : undefined; + } + + module.exports = head; + + +/***/ }), +/* 243 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseFlatten = __webpack_require__(108); + + /** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ + function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; + } + + module.exports = flatten; + + +/***/ }), +/* 244 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseFlatten = __webpack_require__(108); + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0; + + /** + * Recursively flattens `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] + */ + function flattenDeep(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, INFINITY) : []; + } + + module.exports = flattenDeep; + + +/***/ }), +/* 245 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseFlatten = __webpack_require__(108), + toInteger = __webpack_require__(100); + + /** + * Recursively flatten `array` up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Array + * @param {Array} array The array to flatten. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * var array = [1, [2, [3, [4]], 5]]; + * + * _.flattenDepth(array, 1); + * // => [1, 2, [3, [4]], 5] + * + * _.flattenDepth(array, 2); + * // => [1, 2, 3, [4], 5] + */ + function flattenDepth(array, depth) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(array, depth); + } + + module.exports = flattenDepth; + + +/***/ }), +/* 246 */ +/***/ (function(module, exports) { + + /** + * The inverse of `_.toPairs`; this method returns an object composed + * from key-value `pairs`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} pairs The key-value pairs. + * @returns {Object} Returns the new object. + * @example + * + * _.fromPairs([['a', 1], ['b', 2]]); + * // => { 'a': 1, 'b': 2 } + */ + function fromPairs(pairs) { + var index = -1, + length = pairs == null ? 0 : pairs.length, + result = {}; + + while (++index < length) { + var pair = pairs[index]; + result[pair[0]] = pair[1]; + } + return result; + } + + module.exports = fromPairs; + + +/***/ }), +/* 247 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseIndexOf = __webpack_require__(149), + toInteger = __webpack_require__(100); + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeMax = Math.max; + + /** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ + function indexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseIndexOf(array, value, index); + } + + module.exports = indexOf; + + +/***/ }), +/* 248 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseSlice = __webpack_require__(86); + + /** + * Gets all but the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + */ + function initial(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 0, -1) : []; + } + + module.exports = initial; + + +/***/ }), +/* 249 */ +/***/ (function(module, exports, __webpack_require__) { + + var arrayMap = __webpack_require__(154), + baseIntersection = __webpack_require__(250), + baseRest = __webpack_require__(157), + castArrayLikeObject = __webpack_require__(251); + + /** + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersection([2, 1], [2, 3]); + * // => [2] + */ + var intersection = baseRest(function(arrays) { + var mapped = arrayMap(arrays, castArrayLikeObject); + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped) + : []; + }); + + module.exports = intersection; + + +/***/ }), +/* 250 */ +/***/ (function(module, exports, __webpack_require__) { + + var SetCache = __webpack_require__(116), + arrayIncludes = __webpack_require__(148), + arrayIncludesWith = __webpack_require__(153), + arrayMap = __webpack_require__(154), + baseUnary = __webpack_require__(155), + cacheHas = __webpack_require__(156); + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeMin = Math.min; + + /** + * The base implementation of methods like `_.intersection`, without support + * for iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + */ + function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; + + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); + } + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) + ? new SetCache(othIndex && array) + : undefined; + } + array = arrays[0]; + + var index = -1, + seen = caches[0]; + + outer: + while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + module.exports = baseIntersection; + + +/***/ }), +/* 251 */ +/***/ (function(module, exports, __webpack_require__) { + + var isArrayLikeObject = __webpack_require__(166); + + /** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ + function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; + } + + module.exports = castArrayLikeObject; + + +/***/ }), +/* 252 */ +/***/ (function(module, exports, __webpack_require__) { + + var arrayMap = __webpack_require__(154), + baseIntersection = __webpack_require__(250), + baseIteratee = __webpack_require__(168), + baseRest = __webpack_require__(157), + castArrayLikeObject = __webpack_require__(251), + last = __webpack_require__(228); + + /** + * This method is like `_.intersection` except that it accepts `iteratee` + * which is invoked for each element of each `arrays` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [2.1] + * + * // The `_.property` iteratee shorthand. + * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }] + */ + var intersectionBy = baseRest(function(arrays) { + var iteratee = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + if (iteratee === last(mapped)) { + iteratee = undefined; + } else { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, baseIteratee(iteratee, 2)) + : []; + }); + + module.exports = intersectionBy; + + +/***/ }), +/* 253 */ +/***/ (function(module, exports, __webpack_require__) { + + var arrayMap = __webpack_require__(154), + baseIntersection = __webpack_require__(250), + baseRest = __webpack_require__(157), + castArrayLikeObject = __webpack_require__(251), + last = __webpack_require__(228); + + /** + * This method is like `_.intersection` except that it accepts `comparator` + * which is invoked to compare elements of `arrays`. The order and references + * of result values are determined by the first array. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.intersectionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }] + */ + var intersectionWith = baseRest(function(arrays) { + var comparator = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + comparator = typeof comparator == 'function' ? comparator : undefined; + if (comparator) { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, undefined, comparator) + : []; + }); + + module.exports = intersectionWith; + + +/***/ }), +/* 254 */ +/***/ (function(module, exports) { + + /** Used for built-in method references. */ + var arrayProto = Array.prototype; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeJoin = arrayProto.join; + + /** + * Converts all elements in `array` into a string separated by `separator`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to convert. + * @param {string} [separator=','] The element separator. + * @returns {string} Returns the joined string. + * @example + * + * _.join(['a', 'b', 'c'], '~'); + * // => 'a~b~c' + */ + function join(array, separator) { + return array == null ? '' : nativeJoin.call(array, separator); + } + + module.exports = join; + + +/***/ }), +/* 255 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseFindIndex = __webpack_require__(150), + baseIsNaN = __webpack_require__(151), + strictLastIndexOf = __webpack_require__(256), + toInteger = __webpack_require__(100); + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeMax = Math.max, + nativeMin = Math.min; + + /** + * This method is like `_.indexOf` except that it iterates over elements of + * `array` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.lastIndexOf([1, 2, 1, 2], 2); + * // => 3 + * + * // Search from the `fromIndex`. + * _.lastIndexOf([1, 2, 1, 2], 2, 2); + * // => 1 + */ + function lastIndexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); + } + return value === value + ? strictLastIndexOf(array, value, index) + : baseFindIndex(array, baseIsNaN, index, true); + } + + module.exports = lastIndexOf; + + +/***/ }), +/* 256 */ +/***/ (function(module, exports) { + + /** + * A specialized version of `_.lastIndexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictLastIndexOf(array, value, fromIndex) { + var index = fromIndex + 1; + while (index--) { + if (array[index] === value) { + return index; + } + } + return index; + } + + module.exports = strictLastIndexOf; + + +/***/ }), +/* 257 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseNth = __webpack_require__(258), + toInteger = __webpack_require__(100); + + /** + * Gets the element at index `n` of `array`. If `n` is negative, the nth + * element from the end is returned. + * + * @static + * @memberOf _ + * @since 4.11.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=0] The index of the element to return. + * @returns {*} Returns the nth element of `array`. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * + * _.nth(array, 1); + * // => 'b' + * + * _.nth(array, -2); + * // => 'c'; + */ + function nth(array, n) { + return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; + } + + module.exports = nth; + + +/***/ }), +/* 258 */ +/***/ (function(module, exports, __webpack_require__) { + + var isIndex = __webpack_require__(99); + + /** + * The base implementation of `_.nth` which doesn't coerce arguments. + * + * @private + * @param {Array} array The array to query. + * @param {number} n The index of the element to return. + * @returns {*} Returns the nth element of `array`. + */ + function baseNth(array, n) { + var length = array.length; + if (!length) { + return; + } + n += n < 0 ? length : 0; + return isIndex(n, length) ? array[n] : undefined; + } + + module.exports = baseNth; + + +/***/ }), +/* 259 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseRest = __webpack_require__(157), + pullAll = __webpack_require__(260); + + /** + * Removes all given values from `array` using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` + * to remove elements from an array by predicate. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...*} [values] The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pull(array, 'a', 'c'); + * console.log(array); + * // => ['b', 'b'] + */ + var pull = baseRest(pullAll); + + module.exports = pull; + + +/***/ }), +/* 260 */ +/***/ (function(module, exports, __webpack_require__) { + + var basePullAll = __webpack_require__(261); + + /** + * This method is like `_.pull` except that it accepts an array of values to remove. + * + * **Note:** Unlike `_.difference`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pullAll(array, ['a', 'c']); + * console.log(array); + * // => ['b', 'b'] + */ + function pullAll(array, values) { + return (array && array.length && values && values.length) + ? basePullAll(array, values) + : array; + } + + module.exports = pullAll; + + +/***/ }), +/* 261 */ +/***/ (function(module, exports, __webpack_require__) { + + var arrayMap = __webpack_require__(154), + baseIndexOf = __webpack_require__(149), + baseIndexOfWith = __webpack_require__(262), + baseUnary = __webpack_require__(155), + copyArray = __webpack_require__(113); + + /** Used for built-in method references. */ + var arrayProto = Array.prototype; + + /** Built-in value references. */ + var splice = arrayProto.splice; + + /** + * The base implementation of `_.pullAllBy` without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + */ + function basePullAll(array, values, iteratee, comparator) { + var indexOf = comparator ? baseIndexOfWith : baseIndexOf, + index = -1, + length = values.length, + seen = array; + + if (array === values) { + values = copyArray(values); + } + if (iteratee) { + seen = arrayMap(array, baseUnary(iteratee)); + } + while (++index < length) { + var fromIndex = 0, + value = values[index], + computed = iteratee ? iteratee(value) : value; + + while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { + if (seen !== array) { + splice.call(seen, fromIndex, 1); + } + splice.call(array, fromIndex, 1); + } + } + return array; + } + + module.exports = basePullAll; + + +/***/ }), +/* 262 */ +/***/ (function(module, exports) { + + /** + * This function is like `baseIndexOf` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @param {Function} comparator The comparator invoked per element. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOfWith(array, value, fromIndex, comparator) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (comparator(array[index], value)) { + return index; + } + } + return -1; + } + + module.exports = baseIndexOfWith; + + +/***/ }), +/* 263 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseIteratee = __webpack_require__(168), + basePullAll = __webpack_require__(261); + + /** + * This method is like `_.pullAll` except that it accepts `iteratee` which is + * invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The iteratee is invoked with one argument: (value). + * + * **Note:** Unlike `_.differenceBy`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; + * + * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); + * console.log(array); + * // => [{ 'x': 2 }] + */ + function pullAllBy(array, values, iteratee) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, baseIteratee(iteratee, 2)) + : array; + } + + module.exports = pullAllBy; + + +/***/ }), +/* 264 */ +/***/ (function(module, exports, __webpack_require__) { + + var basePullAll = __webpack_require__(261); + + /** + * This method is like `_.pullAll` except that it accepts `comparator` which + * is invoked to compare elements of `array` to `values`. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.differenceWith`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; + * + * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); + * console.log(array); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] + */ + function pullAllWith(array, values, comparator) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, undefined, comparator) + : array; + } + + module.exports = pullAllWith; + + +/***/ }), +/* 265 */ +/***/ (function(module, exports, __webpack_require__) { + + var arrayMap = __webpack_require__(154), + baseAt = __webpack_require__(266), + basePullAt = __webpack_require__(267), + compareAscending = __webpack_require__(270), + flatRest = __webpack_require__(271), + isIndex = __webpack_require__(99); + + /** + * Removes elements from `array` corresponding to `indexes` and returns an + * array of removed elements. + * + * **Note:** Unlike `_.at`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...(number|number[])} [indexes] The indexes of elements to remove. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * var pulled = _.pullAt(array, [1, 3]); + * + * console.log(array); + * // => ['a', 'c'] + * + * console.log(pulled); + * // => ['b', 'd'] + */ + var pullAt = flatRest(function(array, indexes) { + var length = array == null ? 0 : array.length, + result = baseAt(array, indexes); + + basePullAt(array, arrayMap(indexes, function(index) { + return isIndex(index, length) ? +index : index; + }).sort(compareAscending)); + + return result; + }); + + module.exports = pullAt; + + +/***/ }), +/* 266 */ +/***/ (function(module, exports, __webpack_require__) { + + var get = __webpack_require__(212); + + /** + * The base implementation of `_.at` without support for individual paths. + * + * @private + * @param {Object} object The object to iterate over. + * @param {string[]} paths The property paths to pick. + * @returns {Array} Returns the picked elements. + */ + function baseAt(object, paths) { + var index = -1, + length = paths.length, + result = Array(length), + skip = object == null; + + while (++index < length) { + result[index] = skip ? undefined : get(object, paths[index]); + } + return result; + } + + module.exports = baseAt; + + +/***/ }), +/* 267 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseUnset = __webpack_require__(268), + isIndex = __webpack_require__(99); + + /** Used for built-in method references. */ + var arrayProto = Array.prototype; + + /** Built-in value references. */ + var splice = arrayProto.splice; + + /** + * The base implementation of `_.pullAt` without support for individual + * indexes or capturing the removed elements. + * + * @private + * @param {Array} array The array to modify. + * @param {number[]} indexes The indexes of elements to remove. + * @returns {Array} Returns `array`. + */ + function basePullAt(array, indexes) { + var length = array ? indexes.length : 0, + lastIndex = length - 1; + + while (length--) { + var index = indexes[length]; + if (length == lastIndex || index !== previous) { + var previous = index; + if (isIndex(index)) { + splice.call(array, index, 1); + } else { + baseUnset(array, index); + } + } + } + return array; + } + + module.exports = basePullAt; + + +/***/ }), +/* 268 */ +/***/ (function(module, exports, __webpack_require__) { + + var castPath = __webpack_require__(214), + last = __webpack_require__(228), + parent = __webpack_require__(269), + toKey = __webpack_require__(221); + + /** + * The base implementation of `_.unset`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The property path to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + */ + function baseUnset(object, path) { + path = castPath(path, object); + object = parent(object, path); + return object == null || delete object[toKey(last(path))]; + } + + module.exports = baseUnset; + + +/***/ }), +/* 269 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseGet = __webpack_require__(213), + baseSlice = __webpack_require__(86); + + /** + * Gets the parent value at `path` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path to get the parent value of. + * @returns {*} Returns the parent value. + */ + function parent(object, path) { + return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); + } + + module.exports = parent; + + +/***/ }), +/* 270 */ +/***/ (function(module, exports, __webpack_require__) { + + var isSymbol = __webpack_require__(103); + + /** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ + function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; + } + + module.exports = compareAscending; + + +/***/ }), +/* 271 */ +/***/ (function(module, exports, __webpack_require__) { + + var flatten = __webpack_require__(243), + overRest = __webpack_require__(159), + setToString = __webpack_require__(161); + + /** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); + } + + module.exports = flatRest; + + +/***/ }), +/* 272 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseIteratee = __webpack_require__(168), + basePullAt = __webpack_require__(267); + + /** + * Removes all elements from `array` that `predicate` returns truthy for + * and returns an array of the removed elements. The predicate is invoked + * with three arguments: (value, index, array). + * + * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` + * to pull elements from an array by value. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = [1, 2, 3, 4]; + * var evens = _.remove(array, function(n) { + * return n % 2 == 0; + * }); + * + * console.log(array); + * // => [1, 3] + * + * console.log(evens); + * // => [2, 4] + */ + function remove(array, predicate) { + var result = []; + if (!(array && array.length)) { + return result; + } + var index = -1, + indexes = [], + length = array.length; + + predicate = baseIteratee(predicate, 3); + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result.push(value); + indexes.push(index); + } + } + basePullAt(array, indexes); + return result; + } + + module.exports = remove; + + +/***/ }), +/* 273 */ +/***/ (function(module, exports) { + + /** Used for built-in method references. */ + var arrayProto = Array.prototype; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeReverse = arrayProto.reverse; + + /** + * Reverses `array` so that the first element becomes the last, the second + * element becomes the second to last, and so on. + * + * **Note:** This method mutates `array` and is based on + * [`Array#reverse`](https://mdn.io/Array/reverse). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.reverse(array); + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function reverse(array) { + return array == null ? array : nativeReverse.call(array); + } + + module.exports = reverse; + + +/***/ }), +/* 274 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseSlice = __webpack_require__(86), + isIterateeCall = __webpack_require__(87), + toInteger = __webpack_require__(100); + + /** + * Creates a slice of `array` from `start` up to, but not including, `end`. + * + * **Note:** This method is used instead of + * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are + * returned. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function slice(array, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { + start = 0; + end = length; + } + else { + start = start == null ? 0 : toInteger(start); + end = end === undefined ? length : toInteger(end); + } + return baseSlice(array, start, end); + } + + module.exports = slice; + + +/***/ }), +/* 275 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseSortedIndex = __webpack_require__(276); + + /** + * Uses a binary search to determine the lowest index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedIndex([30, 50], 40); + * // => 1 + */ + function sortedIndex(array, value) { + return baseSortedIndex(array, value); + } + + module.exports = sortedIndex; + + +/***/ }), +/* 276 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseSortedIndexBy = __webpack_require__(277), + identity = __webpack_require__(158), + isSymbol = __webpack_require__(103); + + /** Used as references for the maximum length and index of an array. */ + var MAX_ARRAY_LENGTH = 4294967295, + HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; + + /** + * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which + * performs a binary search of `array` to determine the index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndex(array, value, retHighest) { + var low = 0, + high = array == null ? low : array.length; + + if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { + while (low < high) { + var mid = (low + high) >>> 1, + computed = array[mid]; + + if (computed !== null && !isSymbol(computed) && + (retHighest ? (computed <= value) : (computed < value))) { + low = mid + 1; + } else { + high = mid; + } + } + return high; + } + return baseSortedIndexBy(array, value, identity, retHighest); + } + + module.exports = baseSortedIndex; + + +/***/ }), +/* 277 */ +/***/ (function(module, exports, __webpack_require__) { + + var isSymbol = __webpack_require__(103); + + /** Used as references for the maximum length and index of an array. */ + var MAX_ARRAY_LENGTH = 4294967295, + MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeFloor = Math.floor, + nativeMin = Math.min; + + /** + * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` + * which invokes `iteratee` for `value` and each element of `array` to compute + * their sort ranking. The iteratee is invoked with one argument; (value). + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} iteratee The iteratee invoked per element. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndexBy(array, value, iteratee, retHighest) { + value = iteratee(value); + + var low = 0, + high = array == null ? 0 : array.length, + valIsNaN = value !== value, + valIsNull = value === null, + valIsSymbol = isSymbol(value), + valIsUndefined = value === undefined; + + while (low < high) { + var mid = nativeFloor((low + high) / 2), + computed = iteratee(array[mid]), + othIsDefined = computed !== undefined, + othIsNull = computed === null, + othIsReflexive = computed === computed, + othIsSymbol = isSymbol(computed); + + if (valIsNaN) { + var setLow = retHighest || othIsReflexive; + } else if (valIsUndefined) { + setLow = othIsReflexive && (retHighest || othIsDefined); + } else if (valIsNull) { + setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); + } else if (valIsSymbol) { + setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); + } else if (othIsNull || othIsSymbol) { + setLow = false; + } else { + setLow = retHighest ? (computed <= value) : (computed < value); + } + if (setLow) { + low = mid + 1; + } else { + high = mid; + } + } + return nativeMin(high, MAX_ARRAY_INDEX); + } + + module.exports = baseSortedIndexBy; + + +/***/ }), +/* 278 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseIteratee = __webpack_require__(168), + baseSortedIndexBy = __webpack_require__(277); + + /** + * This method is like `_.sortedIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); + * // => 0 + */ + function sortedIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, baseIteratee(iteratee, 2)); + } + + module.exports = sortedIndexBy; + + +/***/ }), +/* 279 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseSortedIndex = __webpack_require__(276), + eq = __webpack_require__(88); + + /** + * This method is like `_.indexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedIndexOf([4, 5, 5, 5, 6], 5); + * // => 1 + */ + function sortedIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value); + if (index < length && eq(array[index], value)) { + return index; + } + } + return -1; + } + + module.exports = sortedIndexOf; + + +/***/ }), +/* 280 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseSortedIndex = __webpack_require__(276); + + /** + * This method is like `_.sortedIndex` except that it returns the highest + * index at which `value` should be inserted into `array` in order to + * maintain its sort order. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedLastIndex([4, 5, 5, 5, 6], 5); + * // => 4 + */ + function sortedLastIndex(array, value) { + return baseSortedIndex(array, value, true); + } + + module.exports = sortedLastIndex; + + +/***/ }), +/* 281 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseIteratee = __webpack_require__(168), + baseSortedIndexBy = __webpack_require__(277); + + /** + * This method is like `_.sortedLastIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 1 + * + * // The `_.property` iteratee shorthand. + * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); + * // => 1 + */ + function sortedLastIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, baseIteratee(iteratee, 2), true); + } + + module.exports = sortedLastIndexBy; + + +/***/ }), +/* 282 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseSortedIndex = __webpack_require__(276), + eq = __webpack_require__(88); + + /** + * This method is like `_.lastIndexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); + * // => 3 + */ + function sortedLastIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value, true) - 1; + if (eq(array[index], value)) { + return index; + } + } + return -1; + } + + module.exports = sortedLastIndexOf; + + +/***/ }), +/* 283 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseSortedUniq = __webpack_require__(284); + + /** + * This method is like `_.uniq` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniq([1, 1, 2]); + * // => [1, 2] + */ + function sortedUniq(array) { + return (array && array.length) + ? baseSortedUniq(array) + : []; + } + + module.exports = sortedUniq; + + +/***/ }), +/* 284 */ +/***/ (function(module, exports, __webpack_require__) { + + var eq = __webpack_require__(88); + + /** + * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseSortedUniq(array, iteratee) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (!index || !eq(computed, seen)) { + var seen = computed; + result[resIndex++] = value === 0 ? 0 : value; + } + } + return result; + } + + module.exports = baseSortedUniq; + + +/***/ }), +/* 285 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseIteratee = __webpack_require__(168), + baseSortedUniq = __webpack_require__(284); + + /** + * This method is like `_.uniqBy` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); + * // => [1.1, 2.3] + */ + function sortedUniqBy(array, iteratee) { + return (array && array.length) + ? baseSortedUniq(array, baseIteratee(iteratee, 2)) + : []; + } + + module.exports = sortedUniqBy; + + +/***/ }), +/* 286 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseSlice = __webpack_require__(86); + + /** + * Gets all but the first element of `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.tail([1, 2, 3]); + * // => [2, 3] + */ + function tail(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 1, length) : []; + } + + module.exports = tail; + + +/***/ }), +/* 287 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseSlice = __webpack_require__(86), + toInteger = __webpack_require__(100); + + /** + * Creates a slice of `array` with `n` elements taken from the beginning. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.take([1, 2, 3]); + * // => [1] + * + * _.take([1, 2, 3], 2); + * // => [1, 2] + * + * _.take([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.take([1, 2, 3], 0); + * // => [] + */ + function take(array, n, guard) { + if (!(array && array.length)) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + module.exports = take; + + +/***/ }), +/* 288 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseSlice = __webpack_require__(86), + toInteger = __webpack_require__(100); + + /** + * Creates a slice of `array` with `n` elements taken from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.takeRight([1, 2, 3]); + * // => [3] + * + * _.takeRight([1, 2, 3], 2); + * // => [2, 3] + * + * _.takeRight([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.takeRight([1, 2, 3], 0); + * // => [] + */ + function takeRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, n < 0 ? 0 : n, length); + } + + module.exports = takeRight; + + +/***/ }), +/* 289 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseIteratee = __webpack_require__(168), + baseWhile = __webpack_require__(233); + + /** + * Creates a slice of `array` with elements taken from the end. Elements are + * taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.takeRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeRightWhile(users, ['active', false]); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.takeRightWhile(users, 'active'); + * // => [] + */ + function takeRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, baseIteratee(predicate, 3), false, true) + : []; + } + + module.exports = takeRightWhile; + + +/***/ }), +/* 290 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseIteratee = __webpack_require__(168), + baseWhile = __webpack_require__(233); + + /** + * Creates a slice of `array` with elements taken from the beginning. Elements + * are taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.takeWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matches` iteratee shorthand. + * _.takeWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeWhile(users, ['active', false]); + * // => objects for ['barney', 'fred'] + * + * // The `_.property` iteratee shorthand. + * _.takeWhile(users, 'active'); + * // => [] + */ + function takeWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, baseIteratee(predicate, 3)) + : []; + } + + module.exports = takeWhile; + + +/***/ }), +/* 291 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseFlatten = __webpack_require__(108), + baseRest = __webpack_require__(157), + baseUniq = __webpack_require__(292), + isArrayLikeObject = __webpack_require__(166); + + /** + * Creates an array of unique values, in order, from all given arrays using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.union([2], [1, 2]); + * // => [2, 1] + */ + var union = baseRest(function(arrays) { + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); + }); + + module.exports = union; + + +/***/ }), +/* 292 */ +/***/ (function(module, exports, __webpack_require__) { + + var SetCache = __webpack_require__(116), + arrayIncludes = __webpack_require__(148), + arrayIncludesWith = __webpack_require__(153), + cacheHas = __webpack_require__(156), + createSet = __webpack_require__(293), + setToArray = __webpack_require__(184); + + /** Used as the size to enable large array optimizations. */ + var LARGE_ARRAY_SIZE = 200; + + /** + * The base implementation of `_.uniqBy` without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; + + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; + } + else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + module.exports = baseUniq; + + +/***/ }), +/* 293 */ +/***/ (function(module, exports, __webpack_require__) { + + var Set = __webpack_require__(206), + noop = __webpack_require__(294), + setToArray = __webpack_require__(184); + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0; + + /** + * Creates a set object of `values`. + * + * @private + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. + */ + var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { + return new Set(values); + }; + + module.exports = createSet; + + +/***/ }), +/* 294 */ +/***/ (function(module, exports) { + + /** + * This method returns `undefined`. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Util + * @example + * + * _.times(2, _.noop); + * // => [undefined, undefined] + */ + function noop() { + // No operation performed. + } + + module.exports = noop; + + +/***/ }), +/* 295 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseFlatten = __webpack_require__(108), + baseIteratee = __webpack_require__(168), + baseRest = __webpack_require__(157), + baseUniq = __webpack_require__(292), + isArrayLikeObject = __webpack_require__(166), + last = __webpack_require__(228); + + /** + * This method is like `_.union` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which uniqueness is computed. Result values are chosen from the first + * array in which the value occurs. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.unionBy([2.1], [1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + var unionBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), baseIteratee(iteratee, 2)); + }); + + module.exports = unionBy; + + +/***/ }), +/* 296 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseFlatten = __webpack_require__(108), + baseRest = __webpack_require__(157), + baseUniq = __webpack_require__(292), + isArrayLikeObject = __webpack_require__(166), + last = __webpack_require__(228); + + /** + * This method is like `_.union` except that it accepts `comparator` which + * is invoked to compare elements of `arrays`. Result values are chosen from + * the first array in which the value occurs. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.unionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var unionWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); + }); + + module.exports = unionWith; + + +/***/ }), +/* 297 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseUniq = __webpack_require__(292); + + /** + * Creates a duplicate-free version of an array, using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons, in which only the first occurrence of each element + * is kept. The order of result values is determined by the order they occur + * in the array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniq([2, 1, 2]); + * // => [2, 1] + */ + function uniq(array) { + return (array && array.length) ? baseUniq(array) : []; + } + + module.exports = uniq; + + +/***/ }), +/* 298 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseIteratee = __webpack_require__(168), + baseUniq = __webpack_require__(292); + + /** + * This method is like `_.uniq` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * uniqueness is computed. The order of result values is determined by the + * order they occur in the array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniqBy([2.1, 1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + function uniqBy(array, iteratee) { + return (array && array.length) ? baseUniq(array, baseIteratee(iteratee, 2)) : []; + } + + module.exports = uniqBy; + + +/***/ }), +/* 299 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseUniq = __webpack_require__(292); + + /** + * This method is like `_.uniq` except that it accepts `comparator` which + * is invoked to compare elements of `array`. The order of result values is + * determined by the order they occur in the array.The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.uniqWith(objects, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] + */ + function uniqWith(array, comparator) { + comparator = typeof comparator == 'function' ? comparator : undefined; + return (array && array.length) ? baseUniq(array, undefined, comparator) : []; + } + + module.exports = uniqWith; + + +/***/ }), +/* 300 */ +/***/ (function(module, exports, __webpack_require__) { + + var arrayFilter = __webpack_require__(189), + arrayMap = __webpack_require__(154), + baseProperty = __webpack_require__(226), + baseTimes = __webpack_require__(193), + isArrayLikeObject = __webpack_require__(166); + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeMax = Math.max; + + /** + * This method is like `_.zip` except that it accepts an array of grouped + * elements and creates an array regrouping the elements to their pre-zip + * configuration. + * + * @static + * @memberOf _ + * @since 1.2.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] + * + * _.unzip(zipped); + * // => [['a', 'b'], [1, 2], [true, false]] + */ + function unzip(array) { + if (!(array && array.length)) { + return []; + } + var length = 0; + array = arrayFilter(array, function(group) { + if (isArrayLikeObject(group)) { + length = nativeMax(group.length, length); + return true; + } + }); + return baseTimes(length, function(index) { + return arrayMap(array, baseProperty(index)); + }); + } + + module.exports = unzip; + + +/***/ }), +/* 301 */ +/***/ (function(module, exports, __webpack_require__) { + + var apply = __webpack_require__(160), + arrayMap = __webpack_require__(154), + unzip = __webpack_require__(300); + + /** + * This method is like `_.unzip` except that it accepts `iteratee` to specify + * how regrouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @param {Function} [iteratee=_.identity] The function to combine + * regrouped values. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip([1, 2], [10, 20], [100, 200]); + * // => [[1, 10, 100], [2, 20, 200]] + * + * _.unzipWith(zipped, _.add); + * // => [3, 30, 300] + */ + function unzipWith(array, iteratee) { + if (!(array && array.length)) { + return []; + } + var result = unzip(array); + if (iteratee == null) { + return result; + } + return arrayMap(result, function(group) { + return apply(iteratee, undefined, group); + }); + } + + module.exports = unzipWith; + + +/***/ }), +/* 302 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseDifference = __webpack_require__(115), + baseRest = __webpack_require__(157), + isArrayLikeObject = __webpack_require__(166); + + /** + * Creates an array excluding all given values using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.pull`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...*} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.xor + * @example + * + * _.without([2, 1, 2, 3], 1, 2); + * // => [3] + */ + var without = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, values) + : []; + }); + + module.exports = without; + + +/***/ }), +/* 303 */ +/***/ (function(module, exports, __webpack_require__) { + + var arrayFilter = __webpack_require__(189), + baseRest = __webpack_require__(157), + baseXor = __webpack_require__(304), + isArrayLikeObject = __webpack_require__(166); + + /** + * Creates an array of unique values that is the + * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) + * of the given arrays. The order of result values is determined by the order + * they occur in the arrays. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.without + * @example + * + * _.xor([2, 1], [2, 3]); + * // => [1, 3] + */ + var xor = baseRest(function(arrays) { + return baseXor(arrayFilter(arrays, isArrayLikeObject)); + }); + + module.exports = xor; + + +/***/ }), +/* 304 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseDifference = __webpack_require__(115), + baseFlatten = __webpack_require__(108), + baseUniq = __webpack_require__(292); + + /** + * The base implementation of methods like `_.xor`, without support for + * iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of values. + */ + function baseXor(arrays, iteratee, comparator) { + var length = arrays.length; + if (length < 2) { + return length ? baseUniq(arrays[0]) : []; + } + var index = -1, + result = Array(length); + + while (++index < length) { + var array = arrays[index], + othIndex = -1; + + while (++othIndex < length) { + if (othIndex != index) { + result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); + } + } + } + return baseUniq(baseFlatten(result, 1), iteratee, comparator); + } + + module.exports = baseXor; + + +/***/ }), +/* 305 */ +/***/ (function(module, exports, __webpack_require__) { + + var arrayFilter = __webpack_require__(189), + baseIteratee = __webpack_require__(168), + baseRest = __webpack_require__(157), + baseXor = __webpack_require__(304), + isArrayLikeObject = __webpack_require__(166), + last = __webpack_require__(228); + + /** + * This method is like `_.xor` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which by which they're compared. The order of result values is determined + * by the order they occur in the arrays. The iteratee is invoked with one + * argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2, 3.4] + * + * // The `_.property` iteratee shorthand. + * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var xorBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseXor(arrayFilter(arrays, isArrayLikeObject), baseIteratee(iteratee, 2)); + }); + + module.exports = xorBy; + + +/***/ }), +/* 306 */ +/***/ (function(module, exports, __webpack_require__) { + + var arrayFilter = __webpack_require__(189), + baseRest = __webpack_require__(157), + baseXor = __webpack_require__(304), + isArrayLikeObject = __webpack_require__(166), + last = __webpack_require__(228); + + /** + * This method is like `_.xor` except that it accepts `comparator` which is + * invoked to compare elements of `arrays`. The order of result values is + * determined by the order they occur in the arrays. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.xorWith(objects, others, _.isEqual); + * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var xorWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); + }); + + module.exports = xorWith; + + +/***/ }), +/* 307 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseRest = __webpack_require__(157), + unzip = __webpack_require__(300); + + /** + * Creates an array of grouped elements, the first of which contains the + * first elements of the given arrays, the second of which contains the + * second elements of the given arrays, and so on. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] + */ + var zip = baseRest(unzip); + + module.exports = zip; + + +/***/ }), +/* 308 */ +/***/ (function(module, exports, __webpack_require__) { + + var assignValue = __webpack_require__(309), + baseZipObject = __webpack_require__(311); + + /** + * This method is like `_.fromPairs` except that it accepts two arrays, + * one of property identifiers and one of corresponding values. + * + * @static + * @memberOf _ + * @since 0.4.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObject(['a', 'b'], [1, 2]); + * // => { 'a': 1, 'b': 2 } + */ + function zipObject(props, values) { + return baseZipObject(props || [], values || [], assignValue); + } + + module.exports = zipObject; + + +/***/ }), +/* 309 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseAssignValue = __webpack_require__(310), + eq = __webpack_require__(88); + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + module.exports = assignValue; + + +/***/ }), +/* 310 */ +/***/ (function(module, exports, __webpack_require__) { + + var defineProperty = __webpack_require__(164); + + /** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } + } + + module.exports = baseAssignValue; + + +/***/ }), +/* 311 */ +/***/ (function(module, exports) { + + /** + * This base implementation of `_.zipObject` which assigns values using `assignFunc`. + * + * @private + * @param {Array} props The property identifiers. + * @param {Array} values The property values. + * @param {Function} assignFunc The function to assign values. + * @returns {Object} Returns the new object. + */ + function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; + + while (++index < length) { + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); + } + return result; + } + + module.exports = baseZipObject; + + +/***/ }), +/* 312 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseSet = __webpack_require__(313), + baseZipObject = __webpack_require__(311); + + /** + * This method is like `_.zipObject` except that it supports property paths. + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); + * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } + */ + function zipObjectDeep(props, values) { + return baseZipObject(props || [], values || [], baseSet); + } + + module.exports = zipObjectDeep; + + +/***/ }), +/* 313 */ +/***/ (function(module, exports, __webpack_require__) { + + var assignValue = __webpack_require__(309), + castPath = __webpack_require__(214), + isIndex = __webpack_require__(99), + isObject = __webpack_require__(97), + toKey = __webpack_require__(221); + + /** + * The base implementation of `_.set`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; + } + path = castPath(path, object); + + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + + while (nested != null && ++index < length) { + var key = toKey(path[index]), + newValue = value; + + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = isObject(objValue) + ? objValue + : (isIndex(path[index + 1]) ? [] : {}); + } + } + assignValue(nested, key, newValue); + nested = nested[key]; + } + return object; + } + + module.exports = baseSet; + + +/***/ }), +/* 314 */ +/***/ (function(module, exports, __webpack_require__) { + + var baseRest = __webpack_require__(157), + unzipWith = __webpack_require__(301); + + /** + * This method is like `_.zip` except that it accepts `iteratee` to specify + * how grouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @param {Function} [iteratee=_.identity] The function to combine + * grouped values. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { + * return a + b + c; + * }); + * // => [111, 222] + */ + var zipWith = baseRest(function(arrays) { + var length = arrays.length, + iteratee = length > 1 ? arrays[length - 1] : undefined; + + iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; + return unzipWith(arrays, iteratee); + }); + + module.exports = zipWith; + + +/***/ }), +/* 315 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {module.exports = function ( handlerFunction ){ + var viewer = {}, + lastSelectedElement; + + viewer.handle = function ( selectedElement ){ + // Don't display details on a drag event, which will be prevented + if ( d3.event.defaultPrevented ) { + return; + } + + var isSelection = true; + + // Deselection of the focused element + if ( lastSelectedElement === selectedElement ) { + isSelection = false; + } + + if ( handlerFunction instanceof Function ) { + if ( isSelection ) { + handlerFunction(selectedElement); + } else { + handlerFunction(undefined); + } + } + + if ( isSelection ) { + lastSelectedElement = selectedElement; + } else { + lastSelectedElement = undefined; + } + }; + + /** + * Resets the displayed information to its default. + */ + viewer.reset = function (){ + if ( lastSelectedElement ) { + handlerFunction(undefined); + lastSelectedElement = undefined; + } + }; + + return viewer; + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), +/* 316 */ +/***/ (function(module, exports, __webpack_require__) { + + var SetOperatorNode = __webpack_require__(20); + + module.exports = function (){ + + var filter = {}, + nodes, + properties, + enabled = false, + filteredNodes, + filteredProperties, + filterTools = __webpack_require__(76)(); + + + /** + * If enabled, all set operators including connected properties are filtered. + * @param untouchedNodes + * @param untouchedProperties + */ + filter.filter = function ( untouchedNodes, untouchedProperties ){ + nodes = untouchedNodes; + properties = untouchedProperties; + + if ( this.enabled() ) { + removeSetOperators(); + } + + filteredNodes = nodes; + filteredProperties = properties; + }; + + function removeSetOperators(){ + var filteredData = filterTools.filterNodesAndTidy(nodes, properties, isNoSetOperator); + + nodes = filteredData.nodes; + properties = filteredData.properties; + } + + function isNoSetOperator( node ){ + return !(node instanceof SetOperatorNode); + } + + filter.enabled = function ( p ){ + if ( !arguments.length ) return enabled; + enabled = p; + return filter; + }; + + + // Functions a filter must have + filter.filteredNodes = function (){ + return filteredNodes; + }; + + filter.filteredProperties = function (){ + return filteredProperties; + }; + + + return filter; + }; + + +/***/ }), +/* 317 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(d3) {var SetOperatorNode = __webpack_require__(20); + var OwlThing = __webpack_require__(31); + var OwlNothing = __webpack_require__(30); + var elementTools = __webpack_require__(63)(); + + module.exports = function (){ + + var statistics = {}, + nodeCount, + occurencesOfClassAndDatatypeTypes = {}, + edgeCount, + occurencesOfPropertyTypes = {}, + classCount, + datatypeCount, + datatypePropertyCount, + objectPropertyCount, + propertyCount, + totalIndividualCount, + filteredNodes, + filteredProperties; + + + statistics.filter = function ( classesAndDatatypes, properties ){ + resetStoredData(); + + storeTotalCounts(classesAndDatatypes, properties); + storeClassAndDatatypeCount(classesAndDatatypes); + storePropertyCount(properties); + + storeOccurencesOfTypes(classesAndDatatypes, occurencesOfClassAndDatatypeTypes); + storeOccurencesOfTypes(properties, occurencesOfPropertyTypes); + + storeTotalIndividualCount(classesAndDatatypes); + + filteredNodes = classesAndDatatypes; + filteredProperties = properties; + }; + + function resetStoredData(){ + nodeCount = 0; + edgeCount = 0; + classCount = 0; + datatypeCount = 0; + datatypePropertyCount = 0; + objectPropertyCount = 0; + propertyCount = 0; + totalIndividualCount = 0; + } + + function storeTotalCounts( classesAndDatatypes, properties ){ + nodeCount = classesAndDatatypes.length; + + var seenProperties = __webpack_require__(62)(), i, l, property; + for ( i = 0, l = properties.length; i < l; i++ ) { + property = properties[i]; + if ( !seenProperties.has(property) ) { + edgeCount += 1; + } + + seenProperties.add(property); + if ( property.inverse() ) { + seenProperties.add(property.inverse()); + } + } + } + + function storeClassAndDatatypeCount( classesAndDatatypes ){ + // Each datatype should be counted just a single time + var datatypeSet = d3.set(), + hasThing = false, + hasNothing = false; + classCount = 0; + var old = 0, newcc = 0; + classesAndDatatypes.forEach(function ( node ){ + if ( elementTools.isDatatype(node) ) { + datatypeSet.add(node.defaultLabel()); + } else if ( !(node instanceof SetOperatorNode) ) { + if ( node instanceof OwlThing ) { + hasThing = true; + } else if ( node instanceof OwlNothing ) { + hasNothing = true; + } else { + old = classCount; + var adds = 1 + countElementArray(node.equivalents()); + classCount += adds; + newcc = classCount; + } + } else if ( node instanceof SetOperatorNode ) { + old = classCount; + classCount += 1; + newcc = classCount; + } + }); + + // count things and nothings just a single time + // classCount += hasThing ? 1 : 0; + // classCount += hasNothing ? 1 : 0; + + datatypeCount = datatypeSet.size(); + } + + function storePropertyCount( properties ){ + for ( var i = 0, l = properties.length; i < l; i++ ) { + var property = properties[i]; + var attr; + var result = false; + if ( property.attributes ) { + attr = property.attributes(); + if ( attr && attr.indexOf("datatype") !== -1 ) { + result = true; + } + } + if ( result === true ) { + datatypePropertyCount += getExtendedPropertyCount(property); + } else if ( elementTools.isObjectProperty(property) ) { + objectPropertyCount += getExtendedPropertyCount(property); + } + } + propertyCount = objectPropertyCount + datatypePropertyCount; + } + + function getExtendedPropertyCount( property ){ + // count the property itself + var count = 1; + + // and count properties this property represents + count += countElementArray(property.equivalents()); + count += countElementArray(property.redundantProperties()); + + return count; + } + + function countElementArray( properties ){ + if ( properties ) { + return properties.length; + } + return 0; + } + + function storeOccurencesOfTypes( elements, storage ){ + elements.forEach(function ( element ){ + var type = element.type(), + typeCount = storage[type]; + + if ( typeof typeCount === "undefined" ) { + typeCount = 0; + } else { + typeCount += 1; + } + storage[type] = typeCount; + }); + } + + function storeTotalIndividualCount( nodes ){ + var sawIndividuals = {}; + var totalCount = 0; + for ( var i = 0, l = nodes.length; i < l; i++ ) { + var individuals = nodes[i].individuals(); + + var tempCount = 0; + for ( var iA = 0; iA < individuals.length; iA++ ) { + if ( sawIndividuals[individuals[iA].iri()] === undefined ) { + sawIndividuals[individuals[iA].iri()] = 1; // this iri for that individual is now set to 1 >> seen it + tempCount++; + } + } + totalCount += tempCount; + } + totalIndividualCount = totalCount; + sawIndividuals = {}; // clear the object + + } + + + statistics.nodeCount = function (){ + return nodeCount; + }; + + statistics.occurencesOfClassAndDatatypeTypes = function (){ + return occurencesOfClassAndDatatypeTypes; + }; + + statistics.edgeCount = function (){ + return edgeCount; + }; + + statistics.occurencesOfPropertyTypes = function (){ + return occurencesOfPropertyTypes; + }; + + statistics.classCount = function (){ + return classCount; + }; + + statistics.datatypeCount = function (){ + return datatypeCount; + }; + + statistics.datatypePropertyCount = function (){ + return datatypePropertyCount; + }; + + statistics.objectPropertyCount = function (){ + return objectPropertyCount; + }; + + statistics.propertyCount = function (){ + return propertyCount; + }; + + statistics.totalIndividualCount = function (){ + return totalIndividualCount; + }; + + + // Functions a filter must have + statistics.filteredNodes = function (){ + return filteredNodes; + }; + + statistics.filteredProperties = function (){ + return filteredProperties; + }; + + + return statistics; + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) + +/***/ }), +/* 318 */ +/***/ (function(module, exports, __webpack_require__) { + + var elementTools = __webpack_require__(63)(); + + module.exports = function (){ + + var filter = {}, + nodes, + properties, + enabled = false, + filteredNodes, + filteredProperties; + + + /** + * If enabled subclasses that have only subclass properties are filtered. + * @param untouchedNodes + * @param untouchedProperties + */ + filter.filter = function ( untouchedNodes, untouchedProperties ){ + nodes = untouchedNodes; + properties = untouchedProperties; + + if ( this.enabled() ) { + hideSubclassesWithoutOwnProperties(); + } + + filteredNodes = nodes; + filteredProperties = properties; + }; + + function hideSubclassesWithoutOwnProperties(){ + var unneededProperties = [], + unneededClasses = [], + subclasses = [], + connectedProperties, + subclass, + property, + i, // index, + l; // length + + + for ( i = 0, l = properties.length; i < l; i++ ) { + property = properties[i]; + if ( elementTools.isRdfsSubClassOf(property) ) { + subclasses.push(property.domain()); + } + } + + for ( i = 0, l = subclasses.length; i < l; i++ ) { + subclass = subclasses[i]; + connectedProperties = findRelevantConnectedProperties(subclass, properties); + + // Only remove the node and its properties, if they're all subclassOf properties + if ( areOnlySubclassProperties(connectedProperties) && + doesNotInheritFromMultipleClasses(subclass, connectedProperties) ) { + + unneededProperties = unneededProperties.concat(connectedProperties); + unneededClasses.push(subclass); + } + } + + nodes = removeUnneededElements(nodes, unneededClasses); + properties = removeUnneededElements(properties, unneededProperties); + } + + /** + * Looks recursively for connected properties. Because just subclasses are relevant, + * we just look recursively for their properties. + * + * @param node + * @param allProperties + * @param visitedNodes a visited nodes which is used on recursive invocation + * @returns {Array} + */ + function findRelevantConnectedProperties( node, allProperties, visitedNodes ){ + var connectedProperties = [], + property, + i, + l; + + for ( i = 0, l = allProperties.length; i < l; i++ ) { + property = allProperties[i]; + if ( property.domain() === node || + property.range() === node ) { + + connectedProperties.push(property); + + + /* Special case: SuperClass <-(1) Subclass <-(2) Subclass ->(3) e.g. Datatype + * We need to find the last property recursively. Otherwise, we would remove the subClassOf + * property (1) because we didn't see the datatype property (3). + */ + + // Look only for subclass properties, because these are the relevant properties + if ( elementTools.isRdfsSubClassOf(property) ) { + var domain = property.domain(); + visitedNodes = visitedNodes || __webpack_require__(62)(); + + // If we have the range, there might be a nested property on the domain + if ( node === property.range() && !visitedNodes.has(domain) ) { + visitedNodes.add(domain); + var nestedConnectedProperties = findRelevantConnectedProperties(domain, allProperties, visitedNodes); + connectedProperties = connectedProperties.concat(nestedConnectedProperties); + } + } + } + } + + return connectedProperties; + } + + function areOnlySubclassProperties( connectedProperties ){ + var onlySubclassProperties = true, + property, + i, + l; + + for ( i = 0, l = connectedProperties.length; i < l; i++ ) { + property = connectedProperties[i]; + + if ( !elementTools.isRdfsSubClassOf(property) ) { + onlySubclassProperties = false; + break; + } + } + + return onlySubclassProperties; + } + + function doesNotInheritFromMultipleClasses( subclass, connectedProperties ){ + var superClassCount = 0; + + for ( var i = 0, l = connectedProperties.length; i < l; i++ ) { + var property = connectedProperties[i]; + + if ( property.domain() === subclass ) { + superClassCount += 1; + } + + if ( superClassCount > 1 ) { + return false; + } + } + + return true; + } + + function removeUnneededElements( array, removableElements ){ + var disjoint = [], + element, + i, + l; + + for ( i = 0, l = array.length; i < l; i++ ) { + element = array[i]; + if ( removableElements.indexOf(element) === -1 ) { + disjoint.push(element); + } + } + return disjoint; + } + + filter.enabled = function ( p ){ + if ( !arguments.length ) return enabled; + enabled = p; + return filter; + }; + + + // Functions a filter must have + filter.filteredNodes = function (){ + return filteredNodes; + }; + + filter.filteredProperties = function (){ + return filteredProperties; + }; + + + return filter; + }; + + +/***/ }) +/******/ ]); \ No newline at end of file diff --git a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/vb/LICENSE.txt b/cluedo4KG-sources/webvowl/license.txt similarity index 89% rename from cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/vb/LICENSE.txt rename to cluedo4KG-sources/webvowl/license.txt index 60839703a97eb623070a57da751df1dfc903327e..008e54c7738741faaef97a8a450a3a0b1f1624ea 100644 --- a/cluedo4KG-sources/cluedo4kg-App/Sparqluedo/media/codemirror/mode/vb/LICENSE.txt +++ b/cluedo4KG-sources/webvowl/license.txt @@ -1,6 +1,6 @@ -The MIT License +The MIT License (MIT) -Copyright (c) 2012 Codility Limited, 107 Cheapside, London EC2V 6DN, UK +Copyright (c) 2014-2019 Vincent Link, Steffen Lohmann, Eduard Marbach, Stefan Negru, Vitalis Wiens Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal