2648 'textarea' hideHTMLTextArea |
2648 'textarea' hideHTMLTextArea |
2649 'input' hideHTMLInput |
2649 'input' hideHTMLInput |
2650 'table' hideHTMLTable |
2650 'table' hideHTMLTable |
2651 'script' hideHTMLScript |
2651 'script' hideHTMLScript |
2652 'form' hideHTMLForm |
2652 'form' hideHTMLForm |
|
2653 'a' nil |
2653 'h1' hideHTMLHeaders |
2654 'h1' hideHTMLHeaders |
2654 'h2' hideHTMLHeaders |
2655 'h2' hideHTMLHeaders |
2655 'h3' hideHTMLHeaders |
2656 'h3' hideHTMLHeaders |
2656 'h4' hideHTMLHeaders |
2657 'h4' hideHTMLHeaders |
2657 'h5' hideHTMLHeaders |
2658 'h5' hideHTMLHeaders |
2658 'h6' hideHTMLHeaders |
2659 'h6' hideHTMLHeaders |
2659 ) pairWiseDo:[:nm :hideInstVarName| |
2660 ) pairWiseDo:[:nm :hideInstVarName| |
2660 |type hideHolder idx tagText doc markup label text markupName markupType| |
2661 |type hideHolder idx tagText doc markup label text markupName markupType |
|
2662 isHeader| |
2661 |
2663 |
2662 type := hideHolder := nil. |
2664 type := hideHolder := nil. |
2663 |
2665 |
2664 idx := l indexOfSubCollection:('<',nm). |
2666 idx := l indexOfSubCollection:('<',nm). |
2665 idx ~~ 0 ifTrue:[ |
2667 idx ~~ 0 ifTrue:[ |
2666 type := Tag::TElement. |
2668 hideHolder := hideInstVarName isNil |
2667 hideHolder := self instVarNamed:hideInstVarName. |
2669 ifTrue:[ false ] |
|
2670 ifFalse:[ self instVarNamed:hideInstVarName ]. |
2668 |
2671 |
2669 tagText := line copyFrom:idx. |
2672 tagText := line copyFrom:idx. |
2670 doc := HTMLParser new parseText:tagText. |
2673 doc := HTMLParser new parseText:tagText. |
2671 markup := doc markup. |
2674 markup := doc markup. |
2672 markupName := markup name. |
2675 markupName := markup name. |
2673 markupType := markup type. |
2676 markupType := "markup tag ?" markup type. |
|
2677 |
|
2678 isHeader := (#(h1 h2 h3 h4 h5 h6) includes:markupType). |
|
2679 isHeader ifTrue:[ |
|
2680 type := Tag::THeaderElement |
|
2681 ] ifFalse: [ |
|
2682 markupType == #'form' ifTrue:[ |
|
2683 type := Tag::TFormElement |
|
2684 ] ifFalse:[ |
|
2685 markupType == #'a' ifTrue:[ |
|
2686 type := Tag::TAnchorElement. |
|
2687 markupName := markup hrefString notEmptyOrNil ifTrue:['"',markup hrefString,'"'] ifFalse:[ markup name ] |
|
2688 ] ifFalse:[ |
|
2689 type := Tag::TElement |
|
2690 ] |
|
2691 ]. |
|
2692 ]. |
|
2693 |
2674 markup id notEmptyOrNil ifTrue:[ |
2694 markup id notEmptyOrNil ifTrue:[ |
2675 label := nm , ' (',markup id,')' |
2695 label := nm , ' (',markup id,')' |
2676 ] ifFalse:[ |
2696 ] ifFalse:[ |
2677 markupName notEmptyOrNil ifTrue:[ |
2697 markupName notEmptyOrNil ifTrue:[ |
2678 label := nm , ' (',markupName,')' |
2698 label := nm , ' (',markupName,')' |
2679 ] ifFalse:[ |
2699 ] ifFalse:[ |
2680 (markupType == #input and:[ markup valueString notEmptyOrNil ]) ifTrue:[ |
2700 (markupType == #input and:[ markup valueString notEmptyOrNil ]) ifTrue:[ |
2681 label := nm , ' (',markup valueString,')' |
2701 label := nm , ' ("',markup valueString,'")' |
2682 ] ifFalse:[ |
2702 ] ifFalse:[ |
2683 (markupType == #script and:[ markup src notEmptyOrNil ]) ifTrue:[ |
2703 (markupType == #script and:[ markup src notEmptyOrNil ]) ifTrue:[ |
2684 label := nm , ' ("',markup src,'")' |
2704 label := nm , ' ("',markup src,'")' |
2685 ] ifFalse:[ |
2705 ] ifFalse:[ |
2686 ( (#(h1 h2 h3 h4 h5 h6) includes:markupType) |
2706 ( isHeader |
2687 and:[text := self plainTextBetweenHTMLElement:markup andElementWithTag:('/',markupType). |
2707 and:[text := self plainTextBetweenHTMLElement:markup andElementWithTag:('/',markupType). |
2688 text notEmpty |
2708 text notEmpty] |
2689 ]) ifTrue:[ |
2709 ) ifTrue:[ |
2690 label := '"',text,'" (',nm,')' |
2710 label := '"',text,'" (',nm,')' |
2691 ] ifFalse:[ |
2711 ] ifFalse:[ |
2692 label := nm |
2712 label := nm |
2693 ] |
2713 ] |
2694 ] |
2714 ] |