Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

32
LINES

< > BotCompany Repo | #1032577 // HtitledSection - successor of htitledSectionWithDiv. create titled section in HTML (like jSection) [not <section> tag]

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (4725L/28K).

1  
// design by Kriti Shankar Senapati
2  
sclass HtitledSection {
3  
  S titleHTML;
4  
  S backgroundColor = "#fff";
5  
  S labelStyle = "width: auto; float: top; position: relative; top: -.6em; left:15px; background-color: " + backgroundColor;
6  
  S innerDivID;
7  
  S innerDivStyle;
8  
  S innerDivClass;
9  
  S outerDivClass;
10  
  new MapSO outerDivParams;
11  
  new MapSO innerDivParams;
12  
  O contents;
13  
  
14  
  *() {}
15  
  *(S *titleHTML) {}
16  
  *(S *titleHTML, O *contents) {}
17  
  
18  
  S html() {
19  
    outerDivParams.put("data-section", htmlDecode_dropTags(titleHTML));
20  
    
21  
    ret div(
22  
      tag label(b("&nbsp;" + titleHTML + "&nbsp;"), style := labelStyle)
23  
    + div(contents,
24  
      paramsPlus(params_plusHTMLClass(
25  
        params_stylePlus(innerDivParams,
26  
          joinNemptiesWithSemicolon(innerDivStyle, "padding-left: 15px")),
27  
        joinNemptiesWithSpace("sectionContents", innerDivClass)),
28  
        id := innerDivID)),
29  
      params_stylePlus("border: 2px solid",
30  
        params_plusHTMLClass(outerDivParams, outerDivClass)));
31  
  }
32  
}

Author comment

Began life as a copy of #1030189

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1032577
Snippet name: HtitledSection - successor of htitledSectionWithDiv. create titled section in HTML (like jSection) [not <section> tag]
Eternal ID of this version: #1032577/11
Text MD5: 41b80040d0704a7844ba4d5e1547f917
Transpilation MD5: 025a6338c046668ed1e44a05821993bf
Author: stefan
Category: javax / html
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-09-23 02:03:00
Source code size: 1031 bytes / 32 lines
Pitched / IR pitched: No / No
Views / Downloads: 107 / 224
Version history: 10 change(s)
Referenced in: [show references]