Fossil

Check-in [9c211011]
Login

Check-in [9c211011]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Rework style.c to use new line continuation feature of translate.c
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9c211011190bde9aeaac04040d41ac8c637c2e49
User & Date: andygoth 2016-11-05 06:38:01
Context
2016-11-05
13:57
Change Files/Folders selection to a Folders Only checkbox ... (check-in: b6a824ec user: andygoth tags: trunk)
06:42
Merge trunk ... (check-in: 4630d9ba user: andygoth tags: andygoth-timeline-ms)
06:38
Rework style.c to use new line continuation feature of translate.c ... (check-in: 9c211011 user: andygoth tags: trunk)
06:37
Enhance translate.c to interpret backslash at the end of a cgi_printf() "@" line as a directive to omit the newline ... (check-in: e193e21b user: andygoth tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/style.c.

543
544
545
546
547
548
549
550
551
552
553
554

555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581

582
583
584
585
586
587
588
589
590
591
592
593
594
595
596



597
598
599
600



601
602
603
604
605
606
607
608




609
610
611
612
613
614
615
616
617
618
      const char *zDisabled = " disabled";
      if( !aSubmenuCtrl[i].isDisabled ){
        zDisabled = "";
        cgi_tag_query_parameter(zQPN);
      }
      switch( aSubmenuCtrl[i].eType ){
        case FF_ENTRY:
          cgi_printf(
             "<span class='submenuctrl'>"
             "&nbsp;%h<input type='text' name='%s' value='%h'%s",
             aSubmenuCtrl[i].zLabel, zQPN, PD(zQPN, ""), zDisabled
          );

          if( aSubmenuCtrl[i].iSize<0 ){
             cgi_printf(" size='%d'", -aSubmenuCtrl[i].iSize);
          }else if( aSubmenuCtrl[i].iSize>0 ){
             cgi_printf(
                " size='%d' maxlength='%d'",
                aSubmenuCtrl[i].iSize, aSubmenuCtrl[i].iSize
             );
          }
          @ onchange='gebi("f01").submit();'></span>
          break;
        case FF_MULTI: {
          int j;
          const char *zVal = P(zQPN);
          if( aSubmenuCtrl[i].zLabel ){
            cgi_printf("&nbsp;%h", aSubmenuCtrl[i].zLabel);
          }
          cgi_printf(
             "<select class='submenuctrl' size='1' name='%s'%s "
             "onchange='gebi(\"f01\").submit();'>\n",
             zQPN, zDisabled
          );
          for(j=0; j<aSubmenuCtrl[i].iSize*2; j+=2){
            const char *zQPV = aSubmenuCtrl[i].azChoice[j];
            cgi_printf(
              "<option value='%h'%s>%h</option>\n",
              zQPV,
              fossil_strcmp(zVal,zQPV)==0 ? " selected" : "",

              aSubmenuCtrl[i].azChoice[j+1]
            );
          }
          @ </select>
          break;
        }
        case FF_BINARY: {
          int isTrue = PB(zQPN);
          cgi_printf(
             "<select class='submenuctrl' size='1' name='%s'%s "
             "onchange='gebi(\"f01\").submit();'>\n",
             zQPN, zDisabled
          );
          cgi_printf(
            "<option value='1'%s>%h</option>\n",



            isTrue ? " selected":"", aSubmenuCtrl[i].zLabel
          );
          cgi_printf(
            "<option value='0'%s>%h</option>\n",



            (!isTrue) ? " selected":"", aSubmenuCtrl[i].zFalse
          );
          @ </select>
          break;
        }
        case FF_CHECKBOX:
          cgi_printf(
            "<label class='submenuctrl'><input type='checkbox' name='%s' "




            "value='1'%s%s onchange='gebi(\"f01\").submit();'>%s</label>\n",
            zQPN, PB(zQPN) ? " checked" : "", zDisabled, aSubmenuCtrl[i].zLabel
          );
          break;
      }
    }
    @ </div>
    if( nSubmenuCtrl ){
      cgi_query_parameters_to_hidden();
      cgi_tag_query_parameter(0);







<
|
<
|
<
>

|

<
|
|
<

|





|

<
|
|
<
<


<
|
|
|
>
|
<






<
|
|
<
<
<
|
>
>
>
|
<
<
|
>
>
>
|
<




<
|
>
>
>
>
|
|
<







543
544
545
546
547
548
549

550

551

552
553
554
555

556
557

558
559
560
561
562
563
564
565
566

567
568


569
570

571
572
573
574
575

576
577
578
579
580
581

582
583



584
585
586
587
588


589
590
591
592
593

594
595
596
597

598
599
600
601
602
603
604

605
606
607
608
609
610
611
      const char *zDisabled = " disabled";
      if( !aSubmenuCtrl[i].isDisabled ){
        zDisabled = "";
        cgi_tag_query_parameter(zQPN);
      }
      switch( aSubmenuCtrl[i].eType ){
        case FF_ENTRY:

          @ <span class='submenuctrl'>\

          @ &nbsp;%h(aSubmenuCtrl[i].zLabel)\

          @ <input type='text' name='%s(zQPN)' value='%h(PD(zQPN, ""))' \
          if( aSubmenuCtrl[i].iSize<0 ){
            @ size='%d(-aSubmenuCtrl[i].iSize)' \
          }else if( aSubmenuCtrl[i].iSize>0 ){

            @ size='%d(aSubmenuCtrl[i].iSize)' \
            @ maxlength='%d(aSubmenuCtrl[i].iSize)' \

          }
          @ onchange='gebi("f01").submit();'%s(zDisabled)></span>
          break;
        case FF_MULTI: {
          int j;
          const char *zVal = P(zQPN);
          if( aSubmenuCtrl[i].zLabel ){
            @ &nbsp;%h(aSubmenuCtrl[i].zLabel)\
          }

          @ <select class='submenuctrl' size='1' name='%s(zQPN)' \
          @ onchange='gebi("f01").submit();'%s(zDisabled)>


          for(j=0; j<aSubmenuCtrl[i].iSize*2; j+=2){
            const char *zQPV = aSubmenuCtrl[i].azChoice[j];

            @ <option value='%h(zQPV)'\
            if( fossil_strcmp(zVal, zQPV)==0 ){
              @  selected\
            }
            @ >%h(aSubmenuCtrl[i].azChoice[j+1])</option>

          }
          @ </select>
          break;
        }
        case FF_BINARY: {
          int isTrue = PB(zQPN);

          @ <select class='submenuctrl' size='1' name='%s(zQPN)' \
          @ onchange='gebi("f01").submit();'%s(zDisabled)>



          @ <option value='1'\
          if( isTrue ){
            @  selected\
          }
          @ >%h(aSubmenuCtrl[i].zLabel)</option>


          @ <option value='0'\
          if( !isTrue ){
            @  selected\
          }
          @ >%h(aSubmenuCtrl[i].zFalse)</option>

          @ </select>
          break;
        }
        case FF_CHECKBOX:

          @ <label class='submenuctrl'>\
          @ <input type='checkbox' name='%s(zQPN)' value='1' \
          if( PB(zQPN) ){
            @ checked \
          }
          @ onchange='gebi("f01").submit();'%s(zDisabled)>\
          @ %h(aSubmenuCtrl[i].zLabel)</label>

          break;
      }
    }
    @ </div>
    if( nSubmenuCtrl ){
      cgi_query_parameters_to_hidden();
      cgi_tag_query_parameter(0);