MailChimp for WordPress - Version 3.1.5

Version Description

Download this release

Release Info

Developer DvanKooten
Plugin Icon 128x128 MailChimp for WordPress
Version 3.1.5
Comparing to
See all releases

Code changes from version 3.1.4 to 3.1.5

CHANGELOG.md CHANGED
@@ -1,6 +1,24 @@
1
  Changelog
2
  =========
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  #### 3.1.4 - February 29, 2016
5
 
6
  **Fixes**
1
  Changelog
2
  =========
3
 
4
+ #### 3.1.5 - March 22, 2016
5
+
6
+ **Fixes**
7
+
8
+ - Response message was shown for unsubmitted forms when using `{response}` in the form mark-up with multiple forms on the same page.
9
+
10
+ **Improvements**
11
+
12
+ - Scroll to form after form submission now uses native browser method `scrollIntoView()`.
13
+ - Various improvements for right-to-left (RTL) sites.
14
+ - The MailChimp API key is now obfuscated on the settings page.
15
+ - Contact Form 7 integration now uses an early hook priority to ensure we run before any page redirects.
16
+
17
+ **Additions**
18
+
19
+ - Add position option for WooCommerce integration.
20
+ - Add `{post}` tag whch can be used in form mark-up to fetch properties of the current page or post.
21
+
22
  #### 3.1.4 - February 29, 2016
23
 
24
  **Fixes**
assets/css/admin-styles.css CHANGED
@@ -17,7 +17,7 @@
17
  /* The rest of this file contains styles related to the mechanics of
18
  the editor. You probably shouldn't touch them. */
19
  /* The fake, visible scrollbars. Used to force redraw during scrolling
20
- before actuall scrolling happens, thus preventing shaking and
21
  flickering artifacts. */
22
  /* Force content-box sizing for the elements where we expect it */
23
  /* IE7 hack to prevent it from returning funny offsetTops on the spans */
@@ -401,6 +401,7 @@
401
  white-space: normal;
402
  height: 100%;
403
  display: inline-block;
 
404
  margin-bottom: -30px;
405
  /* Hack to make IE7 behave */
406
  *zoom: 1;
@@ -709,3 +710,19 @@
709
  right: 0;
710
  bottom: 0;
711
  top: 0; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  /* The rest of this file contains styles related to the mechanics of
18
  the editor. You probably shouldn't touch them. */
19
  /* The fake, visible scrollbars. Used to force redraw during scrolling
20
+ before actual scrolling happens, thus preventing shaking and
21
  flickering artifacts. */
22
  /* Force content-box sizing for the elements where we expect it */
23
  /* IE7 hack to prevent it from returning funny offsetTops on the spans */
401
  white-space: normal;
402
  height: 100%;
403
  display: inline-block;
404
+ vertical-align: top;
405
  margin-bottom: -30px;
406
  /* Hack to make IE7 behave */
407
  *zoom: 1;
710
  right: 0;
711
  bottom: 0;
712
  top: 0; }
713
+
714
+ .rtl .overlay .close {
715
+ right: auto;
716
+ left: 0; }
717
+
718
+ .rtl #mc4wp-admin .page-title {
719
+ background-position: right center;
720
+ padding-left: 0;
721
+ padding-right: 42px; }
722
+
723
+ .rtl #mc4wp-admin .CodeMirror-scroll {
724
+ overflow-y: hidden !important; }
725
+
726
+ .rtl #mc4wp-admin .CodeMirror-vscrollbar {
727
+ left: 0 !important;
728
+ right: auto !important; }
assets/css/admin-styles.min.css CHANGED
@@ -1 +1 @@
1
- #mc4wp-admin .cm-em,#mc4wp-admin .help,.mc4wp-admin .cm-em,.mc4wp-admin .help{font-style:italic}#mc4wp-admin .row,.mc4wp-admin .row{margin:20px -20px}#mc4wp-admin .row:after,.mc4wp-admin .row:after{content:"";clear:both;display:table}#mc4wp-admin .row .col,.mc4wp-admin .row .col{padding:0 20px;float:left;-webkit-box-sizing:border-box;box-sizing:border-box}#mc4wp-admin .row .col-1,.mc4wp-admin .row .col-1{width:16.666%}#mc4wp-admin .row .col-2,.mc4wp-admin .row .col-2{width:33.333%}#mc4wp-admin .row .col-3,.mc4wp-admin .row .col-3{width:50%}#mc4wp-admin .row .col-4,.mc4wp-admin .row .col-4{width:66.666%}#mc4wp-admin .row .col-5,.mc4wp-admin .row .col-5{width:83.333%}#mc4wp-admin .field-wizard td.stretch,#mc4wp-admin .row .col-6,.mc4wp-admin .field-wizard td.stretch,.mc4wp-admin .row .col-6,.overlay{width:100%}@media (max-width:1200px){#mc4wp-admin .row .col,.mc4wp-admin .row .col{width:100%;float:none;margin:20px 0}}#mc4wp-admin .status,.mc4wp-admin .status{display:inline-block;margin-left:1em;padding:3px 6px;color:#fff;font-size:12px;font-weight:700}#mc4wp-admin .status.positive,.mc4wp-admin .status.positive{background-color:#32cd32}#mc4wp-admin .status.negative,.mc4wp-admin .status.negative{background-color:red}#mc4wp-admin .status.neutral,.mc4wp-admin .status.neutral{background:gray}#mc4wp-admin .valigntop,.mc4wp-admin .valigntop{vertical-align:top!important}#mc4wp-admin .field-wizard .dashicons,#mc4wp-admin .field-wizard td,#mc4wp-admin .field-wizard tr,.mc4wp-admin .field-wizard .dashicons,.mc4wp-admin .field-wizard td,.mc4wp-admin .field-wizard tr{vertical-align:middle}#mc4wp-admin .big-margin,.mc4wp-admin .big-margin{margin:60px 0}#mc4wp-admin .medium-margin,.mc4wp-admin .medium-margin{margin:40px 0}#mc4wp-admin .small-margin,.mc4wp-admin .small-margin{margin:20px 0}#mc4wp-admin .hover-activated,.mc4wp-admin .hover-activated{opacity:.5}#mc4wp-admin .hover-activated:hover,.mc4wp-admin .hover-activated:hover{cursor:pointer;opacity:1}#mc4wp-admin .help-text,.mc4wp-admin .help-text{font-size:14px}#mc4wp-admin .help-text p,.mc4wp-admin .help-text p{margin:10px 0;font-size:14px}#mc4wp-admin .help-text ul,.mc4wp-admin .help-text ul{list-style:square;margin-top:15px;padding-left:40px}#mc4wp-admin .muted,.mc4wp-admin .muted{color:#aaa}#mc4wp-admin .red,.mc4wp-admin .red{color:red}#mc4wp-admin .green,.mc4wp-admin .green{color:#32cd32}#mc4wp-admin .mc4wp-notice,.mc4wp-admin .mc4wp-notice{padding:6px 12px;color:#31708f;background:#d9edf7;border:1px solid #bce8f1;margin:1em 0!important}#mc4wp-admin .column-ID,.mc4wp-admin .column-ID{width:10%}#mc4wp-admin .block,.mc4wp-admin .block{display:block}#mc4wp-admin .code-sample,.mc4wp-admin .code-sample{font-family:Consolas,Monaco,Lucida Console,monospace;font-size:12px;background:#fff}#mc4wp-admin .breadcrumbs,.mc4wp-admin .breadcrumbs{border-bottom:1px solid #ccc;padding-bottom:1em}#mc4wp-admin .tab,.mc4wp-admin .tab{display:none}#mc4wp-admin .tab.tab-active,.mc4wp-admin .tab.tab-active{display:block}#mc4wp-admin .tab h2,.mc4wp-admin .tab h2{margin-top:20px}#mc4wp-admin .CodeMirror,.mc4wp-admin .CodeMirror{font-family:monospace;height:300px;color:#000}#mc4wp-admin .CodeMirror-lines,.mc4wp-admin .CodeMirror-lines{padding:4px 0}#mc4wp-admin .CodeMirror pre,.mc4wp-admin .CodeMirror pre{padding:0 4px}#mc4wp-admin .CodeMirror-gutter-filler,#mc4wp-admin .CodeMirror-scrollbar-filler,.mc4wp-admin .CodeMirror-gutter-filler,.mc4wp-admin .CodeMirror-scrollbar-filler{background-color:#fff}#mc4wp-admin .CodeMirror-gutters,.mc4wp-admin .CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}#mc4wp-admin .CodeMirror-linenumber,.mc4wp-admin .CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}#mc4wp-admin .CodeMirror-guttermarker,.mc4wp-admin .CodeMirror-guttermarker{color:#000}#mc4wp-admin .CodeMirror-guttermarker-subtle,.mc4wp-admin .CodeMirror-guttermarker-subtle{color:#999}#mc4wp-admin .CodeMirror-cursor,.mc4wp-admin .CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}#mc4wp-admin .CodeMirror div.CodeMirror-secondarycursor,.mc4wp-admin .CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}#mc4wp-admin .cm-fat-cursor .CodeMirror-cursor,.mc4wp-admin .cm-fat-cursor .CodeMirror-cursor{width:auto;border:0;background:#7e7}#mc4wp-admin .cm-fat-cursor div.CodeMirror-cursors,.mc4wp-admin .cm-fat-cursor div.CodeMirror-cursors{z-index:1}#mc4wp-admin .cm-animate-fat-cursor,.mc4wp-admin .cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}#mc4wp-admin .cm-tab,.mc4wp-admin .cm-tab{display:inline-block;text-decoration:inherit}#mc4wp-admin .CodeMirror-ruler,.mc4wp-admin .CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}#mc4wp-admin .cm-s-default .cm-header,.mc4wp-admin .cm-s-default .cm-header{color:#00f}#mc4wp-admin .cm-s-default .cm-quote,.mc4wp-admin .cm-s-default .cm-quote{color:#090}#mc4wp-admin .cm-negative,.mc4wp-admin .cm-negative{color:#d44}#mc4wp-admin .cm-positive,.mc4wp-admin .cm-positive{color:#292}#mc4wp-admin .cm-header,#mc4wp-admin .cm-strong,.mc4wp-admin .cm-header,.mc4wp-admin .cm-strong{font-weight:700}#mc4wp-admin .cm-link,.mc4wp-admin .cm-link{text-decoration:underline}#mc4wp-admin .cm-strikethrough,.mc4wp-admin .cm-strikethrough{text-decoration:line-through}#mc4wp-admin .cm-s-default .cm-keyword,.mc4wp-admin .cm-s-default .cm-keyword{color:#708}#mc4wp-admin .cm-s-default .cm-atom,.mc4wp-admin .cm-s-default .cm-atom{color:#219}#mc4wp-admin .cm-s-default .cm-number,.mc4wp-admin .cm-s-default .cm-number{color:#164}#mc4wp-admin .cm-s-default .cm-def,.mc4wp-admin .cm-s-default .cm-def{color:#00f}#mc4wp-admin .cm-s-default .cm-variable-2,.mc4wp-admin .cm-s-default .cm-variable-2{color:#05a}#mc4wp-admin .cm-s-default .cm-variable-3,.mc4wp-admin .cm-s-default .cm-variable-3{color:#085}#mc4wp-admin .cm-s-default .cm-comment,.mc4wp-admin .cm-s-default .cm-comment{color:#a50}#mc4wp-admin .cm-s-default .cm-string,.mc4wp-admin .cm-s-default .cm-string{color:#a11}#mc4wp-admin .cm-s-default .cm-string-2,.mc4wp-admin .cm-s-default .cm-string-2{color:#f50}#mc4wp-admin .cm-s-default .cm-meta,#mc4wp-admin .cm-s-default .cm-qualifier,.mc4wp-admin .cm-s-default .cm-meta,.mc4wp-admin .cm-s-default .cm-qualifier{color:#555}#mc4wp-admin .cm-s-default .cm-builtin,.mc4wp-admin .cm-s-default .cm-builtin{color:#30a}#mc4wp-admin .cm-s-default .cm-bracket,.mc4wp-admin .cm-s-default .cm-bracket{color:#997}#mc4wp-admin .cm-s-default .cm-tag,.mc4wp-admin .cm-s-default .cm-tag{color:#170}#mc4wp-admin .cm-s-default .cm-attribute,.mc4wp-admin .cm-s-default .cm-attribute{color:#00c}#mc4wp-admin .cm-s-default .cm-hr,.mc4wp-admin .cm-s-default .cm-hr{color:#999}#mc4wp-admin .cm-s-default .cm-link,.mc4wp-admin .cm-s-default .cm-link{color:#00c}#mc4wp-admin .cm-invalidchar,#mc4wp-admin .cm-s-default .cm-error,.mc4wp-admin .cm-invalidchar,.mc4wp-admin .cm-s-default .cm-error{color:red}#mc4wp-admin .CodeMirror-composing,.mc4wp-admin .CodeMirror-composing{border-bottom:2px solid}#mc4wp-admin div.CodeMirror span.CodeMirror-matchingbracket,.mc4wp-admin div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}#mc4wp-admin div.CodeMirror span.CodeMirror-nonmatchingbracket,.mc4wp-admin div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}#mc4wp-admin .CodeMirror-matchingtag,.mc4wp-admin .CodeMirror-matchingtag{background:rgba(255,150,0,.3)}#mc4wp-admin .CodeMirror-activeline-background,.mc4wp-admin .CodeMirror-activeline-background{background:#e8f2ff}#mc4wp-admin .CodeMirror,.mc4wp-admin .CodeMirror{position:relative;overflow:hidden;background:#fff}#mc4wp-admin .CodeMirror-scroll,.mc4wp-admin .CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}#mc4wp-admin .CodeMirror-sizer,.mc4wp-admin .CodeMirror-sizer{position:relative;border-right:30px solid transparent}#mc4wp-admin .CodeMirror-gutter-filler,#mc4wp-admin .CodeMirror-hscrollbar,#mc4wp-admin .CodeMirror-scrollbar-filler,#mc4wp-admin .CodeMirror-vscrollbar,.mc4wp-admin .CodeMirror-gutter-filler,.mc4wp-admin .CodeMirror-hscrollbar,.mc4wp-admin .CodeMirror-scrollbar-filler,.mc4wp-admin .CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}#mc4wp-admin .CodeMirror-vscrollbar,.mc4wp-admin .CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}#mc4wp-admin .CodeMirror-hscrollbar,.mc4wp-admin .CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}#mc4wp-admin .CodeMirror-scrollbar-filler,.mc4wp-admin .CodeMirror-scrollbar-filler{right:0;bottom:0}#mc4wp-admin .CodeMirror-gutter-filler,.mc4wp-admin .CodeMirror-gutter-filler{left:0;bottom:0}#mc4wp-admin .CodeMirror-gutters,.mc4wp-admin .CodeMirror-gutters{position:absolute;left:0;top:0;z-index:3}#mc4wp-admin .CodeMirror-gutter,.mc4wp-admin .CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;margin-bottom:-30px}#mc4wp-admin .CodeMirror-gutter-wrapper,.mc4wp-admin .CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important;-webkit-user-select:none;-moz-user-select:none;user-select:none}#mc4wp-admin .CodeMirror-gutter-background,.mc4wp-admin .CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}#mc4wp-admin .CodeMirror-gutter-elt,.mc4wp-admin .CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}#mc4wp-admin .CodeMirror-lines,.mc4wp-admin .CodeMirror-lines{cursor:text;min-height:1px}#mc4wp-admin .CodeMirror pre,.mc4wp-admin .CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent}#mc4wp-admin .CodeMirror-wrap pre,.mc4wp-admin .CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}#mc4wp-admin .CodeMirror-linebackground,.mc4wp-admin .CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}#mc4wp-admin .CodeMirror-linewidget,.mc4wp-admin .CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}#mc4wp-admin .CodeMirror-code,.mc4wp-admin .CodeMirror-code{outline:0}#mc4wp-admin .CodeMirror-gutter,#mc4wp-admin .CodeMirror-gutters,#mc4wp-admin .CodeMirror-linenumber,#mc4wp-admin .CodeMirror-scroll,#mc4wp-admin .CodeMirror-sizer,.mc4wp-admin .CodeMirror-gutter,.mc4wp-admin .CodeMirror-gutters,.mc4wp-admin .CodeMirror-linenumber,.mc4wp-admin .CodeMirror-scroll,.mc4wp-admin .CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}#mc4wp-admin .CodeMirror-measure,.mc4wp-admin .CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}#mc4wp-admin .CodeMirror-cursor,.mc4wp-admin .CodeMirror-cursor{position:absolute}#mc4wp-admin .CodeMirror-measure pre,.mc4wp-admin .CodeMirror-measure pre{position:static}#mc4wp-admin div.CodeMirror-cursors,.mc4wp-admin div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}#mc4wp-admin .CodeMirror-focused div.CodeMirror-cursors,#mc4wp-admin div.CodeMirror-dragcursors,.mc4wp-admin .CodeMirror-focused div.CodeMirror-cursors,.mc4wp-admin div.CodeMirror-dragcursors{visibility:visible}#mc4wp-admin .CodeMirror-selected,.mc4wp-admin .CodeMirror-selected{background:#d9d9d9}#mc4wp-admin .CodeMirror-focused .CodeMirror-selected,#mc4wp-admin .CodeMirror-line::selection,#mc4wp-admin .CodeMirror-line>span::selection,#mc4wp-admin .CodeMirror-line>span>span::selection,.mc4wp-admin .CodeMirror-focused .CodeMirror-selected,.mc4wp-admin .CodeMirror-line::selection,.mc4wp-admin .CodeMirror-line>span::selection,.mc4wp-admin .CodeMirror-line>span>span::selection{background:#d7d4f0}#mc4wp-admin .CodeMirror-crosshair,.mc4wp-admin .CodeMirror-crosshair{cursor:crosshair}#mc4wp-admin .CodeMirror-line::-moz-selection,#mc4wp-admin .CodeMirror-line>span::-moz-selection,#mc4wp-admin .CodeMirror-line>span>span::-moz-selection,.mc4wp-admin .CodeMirror-line::-moz-selection,.mc4wp-admin .CodeMirror-line>span::-moz-selection,.mc4wp-admin .CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}#mc4wp-admin .cm-searching,.mc4wp-admin .cm-searching{background:#ffa;background:rgba(255,255,0,.4)}#mc4wp-admin .cm-force-border,.mc4wp-admin .cm-force-border{padding-right:.1px}@media print{#mc4wp-admin .CodeMirror div.CodeMirror-cursors,.mc4wp-admin .CodeMirror div.CodeMirror-cursors{visibility:hidden}}#mc4wp-admin .cm-tab-wrap-hack:after,.mc4wp-admin .cm-tab-wrap-hack:after{content:''}#mc4wp-admin span.CodeMirror-selectedtext,.mc4wp-admin span.CodeMirror-selectedtext{background:0 0}#mc4wp-admin .CodeMirror,.mc4wp-admin .CodeMirror{border:1px solid #ccc;padding:10px;min-height:500px}#mc4wp-admin .CodeMirror-empty,.mc4wp-admin .CodeMirror-empty{color:#999}#mc4wp-admin .field-wizard h3,.mc4wp-admin .field-wizard h3{margin-top:0;padding-bottom:12px;border-bottom:1px solid #eee;margin-bottom:12px}#mc4wp-admin .field-wizard code,.mc4wp-admin .field-wizard code{margin-left:10px}#mc4wp-admin .field-wizard>div,.mc4wp-admin .field-wizard>div{margin:24px 0}#mc4wp-admin .field-wizard label,.mc4wp-admin .field-wizard label{font-weight:600;display:block;margin-bottom:3px}#mc4wp-admin .field-wizard table,.mc4wp-admin .field-wizard table{table-layout:fixed;border-collapse:collapse;border-spacing:0}#mc4wp-admin .field-wizard .cb-wrap,.mc4wp-admin .field-wizard .cb-wrap{font-weight:400}#mc4wp-admin .field-wizard .cb-wrap input,.mc4wp-admin .field-wizard .cb-wrap input{margin-right:6px}#mc4wp-admin .field-wizard .limit-height,.mc4wp-admin .field-wizard .limit-height{border:1px solid #eee;padding:6px;max-height:200px;overflow-y:scroll}#mc4wp-admin .field-wizard .help,.mc4wp-admin .field-wizard .help{margin-top:0}#mc4wp-admin .available-fields,.mc4wp-admin .available-fields{border:1px solid #ccc;padding:20px;background:#fff}#mc4wp-admin .available-fields strong,.mc4wp-admin .available-fields strong{display:block;margin-bottom:10px}#mc4wp-admin .available-fields button,.mc4wp-admin .available-fields button{margin:0 6px 6px 0}#mc4wp-admin .available-fields .is-required:after,.mc4wp-admin .available-fields .is-required:after{content:" *";color:red}#mc4wp-admin .available-fields .is-required.not-in-form,.mc4wp-admin .available-fields .is-required.not-in-form{-webkit-box-shadow:0 0 3px 1px red;-moz-box-shadow:0 0 3px 1px red;box-shadow:0 0 3px 1px red}#mc4wp-admin .available-fields .in-form,.mc4wp-admin .available-fields .in-form{opacity:.5}#mc4wp-admin .page-title,.mc4wp-admin .page-title{background:url(../img/icon-large.png) left center no-repeat;padding-left:42px;line-height:32px;margin-bottom:20px}#mc4wp-admin .page-title small,.mc4wp-admin .page-title small{font-size:12px;color:#777;display:inline-block;margin-left:10px}#mc4wp-admin .button .dashicons,#mc4wp-admin .button-secondary .dashicons,#mc4wp-admin .page-title-action .dashicons,.mc4wp-admin .button .dashicons,.mc4wp-admin .button-secondary .dashicons,.mc4wp-admin .page-title-action .dashicons{vertical-align:middle;line-height:16px;margin:0 4px 0 0}#mc4wp-admin .form-table td p,.mc4wp-admin .form-table td p{margin-top:1em}#mc4wp-admin .sidebar,.mc4wp-admin .sidebar{border-left:1px solid #ccc}#mc4wp-admin .sidebar h3,#mc4wp-admin .sidebar h4,.mc4wp-admin .sidebar h3,.mc4wp-admin .sidebar h4{font-size:16px;margin-bottom:0}#mc4wp-admin .sidebar>div,.mc4wp-admin .sidebar>div{border-bottom:1px solid #ccc;margin-bottom:20px;padding-bottom:20px}#mc4wp-admin .sidebar>div:last-of-type,.mc4wp-admin .sidebar>div:last-of-type{border-bottom:0}.overlay{position:fixed;left:0;top:0;z-index:99999;padding:20px;max-width:480px;max-height:100%;background:#fefefe;border:1px solid #ccc;overflow-y:scroll;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.overlay .close{position:absolute;padding:10px;right:0;top:0;font-size:24px;cursor:pointer;opacity:.5}.overlay .close:hover{opacity:1}.overlay-background{z-index:99998;background:rgba(0,0,0,.67);position:fixed;left:0;right:0;bottom:0;top:0}
1
+ #mc4wp-admin .cm-em,#mc4wp-admin .help,.mc4wp-admin .cm-em,.mc4wp-admin .help{font-style:italic}#mc4wp-admin .row,.mc4wp-admin .row{margin:20px -20px}#mc4wp-admin .row:after,.mc4wp-admin .row:after{content:"";clear:both;display:table}#mc4wp-admin .row .col,.mc4wp-admin .row .col{padding:0 20px;float:left;-webkit-box-sizing:border-box;box-sizing:border-box}#mc4wp-admin .row .col-1,.mc4wp-admin .row .col-1{width:16.666%}#mc4wp-admin .row .col-2,.mc4wp-admin .row .col-2{width:33.333%}#mc4wp-admin .row .col-3,.mc4wp-admin .row .col-3{width:50%}#mc4wp-admin .row .col-4,.mc4wp-admin .row .col-4{width:66.666%}#mc4wp-admin .row .col-5,.mc4wp-admin .row .col-5{width:83.333%}#mc4wp-admin .field-wizard td.stretch,#mc4wp-admin .row .col-6,.mc4wp-admin .field-wizard td.stretch,.mc4wp-admin .row .col-6,.overlay{width:100%}@media (max-width:1200px){#mc4wp-admin .row .col,.mc4wp-admin .row .col{width:100%;float:none;margin:20px 0}}#mc4wp-admin .status,.mc4wp-admin .status{display:inline-block;margin-left:1em;padding:3px 6px;color:#fff;font-size:12px;font-weight:700}#mc4wp-admin .status.positive,.mc4wp-admin .status.positive{background-color:#32cd32}#mc4wp-admin .status.negative,.mc4wp-admin .status.negative{background-color:red}#mc4wp-admin .status.neutral,.mc4wp-admin .status.neutral{background:gray}#mc4wp-admin .valigntop,.mc4wp-admin .valigntop{vertical-align:top!important}#mc4wp-admin .big-margin,.mc4wp-admin .big-margin{margin:60px 0}#mc4wp-admin .medium-margin,.mc4wp-admin .medium-margin{margin:40px 0}#mc4wp-admin .small-margin,.mc4wp-admin .small-margin{margin:20px 0}#mc4wp-admin .hover-activated,.mc4wp-admin .hover-activated{opacity:.5}#mc4wp-admin .hover-activated:hover,.mc4wp-admin .hover-activated:hover{cursor:pointer;opacity:1}#mc4wp-admin .help-text,.mc4wp-admin .help-text{font-size:14px}#mc4wp-admin .help-text p,.mc4wp-admin .help-text p{margin:10px 0;font-size:14px}#mc4wp-admin .help-text ul,.mc4wp-admin .help-text ul{list-style:square;margin-top:15px;padding-left:40px}#mc4wp-admin .muted,.mc4wp-admin .muted{color:#aaa}#mc4wp-admin .red,.mc4wp-admin .red{color:red}#mc4wp-admin .green,.mc4wp-admin .green{color:#32cd32}#mc4wp-admin .mc4wp-notice,.mc4wp-admin .mc4wp-notice{padding:6px 12px;color:#31708f;background:#d9edf7;border:1px solid #bce8f1;margin:1em 0!important}#mc4wp-admin .column-ID,.mc4wp-admin .column-ID{width:10%}#mc4wp-admin .block,.mc4wp-admin .block{display:block}#mc4wp-admin .code-sample,.mc4wp-admin .code-sample{font-family:Consolas,Monaco,Lucida Console,monospace;font-size:12px;background:#fff}#mc4wp-admin .breadcrumbs,.mc4wp-admin .breadcrumbs{border-bottom:1px solid #ccc;padding-bottom:1em}#mc4wp-admin .tab,.mc4wp-admin .tab{display:none}#mc4wp-admin .tab.tab-active,.mc4wp-admin .tab.tab-active{display:block}#mc4wp-admin .tab h2,.mc4wp-admin .tab h2{margin-top:20px}#mc4wp-admin .CodeMirror,.mc4wp-admin .CodeMirror{font-family:monospace;height:300px;color:#000}#mc4wp-admin .CodeMirror-lines,.mc4wp-admin .CodeMirror-lines{padding:4px 0}#mc4wp-admin .CodeMirror pre,.mc4wp-admin .CodeMirror pre{padding:0 4px}#mc4wp-admin .CodeMirror-gutter-filler,#mc4wp-admin .CodeMirror-scrollbar-filler,.mc4wp-admin .CodeMirror-gutter-filler,.mc4wp-admin .CodeMirror-scrollbar-filler{background-color:#fff}#mc4wp-admin .CodeMirror-gutters,.mc4wp-admin .CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}#mc4wp-admin .CodeMirror-linenumber,.mc4wp-admin .CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}#mc4wp-admin .CodeMirror-guttermarker,.mc4wp-admin .CodeMirror-guttermarker{color:#000}#mc4wp-admin .CodeMirror-guttermarker-subtle,.mc4wp-admin .CodeMirror-guttermarker-subtle{color:#999}#mc4wp-admin .CodeMirror-cursor,.mc4wp-admin .CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}#mc4wp-admin .CodeMirror div.CodeMirror-secondarycursor,.mc4wp-admin .CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}#mc4wp-admin .cm-fat-cursor .CodeMirror-cursor,.mc4wp-admin .cm-fat-cursor .CodeMirror-cursor{width:auto;border:0;background:#7e7}#mc4wp-admin .cm-fat-cursor div.CodeMirror-cursors,.mc4wp-admin .cm-fat-cursor div.CodeMirror-cursors{z-index:1}#mc4wp-admin .cm-animate-fat-cursor,.mc4wp-admin .cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}#mc4wp-admin .cm-tab,.mc4wp-admin .cm-tab{display:inline-block;text-decoration:inherit}#mc4wp-admin .CodeMirror-ruler,.mc4wp-admin .CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}#mc4wp-admin .cm-s-default .cm-header,.mc4wp-admin .cm-s-default .cm-header{color:#00f}#mc4wp-admin .cm-s-default .cm-quote,.mc4wp-admin .cm-s-default .cm-quote{color:#090}#mc4wp-admin .cm-negative,.mc4wp-admin .cm-negative{color:#d44}#mc4wp-admin .cm-positive,.mc4wp-admin .cm-positive{color:#292}#mc4wp-admin .cm-header,#mc4wp-admin .cm-strong,.mc4wp-admin .cm-header,.mc4wp-admin .cm-strong{font-weight:700}#mc4wp-admin .cm-link,.mc4wp-admin .cm-link{text-decoration:underline}#mc4wp-admin .cm-strikethrough,.mc4wp-admin .cm-strikethrough{text-decoration:line-through}#mc4wp-admin .cm-s-default .cm-keyword,.mc4wp-admin .cm-s-default .cm-keyword{color:#708}#mc4wp-admin .cm-s-default .cm-atom,.mc4wp-admin .cm-s-default .cm-atom{color:#219}#mc4wp-admin .cm-s-default .cm-number,.mc4wp-admin .cm-s-default .cm-number{color:#164}#mc4wp-admin .cm-s-default .cm-def,.mc4wp-admin .cm-s-default .cm-def{color:#00f}#mc4wp-admin .cm-s-default .cm-variable-2,.mc4wp-admin .cm-s-default .cm-variable-2{color:#05a}#mc4wp-admin .cm-s-default .cm-variable-3,.mc4wp-admin .cm-s-default .cm-variable-3{color:#085}#mc4wp-admin .cm-s-default .cm-comment,.mc4wp-admin .cm-s-default .cm-comment{color:#a50}#mc4wp-admin .cm-s-default .cm-string,.mc4wp-admin .cm-s-default .cm-string{color:#a11}#mc4wp-admin .cm-s-default .cm-string-2,.mc4wp-admin .cm-s-default .cm-string-2{color:#f50}#mc4wp-admin .cm-s-default .cm-meta,#mc4wp-admin .cm-s-default .cm-qualifier,.mc4wp-admin .cm-s-default .cm-meta,.mc4wp-admin .cm-s-default .cm-qualifier{color:#555}#mc4wp-admin .cm-s-default .cm-builtin,.mc4wp-admin .cm-s-default .cm-builtin{color:#30a}#mc4wp-admin .cm-s-default .cm-bracket,.mc4wp-admin .cm-s-default .cm-bracket{color:#997}#mc4wp-admin .cm-s-default .cm-tag,.mc4wp-admin .cm-s-default .cm-tag{color:#170}#mc4wp-admin .cm-s-default .cm-attribute,.mc4wp-admin .cm-s-default .cm-attribute{color:#00c}#mc4wp-admin .cm-s-default .cm-hr,.mc4wp-admin .cm-s-default .cm-hr{color:#999}#mc4wp-admin .cm-s-default .cm-link,.mc4wp-admin .cm-s-default .cm-link{color:#00c}#mc4wp-admin .cm-invalidchar,#mc4wp-admin .cm-s-default .cm-error,.mc4wp-admin .cm-invalidchar,.mc4wp-admin .cm-s-default .cm-error{color:red}#mc4wp-admin .CodeMirror-composing,.mc4wp-admin .CodeMirror-composing{border-bottom:2px solid}#mc4wp-admin div.CodeMirror span.CodeMirror-matchingbracket,.mc4wp-admin div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}#mc4wp-admin div.CodeMirror span.CodeMirror-nonmatchingbracket,.mc4wp-admin div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}#mc4wp-admin .CodeMirror-matchingtag,.mc4wp-admin .CodeMirror-matchingtag{background:rgba(255,150,0,.3)}#mc4wp-admin .CodeMirror-activeline-background,.mc4wp-admin .CodeMirror-activeline-background{background:#e8f2ff}#mc4wp-admin .CodeMirror,.mc4wp-admin .CodeMirror{position:relative;overflow:hidden;background:#fff}#mc4wp-admin .CodeMirror-scroll,.mc4wp-admin .CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}#mc4wp-admin .CodeMirror-sizer,.mc4wp-admin .CodeMirror-sizer{position:relative;border-right:30px solid transparent}#mc4wp-admin .CodeMirror-gutter-filler,#mc4wp-admin .CodeMirror-hscrollbar,#mc4wp-admin .CodeMirror-scrollbar-filler,#mc4wp-admin .CodeMirror-vscrollbar,.mc4wp-admin .CodeMirror-gutter-filler,.mc4wp-admin .CodeMirror-hscrollbar,.mc4wp-admin .CodeMirror-scrollbar-filler,.mc4wp-admin .CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}#mc4wp-admin .CodeMirror-vscrollbar,.mc4wp-admin .CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}#mc4wp-admin .CodeMirror-hscrollbar,.mc4wp-admin .CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}#mc4wp-admin .CodeMirror-scrollbar-filler,.mc4wp-admin .CodeMirror-scrollbar-filler{right:0;bottom:0}#mc4wp-admin .CodeMirror-gutter-filler,.mc4wp-admin .CodeMirror-gutter-filler{left:0;bottom:0}#mc4wp-admin .CodeMirror-gutters,.mc4wp-admin .CodeMirror-gutters{position:absolute;left:0;top:0;z-index:3}#mc4wp-admin .CodeMirror-gutter,.mc4wp-admin .CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-30px}#mc4wp-admin .field-wizard .dashicons,#mc4wp-admin .field-wizard td,#mc4wp-admin .field-wizard tr,.mc4wp-admin .field-wizard .dashicons,.mc4wp-admin .field-wizard td,.mc4wp-admin .field-wizard tr{vertical-align:middle}#mc4wp-admin .CodeMirror-gutter-wrapper,.mc4wp-admin .CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important;-webkit-user-select:none;-moz-user-select:none;user-select:none}#mc4wp-admin .CodeMirror-gutter-background,.mc4wp-admin .CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}#mc4wp-admin .CodeMirror-gutter-elt,.mc4wp-admin .CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}#mc4wp-admin .CodeMirror-lines,.mc4wp-admin .CodeMirror-lines{cursor:text;min-height:1px}#mc4wp-admin .CodeMirror pre,.mc4wp-admin .CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent}#mc4wp-admin .CodeMirror-wrap pre,.mc4wp-admin .CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}#mc4wp-admin .CodeMirror-linebackground,.mc4wp-admin .CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}#mc4wp-admin .CodeMirror-linewidget,.mc4wp-admin .CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}#mc4wp-admin .CodeMirror-code,.mc4wp-admin .CodeMirror-code{outline:0}#mc4wp-admin .CodeMirror-gutter,#mc4wp-admin .CodeMirror-gutters,#mc4wp-admin .CodeMirror-linenumber,#mc4wp-admin .CodeMirror-scroll,#mc4wp-admin .CodeMirror-sizer,.mc4wp-admin .CodeMirror-gutter,.mc4wp-admin .CodeMirror-gutters,.mc4wp-admin .CodeMirror-linenumber,.mc4wp-admin .CodeMirror-scroll,.mc4wp-admin .CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}#mc4wp-admin .CodeMirror-measure,.mc4wp-admin .CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}#mc4wp-admin .CodeMirror-cursor,.mc4wp-admin .CodeMirror-cursor{position:absolute}#mc4wp-admin .CodeMirror-measure pre,.mc4wp-admin .CodeMirror-measure pre{position:static}#mc4wp-admin div.CodeMirror-cursors,.mc4wp-admin div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}#mc4wp-admin .CodeMirror-focused div.CodeMirror-cursors,#mc4wp-admin div.CodeMirror-dragcursors,.mc4wp-admin .CodeMirror-focused div.CodeMirror-cursors,.mc4wp-admin div.CodeMirror-dragcursors{visibility:visible}#mc4wp-admin .CodeMirror-selected,.mc4wp-admin .CodeMirror-selected{background:#d9d9d9}#mc4wp-admin .CodeMirror-focused .CodeMirror-selected,#mc4wp-admin .CodeMirror-line::selection,#mc4wp-admin .CodeMirror-line>span::selection,#mc4wp-admin .CodeMirror-line>span>span::selection,.mc4wp-admin .CodeMirror-focused .CodeMirror-selected,.mc4wp-admin .CodeMirror-line::selection,.mc4wp-admin .CodeMirror-line>span::selection,.mc4wp-admin .CodeMirror-line>span>span::selection{background:#d7d4f0}#mc4wp-admin .CodeMirror-crosshair,.mc4wp-admin .CodeMirror-crosshair{cursor:crosshair}#mc4wp-admin .CodeMirror-line::-moz-selection,#mc4wp-admin .CodeMirror-line>span::-moz-selection,#mc4wp-admin .CodeMirror-line>span>span::-moz-selection,.mc4wp-admin .CodeMirror-line::-moz-selection,.mc4wp-admin .CodeMirror-line>span::-moz-selection,.mc4wp-admin .CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}#mc4wp-admin .cm-searching,.mc4wp-admin .cm-searching{background:#ffa;background:rgba(255,255,0,.4)}#mc4wp-admin .cm-force-border,.mc4wp-admin .cm-force-border{padding-right:.1px}@media print{#mc4wp-admin .CodeMirror div.CodeMirror-cursors,.mc4wp-admin .CodeMirror div.CodeMirror-cursors{visibility:hidden}}#mc4wp-admin .cm-tab-wrap-hack:after,.mc4wp-admin .cm-tab-wrap-hack:after{content:''}#mc4wp-admin span.CodeMirror-selectedtext,.mc4wp-admin span.CodeMirror-selectedtext{background:0 0}#mc4wp-admin .CodeMirror,.mc4wp-admin .CodeMirror{border:1px solid #ccc;padding:10px;min-height:500px}#mc4wp-admin .CodeMirror-empty,.mc4wp-admin .CodeMirror-empty{color:#999}#mc4wp-admin .field-wizard h3,.mc4wp-admin .field-wizard h3{margin-top:0;padding-bottom:12px;border-bottom:1px solid #eee;margin-bottom:12px}#mc4wp-admin .field-wizard code,.mc4wp-admin .field-wizard code{margin-left:10px}#mc4wp-admin .field-wizard>div,.mc4wp-admin .field-wizard>div{margin:24px 0}#mc4wp-admin .field-wizard label,.mc4wp-admin .field-wizard label{font-weight:600;display:block;margin-bottom:3px}#mc4wp-admin .field-wizard table,.mc4wp-admin .field-wizard table{table-layout:fixed;border-collapse:collapse;border-spacing:0}#mc4wp-admin .field-wizard .cb-wrap,.mc4wp-admin .field-wizard .cb-wrap{font-weight:400}#mc4wp-admin .field-wizard .cb-wrap input,.mc4wp-admin .field-wizard .cb-wrap input{margin-right:6px}#mc4wp-admin .field-wizard .limit-height,.mc4wp-admin .field-wizard .limit-height{border:1px solid #eee;padding:6px;max-height:200px;overflow-y:scroll}#mc4wp-admin .field-wizard .help,.mc4wp-admin .field-wizard .help{margin-top:0}#mc4wp-admin .available-fields,.mc4wp-admin .available-fields{border:1px solid #ccc;padding:20px;background:#fff}#mc4wp-admin .available-fields strong,.mc4wp-admin .available-fields strong{display:block;margin-bottom:10px}#mc4wp-admin .available-fields button,.mc4wp-admin .available-fields button{margin:0 6px 6px 0}#mc4wp-admin .available-fields .is-required:after,.mc4wp-admin .available-fields .is-required:after{content:" *";color:red}#mc4wp-admin .available-fields .is-required.not-in-form,.mc4wp-admin .available-fields .is-required.not-in-form{-webkit-box-shadow:0 0 3px 1px red;-moz-box-shadow:0 0 3px 1px red;box-shadow:0 0 3px 1px red}#mc4wp-admin .available-fields .in-form,.mc4wp-admin .available-fields .in-form{opacity:.5}#mc4wp-admin .page-title,.mc4wp-admin .page-title{background:url(../img/icon-large.png) left center no-repeat;padding-left:42px;line-height:32px;margin-bottom:20px}#mc4wp-admin .page-title small,.mc4wp-admin .page-title small{font-size:12px;color:#777;display:inline-block;margin-left:10px}#mc4wp-admin .button .dashicons,#mc4wp-admin .button-secondary .dashicons,#mc4wp-admin .page-title-action .dashicons,.mc4wp-admin .button .dashicons,.mc4wp-admin .button-secondary .dashicons,.mc4wp-admin .page-title-action .dashicons{vertical-align:middle;line-height:16px;margin:0 4px 0 0}#mc4wp-admin .form-table td p,.mc4wp-admin .form-table td p{margin-top:1em}#mc4wp-admin .sidebar,.mc4wp-admin .sidebar{border-left:1px solid #ccc}#mc4wp-admin .sidebar h3,#mc4wp-admin .sidebar h4,.mc4wp-admin .sidebar h3,.mc4wp-admin .sidebar h4{font-size:16px;margin-bottom:0}#mc4wp-admin .sidebar>div,.mc4wp-admin .sidebar>div{border-bottom:1px solid #ccc;margin-bottom:20px;padding-bottom:20px}#mc4wp-admin .sidebar>div:last-of-type,.mc4wp-admin .sidebar>div:last-of-type{border-bottom:0}.overlay{position:fixed;left:0;top:0;z-index:99999;padding:20px;max-width:480px;max-height:100%;background:#fefefe;border:1px solid #ccc;overflow-y:scroll;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.overlay .close{position:absolute;padding:10px;right:0;top:0;font-size:24px;cursor:pointer;opacity:.5}.overlay .close:hover{opacity:1}.overlay-background{z-index:99998;background:rgba(0,0,0,.67);position:fixed;left:0;right:0;bottom:0;top:0}.rtl .overlay .close{right:auto;left:0}.rtl #mc4wp-admin .page-title{background-position:right center;padding-left:0;padding-right:42px}.rtl #mc4wp-admin .CodeMirror-scroll{overflow-y:hidden!important}.rtl #mc4wp-admin .CodeMirror-vscrollbar{left:0!important;right:auto!important}
assets/css/form-editor.css CHANGED
@@ -215,7 +215,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {
215
  border-right: 30px solid transparent; }
216
 
217
  /* The fake, visible scrollbars. Used to force redraw during scrolling
218
- before actuall scrolling happens, thus preventing shaking and
219
  flickering artifacts. */
220
  .CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
221
  position: absolute;
@@ -252,6 +252,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {
252
  white-space: normal;
253
  height: 100%;
254
  display: inline-block;
 
255
  margin-bottom: -30px;
256
  /* Hack to make IE7 behave */
257
  *zoom: 1;
215
  border-right: 30px solid transparent; }
216
 
217
  /* The fake, visible scrollbars. Used to force redraw during scrolling
218
+ before actual scrolling happens, thus preventing shaking and
219
  flickering artifacts. */
220
  .CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
221
  position: absolute;
252
  white-space: normal;
253
  height: 100%;
254
  display: inline-block;
255
+ vertical-align: top;
256
  margin-bottom: -30px;
257
  /* Hack to make IE7 behave */
258
  *zoom: 1;
assets/css/form-editor.min.css CHANGED
@@ -1 +1 @@
1
- .field-wizard .dashicons,.field-wizard td,.field-wizard tr{vertical-align:middle}.CodeMirror{font-family:monospace;height:300px;color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important;-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected,.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0}.CodeMirror{border:1px solid #ccc;padding:10px;min-height:500px}.CodeMirror-empty{color:#999}.field-wizard h3{margin-top:0;padding-bottom:12px;border-bottom:1px solid #eee;margin-bottom:12px}.field-wizard code{margin-left:10px}.field-wizard>div{margin:24px 0}.field-wizard label{font-weight:600;display:block;margin-bottom:3px}.field-wizard table{table-layout:fixed;border-collapse:collapse;border-spacing:0}.field-wizard td.stretch{width:100%}.field-wizard .cb-wrap{font-weight:400}.field-wizard .cb-wrap input{margin-right:6px}.field-wizard .limit-height{border:1px solid #eee;padding:6px;max-height:200px;overflow-y:scroll}.field-wizard .help{margin-top:0}.available-fields{border:1px solid #ccc;padding:20px;background:#fff}.available-fields strong{display:block;margin-bottom:10px}.available-fields button{margin:0 6px 6px 0}.available-fields .is-required:after{content:" *";color:red}.available-fields .is-required.not-in-form{-webkit-box-shadow:0 0 3px 1px red;-moz-box-shadow:0 0 3px 1px red;box-shadow:0 0 3px 1px red}.available-fields .in-form{opacity:.5}
1
+ .CodeMirror{font-family:monospace;height:300px;color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-30px}.field-wizard .dashicons,.field-wizard td,.field-wizard tr{vertical-align:middle}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important;-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected,.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0}.CodeMirror{border:1px solid #ccc;padding:10px;min-height:500px}.CodeMirror-empty{color:#999}.field-wizard h3{margin-top:0;padding-bottom:12px;border-bottom:1px solid #eee;margin-bottom:12px}.field-wizard code{margin-left:10px}.field-wizard>div{margin:24px 0}.field-wizard label{font-weight:600;display:block;margin-bottom:3px}.field-wizard table{table-layout:fixed;border-collapse:collapse;border-spacing:0}.field-wizard td.stretch{width:100%}.field-wizard .cb-wrap{font-weight:400}.field-wizard .cb-wrap input{margin-right:6px}.field-wizard .limit-height{border:1px solid #eee;padding:6px;max-height:200px;overflow-y:scroll}.field-wizard .help{margin-top:0}.available-fields{border:1px solid #ccc;padding:20px;background:#fff}.available-fields strong{display:block;margin-bottom:10px}.available-fields button{margin:0 6px 6px 0}.available-fields .is-required:after{content:" *";color:red}.available-fields .is-required.not-in-form{-webkit-box-shadow:0 0 3px 1px red;-moz-box-shadow:0 0 3px 1px red;box-shadow:0 0 3px 1px red}.available-fields .in-form{opacity:.5}
assets/js/admin.js CHANGED
@@ -383,26 +383,83 @@ var URL = {
383
 
384
  module.exports = URL;
385
  },{}],6:[function(require,module,exports){
386
- var m = (function app(window, undefined) {
387
- var OBJECT = "[object Object]", ARRAY = "[object Array]", STRING = "[object String]", FUNCTION = "function";
388
- var type = {}.toString;
389
- var parser = /(?:(^|#|\.)([^#\.\[\]]+))|(\[.+?\])/g, attrParser = /\[(.+?)(?:=("|'|)(.*?)\2)?\]/;
390
- var voidElements = /^(AREA|BASE|BR|COL|COMMAND|EMBED|HR|IMG|INPUT|KEYGEN|LINK|META|PARAM|SOURCE|TRACK|WBR)$/;
391
- var noop = function() {}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
392
 
393
  // caching commonly used variables
394
- var $document, $location, $requestAnimationFrame, $cancelAnimationFrame;
395
 
396
  // self invoking function needed because of the way mocks work
397
- function initialize(window){
398
- $document = window.document;
399
- $location = window.location;
400
- $cancelAnimationFrame = window.cancelAnimationFrame || window.clearTimeout;
401
- $requestAnimationFrame = window.requestAnimationFrame || window.setTimeout;
402
  }
403
 
404
- initialize(window);
 
 
 
 
405
 
 
406
 
407
  /**
408
  * @typedef {String} Tag
@@ -410,957 +467,1825 @@ var m = (function app(window, undefined) {
410
  * Which describes a DOM node
411
  */
412
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
413
  /**
414
  *
415
  * @param {Tag} The DOM node tag
416
  * @param {Object=[]} optional key-value pairs to be mapped to DOM attrs
417
- * @param {...mNode=[]} Zero or more Mithril child nodes. Can be an array, or splat (optional)
418
- *
419
  */
420
- function m() {
421
- var args = [].slice.call(arguments);
422
- var hasAttrs = args[1] != null && type.call(args[1]) === OBJECT && !("tag" in args[1] || "view" in args[1]) && !("subtree" in args[1]);
423
- var attrs = hasAttrs ? args[1] : {};
424
- var classAttrName = "class" in attrs ? "class" : "className";
425
- var cell = {tag: "div", attrs: {}};
426
- var match, classes = [];
427
- if (type.call(args[0]) != STRING) throw new Error("selector in m(selector, attrs, children) should be a string")
428
- while (match = parser.exec(args[0])) {
429
- if (match[1] === "" && match[2]) cell.tag = match[2];
430
- else if (match[1] === "#") cell.attrs.id = match[2];
431
- else if (match[1] === ".") classes.push(match[2]);
432
- else if (match[3][0] === "[") {
433
- var pair = attrParser.exec(match[3]);
434
- cell.attrs[pair[1]] = pair[3] || (pair[2] ? "" :true)
435
- }
436
  }
437
 
438
- var children = hasAttrs ? args.slice(2) : args.slice(1);
439
- if (children.length === 1 && type.call(children[0]) === ARRAY) {
440
- cell.children = children[0]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
441
  }
442
- else {
443
- cell.children = children
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
444
  }
445
-
446
- for (var attrName in attrs) {
447
- if (attrs.hasOwnProperty(attrName)) {
448
- if (attrName === classAttrName && attrs[attrName] != null && attrs[attrName] !== "") {
449
- classes.push(attrs[attrName])
450
- cell.attrs[attrName] = "" //create key in correct iteration order
451
- }
452
- else cell.attrs[attrName] = attrs[attrName]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
453
  }
454
  }
455
- if (classes.length > 0) cell.attrs[classAttrName] = classes.join(" ");
456
-
457
- return cell
458
  }
459
- function build(parentElement, parentTag, parentCache, parentIndex, data, cached, shouldReattach, index, editable, namespace, configs) {
460
- //`build` is a recursive function that manages creation/diffing/removal of DOM elements based on comparison between `data` and `cached`
461
- //the diff algorithm can be summarized as this:
462
- //1 - compare `data` and `cached`
463
- //2 - if they are different, copy `data` to `cached` and update the DOM based on what the difference is
464
- //3 - recursively apply this algorithm for every array and for the children of every virtual element
465
-
466
- //the `cached` data structure is essentially the same as the previous redraw's `data` data structure, with a few additions:
467
- //- `cached` always has a property called `nodes`, which is a list of DOM elements that correspond to the data represented by the respective virtual element
468
- //- in order to support attaching `nodes` as a property of `cached`, `cached` is *always* a non-primitive object, i.e. if the data was a string, then cached is a String instance. If data was `null` or `undefined`, cached is `new String("")`
469
- //- `cached also has a `configContext` property, which is the state storage object exposed by config(element, isInitialized, context)
470
- //- when `cached` is an Object, it represents a virtual element; when it's an Array, it represents a list of elements; when it's a String, Number or Boolean, it represents a text node
471
-
472
- //`parentElement` is a DOM element used for W3C DOM API calls
473
- //`parentTag` is only used for handling a corner case for textarea values
474
- //`parentCache` is used to remove nodes in some multi-node cases
475
- //`parentIndex` and `index` are used to figure out the offset of nodes. They're artifacts from before arrays started being flattened and are likely refactorable
476
- //`data` and `cached` are, respectively, the new and old nodes being diffed
477
- //`shouldReattach` is a flag indicating whether a parent node was recreated (if so, and if this node is reused, then this node must reattach itself to the new parent)
478
- //`editable` is a flag that indicates whether an ancestor is contenteditable
479
- //`namespace` indicates the closest HTML namespace as it cascades down from an ancestor
480
- //`configs` is a list of config functions to run after the topmost `build` call finishes running
481
-
482
- //there's logic that relies on the assumption that null and undefined data are equivalent to empty strings
483
- //- this prevents lifecycle surprises from procedural helpers that mix implicit and explicit return statements (e.g. function foo() {if (cond) return m("div")}
484
- //- it simplifies diffing code
485
- //data.toString() might throw or return null if data is the return value of Console.log in Firefox (behavior depends on version)
486
- try {if (data == null || data.toString() == null) data = "";} catch (e) {data = ""}
487
- if (data.subtree === "retain") return cached;
488
- var cachedType = type.call(cached), dataType = type.call(data);
489
- if (cached == null || cachedType !== dataType) {
490
- if (cached != null) {
491
- if (parentCache && parentCache.nodes) {
492
- var offset = index - parentIndex;
493
- var end = offset + (dataType === ARRAY ? data : cached.nodes).length;
494
- clear(parentCache.nodes.slice(offset, end), parentCache.slice(offset, end))
495
- }
496
- else if (cached.nodes) clear(cached.nodes, cached)
497
  }
498
- cached = new data.constructor;
499
- if (cached.tag) cached = {}; //if constructor creates a virtual dom element, use a blank object as the base cached node instead of copying the virtual el (#277)
500
- cached.nodes = []
501
- }
502
-
503
- if (dataType === ARRAY) {
504
- //recursively flatten array
505
- for (var i = 0, len = data.length; i < len; i++) {
506
- if (type.call(data[i]) === ARRAY) {
507
- data = data.concat.apply([], data);
508
- i-- //check current index again and flatten until there are no more nested arrays at that index
509
- len = data.length
510
- }
511
  }
512
-
513
- var nodes = [], intact = cached.length === data.length, subArrayCount = 0;
514
-
515
- //keys algorithm: sort elements without recreating them if keys are present
516
- //1) create a map of all existing keys, and mark all for deletion
517
- //2) add new keys to map and mark them for addition
518
- //3) if key exists in new list, change action from deletion to a move
519
- //4) for each key, handle its corresponding action as marked in previous steps
520
- var DELETION = 1, INSERTION = 2 , MOVE = 3;
521
- var existing = {}, shouldMaintainIdentities = false;
522
- for (var i = 0; i < cached.length; i++) {
523
- if (cached[i] && cached[i].attrs && cached[i].attrs.key != null) {
524
- shouldMaintainIdentities = true;
525
- existing[cached[i].attrs.key] = {action: DELETION, index: i}
526
  }
 
 
527
  }
528
-
529
- var guid = 0
530
- for (var i = 0, len = data.length; i < len; i++) {
531
- if (data[i] && data[i].attrs && data[i].attrs.key != null) {
532
- for (var j = 0, len = data.length; j < len; j++) {
533
- if (data[j] && data[j].attrs && data[j].attrs.key == null) data[j].attrs.key = "__mithril__" + guid++
534
- }
535
- break
536
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
537
  }
538
-
539
- if (shouldMaintainIdentities) {
540
- var keysDiffer = false
541
- if (data.length != cached.length) keysDiffer = true
542
- else for (var i = 0, cachedCell, dataCell; cachedCell = cached[i], dataCell = data[i]; i++) {
543
- if (cachedCell.attrs && dataCell.attrs && cachedCell.attrs.key != dataCell.attrs.key) {
544
- keysDiffer = true
545
- break
546
- }
547
- }
548
-
549
- if (keysDiffer) {
550
- for (var i = 0, len = data.length; i < len; i++) {
551
- if (data[i] && data[i].attrs) {
552
- if (data[i].attrs.key != null) {
553
- var key = data[i].attrs.key;
554
- if (!existing[key]) existing[key] = {action: INSERTION, index: i};
555
- else existing[key] = {
556
- action: MOVE,
557
- index: i,
558
- from: existing[key].index,
559
- element: cached.nodes[existing[key].index] || $document.createElement("div")
560
- }
561
- }
562
- }
563
- }
564
- var actions = []
565
- for (var prop in existing) actions.push(existing[prop])
566
- var changes = actions.sort(sortChanges);
567
- var newCached = new Array(cached.length)
568
- newCached.nodes = cached.nodes.slice()
569
-
570
- for (var i = 0, change; change = changes[i]; i++) {
571
- if (change.action === DELETION) {
572
- clear(cached[change.index].nodes, cached[change.index]);
573
- newCached.splice(change.index, 1)
574
- }
575
- if (change.action === INSERTION) {
576
- var dummy = $document.createElement("div");
577
- dummy.key = data[change.index].attrs.key;
578
- parentElement.insertBefore(dummy, parentElement.childNodes[change.index] || null);
579
- newCached.splice(change.index, 0, {attrs: {key: data[change.index].attrs.key}, nodes: [dummy]})
580
- newCached.nodes[change.index] = dummy
581
- }
582
-
583
- if (change.action === MOVE) {
584
- if (parentElement.childNodes[change.index] !== change.element && change.element !== null) {
585
- parentElement.insertBefore(change.element, parentElement.childNodes[change.index] || null)
586
- }
587
- newCached[change.index] = cached[change.from]
588
- newCached.nodes[change.index] = change.element
589
- }
590
- }
591
- cached = newCached;
592
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
593
  }
594
- //end key algorithm
595
-
596
- for (var i = 0, cacheCount = 0, len = data.length; i < len; i++) {
597
- //diff each item in the array
598
- var item = build(parentElement, parentTag, cached, index, data[i], cached[cacheCount], shouldReattach, index + subArrayCount || subArrayCount, editable, namespace, configs);
599
- if (item === undefined) continue;
600
- if (!item.nodes.intact) intact = false;
601
- if (item.$trusted) {
602
- //fix offset of next element if item was a trusted string w/ more than one html element
603
- //the first clause in the regexp matches elements
604
- //the second clause (after the pipe) matches text nodes
605
- subArrayCount += (item.match(/<[^\/]|\>\s*[^<]/g) || [0]).length
606
- }
607
- else subArrayCount += type.call(item) === ARRAY ? item.length : 1;
608
- cached[cacheCount++] = item
609
  }
610
- if (!intact) {
611
- //diff the array itself
612
-
613
- //update the list of DOM nodes by collecting the nodes from each item
614
- for (var i = 0, len = data.length; i < len; i++) {
615
- if (cached[i] != null) nodes.push.apply(nodes, cached[i].nodes)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
616
  }
617
- //remove items from the end of the array if the new array is shorter than the old one
618
- //if errors ever happen here, the issue is most likely a bug in the construction of the `cached` data structure somewhere earlier in the program
619
- for (var i = 0, node; node = cached.nodes[i]; i++) {
620
- if (node.parentNode != null && nodes.indexOf(node) < 0) clear([node], [cached[i]])
 
621
  }
622
- if (data.length < cached.length) cached.length = data.length;
623
- cached.nodes = nodes
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
624
  }
625
  }
626
- else if (data != null && dataType === OBJECT) {
627
- var views = [], controllers = []
628
- while (data.view) {
629
- var view = data.view.$original || data.view
630
- var controllerIndex = m.redraw.strategy() == "diff" && cached.views ? cached.views.indexOf(view) : -1
631
- var controller = controllerIndex > -1 ? cached.controllers[controllerIndex] : new (data.controller || noop)
632
- var key = data && data.attrs && data.attrs.key
633
- data = pendingRequests == 0 || (cached && cached.controllers && cached.controllers.indexOf(controller) > -1) ? data.view(controller) : {tag: "placeholder"}
634
- if (data.subtree === "retain") return cached;
635
- if (key) {
636
- if (!data.attrs) data.attrs = {}
637
- data.attrs.key = key
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
638
  }
639
- if (controller.onunload) unloaders.push({controller: controller, handler: controller.onunload})
640
- views.push(view)
641
- controllers.push(controller)
642
  }
643
- if (!data.tag && controllers.length) throw new Error("Component template must return a virtual element, not an array, string, etc.")
644
- if (!data.attrs) data.attrs = {};
645
- if (!cached.attrs) cached.attrs = {};
646
-
647
- var dataAttrKeys = Object.keys(data.attrs)
648
- var hasKeys = dataAttrKeys.length > ("key" in data.attrs ? 1 : 0)
649
- //if an element is different enough from the one in cache, recreate it
650
- if (data.tag != cached.tag || dataAttrKeys.sort().join() != Object.keys(cached.attrs).sort().join() || data.attrs.id != cached.attrs.id || data.attrs.key != cached.attrs.key || (m.redraw.strategy() == "all" && (!cached.configContext || cached.configContext.retain !== true)) || (m.redraw.strategy() == "diff" && cached.configContext && cached.configContext.retain === false)) {
651
- if (cached.nodes.length) clear(cached.nodes);
652
- if (cached.configContext && typeof cached.configContext.onunload === FUNCTION) cached.configContext.onunload()
653
- if (cached.controllers) {
654
- for (var i = 0, controller; controller = cached.controllers[i]; i++) {
655
- if (typeof controller.onunload === FUNCTION) controller.onunload({preventDefault: noop})
656
- }
657
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
658
  }
659
- if (type.call(data.tag) != STRING) return;
660
-
661
- var node, isNew = cached.nodes.length === 0;
662
- if (data.attrs.xmlns) namespace = data.attrs.xmlns;
663
- else if (data.tag === "svg") namespace = "http://www.w3.org/2000/svg";
664
- else if (data.tag === "math") namespace = "http://www.w3.org/1998/Math/MathML";
665
-
666
- if (isNew) {
667
- if (data.attrs.is) node = namespace === undefined ? $document.createElement(data.tag, data.attrs.is) : $document.createElementNS(namespace, data.tag, data.attrs.is);
668
- else node = namespace === undefined ? $document.createElement(data.tag) : $document.createElementNS(namespace, data.tag);
669
- cached = {
670
- tag: data.tag,
671
- //set attributes first, then create children
672
- attrs: hasKeys ? setAttributes(node, data.tag, data.attrs, {}, namespace) : data.attrs,
673
- children: data.children != null && data.children.length > 0 ?
674
- build(node, data.tag, undefined, undefined, data.children, cached.children, true, 0, data.attrs.contenteditable ? node : editable, namespace, configs) :
675
- data.children,
676
- nodes: [node]
677
- };
678
- if (controllers.length) {
679
- cached.views = views
680
- cached.controllers = controllers
681
- for (var i = 0, controller; controller = controllers[i]; i++) {
682
- if (controller.onunload && controller.onunload.$old) controller.onunload = controller.onunload.$old
683
- if (pendingRequests && controller.onunload) {
684
- var onunload = controller.onunload
685
- controller.onunload = noop
686
- controller.onunload.$old = onunload
687
- }
688
- }
689
- }
690
-
691
- if (cached.children && !cached.children.nodes) cached.children.nodes = [];
692
- //edge case: setting value on <select> doesn't work before children exist, so set it again after children have been created
693
- if (data.tag === "select" && "value" in data.attrs) setAttributes(node, data.tag, {value: data.attrs.value}, {}, namespace);
694
- parentElement.insertBefore(node, parentElement.childNodes[index] || null)
695
  }
696
- else {
697
- node = cached.nodes[0];
698
- if (hasKeys) setAttributes(node, data.tag, data.attrs, cached.attrs, namespace);
699
- cached.children = build(node, data.tag, undefined, undefined, data.children, cached.children, false, 0, data.attrs.contenteditable ? node : editable, namespace, configs);
700
- cached.nodes.intact = true;
701
- if (controllers.length) {
702
- cached.views = views
703
- cached.controllers = controllers
704
- }
705
- if (shouldReattach === true && node != null) parentElement.insertBefore(node, parentElement.childNodes[index] || null)
 
 
 
 
 
 
 
706
  }
707
- //schedule configs to be called. They are called after `build` finishes running
708
- if (typeof data.attrs["config"] === FUNCTION) {
709
- var context = cached.configContext = cached.configContext || {};
710
-
711
- // bind
712
- var callback = function(data, args) {
713
- return function() {
714
- return data.attrs["config"].apply(data, args)
715
- }
716
- };
717
- configs.push(callback(data, [node, !isNew, context, cached]))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
718
  }
719
  }
720
- else if (typeof data != FUNCTION) {
721
- //handle text nodes
722
- var nodes;
723
- if (cached.nodes.length === 0) {
724
- if (data.$trusted) {
725
- nodes = injectHTML(parentElement, index, data)
726
- }
727
- else {
728
- nodes = [$document.createTextNode(data)];
729
- if (!parentElement.nodeName.match(voidElements)) parentElement.insertBefore(nodes[0], parentElement.childNodes[index] || null)
730
- }
731
- cached = "string number boolean".indexOf(typeof data) > -1 ? new data.constructor(data) : data;
732
- cached.nodes = nodes
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
733
  }
734
- else if (cached.valueOf() !== data.valueOf() || shouldReattach === true) {
735
- nodes = cached.nodes;
736
- if (!editable || editable !== $document.activeElement) {
737
- if (data.$trusted) {
738
- clear(nodes, cached);
739
- nodes = injectHTML(parentElement, index, data)
740
- }
741
- else {
742
- //corner case: replacing the nodeValue of a text node that is a child of a textarea/contenteditable doesn't work
743
- //we need to update the value property of the parent textarea or the innerHTML of the contenteditable element instead
744
- if (parentTag === "textarea") parentElement.value = data;
745
- else if (editable) editable.innerHTML = data;
746
- else {
747
- if (nodes[0].nodeType === 1 || nodes.length > 1) { //was a trusted string
748
- clear(cached.nodes, cached);
749
- nodes = [$document.createTextNode(data)]
750
- }
751
- parentElement.insertBefore(nodes[0], parentElement.childNodes[index] || null);
752
- nodes[0].nodeValue = data
753
- }
754
- }
755
  }
756
- cached = new data.constructor(data);
757
- cached.nodes = nodes
758
  }
759
- else cached.nodes.intact = true
760
  }
 
 
761
 
762
- return cached
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
763
  }
764
- function sortChanges(a, b) {return a.action - b.action || a.index - b.index}
765
  function setAttributes(node, tag, dataAttrs, cachedAttrs, namespace) {
766
- for (var attrName in dataAttrs) {
767
- var dataAttr = dataAttrs[attrName];
768
- var cachedAttr = cachedAttrs[attrName];
769
- if (!(attrName in cachedAttrs) || (cachedAttr !== dataAttr)) {
770
- cachedAttrs[attrName] = dataAttr;
771
- try {
772
- //`config` isn't a real attributes, so ignore it
773
- if (attrName === "config" || attrName == "key") continue;
774
- //hook event handlers to the auto-redrawing system
775
- else if (typeof dataAttr === FUNCTION && attrName.indexOf("on") === 0) {
776
- node[attrName] = autoredraw(dataAttr, node)
777
- }
778
- //handle `style: {...}`
779
- else if (attrName === "style" && dataAttr != null && type.call(dataAttr) === OBJECT) {
780
- for (var rule in dataAttr) {
781
- if (cachedAttr == null || cachedAttr[rule] !== dataAttr[rule]) node.style[rule] = dataAttr[rule]
782
- }
783
- for (var rule in cachedAttr) {
784
- if (!(rule in dataAttr)) node.style[rule] = ""
785
- }
786
- }
787
- //handle SVG
788
- else if (namespace != null) {
789
- if (attrName === "href") node.setAttributeNS("http://www.w3.org/1999/xlink", "href", dataAttr);
790
- else if (attrName === "className") node.setAttribute("class", dataAttr);
791
- else node.setAttribute(attrName, dataAttr)
792
- }
793
- //handle cases that are properties (but ignore cases where we should use setAttribute instead)
794
- //- list and form are typically used as strings, but are DOM element references in js
795
- //- when using CSS selectors (e.g. `m("[style='']")`), style is used as a string, but it's an object in js
796
- else if (attrName in node && !(attrName === "list" || attrName === "style" || attrName === "form" || attrName === "type" || attrName === "width" || attrName === "height")) {
797
- //#348 don't set the value if not needed otherwise cursor placement breaks in Chrome
798
- if (tag !== "input" || node[attrName] !== dataAttr) node[attrName] = dataAttr
799
- }
800
- else node.setAttribute(attrName, dataAttr)
801
- }
802
- catch (e) {
803
- //swallow IE's invalid argument errors to mimic HTML's fallback-to-doing-nothing-on-invalid-attributes behavior
804
- if (e.message.indexOf("Invalid argument") < 0) throw e
805
- }
806
- }
807
- //#348 dataAttr may not be a string, so use loose comparison (double equal) instead of strict (triple equal)
808
- else if (attrName === "value" && tag === "input" && node.value != dataAttr) {
809
- node.value = dataAttr
810
  }
811
  }
812
  return cachedAttrs
813
  }
 
814
  function clear(nodes, cached) {
815
  for (var i = nodes.length - 1; i > -1; i--) {
816
  if (nodes[i] && nodes[i].parentNode) {
817
- try {nodes[i].parentNode.removeChild(nodes[i])}
818
- catch (e) {} //ignore if this fails due to order of events (see http://stackoverflow.com/questions/21926083/failed-to-execute-removechild-on-node)
819
- cached = [].concat(cached);
 
 
 
 
 
 
820
  if (cached[i]) unload(cached[i])
821
  }
822
  }
823
- if (nodes.length != 0) nodes.length = 0
 
 
 
 
824
  }
 
825
  function unload(cached) {
826
- if (cached.configContext && typeof cached.configContext.onunload === FUNCTION) {
827
- cached.configContext.onunload();
828
  cached.configContext.onunload = null
829
  }
830
  if (cached.controllers) {
831
- for (var i = 0, controller; controller = cached.controllers[i]; i++) {
832
- if (typeof controller.onunload === FUNCTION) controller.onunload({preventDefault: noop});
833
- }
 
 
834
  }
835
  if (cached.children) {
836
- if (type.call(cached.children) === ARRAY) {
837
- for (var i = 0, child; child = cached.children[i]; i++) unload(child)
838
- }
839
  else if (cached.children.tag) unload(cached.children)
840
  }
841
  }
 
 
 
 
 
 
 
 
 
 
842
  function injectHTML(parentElement, index, data) {
843
- var nextSibling = parentElement.childNodes[index];
844
  if (nextSibling) {
845
- var isElement = nextSibling.nodeType != 1;
846
- var placeholder = $document.createElement("span");
847
  if (isElement) {
848
- parentElement.insertBefore(placeholder, nextSibling || null);
849
- placeholder.insertAdjacentHTML("beforebegin", data);
850
  parentElement.removeChild(placeholder)
 
 
851
  }
852
- else nextSibling.insertAdjacentHTML("beforebegin", data)
 
853
  }
854
- else parentElement.insertAdjacentHTML("beforeend", data);
855
- var nodes = [];
 
856
  while (parentElement.childNodes[index] !== nextSibling) {
857
- nodes.push(parentElement.childNodes[index]);
858
  index++
859
  }
 
860
  return nodes
861
  }
 
862
  function autoredraw(callback, object) {
863
- return function(e) {
864
- e = e || event;
865
- m.redraw.strategy("diff");
866
- m.startComputation();
867
- try {return callback.call(object, e)}
868
- finally {
 
869
  endFirstComputation()
870
  }
871
  }
872
  }
873
 
874
- var html;
875
  var documentNode = {
876
- appendChild: function(node) {
877
- if (html === undefined) html = $document.createElement("html");
878
- if ($document.documentElement && $document.documentElement !== node) {
 
879
  $document.replaceChild(node, $document.documentElement)
 
 
880
  }
881
- else $document.appendChild(node);
882
  this.childNodes = $document.childNodes
883
  },
884
- insertBefore: function(node) {
 
885
  this.appendChild(node)
886
  },
 
887
  childNodes: []
888
- };
889
- var nodeCache = [], cellCache = {};
890
- m.render = function(root, cell, forceRecreation) {
891
- var configs = [];
892
- if (!root) throw new Error("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");
893
- var id = getCellCacheKey(root);
894
- var isDocumentRoot = root === $document;
895
- var node = isDocumentRoot || root === $document.documentElement ? documentNode : root;
896
- if (isDocumentRoot && cell.tag != "html") cell = {tag: "html", attrs: {}, children: cell};
897
- if (cellCache[id] === undefined) clear(node.childNodes);
898
- if (forceRecreation === true) reset(root);
899
- cellCache[id] = build(node, null, undefined, undefined, cell, cellCache[id], false, 0, null, undefined, configs);
900
- for (var i = 0, len = configs.length; i < len; i++) configs[i]()
901
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
902
  function getCellCacheKey(element) {
903
- var index = nodeCache.indexOf(element);
904
  return index < 0 ? nodeCache.push(element) - 1 : index
905
  }
906
 
907
- m.trust = function(value) {
908
- value = new String(value);
909
- value.$trusted = true;
910
  return value
911
- };
912
 
913
  function gettersetter(store) {
914
- var prop = function() {
915
- if (arguments.length) store = arguments[0];
916
  return store
917
- };
918
 
919
- prop.toJSON = function() {
920
  return store
921
- };
922
 
923
  return prop
924
  }
925
 
926
  m.prop = function (store) {
927
- //note: using non-strict equality check here because we're checking if store is null OR undefined
928
- if (((store != null && type.call(store) === OBJECT) || typeof store === FUNCTION) && typeof store.then === FUNCTION) {
929
  return propify(store)
930
  }
931
 
932
  return gettersetter(store)
933
- };
 
 
 
 
 
 
 
 
 
 
934
 
935
- var roots = [], components = [], controllers = [], lastRedrawId = null, lastRedrawCallTime = 0, computePreRedrawHook = null, computePostRedrawHook = null, prevented = false, topComponent, unloaders = [];
936
- var FRAME_BUDGET = 16; //60 frames per second = 1 call per 16 ms
937
  function parameterize(component, args) {
938
- var controller = function() {
 
939
  return (component.controller || noop).apply(this, args) || this
 
 
 
 
 
940
  }
941
- var view = function(ctrl) {
942
- if (arguments.length > 1) args = args.concat([].slice.call(arguments, 1))
943
- return component.view.apply(component, args ? [ctrl].concat(args) : [ctrl])
 
 
 
 
 
944
  }
 
945
  view.$original = component.view
946
  var output = {controller: controller, view: view}
947
  if (args[0] && args[0].key != null) output.attrs = {key: args[0].key}
948
  return output
949
  }
950
- m.component = function(component) {
951
- return parameterize(component, [].slice.call(arguments, 1))
952
- }
953
- m.mount = m.module = function(root, component) {
954
- if (!root) throw new Error("Please ensure the DOM element exists before rendering a template into it.");
955
- var index = roots.indexOf(root);
956
- if (index < 0) index = roots.length;
957
-
958
- var isPrevented = false;
959
- var event = {preventDefault: function() {
960
- isPrevented = true;
961
- computePreRedrawHook = computePostRedrawHook = null;
962
- }};
963
- for (var i = 0, unloader; unloader = unloaders[i]; i++) {
964
- unloader.handler.call(unloader.controller, event)
965
- unloader.controller.onunload = null
966
- }
967
- if (isPrevented) {
968
- for (var i = 0, unloader; unloader = unloaders[i]; i++) unloader.controller.onunload = unloader.handler
969
- }
970
- else unloaders = []
971
-
972
- if (controllers[index] && typeof controllers[index].onunload === FUNCTION) {
973
- controllers[index].onunload(event)
974
- }
975
-
976
  if (!isPrevented) {
977
- m.redraw.strategy("all");
978
- m.startComputation();
979
- roots[index] = root;
980
- if (arguments.length > 2) component = subcomponent(component, [].slice.call(arguments, 2))
981
- var currentComponent = topComponent = component = component || {controller: function() {}};
982
- var constructor = component.controller || noop
983
- var controller = new constructor;
984
- //controllers may call m.mount recursively (via m.route redirects, for example)
985
- //this conditional ensures only the last recursive m.mount call is applied
 
 
 
 
 
 
 
 
986
  if (currentComponent === topComponent) {
987
- controllers[index] = controller;
988
  components[index] = component
989
  }
990
- endFirstComputation();
 
 
 
991
  return controllers[index]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
992
  }
993
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
994
  var redrawing = false
995
- m.redraw = function(force) {
996
  if (redrawing) return
997
  redrawing = true
998
- //lastRedrawId is a positive number if a second redraw is requested before the next animation frame
999
- //lastRedrawID is null if it's the first redraw and not an event handler
1000
- if (lastRedrawId && force !== true) {
1001
- //when setTimeout: only reschedule redraw if time between now and previous redraw is bigger than a frame, otherwise keep currently scheduled timeout
1002
- //when rAF: always reschedule redraw
1003
- if ($requestAnimationFrame === window.requestAnimationFrame || new Date - lastRedrawCallTime > FRAME_BUDGET) {
1004
- if (lastRedrawId > 0) $cancelAnimationFrame(lastRedrawId);
1005
- lastRedrawId = $requestAnimationFrame(redraw, FRAME_BUDGET)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1006
  }
 
 
1007
  }
1008
- else {
1009
- redraw();
1010
- lastRedrawId = $requestAnimationFrame(function() {lastRedrawId = null}, FRAME_BUDGET)
1011
- }
1012
- redrawing = false
1013
- };
1014
- m.redraw.strategy = m.prop();
1015
  function redraw() {
1016
  if (computePreRedrawHook) {
1017
  computePreRedrawHook()
1018
  computePreRedrawHook = null
1019
  }
1020
- for (var i = 0, root; root = roots[i]; i++) {
 
1021
  if (controllers[i]) {
1022
- var args = components[i].controller && components[i].controller.$$args ? [controllers[i]].concat(components[i].controller.$$args) : [controllers[i]]
1023
- m.render(root, components[i].view ? components[i].view(controllers[i], args) : "")
 
1024
  }
1025
- }
1026
- //after rendering within a routed context, we need to scroll back to the top, and fetch the document title for history.pushState
 
1027
  if (computePostRedrawHook) {
1028
- computePostRedrawHook();
1029
  computePostRedrawHook = null
1030
  }
1031
- lastRedrawId = null;
1032
- lastRedrawCallTime = new Date;
1033
  m.redraw.strategy("diff")
1034
  }
1035
 
1036
- var pendingRequests = 0;
1037
- m.startComputation = function() {pendingRequests++};
1038
- m.endComputation = function() {
1039
- pendingRequests = Math.max(pendingRequests - 1, 0);
1040
- if (pendingRequests === 0) m.redraw()
1041
- };
1042
- var endFirstComputation = function() {
1043
- if (m.redraw.strategy() == "none") {
1044
  pendingRequests--
1045
  m.redraw.strategy("diff")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1046
  }
1047
- else m.endComputation();
1048
- }
1049
-
1050
- m.withAttr = function(prop, withAttrCallback) {
1051
- return function(e) {
1052
- e = e || event;
1053
- var currentTarget = e.currentTarget || this;
1054
- withAttrCallback(prop in currentTarget ? currentTarget[prop] : currentTarget.getAttribute(prop))
1055
- }
1056
- };
1057
-
1058
- //routing
1059
- var modes = {pathname: "", hash: "#", search: "?"};
1060
- var redirect = noop, routeParams, currentRoute, isDefaultRoute = false;
1061
- m.route = function() {
1062
- //m.route()
1063
- if (arguments.length === 0) return currentRoute;
1064
- //m.route(el, defaultRoute, routes)
1065
- else if (arguments.length === 3 && type.call(arguments[1]) === STRING) {
1066
- var root = arguments[0], defaultRoute = arguments[1], router = arguments[2];
1067
- redirect = function(source) {
1068
- var path = currentRoute = normalizeRoute(source);
1069
- if (!routeByValue(root, router, path)) {
1070
- if (isDefaultRoute) throw new Error("Ensure the default route matches one of the routes defined in m.route")
1071
  isDefaultRoute = true
1072
- m.route(defaultRoute, true)
1073
  isDefaultRoute = false
1074
  }
1075
- };
1076
- var listener = m.route.mode === "hash" ? "onhashchange" : "onpopstate";
1077
- window[listener] = function() {
 
 
 
 
1078
  var path = $location[m.route.mode]
1079
  if (m.route.mode === "pathname") path += $location.search
1080
- if (currentRoute != normalizeRoute(path)) {
1081
- redirect(path)
1082
- }
1083
- };
1084
- computePreRedrawHook = setScroll;
1085
- window[listener]()
1086
- }
1087
- //config: m.route
1088
- else if (arguments[0].addEventListener || arguments[0].attachEvent) {
1089
- var element = arguments[0];
1090
- var isInitialized = arguments[1];
1091
- var context = arguments[2];
1092
- var vdom = arguments[3];
1093
- element.href = (m.route.mode !== 'pathname' ? $location.pathname : '') + modes[m.route.mode] + vdom.attrs.href;
1094
- if (element.addEventListener) {
1095
- element.removeEventListener("click", routeUnobtrusive);
1096
- element.addEventListener("click", routeUnobtrusive)
1097
  }
1098
- else {
1099
- element.detachEvent("onclick", routeUnobtrusive);
1100
- element.attachEvent("onclick", routeUnobtrusive)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1101
  }
 
 
1102
  }
1103
- //m.route(route, params, shouldReplaceHistoryEntry)
1104
- else if (type.call(arguments[0]) === STRING) {
1105
- var oldRoute = currentRoute;
1106
- currentRoute = arguments[0];
1107
- var args = arguments[1] || {}
 
1108
  var queryIndex = currentRoute.indexOf("?")
1109
- var params = queryIndex > -1 ? parseQueryString(currentRoute.slice(queryIndex + 1)) : {}
1110
- for (var i in args) params[i] = args[i]
 
 
 
 
 
 
 
 
 
 
1111
  var querystring = buildQueryString(params)
1112
- var currentPath = queryIndex > -1 ? currentRoute.slice(0, queryIndex) : currentRoute
1113
- if (querystring) currentRoute = currentPath + (currentPath.indexOf("?") === -1 ? "?" : "&") + querystring;
 
 
 
 
 
 
 
 
 
 
 
1114
 
1115
- var shouldReplaceHistoryEntry = (arguments.length === 3 ? arguments[2] : arguments[1]) === true || oldRoute === arguments[0];
 
 
1116
 
1117
- if (window.history.pushState) {
 
1118
  computePreRedrawHook = setScroll
1119
- computePostRedrawHook = function() {
1120
- window.history[shouldReplaceHistoryEntry ? "replaceState" : "pushState"](null, $document.title, modes[m.route.mode] + currentRoute);
1121
- };
 
1122
  redirect(modes[m.route.mode] + currentRoute)
1123
- }
1124
- else {
1125
  $location[m.route.mode] = currentRoute
1126
  redirect(modes[m.route.mode] + currentRoute)
1127
  }
1128
  }
1129
- };
1130
- m.route.param = function(key) {
1131
- if (!routeParams) throw new Error("You must call m.route(element, defaultRoute, routes) before calling m.route.param()")
 
 
 
 
 
 
 
 
 
1132
  return routeParams[key]
1133
- };
1134
- m.route.mode = "search";
 
 
1135
  function normalizeRoute(route) {
1136
  return route.slice(modes[m.route.mode].length)
1137
  }
 
1138
  function routeByValue(root, router, path) {
1139
- routeParams = {};
1140
 
1141
- var queryStart = path.indexOf("?");
1142
  if (queryStart !== -1) {
1143
- routeParams = parseQueryString(path.substr(queryStart + 1, path.length));
 
1144
  path = path.substr(0, queryStart)
1145
  }
1146
 
1147
  // Get all routes and check if there's
1148
  // an exact match for the current path
1149
- var keys = Object.keys(router);
1150
- var index = keys.indexOf(path);
1151
- if(index !== -1){
1152
- m.mount(root, router[keys [index]]);
1153
- return true;
 
1154
  }
1155
 
1156
- for (var route in router) {
1157
  if (route === path) {
1158
- m.mount(root, router[route]);
1159
  return true
1160
  }
1161
 
1162
- var matcher = new RegExp("^" + route.replace(/:[^\/]+?\.{3}/g, "(.*?)").replace(/:[^\/]+/g, "([^\\/]+)") + "\/?$");
 
 
1163
 
1164
  if (matcher.test(path)) {
1165
- path.replace(matcher, function() {
1166
- var keys = route.match(/:[^\/]+/g) || [];
1167
- var values = [].slice.call(arguments, 1, -2);
1168
- for (var i = 0, len = keys.length; i < len; i++) routeParams[keys[i].replace(/:|\./g, "")] = decodeURIComponent(values[i])
 
 
 
 
1169
  m.mount(root, router[route])
1170
- });
 
1171
  return true
1172
  }
1173
  }
1174
  }
 
1175
  function routeUnobtrusive(e) {
1176
- e = e || event;
1177
- if (e.ctrlKey || e.metaKey || e.which === 2) return;
1178
- if (e.preventDefault) e.preventDefault();
1179
- else e.returnValue = false;
1180
- var currentTarget = e.currentTarget || e.srcElement;
1181
- var args = m.route.mode === "pathname" && currentTarget.search ? parseQueryString(currentTarget.search.slice(1)) : {};
1182
- while (currentTarget && currentTarget.nodeName.toUpperCase() != "A") currentTarget = currentTarget.parentNode
1183
- m.route(currentTarget[m.route.mode].slice(modes[m.route.mode].length), args)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1184
  }
 
1185
  function setScroll() {
1186
- if (m.route.mode != "hash" && $location.hash) $location.hash = $location.hash;
1187
- else window.scrollTo(0, 0)
 
 
 
1188
  }
 
1189
  function buildQueryString(object, prefix) {
1190
  var duplicates = {}
1191
  var str = []
1192
- for (var prop in object) {
 
1193
  var key = prefix ? prefix + "[" + prop + "]" : prop
1194
  var value = object[prop]
1195
- var valueType = type.call(value)
1196
- var pair = (value === null) ? encodeURIComponent(key) :
1197
- valueType === OBJECT ? buildQueryString(value, key) :
1198
- valueType === ARRAY ? value.reduce(function(memo, item) {
1199
- if (!duplicates[key]) duplicates[key] = {}
 
 
 
 
 
 
1200
  if (!duplicates[key][item]) {
1201
  duplicates[key][item] = true
1202
- return memo.concat(encodeURIComponent(key) + "=" + encodeURIComponent(item))
 
1203
  }
1204
- return memo
1205
- }, []).join("&") :
1206
- encodeURIComponent(key) + "=" + encodeURIComponent(value)
1207
- if (value !== undefined) str.push(pair)
 
 
1208
  }
1209
  return str.join("&")
1210
  }
 
1211
  function parseQueryString(str) {
1212
- if (str.charAt(0) === "?") str = str.substring(1);
1213
-
1214
- var pairs = str.split("&"), params = {};
1215
- for (var i = 0, len = pairs.length; i < len; i++) {
1216
- var pair = pairs[i].split("=");
 
 
 
1217
  var key = decodeURIComponent(pair[0])
1218
- var value = pair.length == 2 ? decodeURIComponent(pair[1]) : null
1219
  if (params[key] != null) {
1220
- if (type.call(params[key]) !== ARRAY) params[key] = [params[key]]
1221
  params[key].push(value)
1222
  }
1223
  else params[key] = value
1224
- }
 
1225
  return params
1226
  }
 
1227
  m.route.buildQueryString = buildQueryString
1228
  m.route.parseQueryString = parseQueryString
1229
-
1230
  function reset(root) {
1231
- var cacheKey = getCellCacheKey(root);
1232
- clear(root.childNodes, cellCache[cacheKey]);
1233
  cellCache[cacheKey] = undefined
1234
  }
1235
 
1236
  m.deferred = function () {
1237
- var deferred = new Deferred();
1238
- deferred.promise = propify(deferred.promise);
1239
  return deferred
1240
- };
 
1241
  function propify(promise, initialValue) {
1242
- var prop = m.prop(initialValue);
1243
- promise.then(prop);
1244
- prop.then = function(resolve, reject) {
1245
  return propify(promise.then(resolve, reject), initialValue)
1246
- };
 
 
1247
  return prop
1248
  }
1249
- //Promiz.mithril.js | Zolmeister | MIT
1250
- //a modified version of Promiz.js, which does not conform to Promises/A+ for two reasons:
1251
- //1) `then` callbacks are called synchronously (because setTimeout is too slow, and the setImmediate polyfill is too big
1252
- //2) throwing subclasses of Error cause the error to be bubbled up instead of triggering rejection (because the spec does not account for the important use case of default browser error handling, i.e. message w/ line number)
1253
- function Deferred(successCallback, failureCallback) {
1254
- var RESOLVING = 1, REJECTING = 2, RESOLVED = 3, REJECTED = 4;
1255
- var self = this, state = 0, promiseValue = 0, next = [];
 
 
 
 
 
 
 
 
 
1256
 
1257
- self["promise"] = {};
 
 
 
 
1258
 
1259
- self["resolve"] = function(value) {
 
 
1260
  if (!state) {
1261
- promiseValue = value;
1262
- state = RESOLVING;
1263
 
1264
  fire()
1265
  }
1266
- return this
1267
- };
1268
 
1269
- self["reject"] = function(value) {
 
 
 
1270
  if (!state) {
1271
- promiseValue = value;
1272
- state = REJECTING;
1273
 
1274
  fire()
1275
  }
1276
- return this
1277
- };
1278
 
1279
- self.promise["then"] = function(successCallback, failureCallback) {
1280
- var deferred = new Deferred(successCallback, failureCallback);
 
 
 
 
1281
  if (state === RESOLVED) {
1282
  deferred.resolve(promiseValue)
1283
- }
1284
- else if (state === REJECTED) {
1285
  deferred.reject(promiseValue)
1286
- }
1287
- else {
1288
  next.push(deferred)
1289
  }
 
1290
  return deferred.promise
1291
- };
1292
 
1293
  function finish(type) {
1294
- state = type || REJECTED;
1295
- next.map(function(deferred) {
1296
- state === RESOLVED && deferred.resolve(promiseValue) || deferred.reject(promiseValue)
 
 
 
 
1297
  })
1298
  }
1299
 
1300
- function thennable(then, successCallback, failureCallback, notThennableCallback) {
1301
- if (((promiseValue != null && type.call(promiseValue) === OBJECT) || typeof promiseValue === FUNCTION) && typeof then === FUNCTION) {
 
1302
  try {
1303
  // count protects against abuse calls from spec checker
1304
- var count = 0;
1305
- then.call(promiseValue, function(value) {
1306
- if (count++) return;
1307
- promiseValue = value;
1308
- successCallback()
1309
  }, function (value) {
1310
- if (count++) return;
1311
- promiseValue = value;
1312
- failureCallback()
1313
  })
1314
- }
1315
- catch (e) {
1316
- m.deferred.onerror(e);
1317
- promiseValue = e;
1318
- failureCallback()
1319
  }
1320
  } else {
1321
- notThennableCallback()
1322
  }
1323
  }
1324
 
1325
  function fire() {
1326
  // check if it's a thenable
1327
- var then;
1328
  try {
1329
  then = promiseValue && promiseValue.then
1330
- }
1331
- catch (e) {
1332
- m.deferred.onerror(e);
1333
- promiseValue = e;
1334
- state = REJECTING;
1335
  return fire()
1336
  }
1337
- thennable(then, function() {
1338
- state = RESOLVING;
 
 
 
 
 
1339
  fire()
1340
- }, function() {
1341
- state = REJECTING;
1342
  fire()
1343
- }, function() {
1344
  try {
1345
- if (state === RESOLVING && typeof successCallback === FUNCTION) {
1346
- promiseValue = successCallback(promiseValue)
1347
- }
1348
- else if (state === REJECTING && typeof failureCallback === "function") {
1349
- promiseValue = failureCallback(promiseValue);
1350
  state = RESOLVING
1351
  }
1352
- }
1353
- catch (e) {
1354
- m.deferred.onerror(e);
1355
- promiseValue = e;
1356
  return finish()
1357
  }
1358
 
1359
  if (promiseValue === self) {
1360
- promiseValue = TypeError();
1361
  finish()
1362
- }
1363
- else {
1364
  thennable(then, function () {
1365
  finish(RESOLVED)
1366
  }, finish, function () {
@@ -1370,178 +2295,235 @@ var m = (function app(window, undefined) {
1370
  })
1371
  }
1372
  }
1373
- m.deferred.onerror = function(e) {
1374
- if (type.call(e) === "[object Error]" && !e.constructor.toString().match(/ Error/)) throw e
1375
- };
1376
 
1377
- m.sync = function(args) {
1378
- var method = "resolve";
 
 
 
 
 
 
 
 
 
 
 
 
1379
  function synchronizer(pos, resolved) {
1380
- return function(value) {
1381
- results[pos] = value;
1382
- if (!resolved) method = "reject";
1383
  if (--outstanding === 0) {
1384
- deferred.promise(results);
1385
  deferred[method](results)
1386
  }
1387
  return value
1388
  }
1389
  }
1390
 
1391
- var deferred = m.deferred();
1392
- var outstanding = args.length;
1393
- var results = new Array(outstanding);
1394
  if (args.length > 0) {
1395
- for (var i = 0; i < args.length; i++) {
1396
- args[i].then(synchronizer(i, true), synchronizer(i, false))
1397
- }
 
 
1398
  }
1399
- else deferred.resolve([]);
1400
 
1401
  return deferred.promise
1402
- };
1403
- function identity(value) {return value}
1404
 
1405
- function ajax(options) {
1406
- if (options.dataType && options.dataType.toLowerCase() === "jsonp") {
1407
- var callbackKey = "mithril_callback_" + new Date().getTime() + "_" + (Math.round(Math.random() * 1e16)).toString(36);
1408
- var script = $document.createElement("script");
1409
-
1410
- window[callbackKey] = function(resp) {
1411
- script.parentNode.removeChild(script);
1412
- options.onload({
1413
- type: "load",
1414
- target: {
1415
- responseText: resp
1416
- }
1417
- });
1418
- window[callbackKey] = undefined
1419
- };
1420
 
1421
- script.onerror = function(e) {
1422
- script.parentNode.removeChild(script);
 
 
1423
 
1424
- options.onerror({
1425
- type: "error",
1426
- target: {
1427
- status: 500,
1428
- responseText: JSON.stringify({error: "Error making jsonp request"})
1429
- }
1430
- });
1431
- window[callbackKey] = undefined;
1432
-
1433
- return false
1434
- };
1435
-
1436
- script.onload = function(e) {
1437
- return false
1438
- };
1439
-
1440
- script.src = options.url
1441
- + (options.url.indexOf("?") > 0 ? "&" : "?")
1442
- + (options.callbackKey ? options.callbackKey : "callback")
1443
- + "=" + callbackKey
1444
- + "&" + buildQueryString(options.data || {});
1445
- $document.body.appendChild(script)
1446
- }
1447
- else {
1448
- var xhr = new window.XMLHttpRequest;
1449
- xhr.open(options.method, options.url, true, options.user, options.password);
1450
- xhr.onreadystatechange = function() {
1451
- if (xhr.readyState === 4) {
1452
- if (xhr.status >= 200 && xhr.status < 300) options.onload({type: "load", target: xhr});
1453
- else options.onerror({type: "error", target: xhr})
1454
  }
1455
- };
1456
- if (options.serialize === JSON.stringify && options.data && options.method !== "GET") {
1457
- xhr.setRequestHeader("Content-Type", "application/json; charset=utf-8")
1458
- }
1459
- if (options.deserialize === JSON.parse) {
1460
- xhr.setRequestHeader("Accept", "application/json, text/*");
1461
- }
1462
- if (typeof options.config === FUNCTION) {
1463
- var maybeXhr = options.config(xhr, options);
1464
- if (maybeXhr != null) xhr = maybeXhr
1465
- }
 
 
 
 
 
 
1466
 
1467
- var data = options.method === "GET" || !options.data ? "" : options.data
1468
- if (data && (type.call(data) != STRING && data.constructor != window.FormData)) {
1469
- throw "Request data should be either be a string or FormData. Check the `serialize` option in `m.request`";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1470
  }
1471
- xhr.send(data);
1472
- return xhr
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1473
  }
1474
  }
1475
- function bindData(xhrOptions, data, serialize) {
1476
- if (xhrOptions.method === "GET" && xhrOptions.dataType != "jsonp") {
1477
- var prefix = xhrOptions.url.indexOf("?") < 0 ? "?" : "&";
1478
- var querystring = buildQueryString(data);
1479
- xhrOptions.url = xhrOptions.url + (querystring ? prefix + querystring : "")
 
 
 
1480
  }
1481
- else xhrOptions.data = serialize(data);
1482
- return xhrOptions
1483
  }
 
1484
  function parameterizeUrl(url, data) {
1485
- var tokens = url.match(/:[a-z]\w+/gi);
1486
- if (tokens && data) {
1487
- for (var i = 0; i < tokens.length; i++) {
1488
- var key = tokens[i].slice(1);
1489
- url = url.replace(tokens[i], data[key]);
1490
  delete data[key]
1491
- }
 
1492
  }
1493
  return url
1494
  }
1495
 
1496
- m.request = function(xhrOptions) {
1497
- if (xhrOptions.background !== true) m.startComputation();
1498
- var deferred = new Deferred();
1499
- var isJSONP = xhrOptions.dataType && xhrOptions.dataType.toLowerCase() === "jsonp";
1500
- var serialize = xhrOptions.serialize = isJSONP ? identity : xhrOptions.serialize || JSON.stringify;
1501
- var deserialize = xhrOptions.deserialize = isJSONP ? identity : xhrOptions.deserialize || JSON.parse;
1502
- var extract = isJSONP ? function(jsonp) {return jsonp.responseText} : xhrOptions.extract || function(xhr) {
1503
- return xhr.responseText.length === 0 && deserialize === JSON.parse ? null : xhr.responseText
1504
- };
1505
- xhrOptions.method = (xhrOptions.method || 'GET').toUpperCase();
1506
- xhrOptions.url = parameterizeUrl(xhrOptions.url, xhrOptions.data);
1507
- xhrOptions = bindData(xhrOptions, xhrOptions.data, serialize);
1508
- xhrOptions.onload = xhrOptions.onerror = function(e) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1509
  try {
1510
- e = e || event;
1511
- var unwrap = (e.type === "load" ? xhrOptions.unwrapSuccess : xhrOptions.unwrapError) || identity;
1512
- var response = unwrap(deserialize(extract(e.target, xhrOptions)), e.target);
1513
- if (e.type === "load"