From 9fbf78410d68b31d4b80491dd288e3e77a6bf714 Mon Sep 17 00:00:00 2001 From: funderburkjim Date: Mon, 25 Apr 2022 22:21:30 -0400 Subject: [PATCH] pwkvn display added. Ref: https://github.com/sanskrit-lexicon/PWK/issues/86 --- basicadjust.php | 6 +- dictinfo.php | 3 +- pwkvn/csl-citation.js | 146 + pwkvn/csl-dict.js | 109 + pwkvn/csl-getword02.js | 73 + pwkvn/csl-input.js | 65 + pwkvn/csl-output.js | 63 + pwkvn/fonts.css | 27 + pwkvn/getsuggest.php | 23 + pwkvn/getsuggestClass.php | 75 + pwkvn/getword_styles.js | 173 + pwkvn/index.html | 28 + pwkvn/lit-element-2.3.1.js | 3965 ++++ pwkvn/mergehw.py | 83 + pwkvn/mergehw.txt | 29552 +++++++++++++++++++++++++++ pwkvn/my-app.js | 156 + pwkvn/my-app1.js | 107 + pwkvn/readme.txt | 32 + servepdfClass.php | 1 + utilities/transcoder/deva_slp1.xml | 138 +- 20 files changed, 34763 insertions(+), 62 deletions(-) create mode 100644 pwkvn/csl-citation.js create mode 100644 pwkvn/csl-dict.js create mode 100644 pwkvn/csl-getword02.js create mode 100644 pwkvn/csl-input.js create mode 100644 pwkvn/csl-output.js create mode 100644 pwkvn/fonts.css create mode 100644 pwkvn/getsuggest.php create mode 100644 pwkvn/getsuggestClass.php create mode 100644 pwkvn/getword_styles.js create mode 100644 pwkvn/index.html create mode 100644 pwkvn/lit-element-2.3.1.js create mode 100644 pwkvn/mergehw.py create mode 100644 pwkvn/mergehw.txt create mode 100644 pwkvn/my-app.js create mode 100644 pwkvn/my-app1.js create mode 100644 pwkvn/readme.txt diff --git a/basicadjust.php b/basicadjust.php index 1547414..adc7535 100644 --- a/basicadjust.php +++ b/basicadjust.php @@ -27,7 +27,7 @@ public function __construct($getParms,$xmlrecs) { $key = $getParms->key; $this->dbg=false; $this->dal_ab = new Dal($dict,"ab"); - if (in_array($dict,array('pwg','pw'))) { + if (in_array($dict,array('pwg','pw','pwkvn'))) { $this->dal_auth = new Dal($dict,"bib"); # pwgbib dbgprint(false,"basicadjust: bib file open? " . $this->dal_auth->status ."\n"); }else if (in_array($dict,array('mw','ap90','ben'))){ @@ -66,7 +66,7 @@ public function line_adjust($line) { /* Replace the 'title' part of a known ls with its capitalized form This is probably particular to pwg and/or pw */ - if (in_array($this->getParms->dict,array('pw','pwg'))) { + if (in_array($this->getParms->dict,array('pw','pwg','pwkvn'))) { $line = preg_replace_callback('|(.*?)|', "BasicAdjust::ls_callback_pwg",$line); @@ -219,7 +219,7 @@ public function ls_matchabbr($fieldname,$fieldidx,$data) { if (!preg_match("|^([^ .,']+)|",$data,$matches)) { return $ans; } - //$tabid = 'code'; // pw, pwg + //$tabid = 'code'; // pw, pwg, pwkvn $key = $matches[1]; $key1 = $key . '%'; $sql = "select * from $table where $fieldname LIKE '$key1'"; diff --git a/dictinfo.php b/dictinfo.php index d7ed7c2..2804d93 100644 --- a/dictinfo.php +++ b/dictinfo.php @@ -17,7 +17,7 @@ class DictInfo { "PUI"=>"2014" , "PWG"=>"2013" , "PW"=>"2014" , "SCH"=>"2014", "SHS"=>"2014" , "SKD"=>"2013" , "SNP"=>"2014" , "STC"=>"2013", "VCP"=>"2019" , "VEI"=>"2014" , "WIL"=>"2014" , "YAT"=>"2014", - "LAN"=>"2019","ARMH"=>"2020"); + "LAN"=>"2019","ARMH"=>"2020","PWKVN"=>"2020"); //static public $scanpath = "../.."; // scan dir.depends on loc of this file! //static public $scanpath = preg_replace('|/awork/apidev|','',__DIR__); #public $scanpath; @@ -195,6 +195,7 @@ public function get_cologne_pdfpages_url() { "YAT"=>"//www.sanskrit-lexicon.uni-koeln.de/scans/YATScan/2014/web/pdfpages" , "LAN"=>"//www.sanskrit-lexicon.uni-koeln.de/scans/LANScan/2019/web/pdfpages" , "ARMH"=>"//www.sanskrit-lexicon.uni-koeln.de/scans/ARMHScan/2020/web/pdfpages" , + "PWKVN"=>"//www.sanskrit-lexicon.uni-koeln.de/scans/PWScan/2014/web/pdfpages" , ); $url = $cologne_pdfpages_urls[$this->dictupper]; return $url; diff --git a/pwkvn/csl-citation.js b/pwkvn/csl-citation.js new file mode 100644 index 0000000..dfbc770 --- /dev/null +++ b/pwkvn/csl-citation.js @@ -0,0 +1,146 @@ +import { html, css, LitElement,unsafeHTML } from './lit-element-2.3.1.js'; + +class cslCitation1 extends LitElement { + static get styles() { + return [ + css`` + ]; + } + + static get properties() { + return { + key: { type: String }, + appname: { type: String }, + dict: { type: String}, + input: { type: String}, + datalist: {type: Array}, + oldval: {type: String}, + value: {type: String}, + suggest: {type: String}, + dbg: Boolean + }; + } + + constructor() { + super(); + this.key=''; + this.appname='csl-citation'; + this.dict=""; + this.input=""; + this.datalist=[]; + this.oldval=''; + this.value=''; + this.suggest='no'; // or 'yes' + this.dbg=false; + } + customEvent() { + let new_event = new CustomEvent('new-citation', + {detail: {key:this.key,appname:this.appname} + }); + this.dispatchEvent(new_event); // this. is needed. Not sure why + } + onReturnKey = (event) => { + // Number 13 is the "Enter" key on the keyboard + if (event.keyCode === 13) { + // Cancel the default action, if needed + event.preventDefault(); + // value is a string of form x : y + let text = event.target.value + let result = text.match(/^[^ ]+/); + this.key = result[0]; + if (this.dbg) {console.log('return key: result=',result);} + var new_event = new CustomEvent('new-citation', + {detail: {key:this.key,appname:this.appname} + }); + this.dispatchEvent(new_event); // this. is required why? + } + } + + async onKeyup (event) { + // User hits enter key. This finishes the search + if ((event.keyCode === 13) ) { + // the second condition may be undesireable when some + // elements of the datalist are prefixes of other elements. + // value is a string of form x : y + let text = this.value; + let result = text.match(/^[^ ]+/); // returns array + this.key = result[0]; + if (this.dbg) {console.log('onKeyup: result=',result);} + event.target.blur(); // causes option to stop + //this.requestUpdate(); + this.customEvent(); + return; + } + + event.preventDefault(); + let value = event.target.value; + if (value == this.oldval) {return;} + this.oldval = value; + this.value=value; + if (this.dbg) {console.log('onKeyup: new value =',value);} + if (value == '') { + this.key = ""; + this.customEvent(); + //this.requestUpdate(); + return; + } + this.key=""; + if (value.length < 2) { + return; + } + + const baseurl = `getsuggest.php`; + //if (this.dbg) {console.log('this.dict=',this.dict);} + //let url = `${baseurl}?dict=${this.dict}&input=${this.input}&term=${this.value}`; + let url = `${baseurl}?input=${this.input}&term=${this.value}`; + if (this.dbg) {console.log('begin fetch from url',url);} + await fetch(url) + .then(r => r.json()) + .then(async data => { + this.datalist = data; // an array of strings + if (this.dbg) {console.log('end fetch. data=',data);} + }) + /*.then(() => this.requestUpdate());*/ + } + + render() { + if (this.dbg) {console.log('render: suggest comes in as',this.suggest);} + //if(this.suggest === undefined) {this.suggest = 'no';} + // Not sure why above statement does NOT always catch undefine + if (this.suggest != 'yes') {this.suggest = 'no';} + if (this.dbg) {console.log('csl-citation render. dict=',this.dict,this.suggest);} + if (this.suggest == 'no') { + return html` +
+ +
+ `; + } + return html` +
+ + + + + ${this.datalist.map(item => + html` + + `)} + +
+ + `; + } +} +if (!customElements.get('csl-citation')) { +customElements.define('csl-citation', cslCitation1);} + diff --git a/pwkvn/csl-dict.js b/pwkvn/csl-dict.js new file mode 100644 index 0000000..6d45eb7 --- /dev/null +++ b/pwkvn/csl-dict.js @@ -0,0 +1,109 @@ +import { html, css, LitElement,unsafeHTML } from './lit-element-2.3.1.js'; + +class cslDict extends LitElement { + static get styles() { + return [ + + ]; + } + + static get properties() { + return { + dict: { type: String }, + }; + } + + constructor() { + super(); + this.dict="mw"; + } + dictnames = +[['WIL' , 'Wilson Sanskrit-English'], +['YAT' , 'Yates Sanskrit-English'], +['GST' , 'Goldstücker Sanskrit-English'], +['BEN' , 'Benfey Sanskrit-English'], +['MW72' , 'Monier-Williams 1872 Sanskrit-English'], +['AP90' , 'Apte Practical Sanskrit-English'], +['CAE' , 'Cappeller Sanskrit-English'], +['MD' , 'Macdonell Sanskrit-English'], +['MW' , 'Monier-Williams Sanskrit-English'], +['SHS' , 'Shabda-Sagara Sanskrit-English'], +['BHS' , 'Edgerton Buddhist Hybrid Sanskrit'], +['AP' , 'Practical Sanskrit-English, revised'], +['PD' , 'An Encyclopedic Dictionary of Sanskrit'], // on Historical Principles'], +['MWE' , 'Monier-Williams English-Sanskrit'], +['BOR' , 'Borooah English-Sanskrit'], +['AE' , 'Apte Student English-Sanskrit'], +['BUR' , 'Burnouf D. Sanscrit-Français'], //'Burnouf Dictionnaire Sanscrit-Français'], +['STC' , 'Stchoupak D. Sanscrit-Français'], //'Stchoupak Dictionnaire Sanscrit-Français'], +['PWG' , 'Grosses Petersburger Wörterbuch'], //'Böhtlingk and Roth Grosses Petersburger Wörterbuch'], +['GRA' , 'Grassman Wörterbuch zum Rig Veda'], +['PW' , 'Böhtlingk Sanskrit-Wörterbuch'], // in kürzerer Fassung'], +['PWKVN' , 'PW, Nachträge und Verbesserungen'], +['CCS' , 'Cappeller Sanskrit Wörterbuch'], +['SCH' , 'Schmidt Nachträge'], // zum Sanskrit-Wörterbuch'], +['BOP' , 'Bopp Glossarium Sanscritum'], +['SKD' , 'Sabda-kalpadruma'], +['VCP' , 'Vacaspatyam'], +['INM' , 'Names in the Mahabharata'],//'Index to the Names in the Mahabharata'], +['VEI' , 'The Vedic Index'], // of Names and Subjects'], +['PUI' , 'The Purana Index'], +['ACC' , 'Aufrecht Catalogus Catalogorum'], +['KRM' , 'Kṛdantarūpamālā'], +['IEG' , 'Indian Epigraphical Glossary'], +['SNP' , 'Meulenbeld Sanskrit Names of Plants'], +['PE' , 'Puranic Encyclopedia'], +['PGN' , 'Names in the Gupta Inscriptions'], //'Personal and Geographical Names in the Gupta Inscriptions'], +['MCI' , 'Mahabharata Cultural Index'] +]; + dictitemF = function(item) { + let value = item[0]; + let name = item[1]; + let markup; + if (this.dict.toLowerCase() == value.toLowerCase()) { + markup = html``; + } else { + markup = html``; + } + return markup; + } + onChangeF (event) { + //event.preventDefault(); + this.dict = event.target.value; + //console.log('csl-dict: new value of this.dict=',this.dict); + var new_event = new CustomEvent('new-dict', + {detail: {dict:this.dict} + }); + this.dispatchEvent(new_event); // this. is needed. Not sure why + } + + render() { + return html` +
+ +
+ `; + } +} + +if (!customElements.get('csl-dict')) { +customElements.define('csl-dict', cslDict); +} + +/* + + + + + } + +*/ diff --git a/pwkvn/csl-getword02.js b/pwkvn/csl-getword02.js new file mode 100644 index 0000000..97eaeb5 --- /dev/null +++ b/pwkvn/csl-getword02.js @@ -0,0 +1,73 @@ +import { html, css, LitElement,unsafeHTML } from './lit-element-2.3.1.js'; +import {getwordStyles} from './getword_styles.js'; + +class cslGetword02 extends LitElement { + static get styles() { + return [ + getwordStyles + ]; + } + + static get properties() { + return { + dict: { type: String }, + key: { type: String }, + input: { type: String }, + output: { type: String }, + accent: { type: String}, + result: { type: String } + }; + } + + constructor() { + super(); + this.dict = 'md'; + this.key = 'guru'; + this.input = 'slp1'; + this.output = 'deva'; // fixed + this.accent = 'no'; + this.result = '... working ...'; + } + urlbaseF = function () { + return css`https://sanskrit-lexicon.uni-koeln.de/scans`; + let origin = window.location.origin; + if (origin.indexOf("sanskrit-lexicon.uni-koeln.de") >= 0) { + return css`https://sanskrit-lexicon.uni-koeln.de/scans`; + }else { + //return origin + "/cologne"; + return css`http://localhost/cologne`; + } + } + + // Don't use connectedCallback() since it can't be async + //async firstUpdated() { + async updated() { + const urlbase = this.urlbaseF(); + //console.log('csl-getword02: urlbase=',urlbase); + let url_apidev = `${urlbase}/csl-apidev`; + url_apidev = '../' ; // when running app in subfolder of csl-apidev + //const baseurl = 'https://sanskrit-lexicon.uni-koeln.de/scans/csl-apidev/getword.php'; + const baseurl = `${url_apidev}/getword.php`; + const url = `${baseurl}?dict=${this.dict}&key=${this.key}&input=${this.input}&output=${this.output}&dispopt=3` + //console.log('updated. url=',url); + await fetch(url) + .then(r => r.text()) + .then(async data => { + //console.log('csl-getword02: updated result=','found'); //data); + this.result = data; + }); + } + + render() { + + const result=`${this.result}`; + return html` +
+ ${unsafeHTML(result)} + +
+ `; + } +} + +customElements.define('csl-getword', cslGetword02); diff --git a/pwkvn/csl-input.js b/pwkvn/csl-input.js new file mode 100644 index 0000000..5ae1f67 --- /dev/null +++ b/pwkvn/csl-input.js @@ -0,0 +1,65 @@ +import { html, css, LitElement,unsafeHTML } from './lit-element-2.3.1.js'; + +class cslInput extends LitElement { + static get styles() { + return [ + + ]; + } + + static get properties() { + return { + input: { type: String }, + }; + } + + constructor() { + super(); + this.input="hk"; + } + itemnames = [ + ['hk', 'Harvard Kyoto'], + ['slp1', 'SLP1'], + ['itrans', 'ITRANS'], + ['deva', 'Devanagari'], + ['iast', 'IAST'], + ]; + + itemF = function(item) { + let value = item[0]; + let name = item[1]; + let markup; + if (this.input.toLowerCase() == value.toLowerCase()) { + markup = html``; + } else { + markup = html``; + } + return markup; + } + onChangeF (event) { + //event.preventDefault(); + this.input = event.target.value; + //console.log('csl-input: new value of this.input=',this.input); + var new_event = new CustomEvent('new-input', + {detail: {input:this.input} + }); + this.dispatchEvent(new_event); // this. is needed. Not sure why + } + + render() { + return html` +
+ +
+ `; + } +} + + +customElements.define('csl-input', cslInput); + + diff --git a/pwkvn/csl-output.js b/pwkvn/csl-output.js new file mode 100644 index 0000000..118b4c3 --- /dev/null +++ b/pwkvn/csl-output.js @@ -0,0 +1,63 @@ +import { html, css, LitElement,unsafeHTML } from './lit-element-2.3.1.js'; + +class cslOutput extends LitElement { + static get styles() { + return [ + + ]; + } + + static get properties() { + return { + output: { type: String }, + }; + } + + constructor() { + super(); + this.output="iast"; + } + itemnames = [ + ['hk', 'Harvard Kyoto'], + ['slp1', 'SLP1'], + ['itrans', 'ITRANS'], + ['deva', 'Devanagari'], + ['iast', 'IAST'], + ]; + + itemF = function(item) { + let value = item[0]; + let name = item[1]; + let markup; + if (this.output.toLowerCase() == value.toLowerCase()) { + markup = html``; + } else { + markup = html``; + } + return markup; + } + onChangeF (event) { + //event.preventDefault(); + this.output = event.target.value; + //console.log('csl-output: new value of this.output=',this.output); + var new_event = new CustomEvent('new-output', + {detail: {output:this.output} + }); + this.dispatchEvent(new_event); // this. is needed. Not sure why + } + + render() { + return html` +
+ +
+ `; + } +} + +customElements.define('csl-output', cslOutput); + diff --git a/pwkvn/fonts.css b/pwkvn/fonts.css new file mode 100644 index 0000000..f0d952c --- /dev/null +++ b/pwkvn/fonts.css @@ -0,0 +1,27 @@ +/* The font faces used by csl-getword + There are two possible choices. First is a local installation. + If this is not available, then the cologne server location is used. +*/ + +@font-face { + src: url(http://localhost/cologne/csl-apidev/fonts/siddhanta.ttf), + url(https://sanskrit-lexicon.uni-koeln.de/scans/csl-apidev/fonts/siddhanta.ttf ); + font-family: siddhanta_deva; +} + +@font-face { + src: url(http://localhost/cologne/csl-apidev/fonts/oldstandard.otf), + url(https://sanskrit-lexicon.uni-koeln.de/scans/csl-apidev/fonts/oldstandard.otf); + font-family: oldstandard; +} +@font-face { + src: url(http://localhost/cologne/csl-apidev/fonts/oldstandarditalic.otf), + url(https://sanskrit-lexicon.uni-koeln.de/scans/csl-apidev/fonts/oldstandarditalic.otf); + font-family: oldstandard_i; +} + +@font-face { + src: url(http://localhost/cologne/csl-apidev/fonts/CharterIndoCapital.otf), + url(https://sanskrit-lexicon.uni-koeln.de/scans/csl-apidev/fonts/CharterIndoCapital.otf); + font-family: charterindocapital; +} diff --git a/pwkvn/getsuggest.php b/pwkvn/getsuggest.php new file mode 100644 index 0000000..b00a488 --- /dev/null +++ b/pwkvn/getsuggest.php @@ -0,0 +1,23 @@ + +json; + /* Next for JSONP + Ref: //www.geekality.net/2010/06/27/php-how-to-easily-provide-json-and-jsonp/ + */ + if (isset($_GET['callback'])) { + echo "{$_GET['callback']}($json)"; + }else { + echo $json; + } +} +getsuggestCall(); +?> diff --git a/pwkvn/getsuggestClass.php b/pwkvn/getsuggestClass.php new file mode 100644 index 0000000..162f08a --- /dev/null +++ b/pwkvn/getsuggestClass.php @@ -0,0 +1,75 @@ + +getsuggestParms(); + $filterin = $getParms->filterin; + $dbg=false; + $origkey = $key; + + //$dict = $getParms->dict; + //dbgprint($dbg,"getsuggestClass: call Dal($dict)\n"); + //$dal = new Dal($dict); + $more = True; + $max = 10; # max number of return results + $maxlike=100; + $filename = "mergehw.txt"; + $lines = file($filename,FILE_IGNORE_NEW_LINES); + $results1 = array(); + $keymatch = $key; + if (preg_match('|^([^ ]+) (.*?)$|',$key,$m)) { + $keymatch = $m[1]; + } + $keylen = strlen($key); + $nresults1 = 0; + foreach($lines as $line) { + if (substr($line,0,$keylen) == $key) { + //$results1[] = $line; + if (preg_match('|^([^ ]+) (.*?)$|',$line,$m)) { + $hw = $m[1]; + $data = $m[2]; + $results1[] = array($hw,$data); + $nresults1 = $nresults1 + 1; + if ($nresults1 >= $max) {break;} + } + } + } + // transcode back from slp1 to filterin + $matches = array(); + if ($nresults1 == 0) { + // $hw = "$key??"; + $hw = "$key??"; + $data = ""; + $matches[] = "$hw : $data"; + } + foreach($results1 as $result) { + list($hw,$data) = $result; + $hw1 = transcoder_processString($hw,"slp1",$filterin); + //$matches[] = array($hw1,$data); + $matches[] = "$hw1 : $data"; + } + + // convert to Json array + $json = json_encode($matches); + // Establish public attributes of class + $this->matches = $matches; + $this->json = $json; + } + +} +?> diff --git a/pwkvn/getword_styles.js b/pwkvn/getword_styles.js new file mode 100644 index 0000000..dccabef --- /dev/null +++ b/pwkvn/getword_styles.js @@ -0,0 +1,173 @@ +import { css, unsafeCSS} from './lit-element-2.3.1.js'; +/* Adaptaion of csl-apidev/css/basic.css. Almost identical. +*/ +/* +const urlbaseF = function () { + let origin = window.location.origin; + if (origin.indexOf("sanskrit-lexicon.uni-koeln.de") >= 0) { + return css`https://sanskrit-lexicon.uni-koeln.de/scans`; + }else { + //return origin + "/cologne"; + return css`http://localhost/cologne`; + } + } +*/ +const urlbaseF = function () { + let origin = window.location.origin; + return css`https://sanskrit-lexicon.uni-koeln.de/scans`; + if (origin.indexOf("sanskrit-lexicon.uni-koeln.de") >= 0) { + return css`https://sanskrit-lexicon.uni-koeln.de/scans`; + }else { + //return origin + "/cologne"; + return css`http://localhost/cologne`; + } + } +const urlbase = urlbaseF(); +const url_apidev = css`${urlbase}/csl-apidev`; +const fontUrl = css`${url_apidev}/fonts`; +//console.log('getword_styles.js. fontUrl=',fontUrl); + +export const getwordStyles = css` +/* Web-font locations +siddhanta : devanagari text +oldstandard: for normal text in pwg +oldstandarditalic : same as above? +charterindocapital: for 'ls' text in pwg + Jul 18, 2015. font family for capitalization, only SNP +NOTE: font-faces are NOT loaded when these are in the shadow dom. + These font-face statements must be in the regular ('light') dom. +Ref: https://medium.com/rate-engineering/winning-the-war-of-css-conflicts-through-the-shadow-dom-de6c797b5cba +@font-face { + src: url(${fontUrl}/siddhanta.ttf); + font-family: siddhanta_deva; +} +@font-face { + src: url(${fontUrl}/oldstandard.otf); + font-family: oldstandard; +} +@font-face { + src: url(${fontUrl}/oldstandarditalic.otf); + font-family: oldstandard_i; +} +@font-face { + src: url(${fontUrl}/CharterIndoCapital.otf); + font-family: charterindocapital; +} +*/ +/* Aug 15, 2015 + Make everything a descendant of #CologneBasic. + Jul 20, 2020. Adapted for web-components +*/ +#CologneBasic { + color: black; background-color: white; /*#DBE4ED; */ + font-size: 14pt; +} +#CologneBasic td {line-height: 130%; /*150%;*/} +#CologneBasic .greek { + font-family: Gentium, Palatino Linotype, Arial Unicode MS; + font-size: 12pt; +} +#CologneBasic {padding-right: 25px;} +#CologneBasic .g {font-size:smaller;font-style:italic;} +#CologneBasic .lang {font-size:smaller;font-style:italic;} +#CologneBasic .hrefdata {font-size:smaller;} +#CologneBasic .lnum {font-size:smaller;} +/*.sdata {color:black;font-size:larger;} */ /* for devanagari */ + +/*#CologneBasic .sdata {color:teal;}*/ +/*#CologneBasic .sdatadeva {color:teal;font-size:larger;}*/ +/* Added '.sdata' in next Aug 20, 2015. + '.sdatadeva' is not used +*/ +#CologneBasic .sdata_siddhanta,.sdata { + color:teal; /* was blue */ + /*font-size:larger;*/ + font-family: siddhanta_deva; +} + +#CologneBasic .asdata {color:blue;font-size:larger;} +#CologneBasic .pb {font-size:smaller; } +#CologneBasic .hom {color:red;} +#CologneBasic .footnote {font-size:smaller;} +#CologneBasic .ls {color:gray; font-size:smaller;} +#CologneBasic .gram {font-weight:bold;} +#CologneBasic .divm {font-weight:bold;} +#CologneBasic .wide {font-stretch:wider;} + +#CologneBasic p { + padding-left: 15pt; + padding-right: 5px; /*15pt; */ +} + +#CologneBasic table.display { + width: 100%; + margin-left: 5px; + margin-right: 15px; /*5px;*/ + + margin-top: 10px; /* 20px; Dec 5, 2013 */ + font-size: 14px; + padding-right: 15px ;/*15px;*/ /* 04-18-2017 For AP display, with indenting */ +} +#CologneBasic td, th { + padding-left,padding-right: 15px; + padding-top: 5px; + text-align: left; + display: block; /* added to basic.css */ +} + +#CologneBasic plex { + color: black; + background-color: #36648b; + /*font-family: verdana,arial,helvetica,sansserif; */ /*Dec 5, 2013*/ + font-size: 12pt; +} + +#CologneBasic h1 { + font-size: 24pt; +} + +#CologneBasic h2 { + font-size: 20pt; + padding-left: 15pt; + padding-top: 20pt; +} + +#CologneBasic h3 { + font-size: 18pt; + padding-left: 30pt; + padding-top: 20pt; +} + +#CologneBasic a:link { + color: black; + /* color: #00008b; */ +} + +#CologneBasic a:visited { + color: #36648b; +} + +#CologneBasic a:active { + color: #4876ff; +} + +#CologneBasic a:hover { + background-color: #ffffcc; + color: #000033; +} +#CologneBasic .botcap { +color:gray; +font-family:charterindocapital; +} +#CologneBasic .cssshade { + background-color:#EAEAEA; /* light gray */ +} +#CologneBasic .sdata { + font-family: siddhanta_deva; + /*color:red;*/ +} +#CologneBasic .displist { + font-family: siddhanta_deva; + /*color:red;*/ +} +`; diff --git a/pwkvn/index.html b/pwkvn/index.html new file mode 100644 index 0000000..c99bfb7 --- /dev/null +++ b/pwkvn/index.html @@ -0,0 +1,28 @@ + + + + + pw-sch-pwkvn + + + + + + + + + + + + diff --git a/pwkvn/lit-element-2.3.1.js b/pwkvn/lit-element-2.3.1.js new file mode 100644 index 0000000..0d923a6 --- /dev/null +++ b/pwkvn/lit-element-2.3.1.js @@ -0,0 +1,3965 @@ +/** + * @license + * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at + * http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at + * http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at + * http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at + * http://polymer.github.io/PATENTS.txt + */ +const directives = new WeakMap(); +/** + * Brands a function as a directive factory function so that lit-html will call + * the function during template rendering, rather than passing as a value. + * + * A _directive_ is a function that takes a Part as an argument. It has the + * signature: `(part: Part) => void`. + * + * A directive _factory_ is a function that takes arguments for data and + * configuration and returns a directive. Users of directive usually refer to + * the directive factory as the directive. For example, "The repeat directive". + * + * Usually a template author will invoke a directive factory in their template + * with relevant arguments, which will then return a directive function. + * + * Here's an example of using the `repeat()` directive factory that takes an + * array and a function to render an item: + * + * ```js + * html`` + * ``` + * + * When `repeat` is invoked, it returns a directive function that closes over + * `items` and the template function. When the outer template is rendered, the + * return directive function is called with the Part for the expression. + * `repeat` then performs it's custom logic to render multiple items. + * + * @param f The directive factory function. Must be a function that returns a + * function of the signature `(part: Part) => void`. The returned function will + * be called with the part object. + * + * @example + * + * import {directive, html} from 'lit-html'; + * + * const immutable = directive((v) => (part) => { + * if (part.value !== v) { + * part.setValue(v) + * } + * }); + */ +const directive = (f) => ((...args) => { + const d = f(...args); + directives.set(d, true); + return d; +}); +const isDirective = (o) => { + return typeof o === 'function' && directives.has(o); +}; + +/** + * @license + * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at + * http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at + * http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at + * http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at + * http://polymer.github.io/PATENTS.txt + */ +/** + * True if the custom elements polyfill is in use. + */ +const isCEPolyfill = typeof window !== 'undefined' && + window.customElements != null && + window.customElements.polyfillWrapFlushCallback !== + undefined; +/** + * Reparents nodes, starting from `start` (inclusive) to `end` (exclusive), + * into another container (could be the same container), before `before`. If + * `before` is null, it appends the nodes to the container. + */ +const reparentNodes = (container, start, end = null, before = null) => { + while (start !== end) { + const n = start.nextSibling; + container.insertBefore(start, before); + start = n; + } +}; +/** + * Removes nodes, starting from `start` (inclusive) to `end` (exclusive), from + * `container`. + */ +const removeNodes = (container, start, end = null) => { + while (start !== end) { + const n = start.nextSibling; + container.removeChild(start); + start = n; + } +}; + +/** + * @license + * Copyright (c) 2018 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at + * http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at + * http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at + * http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at + * http://polymer.github.io/PATENTS.txt + */ +/** + * A sentinel value that signals that a value was handled by a directive and + * should not be written to the DOM. + */ +const noChange = {}; +/** + * A sentinel value that signals a NodePart to fully clear its content. + */ +const nothing = {}; + +/** + * @license + * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at + * http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at + * http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at + * http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at + * http://polymer.github.io/PATENTS.txt + */ +/** + * An expression marker with embedded unique key to avoid collision with + * possible text in templates. + */ +const marker = `{{lit-${String(Math.random()).slice(2)}}}`; +/** + * An expression marker used text-positions, multi-binding attributes, and + * attributes with markup-like text values. + */ +const nodeMarker = ``; +const markerRegex = new RegExp(`${marker}|${nodeMarker}`); +/** + * Suffix appended to all bound attribute names. + */ +const boundAttributeSuffix = '$lit$'; +/** + * An updatable Template that tracks the location of dynamic parts. + */ +class Template { + constructor(result, element) { + this.parts = []; + this.element = element; + const nodesToRemove = []; + const stack = []; + // Edge needs all 4 parameters present; IE11 needs 3rd parameter to be null + const walker = document.createTreeWalker(element.content, 133 /* NodeFilter.SHOW_{ELEMENT|COMMENT|TEXT} */, null, false); + // Keeps track of the last index associated with a part. We try to delete + // unnecessary nodes, but we never want to associate two different parts + // to the same index. They must have a constant node between. + let lastPartIndex = 0; + let index = -1; + let partIndex = 0; + const { strings, values: { length } } = result; + while (partIndex < length) { + const node = walker.nextNode(); + if (node === null) { + // We've exhausted the content inside a nested template element. + // Because we still have parts (the outer for-loop), we know: + // - There is a template in the stack + // - The walker will find a nextNode outside the template + walker.currentNode = stack.pop(); + continue; + } + index++; + if (node.nodeType === 1 /* Node.ELEMENT_NODE */) { + if (node.hasAttributes()) { + const attributes = node.attributes; + const { length } = attributes; + // Per + // https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap, + // attributes are not guaranteed to be returned in document order. + // In particular, Edge/IE can return them out of order, so we cannot + // assume a correspondence between part index and attribute index. + let count = 0; + for (let i = 0; i < length; i++) { + if (endsWith(attributes[i].name, boundAttributeSuffix)) { + count++; + } + } + while (count-- > 0) { + // Get the template literal section leading up to the first + // expression in this attribute + const stringForPart = strings[partIndex]; + // Find the attribute name + const name = lastAttributeNameRegex.exec(stringForPart)[2]; + // Find the corresponding attribute + // All bound attributes have had a suffix added in + // TemplateResult#getHTML to opt out of special attribute + // handling. To look up the attribute value we also need to add + // the suffix. + const attributeLookupName = name.toLowerCase() + boundAttributeSuffix; + const attributeValue = node.getAttribute(attributeLookupName); + node.removeAttribute(attributeLookupName); + const statics = attributeValue.split(markerRegex); + this.parts.push({ type: 'attribute', index, name, strings: statics }); + partIndex += statics.length - 1; + } + } + if (node.tagName === 'TEMPLATE') { + stack.push(node); + walker.currentNode = node.content; + } + } + else if (node.nodeType === 3 /* Node.TEXT_NODE */) { + const data = node.data; + if (data.indexOf(marker) >= 0) { + const parent = node.parentNode; + const strings = data.split(markerRegex); + const lastIndex = strings.length - 1; + // Generate a new text node for each literal section + // These nodes are also used as the markers for node parts + for (let i = 0; i < lastIndex; i++) { + let insert; + let s = strings[i]; + if (s === '') { + insert = createMarker(); + } + else { + const match = lastAttributeNameRegex.exec(s); + if (match !== null && endsWith(match[2], boundAttributeSuffix)) { + s = s.slice(0, match.index) + match[1] + + match[2].slice(0, -boundAttributeSuffix.length) + match[3]; + } + insert = document.createTextNode(s); + } + parent.insertBefore(insert, node); + this.parts.push({ type: 'node', index: ++index }); + } + // If there's no text, we must insert a comment to mark our place. + // Else, we can trust it will stick around after cloning. + if (strings[lastIndex] === '') { + parent.insertBefore(createMarker(), node); + nodesToRemove.push(node); + } + else { + node.data = strings[lastIndex]; + } + // We have a part for each match found + partIndex += lastIndex; + } + } + else if (node.nodeType === 8 /* Node.COMMENT_NODE */) { + if (node.data === marker) { + const parent = node.parentNode; + // Add a new marker node to be the startNode of the Part if any of + // the following are true: + // * We don't have a previousSibling + // * The previousSibling is already the start of a previous part + if (node.previousSibling === null || index === lastPartIndex) { + index++; + parent.insertBefore(createMarker(), node); + } + lastPartIndex = index; + this.parts.push({ type: 'node', index }); + // If we don't have a nextSibling, keep this node so we have an end. + // Else, we can remove it to save future costs. + if (node.nextSibling === null) { + node.data = ''; + } + else { + nodesToRemove.push(node); + index--; + } + partIndex++; + } + else { + let i = -1; + while ((i = node.data.indexOf(marker, i + 1)) !== -1) { + // Comment node has a binding marker inside, make an inactive part + // The binding won't work, but subsequent bindings will + // TODO (justinfagnani): consider whether it's even worth it to + // make bindings in comments work + this.parts.push({ type: 'node', index: -1 }); + partIndex++; + } + } + } + } + // Remove text binding nodes after the walk to not disturb the TreeWalker + for (const n of nodesToRemove) { + n.parentNode.removeChild(n); + } + } +} +const endsWith = (str, suffix) => { + const index = str.length - suffix.length; + return index >= 0 && str.slice(index) === suffix; +}; +const isTemplatePartActive = (part) => part.index !== -1; +// Allows `document.createComment('')` to be renamed for a +// small manual size-savings. +const createMarker = () => document.createComment(''); +/** + * This regex extracts the attribute name preceding an attribute-position + * expression. It does this by matching the syntax allowed for attributes + * against the string literal directly preceding the expression, assuming that + * the expression is in an attribute-value position. + * + * See attributes in the HTML spec: + * https://www.w3.org/TR/html5/syntax.html#elements-attributes + * + * " \x09\x0a\x0c\x0d" are HTML space characters: + * https://www.w3.org/TR/html5/infrastructure.html#space-characters + * + * "\0-\x1F\x7F-\x9F" are Unicode control characters, which includes every + * space character except " ". + * + * So an attribute is: + * * The name: any character except a control character, space character, ('), + * ("), ">", "=", or "/" + * * Followed by zero or more space characters + * * Followed by "=" + * * Followed by zero or more space characters + * * Followed by: + * * Any character except space, ('), ("), "<", ">", "=", (`), or + * * (") then any non-("), or + * * (') then any non-(') + */ +const lastAttributeNameRegex = +// eslint-disable-next-line no-control-regex +/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/; + +/** + * @license + * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at + * http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at + * http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at + * http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at + * http://polymer.github.io/PATENTS.txt + */ +/** + * An instance of a `Template` that can be attached to the DOM and updated + * with new values. + */ +class TemplateInstance { + constructor(template, processor, options) { + this.__parts = []; + this.template = template; + this.processor = processor; + this.options = options; + } + update(values) { + let i = 0; + for (const part of this.__parts) { + if (part !== undefined) { + part.setValue(values[i]); + } + i++; + } + for (const part of this.__parts) { + if (part !== undefined) { + part.commit(); + } + } + } + _clone() { + // There are a number of steps in the lifecycle of a template instance's + // DOM fragment: + // 1. Clone - create the instance fragment + // 2. Adopt - adopt into the main document + // 3. Process - find part markers and create parts + // 4. Upgrade - upgrade custom elements + // 5. Update - set node, attribute, property, etc., values + // 6. Connect - connect to the document. Optional and outside of this + // method. + // + // We have a few constraints on the ordering of these steps: + // * We need to upgrade before updating, so that property values will pass + // through any property setters. + // * We would like to process before upgrading so that we're sure that the + // cloned fragment is inert and not disturbed by self-modifying DOM. + // * We want custom elements to upgrade even in disconnected fragments. + // + // Given these constraints, with full custom elements support we would + // prefer the order: Clone, Process, Adopt, Upgrade, Update, Connect + // + // But Safari does not implement CustomElementRegistry#upgrade, so we + // can not implement that order and still have upgrade-before-update and + // upgrade disconnected fragments. So we instead sacrifice the + // process-before-upgrade constraint, since in Custom Elements v1 elements + // must not modify their light DOM in the constructor. We still have issues + // when co-existing with CEv0 elements like Polymer 1, and with polyfills + // that don't strictly adhere to the no-modification rule because shadow + // DOM, which may be created in the constructor, is emulated by being placed + // in the light DOM. + // + // The resulting order is on native is: Clone, Adopt, Upgrade, Process, + // Update, Connect. document.importNode() performs Clone, Adopt, and Upgrade + // in one step. + // + // The Custom Elements v1 polyfill supports upgrade(), so the order when + // polyfilled is the more ideal: Clone, Process, Adopt, Upgrade, Update, + // Connect. + const fragment = isCEPolyfill ? + this.template.element.content.cloneNode(true) : + document.importNode(this.template.element.content, true); + const stack = []; + const parts = this.template.parts; + // Edge needs all 4 parameters present; IE11 needs 3rd parameter to be null + const walker = document.createTreeWalker(fragment, 133 /* NodeFilter.SHOW_{ELEMENT|COMMENT|TEXT} */, null, false); + let partIndex = 0; + let nodeIndex = 0; + let part; + let node = walker.nextNode(); + // Loop through all the nodes and parts of a template + while (partIndex < parts.length) { + part = parts[partIndex]; + if (!isTemplatePartActive(part)) { + this.__parts.push(undefined); + partIndex++; + continue; + } + // Progress the tree walker until we find our next part's node. + // Note that multiple parts may share the same node (attribute parts + // on a single element), so this loop may not run at all. + while (nodeIndex < part.index) { + nodeIndex++; + if (node.nodeName === 'TEMPLATE') { + stack.push(node); + walker.currentNode = node.content; + } + if ((node = walker.nextNode()) === null) { + // We've exhausted the content inside a nested template element. + // Because we still have parts (the outer for-loop), we know: + // - There is a template in the stack + // - The walker will find a nextNode outside the template + walker.currentNode = stack.pop(); + node = walker.nextNode(); + } + } + // We've arrived at our part's node. + if (part.type === 'node') { + const part = this.processor.handleTextExpression(this.options); + part.insertAfterNode(node.previousSibling); + this.__parts.push(part); + } + else { + this.__parts.push(...this.processor.handleAttributeExpressions(node, part.name, part.strings, this.options)); + } + partIndex++; + } + if (isCEPolyfill) { + document.adoptNode(fragment); + customElements.upgrade(fragment); + } + return fragment; + } +} + +/** + * @license + * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at + * http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at + * http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at + * http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at + * http://polymer.github.io/PATENTS.txt + */ +const commentMarker = ` ${marker} `; +/** + * The return type of `html`, which holds a Template and the values from + * interpolated expressions. + */ +class TemplateResult { + constructor(strings, values, type, processor) { + this.strings = strings; + this.values = values; + this.type = type; + this.processor = processor; + } + /** + * Returns a string of HTML used to create a `