Plugin Directory

Changeset 3065415


Ignore:
Timestamp:
04/05/2024 12:02:32 PM (23 months ago)
Author:
HappyKite
Message:

Releasing Version 1.9.4

  • SECURITY FIX - Fixed XSS Vulnerability - Thanks to Cronus and PatchStack for discovering and reporting.
  • UPDATE - Tested on WordPress 6.4.3
Location:
ultimate-under-construction
Files:
31 added
14 edited

Legend:

Unmodified
Added
Removed
  • ultimate-under-construction/trunk/includes/css/flipclock.css

    r868862 r3065415  
    22/* Reset */
    33.cddiv {
    4   width: 100%;
    5   text-align: center;
     4    width: 100%;
     5    text-align: center;
    66}
    77
    88.flip-clock-wrapper * {
    9     -webkit-box-sizing: border-box;
    10     -moz-box-sizing: border-box;
    11     -ms-box-sizing: border-box;
    12     -o-box-sizing: border-box;
    13     box-sizing: border-box;
    14     -webkit-backface-visibility: hidden;
    15     -moz-backface-visibility: hidden;
    16     -ms-backface-visibility: hidden;
    17     -o-backface-visibility: hidden;
    18     backface-visibility: hidden;
     9    -webkit-box-sizing: border-box;
     10    -moz-box-sizing: border-box;
     11    -ms-box-sizing: border-box;
     12    -o-box-sizing: border-box;
     13    box-sizing: border-box;
     14    -webkit-backface-visibility: hidden;
     15    -moz-backface-visibility: hidden;
     16    -ms-backface-visibility: hidden;
     17    -o-backface-visibility: hidden;
     18    backface-visibility: hidden;
    1919}
    2020
    2121.flip-clock-wrapper a {
    22   cursor: pointer;
    23   text-decoration: none;
    24   color: #ccc; }
     22    cursor: pointer;
     23    text-decoration: none;
     24    color: #ccc;
     25}
    2526
    2627.flip-clock-wrapper a:hover {
    27   color: #fff; }
     28    color: #fff;
     29}
    2830
    2931.flip-clock-wrapper ul {
    30   list-style: none; }
     32    list-style: none;
     33}
    3134
    3235.flip-clock-wrapper.clearfix:before,
    3336.flip-clock-wrapper.clearfix:after {
    34   content: " ";
    35   display: table; }
     37    content: " ";
     38    display: table;
     39}
    3640
    3741.flip-clock-wrapper.clearfix:after {
    38   clear: both; }
     42    clear: both;
     43}
    3944
    4045.flip-clock-wrapper.clearfix {
    41   *zoom: 1; }
     46    *zoom: 1;
     47}
    4248
    4349/* Main */
    4450.flip-clock-wrapper {
    45   font: normal 11px "Helvetica Neue", Helvetica, sans-serif;
    46   -webkit-user-select: none; }
     51    font: normal 11px "Helvetica Neue", Helvetica, sans-serif;
     52    -webkit-user-select: none;
     53}
    4754
    4855.flip-clock-meridium {
    49   background: none !important;
    50   box-shadow: 0 0 0 !important;
    51   font-size: 36px !important; }
    52 
    53 .flip-clock-meridium a { color: #313333; }
     56    background: none !important;
     57    box-shadow: 0 0 0 !important;
     58    font-size: 36px !important;
     59}
     60
     61.flip-clock-meridium a {
     62    color: #313333;
     63}
    5464
    5565.flip-clock-wrapper {
    56   text-align: center;
    57   position: relative;
    58   margin: 1em;
    59   display: inline-block !important;
     66    text-align: center;
     67    position: relative;
     68    margin: 1em;
     69    display: inline-block !important;
    6070}
    6171
    6272.flip-clock-wrapper:before,
    6373.flip-clock-wrapper:after {
    64     content: " "; /* 1 */
    65     display: table; /* 2 */
    66 }
     74    content: " ";
     75    /* 1 */
     76    display: table;
     77    /* 2 */
     78}
     79
    6780.flip-clock-wrapper:after {
    68     clear: both;
     81    clear: both;
    6982}
    7083
    7184/* Skeleton */
    7285.flip-clock-wrapper ul {
    73   position: relative;
    74   float: left;
    75   margin: 5px;
    76   width: 60px;
    77   height: 90px;
    78   font-size: 80px;
    79   font-weight: bold;
    80   line-height: 87px;
    81   border-radius: 6px;
    82   background: #000;
     86    position: relative;
     87    float: left;
     88    margin: 5px;
     89    width: 60px;
     90    height: 90px;
     91    font-size: 80px;
     92    font-weight: bold;
     93    line-height: 87px;
     94    border-radius: 6px;
     95    background: #000;
    8396}
    8497
    8598.flip-clock-wrapper ul li {
    86   z-index: 1;
    87   position: absolute;
    88   left: 0;
    89   top: 0;
    90   width: 100%;
    91   height: 100%;
    92   text-decoration: none !important;
     99    z-index: 1;
     100    position: absolute;
     101    left: 0;
     102    top: 0;
     103    width: 100%;
     104    height: 100%;
     105    text-decoration: none !important;
    93106}
    94107
    95108.flip-clock-wrapper ul li:first-child {
    96   z-index: 2; }
     109    z-index: 2;
     110}
    97111
    98112.flip-clock-wrapper ul li a {
    99   display: block;
    100   height: 100%;
    101   -webkit-perspective: 200px;
    102   -moz-perspective: 200px;
    103   perspective: 200px;
    104   margin: 0 !important;
    105   overflow: visible !important;
    106   cursor: default !important; }
     113    display: block;
     114    height: 100%;
     115    -webkit-perspective: 200px;
     116    -moz-perspective: 200px;
     117    perspective: 200px;
     118    margin: 0 !important;
     119    overflow: visible !important;
     120    cursor: default !important;
     121}
    107122
    108123.flip-clock-wrapper ul li a div {
    109   z-index: 1;
    110   position: absolute;
    111   left: 0;
    112   width: 100%;
    113   height: 50%;
    114   font-size: 80px;
    115   overflow: hidden;
    116   outline: 1px solid transparent; }
     124    z-index: 1;
     125    position: absolute;
     126    left: 0;
     127    width: 100%;
     128    height: 50%;
     129    font-size: 80px;
     130    overflow: hidden;
     131    outline: 1px solid transparent;
     132}
    117133
    118134.flip-clock-wrapper ul li a div .shadow {
    119   position: absolute;
    120   width: 100%;
    121   height: 100%;
    122   z-index: 2; }
     135    position: absolute;
     136    width: 100%;
     137    height: 100%;
     138    z-index: 2;
     139}
    123140
    124141.flip-clock-wrapper ul li a div.up {
    125   -webkit-transform-origin: 50% 100%;
    126   -moz-transform-origin: 50% 100%;
    127   -ms-transform-origin: 50% 100%;
    128   -o-transform-origin: 50% 100%;
    129   transform-origin: 50% 100%;
    130   top: 0; }
     142    -webkit-transform-origin: 50% 100%;
     143    -moz-transform-origin: 50% 100%;
     144    -ms-transform-origin: 50% 100%;
     145    -o-transform-origin: 50% 100%;
     146    transform-origin: 50% 100%;
     147    top: 0;
     148}
    131149
    132150.flip-clock-wrapper ul li a div.up:after {
    133   content: "";
    134   position: absolute;
    135   top: 44px;
    136   left: 0;
    137   z-index: 5;
    138   width: 100%;
    139   height: 3px;
    140   background-color: #000;
    141   background-color: rgba(0, 0, 0, 0.4); }
     151    content: "";
     152    position: absolute;
     153    top: 44px;
     154    left: 0;
     155    z-index: 5;
     156    width: 100%;
     157    height: 3px;
     158    background-color: #000;
     159    background-color: rgba(0, 0, 0, 0.4);
     160}
    142161
    143162.flip-clock-wrapper ul li a div.down {
    144   -webkit-transform-origin: 50% 0;
    145   -moz-transform-origin: 50% 0;
    146   -ms-transform-origin: 50% 0;
    147   -o-transform-origin: 50% 0;
    148   transform-origin: 50% 0;
    149   bottom: 0; }
     163    -webkit-transform-origin: 50% 0;
     164    -moz-transform-origin: 50% 0;
     165    -ms-transform-origin: 50% 0;
     166    -o-transform-origin: 50% 0;
     167    transform-origin: 50% 0;
     168    bottom: 0;
     169}
    150170
    151171.flip-clock-wrapper ul li a div div.inn {
    152   position: absolute;
    153   left: 0;
    154   z-index: 1;
    155   width: 100%;
    156   height: 200%;
    157   color: #ccc;
    158   text-shadow: 0 1px 2px #000;
    159   text-align: center;
    160   background-color: #333;
    161   border-radius: 6px;
    162   font-size: 70px; }
     172    position: absolute;
     173    left: 0;
     174    z-index: 1;
     175    width: 100%;
     176    height: 200%;
     177    color: #ccc;
     178    text-shadow: 0 1px 2px #000;
     179    text-align: center;
     180    background-color: #333;
     181    border-radius: 6px;
     182    font-size: 70px;
     183}
    163184
    164185.flip-clock-wrapper ul li a div.up div.inn {
    165   top: 0; }
     186    top: 0;
     187}
    166188
    167189.flip-clock-wrapper ul li a div.down div.inn {
    168   bottom: 0; }
     190    bottom: 0;
     191}
    169192
    170193/* PLAY */
    171194.flip-clock-wrapper ul.play li.flip-clock-before {
    172   z-index: 3; }
    173 
    174 .flip-clock-wrapper .flip {   box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7); }
     195    z-index: 3;
     196}
     197
     198.flip-clock-wrapper .flip {
     199    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
     200}
    175201
    176202.flip-clock-wrapper ul.play li.flip-clock-active {
    177   -webkit-animation: asd 0.5s 0.5s linear both;
    178   -moz-animation: asd 0.5s 0.5s linear both;
    179   animation: asd 0.5s 0.5s linear both;
    180   z-index: 5; }
     203    -webkit-animation: asd 0.5s 0.5s linear both;
     204    -moz-animation: asd 0.5s 0.5s linear both;
     205    animation: asd 0.5s 0.5s linear both;
     206    z-index: 5;
     207}
    181208
    182209.flip-clock-divider {
    183   float: left;
    184   display: inline-block;
    185   position: relative;
    186   width: 20px;
    187   height: 100px; }
     210    float: left;
     211    display: inline-block;
     212    position: relative;
     213    width: 20px;
     214    height: 100px;
     215}
    188216
    189217.flip-clock-divider:first-child {
    190   width: 0; }
     218    width: 0;
     219}
    191220
    192221.flip-clock-dot {
    193   display: block;
    194   background: #323434;
    195   width: 10px;
    196   height: 10px;
    197   position: absolute;
    198   border-radius: 50%;
    199   box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    200   left: 5px; }
     222    display: block;
     223    background: #323434;
     224    width: 10px;
     225    height: 10px;
     226    position: absolute;
     227    border-radius: 50%;
     228    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
     229    left: 5px;
     230}
    201231
    202232.flip-clock-divider .flip-clock-label {
    203   position: absolute;
    204   top: -1.5em;
    205   right: -86px;
    206   text-shadow: none; }
     233    position: absolute;
     234    top: -1.5em;
     235    right: -86px;
     236    text-shadow: none;
     237}
    207238
    208239.flip-clock-divider.minutes .flip-clock-label {
    209   right: -88px; }
     240    right: -88px;
     241}
    210242
    211243.flip-clock-divider.seconds .flip-clock-label {
    212   right: -91px; }
     244    right: -91px;
     245}
    213246
    214247.flip-clock-dot.top {
    215   top: 30px; }
     248    top: 30px;
     249}
    216250
    217251.flip-clock-dot.bottom {
    218   bottom: 30px; }
     252    bottom: 30px;
     253}
    219254
    220255@-webkit-keyframes asd {
    221   0% {
    222     z-index: 2; }
    223 
    224   20% {
    225     z-index: 4; }
    226 
    227   100% {
    228     z-index: 4; } }
     256    0% {
     257        z-index: 2;
     258    }
     259
     260    20% {
     261        z-index: 4;
     262    }
     263
     264    100% {
     265        z-index: 4;
     266    }
     267}
    229268
    230269@-moz-keyframes asd {
    231   0% {
    232     z-index: 2; }
    233 
    234   20% {
    235     z-index: 4; }
    236 
    237   100% {
    238     z-index: 4; } }
     270    0% {
     271        z-index: 2;
     272    }
     273
     274    20% {
     275        z-index: 4;
     276    }
     277
     278    100% {
     279        z-index: 4;
     280    }
     281}
    239282
    240283@-o-keyframes asd {
    241   0% {
    242     z-index: 2; }
    243 
    244   20% {
    245     z-index: 4; }
    246 
    247   100% {
    248     z-index: 4; } }
     284    0% {
     285        z-index: 2;
     286    }
     287
     288    20% {
     289        z-index: 4;
     290    }
     291
     292    100% {
     293        z-index: 4;
     294    }
     295}
    249296
    250297@keyframes asd {
    251   0% {
    252     z-index: 2; }
    253 
    254   20% {
    255     z-index: 4; }
    256 
    257   100% {
    258     z-index: 4; } }
     298    0% {
     299        z-index: 2;
     300    }
     301
     302    20% {
     303        z-index: 4;
     304    }
     305
     306    100% {
     307        z-index: 4;
     308    }
     309}
    259310
    260311.flip-clock-wrapper ul.play li.flip-clock-active .down {
    261   z-index: 2;
    262   -webkit-animation: turn 0.5s 0.5s linear both;
    263   -moz-animation: turn 0.5s 0.5s linear both;
    264   animation: turn 0.5s 0.5s linear both; }
     312    z-index: 2;
     313    -webkit-animation: turn 0.5s 0.5s linear both;
     314    -moz-animation: turn 0.5s 0.5s linear both;
     315    animation: turn 0.5s 0.5s linear both;
     316}
    265317
    266318@-webkit-keyframes turn {
    267   0% {
    268     -webkit-transform: rotateX(90deg); }
    269 
    270   100% {
    271     -webkit-transform: rotateX(0deg); } }
     319    0% {
     320        -webkit-transform: rotateX(90deg);
     321    }
     322
     323    100% {
     324        -webkit-transform: rotateX(0deg);
     325    }
     326}
    272327
    273328@-moz-keyframes turn {
    274   0% {
    275     -moz-transform: rotateX(90deg); }
    276 
    277   100% {
    278     -moz-transform: rotateX(0deg); } }
     329    0% {
     330        -moz-transform: rotateX(90deg);
     331    }
     332
     333    100% {
     334        -moz-transform: rotateX(0deg);
     335    }
     336}
    279337
    280338@-o-keyframes turn {
    281   0% {
    282     -o-transform: rotateX(90deg); }
    283 
    284   100% {
    285     -o-transform: rotateX(0deg); } }
     339    0% {
     340        -o-transform: rotateX(90deg);
     341    }
     342
     343    100% {
     344        -o-transform: rotateX(0deg);
     345    }
     346}
    286347
    287348@keyframes turn {
    288   0% {
    289     transform: rotateX(90deg); }
    290 
    291   100% {
    292     transform: rotateX(0deg); } }
     349    0% {
     350        transform: rotateX(90deg);
     351    }
     352
     353    100% {
     354        transform: rotateX(0deg);
     355    }
     356}
    293357
    294358.flip-clock-wrapper ul.play li.flip-clock-before .up {
    295   z-index: 2;
    296   -webkit-animation: turn2 0.5s linear both;
    297   -moz-animation: turn2 0.5s linear both;
    298   animation: turn2 0.5s linear both; }
     359    z-index: 2;
     360    -webkit-animation: turn2 0.5s linear both;
     361    -moz-animation: turn2 0.5s linear both;
     362    animation: turn2 0.5s linear both;
     363}
    299364
    300365@-webkit-keyframes turn2 {
    301   0% {
    302     -webkit-transform: rotateX(0deg); }
    303 
    304   100% {
    305     -webkit-transform: rotateX(-90deg); } }
     366    0% {
     367        -webkit-transform: rotateX(0deg);
     368    }
     369
     370    100% {
     371        -webkit-transform: rotateX(-90deg);
     372    }
     373}
    306374
    307375@-moz-keyframes turn2 {
    308   0% {
    309     -moz-transform: rotateX(0deg); }
    310 
    311   100% {
    312     -moz-transform: rotateX(-90deg); } }
     376    0% {
     377        -moz-transform: rotateX(0deg);
     378    }
     379
     380    100% {
     381        -moz-transform: rotateX(-90deg);
     382    }
     383}
    313384
    314385@-o-keyframes turn2 {
    315   0% {
    316     -o-transform: rotateX(0deg); }
    317 
    318   100% {
    319     -o-transform: rotateX(-90deg); } }
     386    0% {
     387        -o-transform: rotateX(0deg);
     388    }
     389
     390    100% {
     391        -o-transform: rotateX(-90deg);
     392    }
     393}
    320394
    321395@keyframes turn2 {
    322   0% {
    323     transform: rotateX(0deg); }
    324 
    325   100% {
    326     transform: rotateX(-90deg); } }
     396    0% {
     397        transform: rotateX(0deg);
     398    }
     399
     400    100% {
     401        transform: rotateX(-90deg);
     402    }
     403}
    327404
    328405.flip-clock-wrapper ul li.flip-clock-active {
    329   z-index: 3; }
     406    z-index: 3;
     407}
    330408
    331409/* SHADOW */
    332410.flip-clock-wrapper ul.play li.flip-clock-before .up .shadow {
    333   background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);
    334   background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, black));
    335   background: linear, top, rgba(0, 0, 0, 0.1) 0%, black 100%;
    336   background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);
    337   background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);
    338   background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%;
    339   -webkit-animation: show 0.5s linear both;
    340   -moz-animation: show 0.5s linear both;
    341   animation: show 0.5s linear both; }
     411    background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);
     412    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, black));
     413    background: linear, top, rgba(0, 0, 0, 0.1) 0%, black 100%;
     414    background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);
     415    background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);
     416    background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%;
     417    -webkit-animation: show 0.5s linear both;
     418    -moz-animation: show 0.5s linear both;
     419    animation: show 0.5s linear both;
     420}
    342421
    343422.flip-clock-wrapper ul.play li.flip-clock-active .up .shadow {
    344   background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);
    345   background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, black));
    346   background: linear, top, rgba(0, 0, 0, 0.1) 0%, black 100%;
    347   background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);
    348   background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);
    349   background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%;
    350   -webkit-animation: hide 0.5s 0.3s linear both;
    351   -moz-animation: hide 0.5s 0.3s linear both;
    352   animation: hide 0.5s 0.3s linear both; }
     423    background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);
     424    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, black));
     425    background: linear, top, rgba(0, 0, 0, 0.1) 0%, black 100%;
     426    background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);
     427    background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);
     428    background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%;
     429    -webkit-animation: hide 0.5s 0.3s linear both;
     430    -moz-animation: hide 0.5s 0.3s linear both;
     431    animation: hide 0.5s 0.3s linear both;
     432}
    353433
    354434/*DOWN*/
    355435.flip-clock-wrapper ul.play li.flip-clock-before .down .shadow {
    356   background: -moz-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);
    357   background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, black), color-stop(100%, rgba(0, 0, 0, 0.1)));
    358   background: linear, top, black 0%, rgba(0, 0, 0, 0.1) 100%;
    359   background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);
    360   background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);
    361   background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%;
    362   -webkit-animation: show 0.5s linear both;
    363   -moz-animation: show 0.5s linear both;
    364   animation: show 0.5s linear both; }
     436    background: -moz-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);
     437    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, black), color-stop(100%, rgba(0, 0, 0, 0.1)));
     438    background: linear, top, black 0%, rgba(0, 0, 0, 0.1) 100%;
     439    background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);
     440    background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);
     441    background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%;
     442    -webkit-animation: show 0.5s linear both;
     443    -moz-animation: show 0.5s linear both;
     444    animation: show 0.5s linear both;
     445}
    365446
    366447.flip-clock-wrapper ul.play li.flip-clock-active .down .shadow {
    367   background: -moz-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);
    368   background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, black), color-stop(100%, rgba(0, 0, 0, 0.1)));
    369   background: linear, top, black 0%, rgba(0, 0, 0, 0.1) 100%;
    370   background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);
    371   background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);
    372   background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%;
    373   -webkit-animation: hide 0.5s 0.3s linear both;
    374   -moz-animation: hide 0.5s 0.3s linear both;
    375   animation: hide 0.5s 0.2s linear both; }
     448    background: -moz-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);
     449    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, black), color-stop(100%, rgba(0, 0, 0, 0.1)));
     450    background: linear, top, black 0%, rgba(0, 0, 0, 0.1) 100%;
     451    background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);
     452    background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);
     453    background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%;
     454    -webkit-animation: hide 0.5s 0.3s linear both;
     455    -moz-animation: hide 0.5s 0.3s linear both;
     456    animation: hide 0.5s 0.2s linear both;
     457}
    376458
    377459@-webkit-keyframes show {
    378   0% {
    379     opacity: 0; }
    380 
    381   100% {
    382     opacity: 1; } }
     460    0% {
     461        opacity: 0;
     462    }
     463
     464    100% {
     465        opacity: 1;
     466    }
     467}
    383468
    384469@-moz-keyframes show {
    385   0% {
    386     opacity: 0; }
    387 
    388   100% {
    389     opacity: 1; } }
     470    0% {
     471        opacity: 0;
     472    }
     473
     474    100% {
     475        opacity: 1;
     476    }
     477}
    390478
    391479@-o-keyframes show {
    392   0% {
    393     opacity: 0; }
    394 
    395   100% {
    396     opacity: 1; } }
     480    0% {
     481        opacity: 0;
     482    }
     483
     484    100% {
     485        opacity: 1;
     486    }
     487}
    397488
    398489@keyframes show {
    399   0% {
    400     opacity: 0; }
    401 
    402   100% {
    403     opacity: 1; } }
     490    0% {
     491        opacity: 0;
     492    }
     493
     494    100% {
     495        opacity: 1;
     496    }
     497}
    404498
    405499@-webkit-keyframes hide {
    406   0% {
    407     opacity: 1; }
    408 
    409   100% {
    410     opacity: 0; } }
     500    0% {
     501        opacity: 1;
     502    }
     503
     504    100% {
     505        opacity: 0;
     506    }
     507}
    411508
    412509@-moz-keyframes hide {
    413   0% {
    414     opacity: 1; }
    415 
    416   100% {
    417     opacity: 0; } }
     510    0% {
     511        opacity: 1;
     512    }
     513
     514    100% {
     515        opacity: 0;
     516    }
     517}
    418518
    419519@-o-keyframes hide {
    420   0% {
    421     opacity: 1; }
    422 
    423   100% {
    424     opacity: 0; } }
     520    0% {
     521        opacity: 1;
     522    }
     523
     524    100% {
     525        opacity: 0;
     526    }
     527}
    425528
    426529@keyframes hide {
    427   0% {
    428     opacity: 1; }
    429 
    430   100% {
    431     opacity: 0; } }
     530    0% {
     531        opacity: 1;
     532    }
     533
     534    100% {
     535        opacity: 0;
     536    }
     537}
  • ultimate-under-construction/trunk/includes/css/plugin_styles.css

    r2750860 r3065415  
    1 .uuc-title { border-bottom: 1px solid #ccc; background: #F5F5F5; padding: 8px; margin: 20px 0; background: -moz-linear-gradient(top, #f1f1f1 0%, #e5e5e5 100%); /* FF3.6+ */
    2 background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f1f1f1), color-stop(100%,#e5e5e5)); /* Chrome,Safari4+ */
    3 background: -webkit-linear-gradient(top, #f1f1f1 0%,#e5e5e5 100%); /* Chrome10+,Safari5.1+ */
    4 background: -o-linear-gradient(top, #f1f1f1 0%,#e5e5e5 100%); /* Opera 11.10+ */
    5 background: -ms-linear-gradient(top, #f1f1f1 0%,#e5e5e5 100%); /* IE10+ */
    6 background: linear-gradient(to bottom, #f1f1f1 0%,#e5e5e5 100%); /* W3C */
    7 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f1f1f1', endColorstr='#e5e5e5',GradientType=0 ); /* IE6-9 */ }
     1.uuc-title {
     2    border-bottom: 1px solid #ccc;
     3    background: #F5F5F5;
     4    padding: 8px;
     5    margin: 20px 0;
     6    background: -moz-linear-gradient(top, #f1f1f1 0%, #e5e5e5 100%);
     7    /* FF3.6+ */
     8    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f1f1f1), color-stop(100%, #e5e5e5));
     9    /* Chrome,Safari4+ */
     10    background: -webkit-linear-gradient(top, #f1f1f1 0%, #e5e5e5 100%);
     11    /* Chrome10+,Safari5.1+ */
     12    background: -o-linear-gradient(top, #f1f1f1 0%, #e5e5e5 100%);
     13    /* Opera 11.10+ */
     14    background: -ms-linear-gradient(top, #f1f1f1 0%, #e5e5e5 100%);
     15    /* IE10+ */
     16    background: linear-gradient(to bottom, #f1f1f1 0%, #e5e5e5 100%);
     17    /* W3C */
     18    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f1f1f1', endColorstr='#e5e5e5', GradientType=0);
     19    /* IE6-9 */
     20}
    821
    9 #wpfooter { display:none !important; visibility: hidden !important; }
     22#wpfooter {
     23    display: none !important;
     24    visibility: hidden !important;
     25}
    1026
    11 .uuc-holdingpage h1 { text-align: center; padding-top: 250px; }
     27.uuc-holdingpage h1 {
     28    text-align: center;
     29    padding-top: 250px;
     30}
  • ultimate-under-construction/trunk/includes/display-functions.php

    r2750860 r3065415  
    11<?php
    2 
    3 /* display functions for outputting data */
    4 
    5 add_filter('get_header', 'uuc_add_content');
    6 
     2/**
     3 * Display Functions
     4 *
     5 * Loads the functionality for the front end holding page.
     6 *
     7 * @package Ultimate Under Construction
     8 */
     9
     10add_action( 'wp_enqueue_scripts', 'uuc_enqueue_scripts' );
     11/**
     12 * Enqueue Scripts
     13 */
     14function uuc_enqueue_scripts() {
     15    wp_enqueue_script( 'uuc_base', UUC_PLUGIN_URL . 'js/base.js', array(), filemtime( UUC_PLUGIN_DIR . 'js/base.js' ), array( 'in_footer' => false ) );
     16    wp_enqueue_script( 'uuc_flipclock', UUC_PLUGIN_URL . 'js/flipclock.js', array(), filemtime( UUC_PLUGIN_DIR . 'js/flipclock.js' ), array( 'in_footer' => false ) );
     17    wp_enqueue_script( 'uuc_counter', UUC_PLUGIN_URL . 'js/dailycounter.js', array(), filemtime( UUC_PLUGIN_DIR . 'js/dailycounter.js' ), array( 'in_footer' => false ) );
     18
     19    wp_enqueue_style( 'uuc_flipclock_styles', UUC_PLUGIN_URL . 'css/base.css', array(), filemtime( UUC_PLUGIN_DIR . 'css/base.css' ), array( 'in_footer' => false ) );
     20}
     21
     22// Display functions for outputting data.
     23add_filter( 'get_header', 'uuc_add_content' );
     24
     25/**
     26 * Add UUC Content.
     27 */
    728function uuc_add_content() {
    829    global $uuc_options;
    9    
    10     //Current version of WP seems to fall over on unticked Checkboxes... This is to tidy it up and stop unwanted 'Notices'
    11     //Enable Checkbox Sanitization
    12     if ( ! isset( $uuc_options['enable'] ) || $uuc_options['enable'] != '1' )
    13       $uuc_options['enable'] = 0;
    14     else
    15       $uuc_options['enable'] = 1;
    16 
    17     //Countdown Checkbox Sanitization
    18     if ( ! isset( $uuc_options['cdenable'] ) || $uuc_options['cdenable'] != '1' )
    19       $uuc_options['cdenable'] = 0;
    20     else
    21       $uuc_options['cdenable'] = 1;
    22 
    23     if ($uuc_options['enable'] == 1) {
     30
     31    // Current version of WP seems to fall over on unticked Checkboxes... This is to tidy it up and stop unwanted 'Notices'.
     32    // Enable Checkbox Sanitization.
     33    if ( ! isset( $uuc_options['enable'] ) || '1' != $uuc_options['enable'] ) {
     34        $uuc_options['enable'] = 0;
     35    } else {
     36        $uuc_options['enable'] = 1;
     37    }
     38
     39    // Countdown Checkbox Sanitization.
     40    if ( ! isset( $uuc_options['cdenable'] ) || '1' != $uuc_options['cdenable'] ) {
     41        $uuc_options['cdenable'] = 0;
     42    } else {
     43        $uuc_options['cdenable'] = 1;
     44    }
     45
     46    if ( 1 == $uuc_options['enable'] ) {
    2447
    2548        ?>
    2649        <!DOCTYPE html>
    2750        <script language="JavaScript">
    28         TargetDate = "<?php echo $uuc_options['cdmonth'], '/', $uuc_options['cdday'], '/', $uuc_options['cdyear']; ?>";
    29         CountActive = true;
    30         CountStepper = -1;
    31         LeadingZero = true;
    32         DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds ";
    33         FinishMessage = "It is finally here!";
     51            TargetDate = "<?php echo esc_html( $uuc_options['cdmonth'] ), '/', esc_html( $uuc_options['cdday'] ), '/', esc_html( $uuc_options['cdyear'] ); ?>";
     52            CountActive = true;
     53            CountStepper = -1;
     54            LeadingZero = true;
     55            DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds ";
     56            FinishMessage = "It is finally here!";
    3457        </script>
    3558
     
    3760
    3861        <?php
    39         echo '<script src="' . plugin_dir_url(__FILE__) . 'js/base.js"></script>';
    40         echo '<script src="' . plugin_dir_url(__FILE__) . 'js/flipclock.js"></script>';
    41         echo '<script src="' . plugin_dir_url(__FILE__) . 'js/dailycounter.js"></script>';
    42         echo '<link rel="stylesheet" href="' . plugin_dir_url(__FILE__) . 'css/flipclock.css">';
     62        echo wp_kses(
     63            '<script src="' . plugin_dir_url( __FILE__ ) . 'js/base.js"></script>',
     64            array(
     65                'script' => array(
     66                    'src' => array(),
     67                ),
     68            )
     69        );
     70        echo wp_kses(
     71            '<script src="' . plugin_dir_url( __FILE__ ) . 'js/flipclock.js"></script>',
     72            array(
     73                'script' => array(
     74                    'src' => array(),
     75                ),
     76            )
     77        );
     78        echo wp_kses(
     79            '<script src="' . plugin_dir_url( __FILE__ ) . 'js/dailycounter.js"></script>',
     80            array(
     81                'script' => array(
     82                    'src' => array(),
     83                ),
     84            )
     85        );
     86        echo wp_kses(
     87            '<link rel="stylesheet" href="' . plugin_dir_url( __FILE__ ) . 'css/flipclock.css">',
     88            array(
     89                'link' => array(
     90                    'rel'  => array(),
     91                    'href' => array(),
     92                ),
     93            )
     94        );
    4395        $html = '';
    44         ?> 
     96        ?>
    4597
    4698        <script type="text/javascript">
    4799            var clock;
    48100
    49             $(document).ready(function() {
     101            $(document).ready(function () {
    50102
    51103                // Grab the current date
     
    53105
    54106                // Set some date in the future.
    55                 var selecteddate  = new Date("<?php echo $uuc_options['cdyear'], '/', $uuc_options['cdmonth'], '/', $uuc_options['cdday']; ?>");
     107                var selecteddate = new Date("<?php echo esc_html( $uuc_options['cdyear'] ), '/', esc_html( $uuc_options['cdmonth'] ), '/', esc_html( $uuc_options['cdday'] ); ?>");
    56108
    57109                // Calculate the difference in seconds between the future and current date
    58110                var diff1 = selecteddate.getTime() / 1000 - currentDate.getTime() / 1000;
    59111
    60                 var diff = (diff1 <= 0) ? "0": diff1;
     112                var diff = (diff1 <= 0) ? "0" : diff1;
    61113
    62114                // Instantiate a coutdown FlipClock
     
    66118                    countdown: true
    67119                });
    68             }); 
    69         </script>   
     120            });
     121        </script>
    70122        <?php
    71123
    72         if(isset($uuc_options['cdday'])){
    73             $entereddate = ($uuc_options['cdyear'] . "-" . $uuc_options['cdmonth'] . "-" . $uuc_options['cdday'] . " " . "00:00:00");
    74             $cddates = strtotime($entereddate);
     124        if ( isset( $uuc_options['cdday'] ) ) {
     125            $entereddate = ( $uuc_options['cdyear'] . '-' . esc_html( $uuc_options['cdmonth'] ) . '-' . esc_html( $uuc_options['cdday'] ) . ' ' . '00:00:00' );
     126            $cddates     = strtotime( $entereddate );
    75127        }
    76128
    77         if(!is_admin() && !is_user_logged_in() && $uuc_options['enable'] == true && $uuc_options['holdingpage_type'] == "htmlblock"){
    78            
     129        if ( ! is_admin() && ! is_user_logged_in() && true == $uuc_options['enable'] && 'htmlblock' == $uuc_options['holdingpage_type'] ) {
     130
    79131            $html .= '<div class="uuc-holdingpage">';
    80             if(isset($uuc_options['html_block'])) {
     132            if ( isset( $uuc_options['html_block'] ) ) {
    81133                $html .= $uuc_options['html_block'];
    82134            }
    83135            $html .= '</div>';
    84             echo $html; exit;
    85         }
    86         elseif(!is_admin() && !is_user_logged_in() && $uuc_options['enable'] == true){
    87            
    88             if (isset($uuc_options['background_style']) && $uuc_options['background_style'] == "solidcolor") {
    89                 if (isset($uuc_options['background_color'])) {?>
     136            echo esc_html( $html );
     137            exit;
     138        } elseif ( ! is_admin() && ! is_user_logged_in() && true == $uuc_options['enable'] ) {
     139
     140            if ( isset( $uuc_options['background_style'] ) && 'solidcolor' == $uuc_options['background_style'] ) {
     141                if ( isset( $uuc_options['background_color'] ) ) {
     142                    ?>
    90143                    <style type="text/css">
    91                         body { background-color: <?php echo $uuc_options['background_color']; ?> }
    92                         .uuc-holdingpage { text-align: center; padding-top: 250px; }
     144                        body {
     145                            background-color: <?php echo esc_html( $uuc_options['background_color'] ); ?>
     146                        }
     147
     148                        .uuc-holdingpage {
     149                            text-align: center;
     150                            padding-top: 250px;
     151                        }
    93152                    </style>
    94                 <?php }
    95             } else if (isset($uuc_options['background_style']) && $uuc_options['background_style'] == "patterned") {
    96                 if (!isset($uuc_options['background_styling'])) {?>
     153                    <?php
     154                }
     155            } elseif ( isset( $uuc_options['background_style'] ) && 'patterned' == $uuc_options['background_style'] ) {
     156                if ( ! isset( $uuc_options['background_styling'] ) ) {
     157                    ?>
    97158                    <style type="text/css">
    98                         body { background: url(<?php echo plugin_dir_url(__FILE__) . '/images/oldmaths.png' ?>); }
    99                         .uuc-holdingpage { text-align: center; padding-top: 250px; }
     159                        body {
     160                            background: url(<?php echo esc_html( plugin_dir_url( __FILE__ ) . '/images/oldmaths.png' ); ?>);
     161                        }
     162
     163                        .uuc-holdingpage {
     164                            text-align: center;
     165                            padding-top: 250px;
     166                        }
    100167                    </style>
    101                 <?php } elseif (isset($uuc_options['background_styling'])) {
    102                     if ($uuc_options['background_styling'] == "darkbind") {?>   
    103                     <style type="text/css">
    104                         body { background: url(<?php echo plugin_dir_url(__FILE__) . 'images/' . $uuc_options['background_styling'].'.png' ?>); }
    105                         .uuc-holdingpage { text-align: center; color: #909090; padding-top: 250px; }
    106                     </style>
    107                     <?php } else { ?>           
    108                     <style type="text/css">
    109                         body { background: url(<?php echo plugin_dir_url(__FILE__) . 'images/' . $uuc_options['background_styling'].'.png' ?>); }
    110                         .uuc-holdingpage { text-align: center; padding-top: 250px; }
    111                     </style>
    112                     <?php }
     168                    <?php
     169                } elseif ( isset( $uuc_options['background_styling'] ) ) {
     170                    if ( 'darkbind' == $uuc_options['background_styling'] ) {
     171                        ?>
     172                        <style type="text/css">
     173                            body {
     174                                background: url(<?php echo esc_html( plugin_dir_url( __FILE__ ) . 'images/' . $uuc_options['background_styling'] . '.png' ); ?>);
     175                            }
     176
     177                            .uuc-holdingpage {
     178                                text-align: center;
     179                                color: #909090;
     180                                padding-top: 250px;
     181                            }
     182                        </style>
     183                    <?php } else { ?>
     184                        <style type="text/css">
     185                            body {
     186                                background: url(<?php echo esc_html( plugin_dir_url( __FILE__ ) . 'images/' . $uuc_options['background_styling'] . '.png' ); ?>);
     187                            }
     188
     189                            .uuc-holdingpage {
     190                                text-align: center;
     191                                padding-top: 250px;
     192                            }
     193                        </style>
     194                        <?php
     195                    }
    113196                }
    114197            }
     
    116199            $html .= '<div class="uuc-holdingpage">';
    117200            $html .= '<h1>' . $uuc_options['website_name'] . '</h1>';
    118             if(isset($uuc_options['holding_message'])) {
     201            if ( isset( $uuc_options['holding_message'] ) ) {
    119202                $html .= '<h2>' . $uuc_options['holding_message'] . '</h2>';
    120203            }
     
    122205            $htmlpart = '';
    123206
    124             if($uuc_options['cdenable'] == true){
    125 
    126                 if($uuc_options['cd_style'] == "flipclock"){
     207            if ( true == $uuc_options['cdenable'] ) {
     208
     209                if ( 'flipclock' == $uuc_options['cd_style'] ) {
    127210                    $html .= '<div class="cddiv"><div class="clock" style="margin:2em;"></div></div>';
    128                 }
    129                 elseif($uuc_options['cd_style'] == "textclock"){
    130                     if($cddates > time()){
    131                         $htmlpart = '<h3>' . '<script src="' . plugin_dir_url(__FILE__) . 'js/countdown.js" language="JavaScript" type="text/JavaScript"></script>';
     211                } elseif ( 'textclock' == $uuc_options['cd_style'] ) {
     212                    if ( $cddates > time() ) {
     213                        $htmlpart  = '<h3>' . '<script src="' . plugin_dir_url( __FILE__ ) . 'js/countdown.js" language="JavaScript" type="text/JavaScript"></script>';
    132214                        $htmlpart .= ' ' . $uuc_options['cdtext'] . '</h3>';
    133                     }
    134                     else{
    135                         $htmlpart = '<h3>' . '<script src="' . plugin_dir_url(__FILE__) . 'js/countdown.js" language="JavaScript" type="text/JavaScript"></script>';
     215                    } else {
     216                        $htmlpart  = '<h3>' . '<script src="' . plugin_dir_url( __FILE__ ) . 'js/countdown.js" language="JavaScript" type="text/JavaScript"></script>';
    136217                        $htmlpart .= '</h3>';
    137218                    }
     
    140221            }
    141222            $html .= '</div>';
    142             echo $html;
     223            echo wp_kses(
     224                $html,
     225                'post'
     226            );
    143227            ?>
    144             <?php exit;
     228            <?php
     229            exit;
    145230        }
    146231    }
  • ultimate-under-construction/trunk/includes/js/base.js

    r868862 r3065415  
    55*/
    66
    7 var Base = function() {
     7var Base = function () {
    88    // dummy
    99};
    1010
    11 Base.extend = function(_instance, _static) { // subclass
    12    
     11Base.extend = function (_instance, _static) { // subclass
     12
    1313    "use strict";
    14    
     14
    1515    var extend = Base.prototype.extend;
    16    
     16
    1717    // build the prototype
    1818    Base._prototyping = true;
    1919    var proto = new this();
    2020    extend.call(proto, _instance);
    21   proto.base = function() {
    22     // call this method from any other method to invoke that method's ancestor
    23   };
     21    proto.base = function () {
     22        // call this method from any other method to invoke that method's ancestor
     23    };
    2424    delete Base._prototyping;
    25    
     25
    2626    // create the wrapper for the constructor function
    2727    //var constructor = proto.constructor.valueOf(); //-dean
    2828    var constructor = proto.constructor;
    29     var klass = proto.constructor = function() {
     29    var klass = proto.constructor = function () {
    3030        if (!Base._prototyping) {
    3131            if (this._constructing || this.constructor == klass) { // instantiation
     
    3838        }
    3939    };
    40    
     40
    4141    // build the class interface
    4242    klass.ancestor = this;
     
    4646    klass.prototype = proto;
    4747    klass.toString = this.toString;
    48     klass.valueOf = function(type) {
     48    klass.valueOf = function (type) {
    4949        //return (type == "object") ? klass : constructor; //-dean
    5050        return (type == "object") ? klass : constructor.valueOf();
     
    5656};
    5757
    58 Base.prototype = { 
    59     extend: function(source, value) {
     58Base.prototype = {
     59    extend: function (source, value) {
    6060        if (arguments.length > 1) { // extending with a name/value pair
    6161            var ancestor = this[source];
     
    6767                var method = value.valueOf();
    6868                // override
    69                 value = function() {
     69                value = function () {
    7070                    var previous = this.base || Base.prototype.base;
    7171                    this.base = ancestor;
     
    7575                };
    7676                // point to the underlying method
    77                 value.valueOf = function(type) {
     77                value.valueOf = function (type) {
    7878                    return (type == "object") ? value : method;
    7979                };
     
    8787                extend = this.extend || extend;
    8888            }
    89             var proto = {toSource: null};
     89            var proto = { toSource: null };
    9090            // do the "toString" and other methods manually
    9191            var hidden = ["constructor", "toString", "valueOf"];
     
    109109// initialise
    110110Base = Base.extend({
    111     constructor: function() {
     111    constructor: function () {
    112112        this.extend(arguments[0]);
    113113    }
     
    115115    ancestor: Object,
    116116    version: "1.1",
    117    
    118     forEach: function(object, block, context) {
     117
     118    forEach: function (object, block, context) {
    119119        for (var key in object) {
    120120            if (this.prototype[key] === undefined) {
     
    123123        }
    124124    },
    125        
    126     implement: function() {
     125
     126    implement: function () {
    127127        for (var i = 0; i < arguments.length; i++) {
    128128            if (typeof arguments[i] == "function") {
     
    136136        return this;
    137137    },
    138    
    139     toString: function() {
     138
     139    toString: function () {
    140140        return String(this.valueOf());
    141141    }
  • ultimate-under-construction/trunk/includes/js/countdown.js

    r2750860 r3065415  
    2020
    2121function calcage(secs, num1, num2) {
    22   s = ((Math.floor(secs/num1))%num2).toString();
    23   if (LeadingZero && s.length < 2)
    24     s = "0" + s;
    25   return "<b>" + s + "</b>";
     22    s = ((Math.floor(secs / num1)) % num2).toString();
     23    if (LeadingZero && s.length < 2)
     24        s = "0" + s;
     25    return "<b>" + s + "</b>";
    2626}
    2727
    2828function CountBack(secs) {
    29   if (secs < 0) {
    30     document.getElementById("cntdwn").innerHTML = FinishMessage;
    31     return;
    32   }
    33   DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage(secs,86400,100000));
    34   DisplayStr = DisplayStr.replace(/%%H%%/g, calcage(secs,3600,24));
    35   DisplayStr = DisplayStr.replace(/%%M%%/g, calcage(secs,60,60));
    36   DisplayStr = DisplayStr.replace(/%%S%%/g, calcage(secs,1,60));
     29    if (secs < 0) {
     30        document.getElementById("cntdwn").innerHTML = FinishMessage;
     31        return;
     32    }
     33    DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage(secs, 86400, 100000));
     34    DisplayStr = DisplayStr.replace(/%%H%%/g, calcage(secs, 3600, 24));
     35    DisplayStr = DisplayStr.replace(/%%M%%/g, calcage(secs, 60, 60));
     36    DisplayStr = DisplayStr.replace(/%%S%%/g, calcage(secs, 1, 60));
    3737
    38   document.getElementById("cntdwn").innerHTML = DisplayStr;
    39   if (CountActive)
    40     setTimeout("CountBack(" + (secs+CountStepper) + ")", SetTimeOutPeriod);
     38    document.getElementById("cntdwn").innerHTML = DisplayStr;
     39    if (CountActive)
     40        setTimeout("CountBack(" + (secs + CountStepper) + ")", SetTimeOutPeriod);
    4141}
    4242
    4343function putspan() {
    44  document.write("<span id='cntdwn'></span>");
     44    document.write("<span id='cntdwn'></span>");
    4545}
    4646
    47 if (typeof(DisplayFormat)=="undefined")
    48   DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds ";
    49 if (typeof(CountActive)=="undefined")
    50   CountActive = true;
    51 if (typeof(FinishMessage)=="undefined")
    52   FinishMessage = "";
    53 if (typeof(CountStepper)!="number")
    54   CountStepper = -1;
    55 if (typeof(LeadingZero)=="undefined")
    56   LeadingZero = true;
     47if (typeof (DisplayFormat) == "undefined")
     48    DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds ";
     49if (typeof (CountActive) == "undefined")
     50    CountActive = true;
     51if (typeof (FinishMessage) == "undefined")
     52    FinishMessage = "";
     53if (typeof (CountStepper) != "number")
     54    CountStepper = -1;
     55if (typeof (LeadingZero) == "undefined")
     56    LeadingZero = true;
    5757
    5858
    5959CountStepper = Math.ceil(CountStepper);
    6060if (CountStepper == 0)
    61   CountActive = false;
    62 var SetTimeOutPeriod = (Math.abs(CountStepper)-1)*1000 + 990;
     61    CountActive = false;
     62var SetTimeOutPeriod = (Math.abs(CountStepper) - 1) * 1000 + 990;
    6363putspan();
    6464var dthen = new Date(TargetDate);
    6565var dnow = new Date();
    6666var utcdnow = new Date(dnow.getTime() + dnow.getTimezoneOffset() * 60000);
    67 if(CountStepper>0)
    68   ddiff = new Date(utcdnow-dthen);
     67if (CountStepper > 0)
     68    ddiff = new Date(utcdnow - dthen);
    6969else
    70   ddiff = new Date(dthen-utcdnow);
    71 gsecs = Math.floor(ddiff.valueOf()/1000);
     70    ddiff = new Date(dthen - utcdnow);
     71gsecs = Math.floor(ddiff.valueOf() / 1000);
    7272CountBack(gsecs);
  • ultimate-under-construction/trunk/includes/js/dailycounter.js

    r868862 r3065415  
    1 (function($) {
     1(function ($) {
    22
    33    /**
     
    2424         */
    2525
    26         constructor: function(factory, options) {
     26        constructor: function (factory, options) {
    2727            this.base(factory, options);
    2828        },
     
    3232         */
    3333
    34         build: function(excludeHours, time) {
    35             var t        = this;
     34        build: function (excludeHours, time) {
     35            var t = this;
    3636            var children = this.factory.$wrapper.find('ul');
    37             var lists    = [];
    38             var offset   = 0;
     37            var lists = [];
     38            var offset = 0;
    3939
    40             time     = time ? time : this.factory.time.getDayCounter(this.showSeconds);
     40            time = time ? time : this.factory.time.getDayCounter(this.showSeconds);
    4141
    42             if(time.length > children.length) {
    43                 $.each(time, function(i, digit) {
     42            if (time.length > children.length) {
     43                $.each(time, function (i, digit) {
    4444                    lists.push(t.createList(digit));
    4545                });
     
    4848            this.factory.lists = lists;
    4949
    50             if(this.showSeconds) {
     50            if (this.showSeconds) {
    5151                $(this.createDivider('Seconds')).insertBefore(this.factory.lists[this.factory.lists.length - 2].$obj);
    5252            }
    53             else
    54             {
     53            else {
    5554                offset = 2;
    5655            }
     
    6261            this._clearExcessDigits();
    6362
    64             if(this.autoStart) {
     63            if (this.autoStart) {
    6564                this.start();
    6665            }
     
    7170         */
    7271
    73         flip: function(doNotAddPlayClass, time) {
    74             if(!time) {
     72        flip: function (doNotAddPlayClass, time) {
     73            if (!time) {
    7574                time = this.factory.time.getDayCounter(this.showSeconds);
    7675            }
     
    8281         */
    8382
    84         _clearExcessDigits: function() {
     83        _clearExcessDigits: function () {
    8584            var tenSeconds = this.factory.lists[this.factory.lists.length - 2];
    8685            var tenMinutes = this.factory.lists[this.factory.lists.length - 4];
    8786
    88             for(var x = 6; x < 10; x++) {
     87            for (var x = 6; x < 10; x++) {
    8988                tenSeconds.$obj.find('li:last-child').remove();
    9089                tenMinutes.$obj.find('li:last-child').remove();
  • ultimate-under-construction/trunk/includes/js/flipclock.js

    r868862 r3065415  
    22
    33var FlipClock;
    4    
     4
    55/**
    66 * FlipClock.js
     
    1010 * @licesnse   http://www.opensource.org/licenses/mit-license.php
    1111 */
    12    
    13 (function($) {
    14    
     12
     13(function ($) {
     14
    1515    "use strict";
    16    
     16
    1717    /**
    1818     * FlipFlock Helper
     
    2222     * @param  object  An object of properties to override the default 
    2323     */
    24      
    25     FlipClock = function(obj, digit, options) {
     24
     25    FlipClock = function (obj, digit, options) {
    2626        return new FlipClock.Factory(obj, digit, options);
    2727    };
     
    3232
    3333    FlipClock.Lang = {};
    34    
     34
    3535    /**
    3636     * The Base FlipClock class is used to extend all other FlipFlock
     
    4242
    4343    FlipClock.Base = Base.extend({
    44        
     44
    4545        /**
    4646         * Build Date
    4747         */
    48          
     48
    4949        buildDate: '2013-11-07',
    50        
     50
    5151        /**
    5252         * Version
    5353         */
    54          
     54
    5555        version: '0.3.1',
    56        
     56
    5757        /**
    5858         * Sets the default options
     
    6161         * @param   object  The override options
    6262         */
    63          
    64         constructor: function(_default, options) {
    65             if(typeof _default !== "object") {
     63
     64        constructor: function (_default, options) {
     65            if (typeof _default !== "object") {
    6666                _default = {};
    6767            }
    68             if(typeof options !== "object") {
     68            if (typeof options !== "object") {
    6969                options = {};
    7070            }
    7171            this.setOptions($.extend(true, {}, _default, options));
    7272        },
    73        
     73
    7474        /**
    7575         * Delegates the callback to the defined method
     
    7878         * @param   object  The override options
    7979         */
    80          
    81         callback: function(method) {
    82             if(typeof method === "function") {
     80
     81        callback: function (method) {
     82            if (typeof method === "function") {
    8383                var args = [];
    84                                
    85                 for(var x = 1; x <= arguments.length; x++) {
    86                     if(arguments[x]) {
     84
     85                for (var x = 1; x <= arguments.length; x++) {
     86                    if (arguments[x]) {
    8787                        args.push(arguments[x]);
    8888                    }
    8989                }
    90                
     90
    9191                method.apply(this, args);
    9292            }
    9393        },
    94          
     94
    9595        /**
    9696         * Log a string into the console if it exists
     
    9898         * @param   string  The name of the option
    9999         * @return  mixed
    100          */     
    101          
    102         log: function(str) {
    103             if(window.console && console.log) {
     100         */
     101
     102        log: function (str) {
     103            if (window.console && console.log) {
    104104                console.log(str);
    105105            }
    106106        },
    107          
     107
    108108        /**
    109109         * Get an single option value. Returns false if option does not exist
     
    111111         * @param   string  The name of the option
    112112         * @return  mixed
    113          */     
    114          
    115         getOption: function(index) {
    116             if(this[index]) {
     113         */
     114
     115        getOption: function (index) {
     116            if (this[index]) {
    117117                return this[index];
    118118            }
    119119            return false;
    120120        },
    121        
     121
    122122        /**
    123123         * Get all options
    124124         *
    125125         * @return  bool
    126          */     
    127          
    128         getOptions: function() {
     126         */
     127
     128        getOptions: function () {
    129129            return this;
    130130        },
    131        
     131
    132132        /**
    133133         * Set a single option value
     
    135135         * @param   string  The name of the option
    136136         * @param   mixed   The value of the option
    137          */     
    138          
    139         setOption: function(index, value) {
     137         */
     138
     139        setOption: function (index, value) {
    140140            this[index] = value;
    141141        },
    142        
     142
    143143        /**
    144144         * Set a multiple options by passing a JSON object
     
    146146         * @param   object  The object with the options
    147147         * @param   mixed   The value of the option
    148          */     
    149        
    150         setOptions: function(options) {
    151             for(var key in options) {
    152                 if(typeof options[key] !== "undefined") {
    153                     this.setOption(key, options[key]);
    154                 }
    155             }
     148         */
     149
     150        setOptions: function (options) {
     151            for (var key in options) {
     152                if (typeof options[key] !== "undefined") {
     153                    this.setOption(key, options[key]);
     154                }
     155            }
    156156        }
    157        
     157
    158158    });
    159    
     159
    160160    /**
    161161     * The FlipClock Factory class is used to build the clock and manage
     
    163163     *
    164164     * @param   object  A jQuery object or CSS selector used to fetch
    165                         the wrapping DOM nodes
     165                            the wrapping DOM nodes
    166166     * @param   mixed   This is the digit used to set the clock. If an
    167                         object is passed, 0 will be used.   
     167                            object is passed, 0 will be used.   
    168168     * @param   object  An object of properties to override the default
    169169     */
    170        
     170
    171171    FlipClock.Factory = FlipClock.Base.extend({
    172        
     172
    173173        /**
    174174         * Auto start the clock on page load (True|False)
    175          */ 
    176          
     175         */
     176
    177177        autoStart: true,
    178        
     178
    179179        /**
    180180         * The callback methods
    181          */     
    182          
     181         */
     182
    183183        callbacks: {
    184184            destroy: false,
     
    190190            reset: false
    191191        },
    192        
     192
    193193        /**
    194194         * The CSS classes
    195          */     
    196          
     195         */
     196
    197197        classes: {
    198198            active: 'flip-clock-active',
     
    205205            wrapper: 'flip-clock-wrapper'
    206206        },
    207        
     207
    208208        /**
    209209         * The name of the clock face class in use
    210          */ 
    211          
     210         */
     211
    212212        clockFace: 'HourlyCounter',
    213          
     213
    214214        /**
    215215         * The name of the default clock face class to use if the defined
    216216         * clockFace variable is not a valid FlipClock.Face object
    217          */ 
    218          
     217         */
     218
    219219        defaultClockFace: 'HourlyCounter',
    220          
     220
    221221        /**
    222222         * The default language
    223          */ 
    224          
     223         */
     224
    225225        defaultLanguage: 'english',
    226          
     226
    227227        /**
    228228         * The language being used to display labels (string)
    229          */ 
    230          
     229         */
     230
    231231        language: 'english',
    232          
     232
    233233        /**
    234234         * The language object after it has been loaded
    235          */ 
    236          
     235         */
     236
    237237        lang: false,
    238          
     238
    239239        /**
    240240         * The FlipClock.Face object
    241          */ 
    242          
     241         */
     242
    243243        face: true,
    244          
     244
    245245        /**
    246246         * Is the clock running? (True|False)
    247          */     
    248          
     247         */
     248
    249249        running: false,
    250        
     250
    251251        /**
    252252         * The FlipClock.Time object
    253          */     
    254          
     253         */
     254
    255255        time: false,
    256        
     256
    257257        /**
    258258         * The FlipClock.Timer object
    259          */     
    260          
     259         */
     260
    261261        timer: false,
    262        
     262
    263263        /**
    264264         * An array of FlipClock.List objects
    265          */     
    266          
     265         */
     266
    267267        lists: [],
    268        
     268
    269269        /**
    270270         * The wrapping jQuery object
    271          */     
    272          
     271         */
     272
    273273        $wrapper: false,
    274        
     274
    275275        /**
    276276         * Constructor
     
    280280         * @param   object  An object override options
    281281         */
    282          
    283         constructor: function(obj, digit, options) {
    284            
    285             this.lists    = [];
    286             this.running  = false;
    287             this.base(options);     
     282
     283        constructor: function (obj, digit, options) {
     284
     285            this.lists = [];
     286            this.running = false;
     287            this.base(options);
    288288            this.$wrapper = $(obj).addClass(this.classes.wrapper);
    289             this.time     = new FlipClock.Time(this, digit ? Math.round(digit) : 0);
    290             this.timer    = new FlipClock.Timer(this, options);
    291 
    292             this.lang     = this.loadLanguage(this.language);
    293             this.face     = this.loadClockFace(this.clockFace, options);
    294 
    295             if(this.autoStart) {
     289            this.time = new FlipClock.Time(this, digit ? Math.round(digit) : 0);
     290            this.timer = new FlipClock.Timer(this, options);
     291
     292            this.lang = this.loadLanguage(this.language);
     293            this.face = this.loadClockFace(this.clockFace, options);
     294
     295            if (this.autoStart) {
    296296                this.start();
    297297            }
    298298        },
    299        
     299
    300300        /**
    301301         * Load the FlipClock.Face object
     
    304304         * @param   object  An object override options
    305305         */
    306          
    307         loadClockFace: function(name, options) {   
     306
     307        loadClockFace: function (name, options) {
    308308            var face, suffix = 'Face';
    309            
    310             name = name.ucfirst()+suffix;
    311            
    312             if(FlipClock[name]) {
     309
     310            name = name.ucfirst() + suffix;
     311
     312            if (FlipClock[name]) {
    313313                face = new FlipClock[name](this, options);
    314314            }
    315315            else {
    316                 face = new FlipClock[this.defaultClockFace+suffix](this, options);
    317             }
    318            
     316                face = new FlipClock[this.defaultClockFace + suffix](this, options);
     317            }
     318
    319319            face.build();
    320                
     320
    321321            return face;
    322322        },
    323            
    324        
     323
     324
    325325        /**
    326326         * Load the FlipClock.Lang object
     
    328328         * @param   object  The name of the language to load
    329329         */
    330          
    331         loadLanguage: function(name) { 
     330
     331        loadLanguage: function (name) {
    332332            var lang;
    333            
    334             if(FlipClock.Lang[name.ucfirst()]) {
     333
     334            if (FlipClock.Lang[name.ucfirst()]) {
    335335                lang = FlipClock.Lang[name.ucfirst()];
    336336            }
    337             else if(FlipClock.Lang[name]) {
     337            else if (FlipClock.Lang[name]) {
    338338                lang = FlipClock.Lang[name];
    339339            }
     
    341341                lang = FlipClock.Lang[this.defaultLanguage];
    342342            }
    343            
     343
    344344            return lang;
    345345        },
    346                    
     346
    347347        /**
    348348         * Localize strings into various languages
     
    352352         */
    353353
    354         localize: function(index, obj) {
     354        localize: function (index, obj) {
    355355            var lang = this.lang;
    356356
    357             if(!index) {
     357            if (!index) {
    358358                return null;
    359359            }
     
    361361            var lindex = index.toLowerCase();
    362362
    363             if(typeof obj == "object") {
     363            if (typeof obj == "object") {
    364364                lang = obj;
    365365            }
    366366
    367             if(lang && lang[lindex]) {
     367            if (lang && lang[lindex]) {
    368368                return lang[lindex];
    369369            }
     
    371371            return index;
    372372        },
    373          
     373
    374374
    375375        /**
    376376         * Starts the clock
    377377         */
    378          
    379         start: function(callback) {
     378
     379        start: function (callback) {
    380380            var t = this;
    381381
    382             if(!t.running && (!t.countdown || t.countdown && t.time.time > 0)) {
     382            if (!t.running && (!t.countdown || t.countdown && t.time.time > 0)) {
    383383                t.face.start(t.time);
    384                 t.timer.start(function() {
     384                t.timer.start(function () {
    385385                    t.flip();
    386                    
    387                     if(typeof callback === "function") {
     386
     387                    if (typeof callback === "function") {
    388388                        callback();
    389                     }   
     389                    }
    390390                });
    391391            }
     
    394394            }
    395395        },
    396        
     396
    397397        /**
    398398         * Stops the clock
    399399         */
    400          
    401         stop: function(callback) {
     400
     401        stop: function (callback) {
    402402            this.face.stop();
    403403            this.timer.stop(callback);
    404            
    405             for(var x in this.lists) {
     404
     405            for (var x in this.lists) {
    406406                this.lists[x].stop();
    407             }   
    408         },
    409        
     407            }
     408        },
     409
    410410        /**
    411411         * Reset the clock
    412412         */
    413          
    414         reset: function(callback) {
     413
     414        reset: function (callback) {
    415415            this.timer.reset(callback);
    416416            this.face.reset();
    417417        },
    418        
     418
    419419        /**
    420420         * Sets the clock time
    421421         */
    422          
    423         setTime: function(time) {
     422
     423        setTime: function (time) {
    424424            this.time.time = time;
    425             this.face.setTime(time);       
    426         },
    427        
     425            this.face.setTime(time);
     426        },
     427
    428428        /**
    429429         * Get the clock time
     
    431431         * @return  object  Returns a FlipClock.Time object
    432432         */
    433          
    434         getTime: function(time) {
    435             return this.time;       
    436         },
    437        
     433
     434        getTime: function (time) {
     435            return this.time;
     436        },
     437
    438438        /**
    439439         * Changes the increment of time to up or down (add/sub)
    440440         */
    441          
    442         setCountdown: function(value) {
     441
     442        setCountdown: function (value) {
    443443            var running = this.running;
    444            
     444
    445445            this.countdown = value ? true : false;
    446                
    447             if(running) {
     446
     447            if (running) {
    448448                this.stop();
    449449                this.start();
    450450            }
    451451        },
    452        
     452
    453453        /**
    454454         * Flip the digits on the clock
     
    456456         * @param  array  An array of digits     
    457457         */
    458         flip: function() {
     458        flip: function () {
    459459            this.face.flip();
    460460        }
    461        
     461
    462462    });
    463    
     463
    464464    /**
    465465     * The FlipClock Face class is the base class in which to extend
     
    469469     * @param   object  An object of properties to override the default
    470470     */
    471      
     471
    472472    FlipClock.Face = FlipClock.Base.extend({
    473        
     473
    474474        /**
    475475         * An array of jQuery objects used for the dividers (the colons)
    476476         */
    477          
     477
    478478        dividers: [],
    479479
    480480        /**
    481481         * An array of FlipClock.List objects
    482          */     
    483          
     482         */
     483
    484484        factory: false,
    485        
     485
    486486        /**
    487487         * An array of FlipClock.List objects
    488          */     
    489          
     488         */
     489
    490490        lists: [],
    491            
     491
    492492        /**
    493493         * Constructor
     
    496496         * @param   object  An object of properties to override the default
    497497         */
    498          
    499         constructor: function(factory, options) {
     498
     499        constructor: function (factory, options) {
    500500            this.base(options);
    501             this.factory  = factory;
     501            this.factory = factory;
    502502            this.dividers = [];
    503503        },
    504        
     504
    505505        /**
    506506         * Build the clock face
    507507         */
    508          
    509         build: function() {},
    510        
     508
     509        build: function () { },
     510
    511511        /**
    512512         * Creates a jQuery object used for the digit divider
     
    516516         *                  If not set, is false.
    517517         */
    518          
    519         createDivider: function(label, css, excludeDots) {
    520        
    521             if(typeof css == "boolean" || !css) {
     518
     519        createDivider: function (label, css, excludeDots) {
     520
     521            if (typeof css == "boolean" || !css) {
    522522                excludeDots = css;
    523523                css = label;
     
    525525
    526526            var dots = [
    527                 '<span class="'+this.factory.classes.dot+' top"></span>',
    528                 '<span class="'+this.factory.classes.dot+' bottom"></span>'
     527                '<span class="' + this.factory.classes.dot + ' top"></span>',
     528                '<span class="' + this.factory.classes.dot + ' bottom"></span>'
    529529            ].join('');
    530530
    531             if(excludeDots) {
    532                 dots = ''; 
     531            if (excludeDots) {
     532                dots = '';
    533533            }
    534534
     
    536536
    537537            var html = [
    538                 '<span class="'+this.factory.classes.divider+' '+(css ? css : '').toLowerCase()+'">',
    539                     '<span class="'+this.factory.classes.label+'">'+(label ? label : '')+'</span>',
    540                     dots,
     538                '<span class="' + this.factory.classes.divider + ' ' + (css ? css : '').toLowerCase() + '">',
     539                '<span class="' + this.factory.classes.label + '">' + (label ? label : '') + '</span>',
     540                dots,
    541541                '</span>'
    542             ]; 
    543            
     542            ];
     543
    544544            return $(html.join(''));
    545545        },
    546        
     546
    547547        /**
    548548         * Creates a FlipClock.List object and appends it to the DOM
     
    551551         * @param   object  An object to override the default properties
    552552         */
    553          
    554         createList: function(digit, options) {
    555             if(typeof digit === "object") {
     553
     554        createList: function (digit, options) {
     555            if (typeof digit === "object") {
    556556                options = digit;
    557557                digit = 0;
    558558            }
    559            
     559
    560560            var obj = new FlipClock.List(this.factory, digit, options);
    561561
    562562            //this.factory.$wrapper.append(obj.$obj);   
    563            
     563
    564564            return obj;
    565565        },
    566        
     566
    567567        /**
    568568         * Triggers when the clock is reset
    569569         */
    570          
    571         reset: function() {},
    572        
     570
     571        reset: function () { },
     572
    573573        /**
    574574         * Sets the clock time
    575575         */
    576          
    577         setTime: function(time) {
    578             this.flip(time);       
    579         },
    580        
     576
     577        setTime: function (time) {
     578            this.flip(time);
     579        },
     580
    581581        /**
    582582         * Sets the clock time
    583583         */
    584          
    585         addDigit: function(digit) {
     584
     585        addDigit: function (digit) {
    586586            var obj = this.createList(digit, {
    587587                classes: {
     
    591591                }
    592592            });
    593            
     593
    594594            obj.$obj.insertBefore(this.factory.lists[0].$obj);
    595                            
     595
    596596            this.factory.lists.unshift(obj);
    597597        },
    598        
     598
    599599        /**
    600600         * Triggers when the clock is started
    601601         */
    602          
    603         start: function() {},
    604        
     602
     603        start: function () { },
     604
    605605        /**
    606606         * Triggers when the time on the clock stops
    607607         */
    608          
    609         stop: function() {},
    610            
     608
     609        stop: function () { },
     610
    611611        /**
    612612         * Triggers when the numbers on the clock flip
    613613         */
    614          
    615         flip: function(time, doNotAddPlayClass) {
     614
     615        flip: function (time, doNotAddPlayClass) {
    616616            var t = this;
    617            
    618             if(!doNotAddPlayClass) {
    619                 if(!t.factory.countdown) {
     617
     618            if (!doNotAddPlayClass) {
     619                if (!t.factory.countdown) {
    620620                    t.factory.time.time++;
    621621                }
    622622                else {
    623                     if(t.factory.time.time <= 0) {
     623                    if (t.factory.time.time <= 0) {
    624624                        t.factory.stop();
    625625                    }
    626                    
    627                     t.factory.time.time--; 
    628                 }
    629             }
    630            
     626
     627                    t.factory.time.time--;
     628                }
     629            }
     630
    631631            var offset = t.factory.lists.length - time.length;
    632            
    633             if(offset < 0) {
     632
     633            if (offset < 0) {
    634634                offset = 0;
    635             }           
    636            
     635            }
     636
    637637            var totalNew = 0;
    638638            var reFlip = false;
    639639
    640             $.each(time, function(i, digit) {
     640            $.each(time, function (i, digit) {
    641641                i += offset;
    642                
     642
    643643                var list = t.factory.lists[i];
    644                    
    645                 if(list) {
     644
     645                if (list) {
    646646                    var currentDigit = list.digit;
    647            
     647
    648648                    list.select(digit);
    649                    
    650                     if(digit != currentDigit && !doNotAddPlayClass) {
    651                         list.play();   
     649
     650                    if (digit != currentDigit && !doNotAddPlayClass) {
     651                        list.play();
    652652                    }
    653                 }   
     653                }
    654654                else {
    655655                    t.addDigit(digit);
     
    658658            });
    659659
    660             for(var x = 0; x < time.length; x++) {
    661                 if(x >= offset && t.factory.lists[x].digit != time[x]) {
     660            for (var x = 0; x < time.length; x++) {
     661                if (x >= offset && t.factory.lists[x].digit != time[x]) {
    662662                    t.factory.lists[x].select(time[x]);
    663663                }
    664664            }
    665665        }
    666                    
     666
    667667    });
    668        
     668
    669669    /**
    670670     * The FlipClock List class is used to build the list used to create
     
    677677     * @param   object  An object of properties to override the default
    678678     */
    679        
     679
    680680    FlipClock.List = FlipClock.Base.extend({
    681        
     681
    682682        /**
    683683         * The digit (0-9)
    684          */     
    685          
     684         */
     685
    686686        digit: 0,
    687        
     687
    688688        /**
    689689         * The CSS classes
    690          */     
    691          
     690         */
     691
    692692        classes: {
    693693            active: 'flip-clock-active',
    694694            before: 'flip-clock-before',
    695             flip: 'flip'   
    696         },
    697                
     695            flip: 'flip'
     696        },
     697
    698698        /**
    699699         * The parent FlipClock.Factory object
    700          */     
    701          
     700         */
     701
    702702        factory: false,
    703        
     703
    704704        /**
    705705         * The wrapping jQuery object
    706          */     
    707          
     706         */
     707
    708708        $obj: false,
    709        
     709
    710710        /**
    711711         * The items in the list
    712          */     
    713          
     712         */
     713
    714714        items: [],
    715                  
     715
    716716        /**
    717717         * Constructor
     
    721721         * @param  object  An object to override the default properties 
    722722         */
    723          
    724         constructor: function(factory, digit, options) {
     723
     724        constructor: function (factory, digit, options) {
    725725            this.factory = factory;
    726             this.digit   = digit;
    727             this.$obj    = this.createList();
    728            
    729             if(digit > 0) {
     726            this.digit = digit;
     727            this.$obj = this.createList();
     728
     729            if (digit > 0) {
    730730                this.select(digit);
    731731            }
    732            
     732
    733733            this.factory.$wrapper.append(this.$obj);
    734734        },
    735        
     735
    736736        /**
    737737         * Select the digit in the list
     
    739739         * @param  int  A digit 0-9 
    740740         */
    741          
    742         select: function(digit) {
    743             if(typeof digit === "undefined") {
     741
     742        select: function (digit) {
     743            if (typeof digit === "undefined") {
    744744                digit = this.digit;
    745745            }
     
    748748            }
    749749
    750             var target = this.$obj.find('[data-digit="'+digit+'"]');
    751             var active = this.$obj.find('.'+this.classes.active).removeClass(this.classes.active);
    752             var before = this.$obj.find('.'+this.classes.before).removeClass(this.classes.before);
    753            
    754             if(!this.factory.countdown) {
    755                 if(target.is(':first-child')) {
     750            var target = this.$obj.find('[data-digit="' + digit + '"]');
     751            var active = this.$obj.find('.' + this.classes.active).removeClass(this.classes.active);
     752            var before = this.$obj.find('.' + this.classes.before).removeClass(this.classes.before);
     753
     754            if (!this.factory.countdown) {
     755                if (target.is(':first-child')) {
    756756                    this.$obj.find(':last-child').addClass(this.classes.before);
    757757                }
     
    761761            }
    762762            else {
    763                 if(target.is(':last-child')) {
     763                if (target.is(':last-child')) {
    764764                    this.$obj.find(':first-child').addClass(this.classes.before);
    765765                }
     
    768768                }
    769769            }
    770            
    771             target.addClass(this.classes.active);           
    772         },
    773        
     770
     771            target.addClass(this.classes.active);
     772        },
     773
    774774        /**
    775775         * Adds the play class to the DOM object
    776776         */
    777                
    778         play: function() {
     777
     778        play: function () {
    779779            this.$obj.addClass(this.factory.classes.play);
    780780        },
    781        
     781
    782782        /**
    783783         * Removes the play class to the DOM object
    784784         */
    785          
    786         stop: function() {
     785
     786        stop: function () {
    787787            var t = this;
    788            
    789             setTimeout(function() {
     788
     789            setTimeout(function () {
    790790                t.$obj.removeClass(t.factory.classes.play);
    791791            }, this.factory.timer.interval);
    792792        },
    793        
     793
    794794        /**
    795795         * Create the list of digits and appends it to the DOM object
    796796         */
    797          
    798         createList: function() {
    799        
    800             var html = $('<ul class="'+this.classes.flip+' '+(this.factory.running ? this.factory.classes.play : '')+'" />');
    801            
    802             for(var x = 0; x < 10; x++) {
     797
     798        createList: function () {
     799
     800            var html = $('<ul class="' + this.classes.flip + ' ' + (this.factory.running ? this.factory.classes.play : '') + '" />');
     801
     802            for (var x = 0; x < 10; x++) {
    803803                var item = $([
    804                 '<li data-digit="'+x+'">',
     804                    '<li data-digit="' + x + '">',
    805805                    '<a href="#">',
    806                         '<div class="up">',
    807                             '<div class="shadow"></div>',
    808                             '<div class="inn">'+x+'</div>',
    809                         '</div>',
    810                         '<div class="down">',
    811                             '<div class="shadow"></div>',
    812                             '<div class="inn">'+x+'</div>',
    813                         '</div>',
     806                    '<div class="up">',
     807                    '<div class="shadow"></div>',
     808                    '<div class="inn">' + x + '</div>',
     809                    '</div>',
     810                    '<div class="down">',
     811                    '<div class="shadow"></div>',
     812                    '<div class="inn">' + x + '</div>',
     813                    '</div>',
    814814                    '</a>',
    815                 '</li>'].join(''));
    816                
     815                    '</li>'].join(''));
     816
    817817                this.items.push(item);
    818                
     818
    819819                html.append(item);
    820820            }
    821                        
     821
    822822            return html;
    823823        }
    824824    });
    825        
     825
    826826    /**
    827827     * The FlipClock Time class is used to manage all the time
     
    833833     * @param   object  An object of properties to override the default
    834834     */
    835        
     835
    836836    FlipClock.Time = FlipClock.Base.extend({
    837        
     837
    838838        /**
    839839         * The time (in seconds)
    840          */     
    841          
     840         */
     841
    842842        minimumDigits: 0,
    843        
     843
    844844        /**
    845845         * The time (in seconds)
    846          */     
    847          
     846         */
     847
    848848        time: 0,
    849        
     849
    850850        /**
    851851         * The parent FlipClock.Factory object
    852          */     
    853          
     852         */
     853
    854854        factory: false,
    855        
     855
    856856        /**
    857857         * Constructor
     
    861861         * @param  object  An object to override the default properties 
    862862         */
    863          
    864         constructor: function(factory, time, options) {
     863
     864        constructor: function (factory, time, options) {
    865865            this.base(options);
    866866            this.factory = factory;
    867867
    868             if(time) {
     868            if (time) {
    869869                this.time = time;
    870870            }
    871871        },
    872        
     872
    873873        /**
    874874         * Convert a string or integer to an array of digits
     
    877877         * @return  array  An array of digits
    878878         */
    879          
    880         convertDigitsToArray: function(str) {
     879
     880        convertDigitsToArray: function (str) {
    881881            var data = [];
    882            
     882
    883883            str = str.toString();
    884            
    885             for(var x = 0;x < str.length; x++) {
    886                 if(str[x].match(/^\d*$/g)) {
    887                     data.push(str[x]); 
    888                 }
    889             }
    890            
     884
     885            for (var x = 0; x < str.length; x++) {
     886                if (str[x].match(/^\d*$/g)) {
     887                    data.push(str[x]);
     888                }
     889            }
     890
    891891            return data;
    892892        },
    893        
     893
    894894        /**
    895895         * Get a specific digit from the time integer
     
    899899         *                 the method returns the defined digit 
    900900         */
    901          
    902         digit: function(i) {
     901
     902        digit: function (i) {
    903903            var timeStr = this.toString();
    904             var length  = timeStr.length;
    905            
    906             if(timeStr[length - i]) {
     904            var length = timeStr.length;
     905
     906            if (timeStr[length - i]) {
    907907                return timeStr[length - i];
    908908            }
    909            
     909
    910910            return false;
    911911        },
     
    917917         * @return  array  An array of digits
    918918         */
    919          
    920         digitize: function(obj) {
     919
     920        digitize: function (obj) {
    921921            var data = [];
    922            
    923             $.each(obj, function(i, value) {
     922
     923            $.each(obj, function (i, value) {
    924924                value = value.toString();
    925                
    926                 if(value.length == 1) {
    927                     value = '0'+value;
    928                 }
    929                
    930                 for(var x = 0; x < value.length; x++) {
     925
     926                if (value.length == 1) {
     927                    value = '0' + value;
     928                }
     929
     930                for (var x = 0; x < value.length; x++) {
    931931                    data.push(value.charAt(x));
    932                 }               
     932                }
    933933            });
    934            
    935             if(data.length > this.minimumDigits) {
     934
     935            if (data.length > this.minimumDigits) {
    936936                this.minimumDigits = data.length;
    937937            }
    938            
    939             if(this.minimumDigits > data.length) {
     938
     939            if (this.minimumDigits > data.length) {
    940940                data.unshift('0');
    941941            }
    942            
     942
    943943            return data;
    944944        },
    945        
     945
    946946        /**
    947947         * Gets a daily breakdown
     
    950950         */
    951951
    952         getDayCounter: function(includeSeconds) {
     952        getDayCounter: function (includeSeconds) {
    953953            var digits = [
    954954                this.getDays(),
     
    957957            ];
    958958
    959             if(includeSeconds) {
     959            if (includeSeconds) {
    960960                digits.push(this.getSeconds(true));
    961961            }
     
    970970         * @return  int   Retuns a floored integer
    971971         */
    972          
    973         getDays: function(mod) {
     972
     973        getDays: function (mod) {
    974974            var days = this.time / 60 / 60 / 24;
    975            
    976             if(mod) {
     975
     976            if (mod) {
    977977                days = days % 7;
    978978            }
    979            
     979
    980980            return Math.floor(days);
    981981        },
    982        
     982
    983983        /**
    984984         * Gets an hourly breakdown
     
    986986         * @return  object  Returns a digitized object
    987987         */
    988          
    989         getHourCounter: function() {
     988
     989        getHourCounter: function () {
    990990            var obj = this.digitize([
    991991                this.getHours(),
     
    993993                this.getSeconds(true)
    994994            ]);
    995            
     995
    996996            return obj;
    997997        },
    998        
     998
    999999        /**
    10001000         * Gets an hourly breakdown
     
    10021002         * @return  object  Returns a digitized object
    10031003         */
    1004          
    1005         getHourly: function() {
     1004
     1005        getHourly: function () {
    10061006            return this.getHourCounter();
    10071007        },
    1008        
     1008
    10091009        /**
    10101010         * Gets number of hours
     
    10131013         * @return  int   Retuns a floored integer
    10141014         */
    1015          
    1016         getHours: function(mod) {
     1015
     1016        getHours: function (mod) {
    10171017            var hours = this.time / 60 / 60;
    1018            
    1019             if(mod) {
    1020                 hours = hours % 24; 
    1021             }
    1022            
     1018
     1019            if (mod) {
     1020                hours = hours % 24;
     1021            }
     1022
    10231023            return Math.floor(hours);
    10241024        },
    1025        
     1025
    10261026        /**
    10271027         * Gets the twenty-four hour time
     
    10291029         * @return  object  returns a digitized object
    10301030         */
    1031          
    1032         getMilitaryTime: function() {
    1033             var date = new Date(); 
    1034             var obj  = this.digitize([
     1031
     1032        getMilitaryTime: function () {
     1033            var date = new Date();
     1034            var obj = this.digitize([
    10351035                date.getHours(),
    10361036                date.getMinutes(),
    1037                 date.getSeconds()               
     1037                date.getSeconds()
    10381038            ]);
    10391039
    10401040            return obj;
    10411041        },
    1042                
     1042
    10431043        /**
    10441044         * Gets number of minutes
     
    10471047         * @return  int   Retuns a floored integer
    10481048         */
    1049          
    1050         getMinutes: function(mod) {
     1049
     1050        getMinutes: function (mod) {
    10511051            var minutes = this.time / 60;
    1052            
    1053             if(mod) {
     1052
     1053            if (mod) {
    10541054                minutes = minutes % 60;
    10551055            }
    1056            
     1056
    10571057            return Math.floor(minutes);
    10581058        },
    1059        
     1059
    10601060        /**
    10611061         * Gets a minute breakdown
    10621062         */
    1063          
    1064         getMinuteCounter: function() {
     1063
     1064        getMinuteCounter: function () {
    10651065            var obj = this.digitize([
    10661066                this.getMinutes(),
     
    10701070            return obj;
    10711071        },
    1072        
     1072
    10731073        /**
    10741074         * Gets number of seconds
     
    10771077         * @return  int   Retuns a ceiled integer
    10781078         */
    1079          
    1080         getSeconds: function(mod) {
     1079
     1080        getSeconds: function (mod) {
    10811081            var seconds = this.time;
    1082            
    1083             if(mod) {
    1084                 if(seconds == 60) {
     1082
     1083            if (mod) {
     1084                if (seconds == 60) {
    10851085                    seconds = 0;
    10861086                }
     
    10891089                }
    10901090            }
    1091            
     1091
    10921092            return Math.ceil(seconds);
    10931093        },
    1094        
     1094
    10951095        /**
    10961096         * Gets the current twelve hour time
     
    10981098         * @return  object  Returns a digitized object
    10991099         */
    1100          
    1101         getTime: function() {
    1102             var date  = new Date();
     1100
     1101        getTime: function () {
     1102            var date = new Date();
    11031103            var hours = date.getHours();
    11041104            var merid = hours > 12 ? 'PM' : 'AM';
    1105             var obj   = this.digitize([
     1105            var obj = this.digitize([
    11061106                hours > 12 ? hours - 12 : (hours === 0 ? 12 : hours),
    11071107                date.getMinutes(),
    1108                 date.getSeconds()               
     1108                date.getSeconds()
    11091109            ]);
    11101110
    11111111            return obj;
    11121112        },
    1113        
     1113
    11141114        /**
    11151115         * Gets number of weeks
     
    11181118         * @return  int   Retuns a floored integer
    11191119         */
    1120          
    1121         getWeeks: function() {
     1120
     1121        getWeeks: function () {
    11221122            var weeks = this.time / 60 / 60 / 24 / 7;
    1123            
    1124             if(mod) {
     1123
     1124            if (mod) {
    11251125                weeks = weeks % 52;
    11261126            }
    1127            
     1127
    11281128            return Math.floor(weeks);
    11291129        },
    1130        
     1130
    11311131        /**
    11321132         * Removes a specific number of leading zeros from the array.
     
    11371137         * @return  array  An array of digits
    11381138         */
    1139          
    1140         removeLeadingZeros: function(totalDigits, digits) {
    1141             var total    = 0;
     1139
     1140        removeLeadingZeros: function (totalDigits, digits) {
     1141            var total = 0;
    11421142            var newArray = [];
    1143            
    1144             $.each(digits, function(i, digit) {
    1145                 if(i < totalDigits) {
     1143
     1144            $.each(digits, function (i, digit) {
     1145                if (i < totalDigits) {
    11461146                    total += parseInt(digits[i], 10);
    11471147                }
     
    11501150                }
    11511151            });
    1152            
    1153             if(total === 0) {
     1152
     1153            if (total === 0) {
    11541154                return newArray;
    11551155            }
    1156            
     1156
    11571157            return digits;
    11581158        },
    1159        
     1159
    11601160        /**
    11611161         * Converts the object to a human readable string
    11621162         */
    1163          
    1164         toString: function() {
     1163
     1164        toString: function () {
    11651165            return this.time.toString();
    11661166        }
    1167        
     1167
    11681168        /*
    11691169        getYears: function() {
     
    11751175        }*/
    11761176    });
    1177    
     1177
    11781178    /**
    11791179     * The FlipClock.Timer object managers the JS timers
     
    11821182     * @param   object  Override the default options
    11831183     */
    1184    
     1184
    11851185    FlipClock.Timer = FlipClock.Base.extend({
    1186        
     1186
    11871187        /**
    11881188         * Callbacks
    1189          */     
    1190          
     1189         */
     1190
    11911191        callbacks: {
    11921192            destroy: false,
     
    11981198            reset: false
    11991199        },
    1200        
     1200
    12011201        /**
    12021202         * FlipClock timer count (how many intervals have passed)
    1203          */     
    1204          
     1203         */
     1204
    12051205        count: 0,
    1206        
     1206
    12071207        /**
    12081208         * The parent FlipClock.Factory object
    1209          */     
    1210          
     1209         */
     1210
    12111211        factory: false,
    1212        
     1212
    12131213        /**
    12141214         * Timer interval (1 second by default)
    1215          */     
    1216          
     1215         */
     1216
    12171217        interval: 1000,
    1218                
     1218
    12191219        /**
    12201220         * Constructor
    12211221         *
    12221222         * @return  void
    1223          */     
    1224          
    1225         constructor: function(factory, options) {
     1223         */
     1224
     1225        constructor: function (factory, options) {
    12261226            this.base(options);
    12271227            this.factory = factory;
    1228             this.callback(this.callbacks.init); 
     1228            this.callback(this.callbacks.init);
    12291229            this.callback(this.callbacks.create);
    12301230        },
    1231        
     1231
    12321232        /**
    12331233         * This method gets the elapsed the time as an interger
    12341234         *
    12351235         * @return  void
    1236          */     
    1237          
    1238         getElapsed: function() {
     1236         */
     1237
     1238        getElapsed: function () {
    12391239            return this.count * this.interval;
    12401240        },
    1241        
     1241
    12421242        /**
    12431243         * This method gets the elapsed the time as a Date object
    12441244         *
    12451245         * @return  void
    1246          */     
    1247          
    1248         getElapsedTime: function() {
     1246         */
     1247
     1248        getElapsedTime: function () {
    12491249            return new Date(this.time + this.getElapsed());
    12501250        },
    1251        
     1251
    12521252        /**
    12531253         * This method is resets the timer
     
    12551255         * @param   callback  This method resets the timer back to 0
    12561256         * @return  void
    1257          */     
    1258          
    1259         reset: function(callback) {
     1257         */
     1258
     1259        reset: function (callback) {
    12601260            clearInterval(this.timer);
    12611261            this.count = 0;
    1262             this._setInterval(callback);           
     1262            this._setInterval(callback);
    12631263            this.callback(this.callbacks.reset);
    12641264        },
    1265        
     1265
    12661266        /**
    12671267         * This method is starts the timer
     
    12691269         * @param   callback  A function that is called once the timer is destroyed
    12701270         * @return  void
    1271          */     
    1272          
    1273         start: function(callback) {     
     1271         */
     1272
     1273        start: function (callback) {
    12741274            this.factory.running = true;
    12751275            this._createTimer(callback);
    12761276            this.callback(this.callbacks.start);
    12771277        },
    1278        
     1278
    12791279        /**
    12801280         * This method is stops the timer
     
    12821282         * @param   callback  A function that is called once the timer is destroyed
    12831283         * @return  void
    1284          */     
    1285          
    1286         stop: function(callback) {
     1284         */
     1285
     1286        stop: function (callback) {
    12871287            this.factory.running = false;
    12881288            this._clearInterval(callback);
     
    12901290            this.callback(callback);
    12911291        },
    1292        
     1292
    12931293        /**
    12941294         * Clear the timer interval
    12951295         *
    12961296         * @return  void
    1297          */     
    1298          
    1299         _clearInterval: function() {
     1297         */
     1298
     1299        _clearInterval: function () {
    13001300            clearInterval(this.timer);
    13011301        },
    1302        
     1302
    13031303        /**
    13041304         * Create the timer object
     
    13061306         * @param   callback  A function that is called once the timer is created
    13071307         * @return  void
    1308          */     
    1309          
    1310         _createTimer: function(callback) {
    1311             this._setInterval(callback);       
    1312         },
    1313        
     1308         */
     1309
     1310        _createTimer: function (callback) {
     1311            this._setInterval(callback);
     1312        },
     1313
    13141314        /**
    13151315         * Destroy the timer object
     
    13171317         * @param   callback  A function that is called once the timer is destroyed
    13181318         * @return  void
    1319          */     
    1320            
    1321         _destroyTimer: function(callback) {
    1322             this._clearInterval();         
     1319         */
     1320
     1321        _destroyTimer: function (callback) {
     1322            this._clearInterval();
    13231323            this.timer = false;
    13241324            this.callback(callback);
    13251325            this.callback(this.callbacks.destroy);
    13261326        },
    1327        
     1327
    13281328        /**
    13291329         * This method is called each time the timer interval is ran
     
    13311331         * @param   callback  A function that is called once the timer is destroyed
    13321332         * @return  void
    1333          */     
    1334          
    1335         _interval: function(callback) {
     1333         */
     1334
     1335        _interval: function (callback) {
    13361336            this.callback(this.callbacks.interval);
    13371337            this.callback(callback);
    13381338            this.count++;
    13391339        },
    1340        
     1340
    13411341        /**
    13421342         * This sets the timer interval
     
    13441344         * @param   callback  A function that is called once the timer is destroyed
    13451345         * @return  void
    1346          */     
    1347          
    1348         _setInterval: function(callback) {
     1346         */
     1347
     1348        _setInterval: function (callback) {
    13491349            var t = this;
    1350            
    1351             t.timer = setInterval(function() {         
     1350
     1351            t.timer = setInterval(function () {
    13521352                t._interval(callback);
    13531353            }, this.interval);
    13541354        }
    1355            
     1355
    13561356    });
    1357    
     1357
    13581358    /**
    13591359     * Capitalize the first letter in a string
     
    13611361     * @return string
    13621362     */
    1363      
    1364     String.prototype.ucfirst = function() {
     1363
     1364    String.prototype.ucfirst = function () {
    13651365        return this.substr(0, 1).toUpperCase() + this.substr(1);
    13661366    };
    1367    
     1367
    13681368    /**
    13691369     * jQuery helper method
     
    13721372     * @param  object  An object of properties to override the default 
    13731373     */
    1374      
    1375     $.fn.FlipClock = function(digit, options) {
    1376         if(typeof digit == "object") {
     1374
     1375    $.fn.FlipClock = function (digit, options) {
     1376        if (typeof digit == "object") {
    13771377            options = digit;
    13781378            digit = 0;
    1379         }       
     1379        }
    13801380        return new FlipClock($(this), digit, options);
    13811381    };
    1382    
     1382
    13831383    /**
    13841384     * jQuery helper method
     
    13871387     * @param  object  An object of properties to override the default 
    13881388     */
    1389      
    1390     $.fn.flipClock = function(digit, options) {
     1389
     1390    $.fn.flipClock = function (digit, options) {
    13911391        return $.fn.FlipClock(digit, options);
    13921392    };
    1393    
     1393
    13941394}(jQuery));
  • ultimate-under-construction/trunk/includes/js/uuc-script-farb.js

    r2750860 r3065415  
    1 jQuery(document).ready(function($) {
    2     $('#colorpicker').hide();
    3     $('#colorpicker').farbtastic('#color');
     1jQuery(document).ready(function ($) {
     2    $('#colorpicker').hide();
     3    $('#colorpicker').farbtastic('#color');
    44
    5     $('#color').click(function() {
    6         $('#colorpicker').fadeIn();
    7     });
     5    $('#color').click(function () {
     6        $('#colorpicker').fadeIn();
     7    });
    88
    9     $(document).mousedown(function() {
    10         $('#colorpicker').each(function() {
    11             var display = $(this).css('display');
    12             if ( display == 'block' )
    13                 $(this).fadeOut();
    14         });
    15     });
     9    $(document).mousedown(function () {
     10        $('#colorpicker').each(function () {
     11            var display = $(this).css('display');
     12            if (display == 'block')
     13                $(this).fadeOut();
     14        });
     15    });
    1616});
  • ultimate-under-construction/trunk/includes/js/uuc-script.js

    r2750860 r3065415  
    11(function ($) {
    2     "use strict";
     2    "use strict";
    33
    4     var default_color = 'bfbfbf';
     4    var default_color = 'bfbfbf';
    55
    6     function pickColor(color) {
    7         $('#background-color').val(color);
    8     }
    9     function toggle_text() {
    10         var background_color = $('#background-color');
    11         if(background_color.val() == undefined || '' === background_color.val().replace('#', '')) {
    12             background_color.val(default_color);
    13             pickColor(default_color);
    14         } else {
    15             pickColor(background_color.val());
    16         }
    17     }
     6    function pickColor(color) {
     7        $('#background-color').val(color);
     8    }
     9    function toggle_text() {
     10        var background_color = $('#background-color');
     11        if (background_color.val() == undefined || '' === background_color.val().replace('#', '')) {
     12            background_color.val(default_color);
     13            pickColor(default_color);
     14        } else {
     15            pickColor(background_color.val());
     16        }
     17    }
    1818
    19     $(document).ready(function () {
    20         var background_color = $('#background-color');
    21         background_color.wpColorPicker({
    22             change: function (event, ui) {
    23                 pickColor(background_color.wpColorPicker('color'));
    24             },
    25             clear: function () {
    26                 pickColor('');
    27             }
    28         });
    29         $('#background-color').click(toggle_text);
     19    $(document).ready(function () {
     20        var background_color = $('#background-color');
     21        background_color.wpColorPicker({
     22            change: function (event, ui) {
     23                pickColor(background_color.wpColorPicker('color'));
     24            },
     25            clear: function () {
     26                pickColor('');
     27            }
     28        });
     29        $('#background-color').click(toggle_text);
    3030
    31         toggle_text();
     31        toggle_text();
    3232
    33     });
     33    });
    3434
    3535}(jQuery));
  • ultimate-under-construction/trunk/includes/js/uuc-upload.js

    r2750860 r3065415  
    1 jQuery(document).ready(function($){
    2   var _custom_media = true,
    3       _orig_send_attachment = wp.media.editor.send.attachment;
     1jQuery(document).ready(function ($) {
     2    var _custom_media = true,
     3        _orig_send_attachment = wp.media.editor.send.attachment;
    44
    5   $('.stag-metabox-table .button').click(function(e) {
    6     var send_attachment_bkp = wp.media.editor.send.attachment;
    7     var button = $(this);
    8     var id = button.attr('id').replace('_button', '');
    9     _custom_media = true;
    10     wp.media.editor.send.attachment = function(props, attachment){
    11       if ( _custom_media ) {
    12         $("#"+id).val(attachment.url);
    13       } else {
    14         return _orig_send_attachment.apply( this, [props, attachment] );
    15       };
    16     }
     5    $('.stag-metabox-table .button').click(function (e) {
     6        var send_attachment_bkp = wp.media.editor.send.attachment;
     7        var button = $(this);
     8        var id = button.attr('id').replace('_button', '');
     9        _custom_media = true;
     10        wp.media.editor.send.attachment = function (props, attachment) {
     11            if (_custom_media) {
     12                $("#" + id).val(attachment.url);
     13            } else {
     14                return _orig_send_attachment.apply(this, [props, attachment]);
     15            };
     16        }
    1717
    18     wp.media.editor.open(button);
    19     return false;
    20   });
     18        wp.media.editor.open(button);
     19        return false;
     20    });
    2121
    22   $('.add_media').on('click', function(){
    23     _custom_media = false;
    24   });
     22    $('.add_media').on('click', function () {
     23        _custom_media = false;
     24    });
    2525});
  • ultimate-under-construction/trunk/includes/scripts.php

    r2750860 r3065415  
    1 <?php
     1<?php
     2/**
     3 * Scripts File
     4 *
     5 * Loads the scripts required for UUC
     6 *
     7 * @package Ultimate Under Construction
     8 */
    29
    3 /***************************
    4 * script control
    5 ***************************/
    610global $wp_version;
    711
    8 //All Actions to be added.
    9 add_action('init', 'uuc_load_scripts');
     12// All Actions to be added.
     13add_action( 'init', 'uuc_load_scripts' );
    1014
    1115if ( is_admin() ) {
    12     if ( $wp_version >= 3.5 ) {
    13         add_action ( 'init', 'uuc_admin_enqueue_scripts_cp' );
    14     } else {
    15         add_action ( 'init', 'uuc_admin_enqueue_scripts_farb' );
    16     }
     16    if ( $wp_version >= 3.5 ) {
     17        add_action( 'init', 'uuc_admin_enqueue_scripts_cp' );
     18    } else {
     19        add_action( 'init', 'uuc_admin_enqueue_scripts_farb' );
     20    }
    1721}
    1822
    19 //All functions mentioned above to be added below here only!
     23// All functions mentioned above to be added below here only!
    2024
     25/**
     26 * Load Scripts
     27 */
    2128function uuc_load_scripts() {
    22     wp_enqueue_style('uuc-styles', plugin_dir_url(__FILE__) . 'css/plugin_styles.css');
     29    wp_enqueue_style( 'uuc-styles', plugin_dir_url( __FILE__ ) . 'css/plugin_styles.css', array(), UUC_VERSION );
    2330}
    2431
     32/**
     33 * Enqueue the Colour Picker Scripts
     34 */
    2535function uuc_admin_enqueue_scripts_cp() {
    26     wp_enqueue_script( 'wp-color-picker' );
    27     wp_enqueue_script( 'uuc-custom', plugin_dir_url(__FILE__) . 'js/uuc-script.js', array( 'jquery', 'wp-color-picker' ), '1.1', true );
    28     wp_enqueue_style( 'wp-color-picker' );
     36    wp_enqueue_script( 'wp-color-picker' );
     37    wp_enqueue_script(
     38        'uuc-custom',
     39        plugin_dir_url( __FILE__ ) . 'js/uuc-script.js',
     40        array(
     41            'jquery',
     42            'wp-color-picker',
     43        ),
     44        '1.1',
     45        true
     46    );
     47    wp_enqueue_style( 'wp-color-picker' );
    2948}
    3049
     50/**
     51 * Enqueue Farbtastic Scripts
     52 *
     53 * Deprecated 1.9.4
     54 */
    3155function uuc_admin_enqueue_scripts_farb() {
    32     wp_enqueue_script( 'farbtastic' );
    33     wp_enqueue_script( 'uuc-custom-farb', plugin_dir_url(__FILE__) . '/js/uuc-script-farb.js', array( 'farbtastic', 'jquery' ) );
    34     wp_enqueue_style( 'farbtastic' );
     56    _deprecated_function( __FUNCTION__, esc_html( UUC_VERSION ), 'uuc_admin_enqueue_scripts_cp' );
     57
     58    return uuc_admin_enqueue_scripts_cp();
    3559}
  • ultimate-under-construction/trunk/includes/uucadmin.php

    r2985037 r3065415  
    1 <?php
    2 
     1<?php
     2/**
     3 * Admin Settings page
     4 *
     5 * Loads the Settings page within the Admin area
     6 *
     7 * @package Ultimate Under Construction
     8 */
     9
     10/**
     11 * Loads Options Page
     12 */
    313function uuc_options_page() {
    414
     
    818    ob_start(); ?>
    919    <div class="wrap">
    10         <div id="icon-tools" class="icon32"></div><h2><?php _e( 'Ultimate Under Construction Plugin Options', 'ultimate-under-construction' ); ?></h2>
    11        
     20        <div id="icon-tools" class="icon32"></div>
     21        <h2><?php esc_html_e( 'Ultimate Under Construction Plugin Options', 'ultimate-under-construction' ); ?></h2>
     22
    1223        <form method="post" action="options.php">
    1324
    14             <?php
    15             //Current version of WP seems to fall over on unticked Checkboxes... This is to tidy it up and stop unwanted 'Notices'
    16             if ( !empty( $uuc_options ) ) {
    17                 //Enable Checkbox Sanitization
    18                 if ( ! isset( $uuc_options['enable'] ) || $uuc_options['enable'] != '1' ) {
    19                     $uuc_options['enable'] = 0;
    20                 } else {
    21                     $uuc_options['enable'] = 1;
    22                 }
    23 
    24                 //Countdown Checkbox Sanitization
    25                 if ( ! isset( $uuc_options['cdenable'] ) || $uuc_options['cdenable'] != '1' ) {
    26                     $uuc_options['cdenable'] = 0;
    27                 } else {
    28                     $uuc_options['cdenable'] = 1;
    29                 }
    30             }
    31 
    32             settings_fields('uuc_settings_group'); ?>
    33 
    34             <h4 class="uuc-title"><?php _e('Enable', 'ultimate-under-construction'); ?></h4>
    35             <p>             
    36                 <input id="uuc_settings[enable]" name="uuc_settings[enable]" type="checkbox" value="1" <?php checked( ( !empty($uuc_options) ) ? $uuc_options['enable'] : '0', '1'); ?>/>
    37                 <label class="description" for="uuc_settings[enable]"><?php _e('Enable the Under Construction Page','ultimate-under-construction'); ?></label>
    38 
    39             <h4 class="uuc-title"><?php _e('Holding Page Type', 'ultimate-under-construction'); ?></h4>
     25            <?php
     26            // Current version of WP seems to fall over on unticked Checkboxes... This is to tidy it up and stop unwanted 'Notices'.
     27            if ( ! empty( $uuc_options ) ) {
     28                // Enable Checkbox Sanitization.
     29                if ( ! isset( $uuc_options['enable'] ) || '1' !== $uuc_options['enable'] ) {
     30                    $uuc_options['enable'] = 0;
     31                } else {
     32                    $uuc_options['enable'] = 1;
     33                }
     34
     35                // Countdown Checkbox Sanitization.
     36                if ( ! isset( $uuc_options['cdenable'] ) || '1' !== $uuc_options['cdenable'] ) {
     37                    $uuc_options['cdenable'] = 0;
     38                } else {
     39                    $uuc_options['cdenable'] = 1;
     40                }
     41            }
     42
     43            settings_fields( 'uuc_settings_group' );
     44            ?>
     45
     46            <h4 class="uuc-title"></h4>
    4047            <p>
    41                 <label><input onclick="checkPage()" type="radio" name="uuc_settings[holdingpage_type]" id="htmlblock" value="htmlblock"<?php if(!isset($uuc_options['holdingpage_type'])){ ?> checked <?php } else { checked( 'htmlblock' == $uuc_options['holdingpage_type'] ); } ?> /> HTML Block</label><br />
    42                 <label><input onclick="checkPage()" type="radio" name="uuc_settings[holdingpage_type]" id="custom" value="custom"<?php checked( ( !empty($uuc_options) ) ? 'custom' == $uuc_options['holdingpage_type'] : '' ); ?> /> Custom Build</label><br />
     48                <input id="uuc_settings[enable]" name="uuc_settings[enable]" type="checkbox" value="1" <?php checked( ( ! empty( $uuc_options ) ) ? $uuc_options['enable'] : '0', '1' ); ?>/>
     49                <label class="description" for="uuc_settings[enable]"><?php esc_html_e( 'Enable the Under Construction Page', 'ultimate-under-construction' ); ?></label>
     50
     51            <h4 class="uuc-title"><?php esc_html_e( 'Holding Page Type', 'ultimate-under-construction' ); ?></h4>
     52            <p>
     53                <label>
     54                    <input onclick="checkPage()" class="check-page" type="radio" name="uuc_settings[holdingpage_type]" id="htmlblock" value="htmlblock"
     55                        <?php
     56                        if ( ! isset( $uuc_options['holdingpage_type'] ) ) {
     57                            ?>
     58                            checked
     59                            <?php
     60                        } else {
     61                            checked( 'htmlblock' == $uuc_options['holdingpage_type'] );
     62                        }
     63                        ?>
     64                    />
     65                    <?php esc_html_e( 'HTML Block', 'ultimate-under-construction' ); ?>
     66                </label>
     67                <br/>
     68                <label>
     69                    <input onclick="checkPage()" class="check-page" type="radio" name="uuc_settings[holdingpage_type]" id="custom" value="custom"<?php checked( ( ! empty( $uuc_options ) ) ? 'custom' == $uuc_options['holdingpage_type'] : '' ); ?> />
     70                    <?php esc_html_e( 'Custom Build', 'ultimate-under-construction' ); ?>
     71                </label><br/>
    4372            </p>
    4473
    45             <div id="htmlblockbg" <?php if ( !empty($uuc_options) && $uuc_options['holdingpage_type'] == "custom" ){ ?> style="visibiliy: hidden; display: none;"<?php }; ?>>
    46                 <h4 class="uuc-title"><?php _e('HTML Block', 'ultimate-under-construction'); ?></h4>
     74            <div id="htmlblockbg"
     75            <?php
     76            if ( ! empty( $uuc_options ) && 'custom' === $uuc_options['holdingpage_type'] ) {
     77                ?>
     78                style="visibiliy: hidden; display: none;"<?php } ?>>
     79                <h4 class="uuc-title"><?php esc_html_e( 'HTML Block', 'ultimate-under-construction' ); ?></h4>
    4780                <p>
    48                     <textarea class="theEditor" name="uuc_settings[html_block]" id="uuc_settings[html_block]" rows="10" cols="75"><?php if (isset($uuc_options['html_block'])) echo $uuc_options['html_block']; ?></textarea>
    49                     <label class="description" for="uuc_settings[html_block]"><?php _e('<br />Enter the HTML - Advised for advanced users only!<br />Will display exactly as entered.', 'ultimate-under-construction'); ?></label>
     81                    <textarea class="theEditor" name="uuc_settings[html_block]" id="uuc_settings[html_block]" rows="10" cols="75">
     82                        <?php
     83                        if ( isset( $uuc_options['html_block'] ) ) {
     84                            echo wp_kses(
     85                                $uuc_options['html_block'],
     86                                array(
     87                                    'a'      => array(
     88                                        'href'  => array(),
     89                                        'title' => array(),
     90                                    ),
     91                                    'br'     => array(),
     92                                    'em'     => array(),
     93                                    'strong' => array(),
     94                                    'p'      => array(),
     95                                )
     96                            );
     97                        }
     98                        ?>
     99                    </textarea>
     100                    <label class="description" for="uuc_settings[html_block]">
     101                        <br />
     102                        <?php esc_html_e( 'Enter the HTML - Advised for advanced users only!', 'ultimate-under-construction' ); ?>
     103                        <br />
     104                        <?php esc_html_e( 'Will display exactly as entered.', 'ultimate-under-construction' ); ?>
     105                    </label>
    50106                </p>
    51107            </div>
    52108
    53             <div id="custombg" <?php if ( ( !empty($uuc_options) ) ? $uuc_options['holdingpage_type'] == "htmlblock" : ''){ ?> style="visibility: hidden; display: none;"<?php }; ?>>
    54                 <h4 class="uuc-title"><?php _e('Website Title', 'ultimate-under-construction'); ?></h4>
     109            <div id="custombg"
     110            <?php
     111            if ( ( ! empty( $uuc_options ) ) ? 'htmlblock' === $uuc_options['holdingpage_type'] : '' ) {
     112                ?>
     113                style="visibility: hidden; display: none;"<?php } ?>>
     114                <h4 class="uuc-title"><?php esc_html_e( 'Website Title', 'ultimate-under-construction' ); ?></h4>
    55115                <p>
    56                     <input id="uuc_settings[website_name]" name="uuc_settings[website_name]" type="text" value="<?php echo ( !empty($uuc_options) ) ? $uuc_options['website_name'] : ''; ?>"/>
    57                     <label class="description" for="uuc_settings[website_name]"><?php _e('Enter the Title of your website', 'ultimate-under-construction'); ?></label>
     116                    <input id="uuc_settings[website_name]" name="uuc_settings[website_name]" type="text"
     117                            value="<?php echo esc_attr( ( ! empty( $uuc_options ) ) ? esc_attr( $uuc_options['website_name'] ) : '' ); ?>"/>
     118                    <label class="description"
     119                            for="uuc_settings[website_name]"><?php esc_html_e( 'Enter the Title of your website', 'ultimate-under-construction' ); ?></label>
    58120                </p>
    59121
    60                 <h4 class="uuc-title"><?php _e('Holding Message', 'ultimate-under-construction'); ?></h4>
     122                <h4 class="uuc-title"><?php esc_html_e( 'Holding Message', 'ultimate-under-construction' ); ?></h4>
    61123                <p>
    62                     <textarea id="uuc_settings[holding_message]" name="uuc_settings[holding_message]" rows="5" cols="50"><?php echo ( !empty($uuc_options) ) ? $uuc_options['holding_message'] : ''; ?></textarea><br />
    63                     <label class="description" for="uuc_settings[holding_message]"><?php _e('Enter a message to appear below the Website Title', 'ultimate-under-construction'); ?></label>
     124                    <textarea id="uuc_settings[holding_message]" name="uuc_settings[holding_message]" rows="5"
     125                                cols="50"><?php echo esc_attr( ( ! empty( $uuc_options ) ) ? esc_attr( $uuc_options['holding_message'] ) : '' ); ?></textarea><br/>
     126                    <label class="description"
     127                            for="uuc_settings[holding_message]"><?php esc_html_e( 'Enter a message to appear below the Website Title', 'ultimate-under-construction' ); ?></label>
    64128                </p>
    65129
    66                 <h4 class="uuc-title"><?php _e('Countdown Timer', 'ultimate-under-construction'); ?></h4>
     130                <h4 class="uuc-title"><?php esc_html_e( 'Countdown Timer', 'ultimate-under-construction' ); ?></h4>
    67131                <p>
    68                     <input id="uuc_settings[cdenable]" name="uuc_settings[cdenable]" type="checkbox" value="1" <?php checked( ( !empty($uuc_options) ) ? $uuc_options['cdenable'] : '0', '1'); ?>/>
    69                     <label class="description" for="uuc_settings[cdenable]"><?php _e('Enable the Countdown Timer?','ultimate-under-construction'); ?></label>
    70                     <br />
    71                     <br />
    72                     <label><input type="radio" name="uuc_settings[cd_style]" id="flipclock" value="flipclock"<?php if(!isset($uuc_options['cd_style'])){ ?> checked <?php } else { checked( 'flipclock' == $uuc_options['cd_style'] ); } ?> /> Flip Clock / </label>
    73                     <label><input type="radio" name="uuc_settings[cd_style]" id="textclock" value="textclock"<?php checked( ( !empty($uuc_options) ) ? 'textclock' == $uuc_options['cd_style'] : '' ); ?> /> Text only.</label>
    74                     <br />
    75                     <br />
    76                     <input id="uuc_settings[cdday]" name="uuc_settings[cdday]" type="text" value="<?php echo ( !empty($uuc_options) ) ? $uuc_options['cdday'] : ''; ?>"/>
    77                     <label class="description" for="uuc_settings[cdday]"><?php _e('Enter the Date - e.g. 14', 'ultimate-under-construction'); ?></label>
    78                     <br />
    79                     <input id="uuc_settings[cdmonth]" name="uuc_settings[cdmonth]" type="text" value="<?php echo ( !empty($uuc_options) ) ? $uuc_options['cdmonth'] : ''; ?>"/>
    80                     <label class="description" for="uuc_settings[cdmonth]"><?php _e('Enter the Month - e.g. 2', 'ultimate-under-construction'); ?></label>
    81                     <br />
    82                     <input id="uuc_settings[cdyear]" name="uuc_settings[cdyear]" type="text" value="<?php echo ( !empty($uuc_options) ) ? $uuc_options['cdyear'] : ''; ?>"/>
    83                     <label class="description" for="uuc_settings[cdyear]"><?php _e('Enter the Year -  e.g. 2014', 'ultimate-under-construction'); ?></label>
    84                     <br />
    85                     <input id="uuc_settings[cdtext]" name="uuc_settings[cdtext]" type="text" value="<?php echo ( !empty($uuc_options) ) ? $uuc_options['cdtext'] : ''; ?>"/>
    86                     <label class="description" for="uuc_settings[cdtext]"><?php _e('Enter the Countdown text - e.g. Till the site goes live!', 'ultimate-under-construction'); ?></label>
     132                    <input id="uuc_settings[cdenable]" name="uuc_settings[cdenable]" type="checkbox" value="1" <?php checked( ( ! empty( $uuc_options ) ) ? $uuc_options['cdenable'] : '0', '1' ); ?>/>
     133                    <label class="description" for="uuc_settings[cdenable]"><?php esc_html_e( 'Enable the Countdown Timer?', 'ultimate-under-construction' ); ?></label>
     134                    <br/>
     135                    <br/>
     136                    <label>
     137                        <input type="radio" name="uuc_settings[cd_style]" id="flipclock" value="flipclock"
     138                            <?php
     139                            if ( ! isset( $uuc_options['cd_style'] ) ) {
     140                                ?>
     141                                checked
     142                                <?php
     143                            } else {
     144                                    checked( 'flipclock' == $uuc_options['cd_style'] );
     145                            }
     146                            ?>
     147                        />
     148                        <?php esc_html_e( 'Flip Clock', 'ultimate-under-construction' ); ?>
     149                    </label>
     150                    <label>
     151                        <input type="radio" name="uuc_settings[cd_style]" id="textclock" value="textclock"<?php checked( ( ! empty( $uuc_options ) ) ? 'textclock' == $uuc_options['cd_style'] : '' ); ?> />
     152                        <?php esc_html_e( 'Text only.', 'ultimate-under-construction' ); ?>
     153                    </label>
     154                    <br/>
     155                    <br/>
     156                    <input id="uuc_settings[cdday]" name="uuc_settings[cdday]" type="text" value="<?php echo ( ! empty( $uuc_options ) ) ? esc_attr( $uuc_options['cdday'] ) : ''; ?>"/>
     157                    <label class="description" for="uuc_settings[cdday]"><?php esc_html_e( 'Enter the Date - e.g. 14', 'ultimate-under-construction' ); ?></label>
     158                    <br/>
     159                    <input id="uuc_settings[cdmonth]" name="uuc_settings[cdmonth]" type="text" value="<?php echo ( ! empty( $uuc_options ) ) ? esc_attr( $uuc_options['cdmonth'] ) : ''; ?>"/>
     160                    <label class="description" for="uuc_settings[cdmonth]"><?php esc_html_e( 'Enter the Month - e.g. 2', 'ultimate-under-construction' ); ?></label>
     161                    <br/>
     162                    <input id="uuc_settings[cdyear]" name="uuc_settings[cdyear]" type="text" value="<?php echo ( ! empty( $uuc_options ) ) ? esc_attr( $uuc_options['cdyear'] ) : ''; ?>"/>
     163                    <label class="description" for="uuc_settings[cdyear]"><?php esc_html_e( 'Enter the Year -  e.g. 2014', 'ultimate-under-construction' ); ?></label>
     164                    <br/>
     165                    <input id="uuc_settings[cdtext]" name="uuc_settings[cdtext]" type="text" value="<?php echo ( ! empty( $uuc_options ) ) ? esc_attr( $uuc_options['cdtext'] ) : ''; ?>"/>
     166                    <label class="description" for="uuc_settings[cdtext]"><?php esc_html_e( 'Enter the Countdown text - e.g. Till the site goes live!', 'ultimate-under-construction' ); ?></label>
    87167                </p>
    88168
    89                 <h4 class="uuc-title"><?php _e('Background Style', 'ultimate-under-construction'); ?></h4>
     169                <h4 class="uuc-title"><?php esc_html_e( 'Background Style', 'ultimate-under-construction' ); ?></h4>
    90170                <p>
    91                     <label><input onclick="checkEm()" type="radio" name="uuc_settings[background_style]" id="solidcolor" value="solidcolor"<?php if(!isset($uuc_options['background_style'])){ ?> checked <?php } else { checked( 'solidcolor' == $uuc_options['background_style'] ); } ?> /> Solid Colour</label><br />
    92                     <label><input onclick="checkEm()" type="radio" name="uuc_settings[background_style]" id="patterned" value="patterned"<?php checked( ( !empty($uuc_options) ) ? 'patterned' == $uuc_options['background_style'] : '' ); ?> /> Patterned Background</label>
     171                    <label>
     172                        <input onclick="checkEm()" class="check-em" type="radio" name="uuc_settings[background_style]" id="solidcolor" value="solidcolor"
     173                            <?php
     174                            if ( ! isset( $uuc_options['background_style'] ) ) {
     175                                ?>
     176                                checked
     177                                <?php
     178                            } else {
     179                                    checked( 'solidcolor' === $uuc_options['background_style'] );
     180                            }
     181                            ?>
     182                        />
     183                        <?php esc_html_e( 'Solid Colour', 'ultimate-under-construction' ); ?>
     184                    </label>
     185                    <br/>
     186                    <label>
     187                        <input onclick="checkEm()" class="check-em" type="radio" name="uuc_settings[background_style]" id="patterned" alue="patterned"<?php checked( ( ! empty( $uuc_options ) ) ? 'patterned' === $uuc_options['background_style'] : '' ); ?> />
     188                        <?php esc_html_e( 'Patterned Background', 'ultimate-under-construction' ); ?>
     189                    </label>
    93190                </p>
    94191
    95                 <?php if ( $wp_version >= 3.5 ){ ?>
    96                 <div id="solidcolorbg" <?php if( !empty( $uuc_options ) && $uuc_options['background_style'] == "patterned"){ ?>style="visibility: hidden; display: none;"<?php }; ?>>
    97                     <h4 class="uuc-title"><?php _e('Background Colour', 'ultimate-under-construction'); ?></h4>
    98                     <p>
    99                         <input name="uuc_settings[background_color]" id="background-color" type="text" value="<?php if ( isset( $uuc_options['background_color'] ) ) echo $uuc_options['background_color']; ?>" />
    100                         <label class="description" for="uuc_settings[background_color]"><?php _e('Select the Background Colour', 'ultimate-under-construction'); ?></label>
    101                     </p>
    102                 </div>
     192                <?php if ( $wp_version >= 3.5 ) { ?>
     193                    <div id="solidcolorbg"
     194                        <?php
     195                        if ( ! empty( $uuc_options ) && 'patterned' === $uuc_options['background_style'] ) {
     196                            ?>
     197                            style="visibility: hidden; display: none;"<?php } ?>>
     198                        <h4 class="uuc-title"><?php esc_html_e( 'Background Colour', 'ultimate-under-construction' ); ?></h4>
     199                        <p>
     200                            <input name="uuc_settings[background_color]" id="background-color" type="text" value="
     201                            <?php
     202                            if ( isset( $uuc_options['background_color'] ) ) {
     203                                echo esc_attr( $uuc_options['background_color'] );
     204                            }
     205                            ?>
     206                            "/>
     207                            <label class="description" for="uuc_settings[background_color]"><?php esc_html_e( 'Select the Background Colour', 'ultimate-under-construction' ); ?></label>
     208                        </p>
     209                    </div>
    103210                <?php } else { ?>
    104                 <div id="solidcolorbg" <?php if( !empty( $uuc_options ) && $uuc_options['background_style'] == "patterned"){ ?>style="visibility: hidden; display: none;"<?php }; ?>>
    105                     <h4 class="uuc-title"><?php _e('Background Colour', 'ultimate-under-construction'); ?></h4>
    106                     <p>
    107                     <div class="color-picker" style="position: relative;">
    108                         <input type="text" name="uuc_settings[background_color]" id="color" value="<?php if ( isset( $uuc_options['background_color'] ) ) echo $uuc_options['background_color']; ?>" />
    109                         <div style="position: absolute;" id="colorpicker"></div>
    110                     </div>
    111                     </p>
    112                 </div>
     211                    <div id="solidcolorbg"
     212                        <?php
     213                        if ( ! empty( $uuc_options ) && 'patterned' === $uuc_options['background_style'] ) {
     214                            ?>
     215                            style="visibility: hidden; display: none;"<?php } ?>>
     216                        <h4 class="uuc-title"><?php esc_html_e( 'Background Colour', 'ultimate-under-construction' ); ?></h4>
     217                        <p>
     218                        <div class="color-picker" style="position: relative;">
     219                            <input type="text" name="uuc_settings[background_color]" id="color" value="
     220                            <?php
     221                            if ( isset( $uuc_options['background_color'] ) ) {
     222                                echo esc_attr( $uuc_options['background_color'] );
     223                            }
     224                            ?>
     225                            "/>
     226                            <div style="position: absolute;" id="colorpicker"></div>
     227                        </div>
     228                        </p>
     229                    </div>
    113230                <?php } ?>
    114231
    115                 <div id="patternedbg" <?php if(!empty( $uuc_options ) && $uuc_options['background_style'] == "solidcolor"){ ?>style="visibility: hidden; display: none;"<?php }; ?>>
    116                     <h4 class="uuc-title"><?php _e('Background Choice', 'ultimate-under-construction'); ?></h4>
    117                     <label><input type="radio" name="uuc_settings[background_styling]" id="background_choice_one" value="squairylight"<?php checked( 'squairylight' == isset($uuc_options['background_styling']) ); ?> /> Squairy</label><br />
    118                     <label><input type="radio" id="background_choice_two" name="uuc_settings[background_styling]" value="lightbind" <?php if(!isset($uuc_options['background_styling'])){ ?> checked <?php } else { checked( 'lightbind' == $uuc_options['background_styling'] ); } ?> /> Light Binding</label><br />
    119                     <label><input type="radio" id="background_choice_three" name="uuc_settings[background_styling]" value="darkbind"  <?php if(!isset($uuc_options['background_styling'])){ ?> checked <?php } else { checked( 'darkbind' == $uuc_options['background_styling'] ); } ?> /> Dark Binding</label> <br />
    120                     <label><input type="radio" id="background_choice_four" name="uuc_settings[background_styling]" value="wavegrid" <?php if(!isset($uuc_options['background_styling'])){ ?> checked <?php } else { checked( 'wavegrid' == $uuc_options['background_styling'] ); } ?> /> Wavegrid</label> <br />
    121                     <label><input type="radio" id="background_choice_five" name="uuc_settings[background_styling]" value="greywashwall" <?php if(!isset($uuc_options['background_styling'])){ ?> checked <?php } else { checked( 'greywashwall' == $uuc_options['background_styling'] ); } ?> /> Gray Wash Wall</label> <br />
    122                     <label><input type="radio" id="background_choice_six" name="uuc_settings[background_styling]" value="flatcardboard" <?php if(!isset($uuc_options['background_styling'])){ ?> checked <?php } else { checked( 'flatcardboard' == $uuc_options['background_styling'] ); } ?> /> Cardboard Flat</label> <br />
    123                     <label><input type="radio" id="background_choice_seven" name="uuc_settings[background_styling]" value="pooltable" <?php if(!isset($uuc_options['background_styling'])){ ?> checked <?php } else { checked( 'pooltable' == $uuc_options['background_styling'] ); } ?> /> Pool Table</label> <br />
    124                     <label><input type="radio" id="background_choice_eight" name="uuc_settings[background_styling]" value="oldmaths" <?php if(!isset($uuc_options['background_styling'])){ ?> checked <?php } else { checked( 'oldmaths' == $uuc_options['background_styling'] ); } ?> /> Old Mathematics</label> <br />
     232                <div id="patternedbg"
     233                    <?php
     234                    if ( ! empty( $uuc_options ) && 'solidcolor' === $uuc_options['background_style'] ) {
     235                        ?>
     236                        style="visibility: hidden; display: none;"<?php } ?>>
     237                    <h4 class="uuc-title"></h4>
     238                    <label>
     239                        <input type="radio" name="uuc_settings[background_styling]" id="background_choice_one" value="squairylight"<?php checked( 'squairylight' === isset( $uuc_options['background_styling'] ) ); ?> />
     240                        <?php esc_html_e( 'Squairy', 'ultimate-under-construction' ); ?>
     241                    </label><br/>
     242                    <label>
     243                        <input type="radio" id="background_choice_two" name="uuc_settings[background_styling]"
     244                                    value="lightbind"
     245                                    <?php
     246                                    if ( ! isset( $uuc_options['background_styling'] ) ) {
     247                                        ?>
     248                                        checked
     249                                        <?php
     250                                    } else {
     251                                        checked( 'lightbind' === $uuc_options['background_styling'] );
     252                                    }
     253                                    ?>
     254                        />
     255                        <?php esc_html_e( 'Light Binding', 'ultimate-under-construction' ); ?>
     256                    </label>
     257                    <br/>
     258                    <label>
     259                        <input type="radio" id="background_choice_three" name="uuc_settings[background_styling]" value="darkbind"
     260                            <?php
     261                            if ( ! isset( $uuc_options['background_styling'] ) ) {
     262                                ?>
     263                                checked
     264                                <?php
     265                            } else {
     266                                checked( 'darkbind' === $uuc_options['background_styling'] );
     267                            }
     268                            ?>
     269                        />
     270                        <?php esc_html_e( 'Dark Binding', 'ultimate-under-construction' ); ?>
     271                    </label>
     272                    <br/>
     273                    <label>
     274                        <input type="radio" id="background_choice_four" name="uuc_settings[background_styling]" value="wavegrid"
     275                            <?php
     276                            if ( ! isset( $uuc_options['background_styling'] ) ) {
     277                                ?>
     278                                checked
     279                                <?php
     280                            } else {
     281                                checked( 'wavegrid' === $uuc_options['background_styling'] );
     282                            }
     283                            ?>
     284                        />
     285                        <?php esc_html_e( 'Wavegrid', 'ultimate-under-construction' ); ?>
     286                    </label>
     287                    <br/>
     288                    <label>
     289                        <input type="radio" id="background_choice_five" name="uuc_settings[background_styling]" value="greywashwall"
     290                            <?php
     291                            if ( ! isset( $uuc_options['background_styling'] ) ) {
     292                                ?>
     293                                checked
     294                                <?php
     295                            } else {
     296                                checked( 'greywashwall' === $uuc_options['background_styling'] );
     297                            }
     298                            ?>
     299                        />
     300                        <?php esc_html_e( 'Gray Wash Wall', 'ultimate-under-construction' ); ?>
     301                    </label>
     302                    <br/>
     303                    <label>
     304                        <input type="radio" id="background_choice_six" name="uuc_settings[background_styling]" value="flatcardboard"
     305                            <?php
     306                            if ( ! isset( $uuc_options['background_styling'] ) ) {
     307                                ?>
     308                                checked
     309                                <?php
     310                            } else {
     311                                checked( 'flatcardboard' === $uuc_options['background_styling'] );
     312                            }
     313                            ?>
     314                        />
     315                        <?php esc_html_e( 'Cardboard Flat', 'ultimate-under-construction' ); ?>
     316                    </label>
     317                    <br/>
     318                    <label>
     319                        <input type="radio" id="background_choice_seven" name="uuc_settings[background_styling]" value="pooltable"
     320                            <?php
     321                            if ( ! isset( $uuc_options['background_styling'] ) ) {
     322                                ?>
     323                                checked
     324                                <?php
     325                            } else {
     326                                checked( 'pooltable' === $uuc_options['background_styling'] );
     327                            }
     328                            ?>
     329                        />
     330                        <?php esc_html_e( 'Pool Table', 'ultimate-under-construction' ); ?>
     331                    </label>
     332                    <br/>
     333                    <label>
     334                        <input type="radio" id="background_choice_eight" name="uuc_settings[background_styling]" value="oldmaths"
     335                            <?php
     336                            if ( ! isset( $uuc_options['background_styling'] ) ) {
     337                                ?>
     338                                checked
     339                                <?php
     340                            } else {
     341                                    checked( 'oldmaths' === $uuc_options['background_styling'] );
     342                            }
     343                            ?>
     344                        />
     345                        <?php esc_html_e( 'Old Mathematics', 'ultimate-under-construction' ); ?>
     346                    </label>
     347                    <br/>
    125348                </div>
    126349            </div>
    127350
    128351            <p class="submit">
    129                 <input type="submit" class="button-primary" value="<?php _e('Save Options', 'ultimate-under-construction'); ?>" />
     352                <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save Options', 'ultimate-under-construction' ); ?>"/>
    130353            </p>
    131 
    132             <script type="text/javascript">
    133             function checkPage() {
    134                 if (document.getElementById("custom").checked) {
    135                     document.getElementById("custombg").style.visibility = "visible";
    136                     document.getElementById("custombg").style.display = "block";
    137                     document.getElementById("htmlblockbg").style.visibility = "hidden";
    138                     document.getElementById("htmlblockbg").style.display = "none";
    139                 };
    140 
    141                 if (document.getElementById("htmlblock").checked) {
    142                     document.getElementById("htmlblockbg").style.visibility = "visible";
    143                     document.getElementById("htmlblockbg").style.display = "block";
    144                     document.getElementById("custombg").style.visibility = "hidden";
    145                     document.getElementById("custombg").style.display = "none";
    146                 }
    147 
    148             };
    149 
    150             function checkEm() {
    151                 if (document.getElementById("solidcolor").checked) {
    152                     document.getElementById("solidcolorbg").style.visibility = "visible";
    153                     document.getElementById("solidcolorbg").style.display = "block";
    154                     document.getElementById("patternedbg").style.visibility = "hidden";
    155                     document.getElementById("patternedbg").style.display = "none";
    156                 };
    157 
    158                 if (document.getElementById("patterned").checked) {
    159                     document.getElementById("patternedbg").style.visibility = "visible";
    160                     document.getElementById("patternedbg").style.display = "block";
    161                     document.getElementById("solidcolorbg").style.visibility = "hidden";
    162                     document.getElementById("solidcolorbg").style.display = "none";
    163                 };
    164             };
    165             </script>
    166354
    167355        </form>
    168356    </div>
    169 </div>
    170     <?php echo ob_get_clean();
     357    </div>
     358    <?php
     359    echo wp_kses(
     360        ob_get_clean(),
     361        array(
     362            'before'   => array(),
     363            'a'        => array(
     364                'href'  => array(),
     365                'title' => array(),
     366            ),
     367            'br'       => array(),
     368            'em'       => array(),
     369            'strong'   => array(),
     370            'p'        => array(
     371                'class' => array(),
     372                'style' => array(),
     373                'id'    => array(),
     374            ),
     375            'h3'       => array(
     376                'class' => array(),
     377                'style' => array(),
     378                'id'    => array(),
     379            ),
     380            'h4'       => array(
     381                'class' => array(),
     382                'style' => array(),
     383                'id'    => array(),
     384            ),
     385            'h1'       => array(
     386                'class' => array(),
     387                'style' => array(),
     388                'id'    => array(),
     389            ),
     390            'h2'       => array(
     391                'class' => array(),
     392                'style' => array(),
     393                'id'    => array(),
     394            ),
     395            'div'      => array(
     396                'class' => array(),
     397                'style' => array(),
     398                'id'    => array(),
     399            ),
     400            'span'     => array(),
     401            'img'      => array(),
     402            'form'     => array(
     403                'class'  => array(),
     404                'method' => array(),
     405                'action' => array(),
     406                'id'     => array(),
     407            ),
     408            'label'    => array(),
     409            'textarea' => array(
     410                'class' => array(),
     411                'style' => array(),
     412                'id'    => array(),
     413                'name'  => array(),
     414                'rows'  => array(),
     415                'cols'  => array(),
     416            ),
     417            'input'    => array(
     418                'class'   => array(),
     419                'type'    => array(),
     420                'id'      => array(),
     421                'name'    => array(),
     422                'value'   => array(),
     423                'onclick' => array(),
     424                'before'  => array(),
     425                'checked' => array(),
     426            ),
     427            ':before'  => array(),
     428            'script'   => array(),
     429        )
     430    );
    171431}
    172432
    173 function admin_register_head() {
    174     $siteurl = get_option('siteurl');
    175     $url = $siteurl . '/wp-content/plugins/ultimate-under-construction/includes/css/plugin_styles.css';
    176     echo "<link rel='stylesheet' type='text/css' href='$url' />\n";
     433add_action( 'admin_enqueue_scripts', 'admin_register_style' );
     434/**
     435 * Output admin page styles.
     436 */
     437function admin_register_style() {
     438    wp_enqueue_style( 'uuc_admin_style', UUC_PLUGIN_URL . 'includes/css/plugin_styles.css', array(), UUC_VERSION );
     439    wp_enqueue_script( 'uuc_admin_script', UUC_PLUGIN_URL . 'includes/js/uuc-admin.js', array(), UUC_VERSION, array( 'in_footer' => true ) );
    177440}
    178 add_action('admin_head', 'admin_register_head');
    179 
     441
     442add_action( 'admin_menu', 'uuc_add_options_link' );
     443/**
     444 * Set up Settings page
     445 */
    180446function uuc_add_options_link() {
    181     add_options_page('Ultimate Under Construction Plugin Options', 'Ultimate Under Construction', 'manage_options', 'uuc-options', 'uuc_options_page');
     447    add_options_page( 'Ultimate Under Construction Plugin Options', 'Ultimate Under Construction', 'manage_options', 'uuc-options', 'uuc_options_page' );
    182448}
    183 add_action('admin_menu', 'uuc_add_options_link');
    184 
     449
     450add_action( 'admin_init', 'uuc_register_settings' );
     451/**
     452 * Register Settings group
     453 */
    185454function uuc_register_settings() {
    186     register_setting('uuc_settings_group', 'uuc_settings');
     455    register_setting( 'uuc_settings_group', 'uuc_settings' );
    187456}
    188 add_action('admin_init', 'uuc_register_settings');
  • ultimate-under-construction/trunk/readme.txt

    r2985037 r3065415  
    33Tags: Under construction, holding page, construction, holding, page, private, preview, coming soon
    44Requires at least: 3.0.1
    5 Tested up to: 6.3.2
    6 Stable tag: 1.9.3
     5Tested up to: 6.4.3
     6Stable tag: 1.9.4
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2626
    2727== Changelog ==
     28= 1.9.4 - 2nd April 2024 =
     29* SECURITY FIX - Fixed XSS Vulnerability - Thanks to Cronus and PatchStack for discovering and reporting.
     30* UPDATE - Tested on WordPress 6.4.3
     31
    2832= 1.9.3 - 27th October 2023 =
    2933* UPDATE - Tested on WordPress 6.3.2.
     
    8286
    8387== Upgrade Notice ==
     88= 1.9.4 =
     89Security Fix - Version 1.9.4 fixes a known XSS Vulnerability. Please Update immediately.
     90
     91= 1.7 =
    8492Please Upgrade - FlipClock doesn't load reliably on v1.6 - Issue has been fixed on 1.7
    8593
  • ultimate-under-construction/trunk/ultimate-under-construction.php

    r2985037 r3065415  
    66Author: HappyKite
    77Author URI: http://www.happykite.co.uk/
    8 Version: 1.9.3
     8Version: 1.9.4
    99Text Domain: ultimate-under-construction
    1010Domain Path: /languages
     
    1212
    1313/*
    14  This file is part of ultimateUnderConstruction.
    15  ultimateUnderConstruction is free software: you can redistribute it and/or modify
    16  it under the terms of the GNU General Public License as published by
    17  the Free Software Foundation, either version 3 of the License, or
    18  (at your option) any later version.
    19  ultimateUnderConstruction is distributed in the hope that it will be useful,
    20  but WITHOUT ANY WARRANTY; without even the implied warranty of
    21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    22  GNU General Public License for more details.
    23  You should have received a copy of the GNU General Public License
    24  along with ultimateUnderConstruction.  If not, see <http://www.gnu.org/licenses/>.
     14This file is part of ultimateUnderConstruction.
     15ultimateUnderConstruction is free software: you can redistribute it and/or modify
     16it under the terms of the GNU General Public License as published by
     17the Free Software Foundation, either version 3 of the License, or
     18(at your option) any later version.
     19ultimateUnderConstruction is distributed in the hope that it will be useful,
     20but WITHOUT ANY WARRANTY; without even the implied warranty of
     21MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     22GNU General Public License for more details.
     23You should have received a copy of the GNU General Public License
     24along with ultimateUnderConstruction.  If not, see <http://www.gnu.org/licenses/>.
    2525 */
     26
     27define( 'UUC_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
     28define( 'UUC_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
     29define( 'UUC_VERSION', '1.9.4' );
    2630
    2731
    2832/***************************
    29 * global variables
    30 ***************************/
     33 * Global variables
     34 */
    3135
    32 $my_prefix = 'uuc_';
    33 $my_plugin_name = 'Ultimate Under Construction page';
    34 
    35 //Retrieve settings from Admin Options table
    36 $uuc_options = get_option('uuc_settings');
     36// Retrieve settings from Admin Options table.
     37$uuc_options = get_option( 'uuc_settings' );
    3738
    3839/***************************
    39 * includes
    40 ***************************/
     40 * Includes
     41 */
    4142
    42 include('includes/scripts.php'); //includes all JS and CSS
    43 include('includes/display-functions.php'); //display content functions
    44 include('includes/uucadmin.php'); //plugin admin options
     43require 'includes/scripts.php'; // includes all JS and CSS.
     44require 'includes/display-functions.php'; // display content functions.
     45require 'includes/uucadmin.php'; // plugin admin options.
     46
     47add_action( 'in_plugin_update_message-ultimate-under-construction/ultimate-under-construction.php', 'uuc_plugin_update_message', 10, 2 );
     48
     49/**
     50 * Update Notice to make it clear it's a security update.
     51 */
     52function uuc_plugin_update_message( $data, $response ) {
     53    if ( '1.9.4' === $response->new_version ) {
     54        $new_version = $response->new_version;
     55
     56        /* translators: %s: version number */
     57        echo wp_kses_post( sprintf( __( '<strong>Notice:</strong> If you are below version %s. Please update Immediately. This update contains a fix for a known XSS Vulnerability', 'uuc' ), $new_version ) );
     58    }
     59}
Note: See TracChangeset for help on using the changeset viewer.