55 * -------------------------------------------------------------
66 * insert............= [Attr] return ajax call to this id
77 * ajax..............= [Attr] * calls and returns the value file's output ex: <pipe id="id1" ajax="foo.bar:insert1:countByEvent" query="key0:value0;" insert="someID">
8- * query.............= [Attr] default query string associated with url ex: <anyTag form-class="someClass" query="key0:value0;key1:value2;" ajax="page.foo"> (Req. form-class)
8+ * * * query.............= [Attr] default query string associated with url ex: <anyTag form-class="someClass" query="key0:value0;key1:value2;" ajax="page.foo"> (Req. form-class)
99 * turn..............= [Attr] * turns based element routine element ex: <anyTag turn="firstelem;secondelem;" class="decrIndex" index="1">
1010 * callback..........= [Attr] callback function ex: <pipe id="id1" callback="foo" class="class1 class2" value="submit" callback-class="class1 class2" ajax="page.foo;insert-id1">
1111 * callback-class....= [Attr] class to be used in the callback function ex: <pipe id="id1" callback="foo" class="class1 class2" value="submit" callback-class="class1 class2" ajax="page.foo;insert-id1">
@@ -540,31 +540,6 @@ function escapeHtml(html) {
540540 return p . innerHTML ;
541541}
542542
543- const dotpipeStyleManager = {
544- styleMap : new Map ( ) ,
545- styleElem : null ,
546- ensureStyleElem : function ( ) {
547- if ( ! this . styleElem ) {
548- this . styleElem = document . createElement ( 'style' ) ;
549- if ( typeof PAGE_NONCE !== 'undefined' ) this . styleElem . setAttribute ( 'nonce' , PAGE_NONCE ) ;
550- document . head . appendChild ( this . styleElem ) ;
551- }
552- } ,
553- addStyle : function ( cssText ) {
554- let className ;
555- if ( this . styleMap . has ( cssText ) ) {
556- className = this . styleMap . get ( cssText ) ;
557- } else {
558- className = md5 ( cssText ) ;
559- this . ensureStyleElem ( ) ;
560- this . styleElem . textContent += `.${ className } { ${ cssText } }\n` ;
561- this . styleMap . set ( cssText , className ) ;
562- }
563- return className ;
564- }
565- } ;
566-
567-
568543/**
569544 *
570545 * @param {JSON Object } value
@@ -762,13 +737,7 @@ function modala(value, tempTag, root, id) {
762737 console . log ( v ) ;
763738 temp . setAttribute ( "boxes" , v ) ;
764739 }
765- else if ( k . toLowerCase ( ) == "style" ) {
766- // Dedup style, assign class, no inline!
767- const className = dotpipeStyleManager . addStyle ( v ) ;
768- temp . classList . add ( className ) ;
769- // Do NOT set temp.style.cssText!
770- }
771- else if ( ! Number ( k ) && k . toLowerCase ( ) != "textcontent" && k . toLowerCase ( ) != "innerhtml" && k . toLowerCase ( ) != "innertext" ) {
740+ else if ( ! Number ( k ) && k . toLowerCase ( ) != "tagname" && k . toLowerCase ( ) != "textcontent" && k . toLowerCase ( ) != "innerhtml" && k . toLowerCase ( ) != "innertext" ) {
772741 try {
773742 temp . setAttribute ( k , v ) ;
774743 }
@@ -780,6 +749,9 @@ function modala(value, tempTag, root, id) {
780749 const val = v . replace ( / \r ? \n / g, "<br>" ) ;
781750 ( k . toLowerCase ( ) == "textcontent" ) ? temp . textContent = val : ( k . toLowerCase ( ) == "innerhtml" ) ? temp . innerHTML = val : temp . innerText = val ;
782751 }
752+ else if ( k . toLowerCase ( ) == "style" ) {
753+ temp . style . cssText = v ;
754+ }
783755 } ) ;
784756 tempTag . appendChild ( temp ) ;
785757 domContentLoad ( ) ;
@@ -1299,7 +1271,6 @@ function pipes(elem, stop = false) {
12991271 }
13001272 navigate ( clone , headers , query , formclass ) ;
13011273 } ) ;
1302- return ;
13031274 }
13041275 // This is a quick way to make a downloadable link in an href
13051276 // else
@@ -1540,15 +1511,14 @@ function navigate(elem, opts = null, query = "", classname = "") {
15401511 insertElement . firstChild . remove ( ) ;
15411512 }
15421513 }
1543- var newContent = elem . getAttribute ( "ajax" ) . split ( ':' ) [ 1 ] ?? elem . getAttribute ( "insert" ) ;
1544- var newNode = document . createElement ( newContent ) ;
1545- modala ( allText , newNode ) ;
1514+ var newContent = document . createElement ( 'div' ) ;
1515+ modala ( allText , newContent ) ;
15461516 domContentLoad ( )
15471517 flashClickListener ( elem ) ;
15481518 if ( elem . classList . contains ( "modala-multi-first" ) ) {
1549- insertElement . insertBefore ( newNode , insertElement . firstChild ) ;
1519+ insertElement . insertBefore ( newContent , insertElement . firstChild ) ;
15501520 } else {
1551- insertElement . appendChild ( newNode ) ;
1521+ insertElement . appendChild ( newContent ) ;
15521522 }
15531523 }
15541524 }
0 commit comments