/adei/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/trunk

« back to all changes in this revision

Viewing changes to js/config.js

  • Committer: Suren A. Chilingaryan
  • Date: 2020-01-13 11:01:10 UTC
  • Revision ID: csa@suren.me-20200113110110-mgl5rjtf815k0zgt
Encode/Decode all custom ADEI parameters

Show diffs side-by-side

added added

removed removed

Lines of Context:
577
577
    for (var i in this.cfg.custom) {
578
578
        if (typeof this.cfg.custom[i] != "object") {
579
579
            if ((this.cfg.custom[i] != null)&&(this.cfg.custom[i] != false)) {
580
 
                res += "&" + i + "=" + this.cfg.custom[i];
 
580
                res += "&" + i + "=" + encodeURIComponent(this.cfg.custom[i]);
581
581
            }
582
582
        }
583
583
    }
585
585
    for (var i in this.cfg_extra.custom) {
586
586
        if (typeof this.cfg.custom[i] != "object") {
587
587
            if ((this.cfg_extra.custom[i] != null)&&(this.cfg_extra.custom[i] != false)) {
588
 
                res += "&" + i + "=" + this.cfg_extra.custom[i];
 
588
                res += "&" + i + "=" + encodeURIComponent(this.cfg_extra.custom[i]);
589
589
            }
590
590
        }
591
591
    }
600
600
        
601
601
        if (typeof this.cfg[item] != "undefined") res += "&" + item + "=" + this.cfg[item];
602
602
        else if (typeof this.cfg_extra[item] != "undefined") res += "&" + item + "=" + this.cfg_extra[item];
603
 
        else if (typeof this.cfg.custom[item] != "undefined") res += "&" + item + "=" + this.cfg.custom[item];
604
 
        else if (typeof this.cfg_extra.custom[item] != "undefined") res += "&" + item + "=" + this.cfg_extra.custom[item];
 
603
        else if (typeof this.cfg.custom[item] != "undefined") res += "&" + item + "=" + encodeURIComponent(this.cfg.custom[item]);
 
604
        else if (typeof this.cfg_extra.custom[item] != "undefined") res += "&" + item + "=" + encodeURIComponent(this.cfg_extra.custom[item]);
605
605
    }
606
606
 
607
607
    return res.substr(1);
658
658
            extra[pair[0]] = pair[1];
659
659
            done = true;
660
660
        } else if (typeof cfg.custom[pair[0]] != "undefined") {
661
 
            cfg.custom[pair[0]] = pair[1];
 
661
            cfg.custom[pair[0]] = decodeURIComponent(pair[1]);
662
662
            done = true;
663
663
        } else if (/axis\d*_(range|mode)$/.exec(pair[0])) {
664
664
            cfg.custom[pair[0]] = pair[1];
665
665
            done = true;
666
666
        } else if (typeof extra.custom[pair[0]] != "undefined") {
667
 
            extra.custom[pair[0]] = pair[1];
 
667
            extra.custom[pair[0]] = decodeURIComponent(pair[1]);
668
668
            done = true;
669
669
        } else if (register_custom) {
670
670
            this.RegisterCustomProperty(pair[0]);
671
671
            
672
672
            if (typeof this.custom_props[pair[0]] != "undefined") {
673
 
                cfg.custom[pair[0]] = pair[1];
 
673
                cfg.custom[pair[0]] = decodeURIComponent(pair[1]);
674
674
            } else {
675
 
                extra.custom[pair[0]] = pair[1];
 
675
                extra.custom[pair[0]] = decodeURIComponent(pair[1]);
676
676
            }
677
677
 
678
678
            done = true;
680
680
            var found = false;
681
681
            for (var j=0; j<this.autoreg_props.length; j++) {
682
682
                if (this.autoreg_props[j].exec(pair[0])) {
683
 
                    cfg.custom[pair[0]] = pair[1];
 
683
                    cfg.custom[pair[0]] = decodeURIComponent(pair[1]);
684
684
                    found = true;
685
685
                    break;
686
686
                }
688
688
            if (!found) {
689
689
                for (var j=0; j<this.autoreg_extra.length; j++) {
690
690
                    if (this.autoreg_extra[j].exec(pair[0])) {
691
 
                        extra.custom[pair[0]] = pair[1];
 
691
                        extra.custom[pair[0]] = decodeURIComponent(pair[1]);
692
692
                        break;
693
693
                    }
694
694
                }