Plugin Directory

Changeset 3428394


Ignore:
Timestamp:
12/27/2025 08:43:55 PM (2 months ago)
Author:
ashanjay
Message:

2.2 (2025-12-27)

ADDED: Option to enable Sun and moon information in footer
ADDED: Moon month view focused around moon phases
ADDED: Data metrics for entry
FIXED: header getting hidden behind wp bar - thank you steve
FIXED: tag text color adjustment based on background
FIXED: to focus on search field when clicked
FIXED: Ajax calls CSRF preventions
UPDATED: timezones to use wordpress based timezone list
UPDATED: Moved tags to top of the new entry form
UPDATED: Layout design and styles

Location:
lifepress
Files:
82 added
23 edited

Legend:

Unmodified
Added
Removed
  • lifepress/trunk/README.txt

    r3244643 r3428394  
    44Author URI: https://ashanjay.com
    55Requires at least: 6.0
    6 Tested up to: 6.7.2
    7 Stable tag: 2.1.3
     6Tested up to: 6.9
     7Stable tag: 2.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1515https://www.youtube.com/watch?v=umNuBKNpHBI
    1616
    17 LifePress is a calendar based journal recorder that will allow you to track back progress and review past events to learn from the past and make positive progress in future. With LifePress you can record unlimited daily events easily with unlimited color-coded categories separated for each user. Track back recorded events quickly with weekly and monthly calendar view.
    18 
    19 You are the creator of wonderful events, journal them with **[LifePress](https://ashanjay.com/lifepress/)**.
     17LifePress is a calendar-based personal journal designed to help you consciously record, reflect, and grow through your life events.
     18
     19Instead of scattered notes or forgotten logs, LifePress gives you a visual timeline of your life — allowing you to look back, recognize patterns, track progress, and move forward with clarity.
     20
     21Each logged-in user gets their own private journal calendar, with unlimited entries, color-coded categories, rich descriptions, images, and now custom data metrics and a lunisolar (moon phase) calendar view.
     22
     23You are the creator of your life experiences. LifePress helps you record them with intention.
     24
     25Learn More: **[LifePress](https://ashanjay.com/lifepress/)**.
    2026
    2127== Main FEATURES ==
    2228
    23 * Record **unlimited** daily events
    24 * Create unlimited color-coded event categories
    25 * Edit event categories in real-time
    26 * Ability to write lengthy description for entries if desired
    27 * Record events by each loggedin website user
    28 * Navigate through months or weeks from top navigator
    29 * Easily check back and view or track recorded events and progress
    30 * Weekly and monthly view of events
    31 * Search previously recorded events
    32 * Compatible with responsive design for veiwing from various devices
    33 * Various pluggable actions and filters allow developers to extend features
    34 * Quickly access any month from fast selector
    35 * From any date come back easily to current date
    36 * Attach images to entries
    37 * Insert Calendar dashboard anywhere on your site using shortcode
    38 * Ability to set timezone for entries
    39 
    40 == 21 days to make a change in your life ==
    41 
    42 Scientists have calculated that an average of 21 days are required to be established as a habit in your life, if done repeatedly on those days. LifePress offers a great platform to record your repeated attempts at learning a new talent or practice to improve for 21 days. If you record these repeated attempts in LifePress, you can easily look back and see when you started the 21 day challenge, when you fell off, and how you are making progress.
    43 
    44 
    45 == Own your personal Journal Data ==
    46 
    47 With LifePress, journal entry data is all yours. Your personal data is privately saved only in your database and only you can see them. Each logged in user will have their own separate LifePress calendar.
    48 
    49 == Business Applications ==
    50 
    51 LifePress is a great solution for business organizations that want to influence their members to record daily entries to track progress in a calendar format. Each user's data is only visible to that user and admin in the calendar, which makes it a great team empowering solution. This would be an ideal solution for life coaches, fitness instructors, physical/life therapists who want their clients to record progressive data to help their clients make tangible changes in life.
    52 
    53 == LifePress Pro - Coming Soon! ==
    54 
    55 As we have received several requests to improve the lifepress plugin for greater application, we are developing the Lifepress Pro, plugin as an extension to LifePress that will bring greater data metric information for calendar entries. We are also hoping in future iterations to implement data visualization for weekly and monthly data aggregates and ability to set goals and calculate progress towards them.
     29* Record **unlimited** daily journal entries
     30* Create **unlimited** color-coded categories
     31* Real-time category editing
     32* Write short notes or long-form journal entries
     33* Each logged-in user has their own private calendar
     34* Weekly and monthly calendar views
     35* Navigate quickly between months and weeks
     36* Fast date selector + return to today anytime
     37* Search past entries easily
     38* Attach images to journal entries
     39* Timezone support for accurate entries
     40* Responsive design for all devices
     41* Insert the LifePress calendar anywhere using a shortcode
     42* Developer-friendly with pluggable actions and filters
     43
     44== 🗄️ Data Metrics (New in 2.2) ==
     45
     46LifePress now supports custom data metrics, allowing you to go beyond simple journaling.
     47
     48Create unlimited custom fields and attach them to journal entries to track meaningful data alongside your notes.
     49
     50Supported metric types include:
     51
     52* Text fields
     53* Checkable (yes/no) fields
     54* Multiple selectable values
     55
     56Perfect for tracking things like:
     57
     58* Mood, energy, or focus
     59* Habits and consistency
     60* Health, fitness, or learning progress
     61* Any personal or professional metric that matters to you
     62
     63Your journal becomes a living dataset of your life.
     64
     65== 🌙 Lunisolar Calendar - Moon View (New in 2.2) ==
     66
     67Switch from the standard calendar to a moon-phase (lunisolar) view and align your journaling with natural rhythms.
     68
     69Center your life awareness around:
     70
     71* New moons
     72* Full moons
     73* Waxing and waning cycles
     74
     75This view is ideal for those who prefer to plan, reflect, and reset in harmony with nature’s cycles rather than purely linear time.
     76
     77
     78== 🏆 21 days to make a change in your life ==
     79
     80Research suggests it takes around 21 days of consistent effort to form a habit.
     81
     82LifePress provides a powerful way to:
     83
     84* Record daily practice attempts
     85* Visually track streaks and breaks
     86* Reflect on when you started, paused, or recommitted
     87
     88Whether you’re building a habit, learning a skill, or healing through consistency, LifePress makes progress visible and honest.
     89
     90
     91== 💪 Own your personal Journal Data ==
     92
     93Your data stays fully under your control.
     94
     95* All entries are stored in your own WordPress database
     96* Journals are private by default
     97* Each user only sees their own LifePress calendar
     98* No external services, no data harvesting
     99
     100Your life data belongs to you.
     101
     102
     103== 🌐 Business Applications ==
     104
     105LifePress is also ideal for organizations and professionals who want to empower people through self-tracking:
     106
     107* Life coaches
     108* Fitness instructors
     109* Therapists
     110* Educators
     111* Wellness communities
     112
     113Users record daily entries privately, while admins can support and guide progress — making LifePress a powerful accountability and growth tool.
     114
     115== 🚀 Future Plans! ==
     116
     117LifePress is actively evolving, as we too use it daily for our personal journalling. Next we plan to add: List View and Lifespan/ long-term timeline view.
     118
     119Have ideas of feature requests? -- Please let us know via support forum!
    56120
    57121
    58122== Screenshots ==
    59123
    60 1. LifePress front-end interactive dashboard for loggedin user
    61 2. Super quick add new entry form
     1241. LifePress dashboard for logged-in users
     1252. New entry form
    621263. Journal entry with image view
    63 4. Edit entry tag form
     1274. Quick month select view
     1285. Entry tag edit view
     1296. Manage Metric Data editor
    64130
    65131== Changelog ==
     132= 2.2 (2025-12-27) =
     133ADDED: Option to enable Sun and moon information in footer
     134ADDED: Moon month view focused around moon phases
     135ADDED: Data metrics for entry
     136FIXED: header getting hidden behind wp bar - thank you steve
     137FIXED: tag text color adjustment based on background
     138FIXED: to focus on search field when clicked
     139FIXED: Ajax calls CSRF preventions
     140UPDATED: timezones to use wordpress based timezone list
     141UPDATED: Moved tags to top of the new entry form
     142UPDATED: Layout design and styles
     143
    66144= 2.1.3 (2025-2-21) =
    67145ADDED: Ability to add a home page link to header
  • lifepress/trunk/assets/admin.css

    r3138542 r3428394  
    11/*
    22 * Lifepress Admin Styles
    3  * @version 2.1
     3 * @version 2.2
    44 */
    55
    6 #lifepress_settings label{display: inline-block;}
    7 #lifepress_settings input[type=text]{display: block;width: 100%}
     6:root{
     7    --lp_color_1: #212121;
     8    --lp_color_blue: #5abdcd;
     9    --lp_color_orange: #F38630;
     10    --lp_border_color_1: #dadce0;
     11    --bgc_focus:#ffefe5;
     12    --bgc_past:#e9f9f8;
     13    --bgc_prev:#e9f9f8;
     14    --bgc_next:#f2e9f9;
     15    --lp_font_1: 'Poppins', sans-serif;
     16    --lp_font_2:'Noto Sans', arial;
     17    --lp_color_grey1:#666666;
     18    --lp_color_grey2:#d4d3d3;
     19
     20    --lpcg0:  #f6f7f7;
     21    --lpcg5:  #dcdcde;
     22    --lpcg10: #c3c4c7;
     23    --lpcg20: #a7aaad;
     24    --lpcg30: #8c8f94;
     25    --lpcg40: #787c82;
     26    --lpcg50: #646970;
     27    --lpcg60: #50575e;
     28    --lpcg70: #3c434a;
     29    --lpcg80: #2c3338;
     30    --lpcg90: #1d2327;
     31    --lpcg100:#101517;
     32
     33    --lpclg0:   #ffffff;
     34    --lpclg3:   #fbfbfc;
     35    --lpclg6:   #f7f7f8;
     36    --lpclg8:   #f5f5f6;
     37    --lpclg10:  #f2f2f3;
     38    --lpclg20:  #e6e6e8;
     39    --lpclg30:  #dadadd;
     40    --lpclg40:  #ceced2;
     41    --lpclg50:  #c2c2c6;
     42    --lpclg60:  #b6b6bb;
     43    --lpclg70:  #aaaaaa;
     44    --lpclg80:  #9e9e9f;
     45    --lpclg90:  #929293;
     46    --lpclg100: #858687;
     47}
     48
     49/* Generic */
     50    .lpcurp{cursor: pointer;}
     51    .lphop7:hover{opacity: .7}
     52
     53    .lpclb{color:var(--lp_color_blue)}
     54
     55    .lp_trans{
     56        -webkit-transition: all .2s ease;
     57        -moz-transition: all .2s ease;
     58        -ms-transition: all .2s ease;
     59        -o-transition: all .2s ease;
     60        transition: all .2s ease;
     61    }
     62
     63    /* Display */
     64        .dfx,.lpdfx{display: -webkit-flex;display: -moz-flex;display: -ms-flex;display: -o-flex;display: flex;}
     65        .lpgap5{gap:5px;}.lpgap10{gap:10px;}.lpgap15{gap:15px;}.lpgap20{gap: 20px;}
     66        .lpfxjcc, .lpfx_jc_c{-ms-flex-pack:center;justify-content:center;}
     67        .lpfxjcsb, .lpfx_jc_sb,.jutc-spacebt{-ms-flex-pack:space-between;justify-content:space-between;}
     68        .lpfx_jc_se{-ms-flex-pack:space-evenly;justify-content:space-evenly;}
     69        .lpfx_jc_sa{-ms-flex-pack:space-around;justify-content:space-around;}
     70        .lpfx_jc_fe{-ms-flex-pack:flex-end;justify-content:flex-end;}
     71        .lpfx_jc_fs{-ms-flex-pack:flex-start;justify-content:flex-start;}
     72        .lpfxaic, .lpfx_ai_c, .alic{align-items:center;}
     73        .lpfxaife, .lpfx_ai_fe{align-items:flex-end;}
     74        .lpfxaifs, .lpfx_ai_fs{align-items:flex-start;}
     75        .lpfxdrc, .lpfx_dr_c{flex-direction:column;}
     76        .lpfxdrcr, .lpfx_dr_cr{flex-direction:column-reverse;}
     77        .lpfxdrr, .lpfx_dr_r{flex-direction:row;}
     78        .lpfxdrrr, .lpfx_dr_rr{flex-direction:row-reverse;}
     79        .lpfxww, .lpfx_ww{flex-wrap: wrap;}
     80        .lpfx_b_50{flex-basis: 50%}
     81        .lpfx_110{flex:1}
     82        .lpfx_1{flex:1 1 auto;}
     83        .lpfx_10a{flex:1 0 auto;}
     84        .lpfx_g1{flex-grow:1;}
     85        .lpdn,.dn{display:none}
     86        .lpdb,.db{display:block}
     87        .lpdib{display:inline-block}
     88
     89    /* opacity */
     90    .lpop0{opacity:0}.lpop1{opacity:.1}.lpop2{opacity:.2}.lpop3{opacity:.3}.lpop4{opacity:.4}.lpop5{opacity:.5}.lpop6{opacity:.6}.lpop7{opacity:.7}.lpop8{opacity:.8}.lpop9{opacity:.9}.lpop10{opacity:1}
     91
     92    /* Font */
     93    .lpfz10{font-size: 10px;}.lpfz11{font-size: 11px;}.lpfz12{font-size: 12px;}.lpfz14{font-size: 14px;}.lpfz16,.fz16{font-size: 16px;}.lpfz18{font-size: 18px;}.lpfz24{font-size: 24px;}.lpfz30{font-size: 30px;}
     94
     95    /* Background */
     96        .lpbgclg0{background-color:var(--lpclg0)}.lpbgclg3{background-color:var(--lpclg3)}.lpbgclg6{background-color:var(--lpclg6)}.lpbgclg8{background-color:var(--lpclg8)}.lpbgclg10{background-color:var(--lpclg10)}.lpbgclg20{background-color:var(--lpclg20)}.lpbgclg30{background-color:var(--lpclg30)}.lpbgclg40{background-color:var(--lpclg40)}.lpbgclg50{background-color:var(--lpclg50)}.lpbgclg60{background-color:var(--lpclg60)}.lpbgclg70{background-color:var(--lpclg70)}.lpbgclg80{background-color:var(--lpclg80)}.lpbgclg90{background-color:var(--lpclg90)}.lpbgclg100{background-color:var(--lpclg100)}.lpbgcg0{background-color:var(--lpcg0)}.lpbgcg5{background-color:var(--lpcg5)}.lpbgcg10{background-color:var(--lpcg10)}.lpbgcg20{background-color:var(--lpcg20)}.lpbgcg30{background-color:var(--lpcg30)}.lpbgcg40{background-color:var(--lpcg40)}.lpbgcg50{background-color:var(--lpcg50)}.lpbgcg60{background-color:var(--lpcg60)}.lpbgcg70{background-color:var(--lpcg70)}.lpbgcg80{background-color:var(--lpcg80)}.lpbgcg90{background-color:var(--lpcg90)}.lpbgcg100{background-color:var(--lpcg100)}
     97
     98    /* hover */
     99        .lphbgclg0:hover{background-color:var(--lpclg0)}.lphbgclg3:hover{background-color:var(--lpclg3)}.lphbgclg6:hover{background-color:var(--lpclg6)}.lphbgclg8:hover{background-color:var(--lpclg8)}.lphbgclg10:hover{background-color:var(--lpclg10)}.lphbgclg20:hover{background-color:var(--lpclg20)}.lphbgclg30:hover{background-color:var(--lpclg30)}.lphbgclg40:hover{background-color:var(--lpclg40)}.lphbgclg50:hover{background-color:var(--lpclg50)}.lphbgclg60:hover{background-color:var(--lpclg60)}.lphbgclg70:hover{background-color:var(--lpclg70)}.lphbgclg80:hover{background-color:var(--lpclg80)}.lphbgclg90:hover{background-color:var(--lpclg90)}.lphbgclg100:hover{background-color:var(--lpclg100)}.lphbgcg0:hover{background-color:var(--lpcg0)}.lphbgcg5:hover{background-color:var(--lpcg5)}.lphbgcg10:hover{background-color:var(--lpcg10)}.lphbgcg20:hover{background-color:var(--lpcg20)}.lphbgcg30:hover{background-color:var(--lpcg30)}.lphbgcg40:hover{background-color:var(--lpcg40)}.lphbgcg50:hover{background-color:var(--lpcg50)}.lphbgcg60:hover{background-color:var(--lpcg60)}.lphbgcg70:hover{background-color:var(--lpcg70)}.lphbgcg80:hover{background-color:var(--lpcg80)}.lphbgcg90:hover{background-color:var(--lpcg90)}.lphbgcg100:hover{background-color:var(--lpcg100)}
     100
     101    /* border */
     102        .lpbr5{border-radius: 5px;}.lpbr10{border-radius: 10px;}.lpbr15{border-radius: 15px;}.lpbr20{border-radius: 20px;}.lpbr25{border-radius: 25px;}
     103
     104    .lpmarl10{margin-left: 10px;}
     105    .lpmarr10{margin-right: 10px;}
     106    .lpmar5-0{margin:5px 0;}
     107    .lppad10{padding:10px;}
     108    .lpw100p{width: 100%;}
     109
     110    .lp_trans{
     111        -webkit-transition: all .2s ease;
     112        -moz-transition: all .2s ease;
     113        -ms-transition: all .2s ease;
     114        -o-transition: all .2s ease;
     115        transition: all .2s ease;
     116    }
     117
     118
     119/* General */
     120#lifepress_settings label{display: inline-block;font-size: 14px;}
     121#lifepress_settings input[type=text]{display: block;width: 100%; flex:1}
    8122.lifepress_form_subbox{
    9123    background-color: #dbf9f7;
     
    14128    padding: 0px;margin-top: 10px; box-shadow: 0px 0px 20px -5px #0000001c;
    15129}
    16 .lifepress_sub_form{
    17     background-color: #c2ecea;
    18     padding: 10px 20px;
    19     border-radius: 10px;
    20     margin: 10px 0;
    21 }
     130.lifepress_sub_form{}
    22131.lp_settings_row{
    23132    padding:1px 20px;
    24133    border-bottom: 1px solid #e7e7e7
    25134}
    26 .lp_settings_row p{display: flex;justify-content: space-between;align-items: center;}
     135.lp_settings_row p{display: flex;align-items: center; flex-wrap:wrap;}
    27136.lp_settings_row p label{flex-basis: 50%;}
    28137.lp_settings_row:last-child{border:none;}
     
    30139
    31140/* loading */   
    32     .lp_loading{position: relative;}
     141    .lp_loader{
     142        height: 20px; width: 100px;
     143        border-radius: 20px;
     144        border:2px solid #828282;
     145        display: block;
     146        overflow: hidden;
     147        margin:40px auto;
     148    }
     149    @keyframes superman {
     150      0% {  transform: translate(-40px, 0);  }
     151      100% {   transform: translate(100px, 0); }
     152    }
     153    @keyframes initloaderA {
     154        0% {}
     155        100% {  transform: translateY(-66.67%);}
     156    }
     157    .lp_loader:before{
     158        content:"";
     159        width: 40px;
     160        height: 20px;
     161        background-color: #84c5d0;
     162        display: block;
     163        position: relative;
     164        animation-name: superman;
     165        animation-duration: 0.7s;
     166        animation-iteration-count: infinite;
     167        animation-direction: alternate;
     168        animation-timing-function: ease-in-out;
     169        animation-fill-mode: none;
     170        animation-delay: 0s;
     171    }
     172    .lp_loading{position: relative;overflow: hidden!important;}
    33173    .lp_loading:before{
    34174        content:"";
    35         background-color: #ffffffb5;
     175        /*background-color: #ffffffb5;*/
     176        background: rgb(247,247,247);
     177        background: linear-gradient(0deg,
     178            rgb(255, 255, 255, 0.5) 33.37%,
     179            rgb(189, 220, 253, 0.7) 50%,
     180            rgb(255, 255, 255, 0.5) 66.67%);
     181        animation:initloaderA 1.5s ease-in-out 0s infinite normal none running;
     182        transform:translateY(0%);
     183        top:0;left: 0;bottom: 0;
    36184        position: absolute;
    37         width: 100%; height: 100%; z-index: 10;top:0; left:0;
    38     }
     185        width: 100%; height: 300%; z-index: 10;
     186    }
     187    .lp_loading.lp_lightbox_in:before{top: 0;left: 0; border-radius: 20px;}
     188
     189/* Lightbox */
     190        #lp_lightboxes{ position: fixed;width: 100%;z-index: 900000; top:0; }
     191    #lp_lightboxes .lp_one_lightbox{
     192        opacity: 0; visibility: hidden;
     193        transition: all 0.1s ease;
     194        background: rgba(222, 222, 222, 0.7);
     195            position: fixed;
     196        width: 100%;
     197        height: 100%;top:0;right:0; bottom:0;
     198        overflow-y: auto
     199    }
     200    #lp_lightboxes .lp_one_lightbox.show{opacity: 1; visibility: visible;}
     201    .lp_one_lightbox .lp_one_lb_in{
     202        -webkit-transition: -webkit-transform 0.15s ease;
     203        transition: transform 0.15s ease;
     204        -webkit-transform: translateY(50px);
     205        transform: translateY(50px);
     206        box-shadow: 0px 0px 30px -5px #0000003d;
     207        background-color: #fbfbfb;
     208        position: relative;
     209        width: 90%;
     210        margin: 50px auto 30px; padding: 50px;
     211        border: none;
     212        border-radius: 25px;
     213        box-sizing: border-box;
     214    }
     215    .lp_one_lightbox.show .lp_one_lb_in{
     216         -webkit-transform: translateY(0px);
     217        transform: translateY(0px);
     218    }
     219
     220    .lp_lb_toprow{
     221        position: absolute;
     222        padding: 10px;
     223        height: 60px;
     224        width: 100%;
     225        display: flex;
     226        flex-direction: row;
     227        margin: 0;
     228        justify-content: flex-end;
     229        box-sizing: border-box;
     230        top: 0;
     231        right: 0;
     232    }
     233    .lp_lb_toprow button{
     234        outline: none;border: none; background: none;
     235        font-size: 16px;    height: 40px; width: 40px;
     236        border-radius: 50%; cursor: pointer;
     237    }
     238    .lp_lb_toprow button svg{color: var(--lp_color_grey1);}
     239    .lp_lb_toprow button:hover{
     240        outline: none;border: none;
     241        background-color: var(--lp_color_grey2)
     242    }
     243    .lp_lb_toprow button:hover svg{ color: var(--lp_color_1) }
     244    .lp_lb_close{
     245        position: relative;
     246        z-index: 90001;
     247        margin: 0 0px 0 10px;
     248        color: var(--lp_color_grey1);
     249        background-color: #f0f0f0;
     250        border-radius: 50%;
     251        padding: 20px;
     252        height: 28px;
     253        width: 28px;
     254        text-align: center;
     255        line-height: 90%;
     256        font-size: 28px;
     257        cursor: pointer;
     258        text-indent: -9999px;
     259        font-weight: 300;
     260        box-sizing: content-box;
     261        -moz-box-sizing: content-box;
     262            box-sizing: border-box;
     263       
     264    }
     265    .lp_lb_close:hover{background-color: var(--lp_color_grey2)}
     266    .lp_lb_close:hover:before,.lp_lb_close:hover:after{ background-color: var(--lp_color_1);    }
     267    .lp_lb_close:before{transform: rotate(45deg);}
     268    .lp_lb_close:after{transform: rotate(-45deg);}
     269    .lp_lb_close:before, .lp_lb_close:after{
     270        position: absolute;
     271        left: 18px;
     272        top: 9px;
     273        content: ' ';
     274        height: 50%;
     275        width: 2px;
     276        background-color: #666666;
     277    }
     278    .lp_one_lightbox{}
     279    .lp_entry_image img{border-radius: 10px;}
     280    .lp_editor_box {flex:1;}
     281
     282/* Metrics */
     283    .lpm_fields_content p{}
     284    .lpm_fields_content p.ui-state-highlight,
     285    .lpp_metrics .ui-state-highlight-big{display: inline-block; width: 150px;height:43px; margin:0; padding:0;background-color: #e6f3f5; border-radius: 15px;}
     286    .lpp_metrics .ui-state-highlight-big{display: block;width: 100%; height: 100px;margin-bottom: 5px;}
     287/* IO Elements */
     288    .lp_toggle {  cursor: pointer; display: inline-block;}
     289    .lp_toggle:hover{opacity: 0.8}
     290
     291    /* When checked → ON state */
     292    .toggle-svg.on .track { fill: var(--lp_color_blue);  transition: fill 0.4s ease;}
     293    .toggle-svg.on .knob {
     294      transform: translateX(260px); /* move from left to right */
     295      transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
     296    }
     297    /* Base styles & transitions */
     298    .toggle-svg .track {transition: fill 0.4s ease;}
     299    .toggle-svg .knob {
     300      transform: translateX(0);
     301      transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
     302      transform-origin: center;
     303    }
     304
     305
  • lifepress/trunk/assets/global.css

    r3244643 r3428394  
    11/**
    22 * LifePress Styles
    3  * @version 2.1.3
     3 * @version 2.2
    44 */
    55
     
    1717    --lp_color_grey1:#666666;
    1818    --lp_color_grey2:#d4d3d3;
     19
     20    --lpcg0:  #f6f7f7;
     21    --lpcg5:  #dcdcde;
     22    --lpcg10: #c3c4c7;
     23    --lpcg20: #a7aaad;
     24    --lpcg30: #8c8f94;
     25    --lpcg40: #787c82;
     26    --lpcg50: #646970;
     27    --lpcg60: #50575e;
     28    --lpcg70: #3c434a;
     29    --lpcg80: #2c3338;
     30    --lpcg90: #1d2327;
     31    --lpcg100:#101517;
     32
     33    --lpclg0:   #ffffff;
     34    --lpclg3:   #fbfbfc;
     35    --lpclg6:   #f7f7f8;
     36    --lpclg8:   #f5f5f6;
     37    --lpclg10:  #f2f2f3;
     38    --lpclg20:  #e6e6e8;
     39    --lpclg30:  #dadadd;
     40    --lpclg40:  #ceced2;
     41    --lpclg50:  #c2c2c6;
     42    --lpclg60:  #b6b6bb;
     43    --lpclg70:  #aaaaaa;
     44    --lpclg80:  #9e9e9f;
     45    --lpclg90:  #929293;
     46    --lpclg100: #858687;
    1947}
    2048
     
    2351        cursor: pointer;
    2452        text-transform: uppercase;
    25         padding: 10px 20px;
     53        padding: 7px 20px;
    2654        display: inline-block;
    2755        border-radius: 20px;
    2856        background-color: #fff;
    29         color:#c3c3c3;
     57        color: var(--lp_color_1);
    3058        font-size: 13px;
    3159        font-weight: bold;
     
    3866    .lp_btn.grey, .lp_form .lp_btn.grey,.lp_btn_grey{background-color: #c5c5c5; color:#fff;}
    3967    .lp_clickable{cursor: pointer;}
     68    .lp_btn.outlined{background-color: transparent; box-shadow: 0px 0px 0px 1px var(--lpcg40)}
     69    .lp_btn.outlined:hover{background-color: var(--lpcg40); color:#fff}
    4070    .lp_hide{display: none;}
    41 
    42     .mart5{margin-top:5px} .mart10{margin-top:10px} .mart15{margin-top:15px} .mart20{margin-top:20px} .mart25{margin-top:25px} .mart30{margin-top:30px} .mart40{margin-top:40px} .mart50{margin-top:50px}
    43     .marb0{margin-bottom:0px}.marb5{margin-bottom:5px} .marb10{margin-bottom:10px} .marb15{margin-bottom:15px} .marb20{margin-bottom:20px} .marb25{margin-bottom:25px} .marb30{margin-bottom:30px} .marb35{margin-bottom:35px} .marb40{margin-bottom:40px} .marb45{margin-bottom:45px} .marb50{margin-bottom:50px}
     71    .lp_btn.lp_svg{display: inline-flex; align-items: center; padding: 0; background-color: transparent;}
     72    .lp_btn.lp_svg svg{margin:0!important; padding: 5px 10px 5px 5px;}
     73
     74    .lp_trans{
     75        -webkit-transition: all .2s ease;
     76        -moz-transition: all .2s ease;
     77        -ms-transition: all .2s ease;
     78        -o-transition: all .2s ease;
     79        transition: all .2s ease;
     80    }
     81
     82    .lpmar0{margin:0;}.mart5{margin-top:5px} .mart10{margin-top:10px} .mart15{margin-top:15px} .mart20{margin-top:20px} .mart25{margin-top:25px} .mart30{margin-top:30px} .mart40{margin-top:40px} .mart50{margin-top:50px}
     83    .marb0{margin-bottom:0px}.marb5{margin-bottom:5px} .lpmarb10,.marb10{margin-bottom:10px} .marb15{margin-bottom:15px} .marb20{margin-bottom:20px} .marb25{margin-bottom:25px} .marb30{margin-bottom:30px} .marb35{margin-bottom:35px} .marb40{margin-bottom:40px} .marb45{margin-bottom:45px} .marb50{margin-bottom:50px}
    4484    .padb5{padding-bottom:5px} .padb10{padding-bottom:10px} .padb15{padding-bottom:15px} .padb20{padding-bottom:20px} .padb25{padding-bottom:25px} .padb30{padding-bottom:30px} .padb40{padding-bottom:40px} .padb50{padding-bottom:50px}
    4585    .padt0{padding-top:0px}.padt5{padding-top:5px} .padt10{padding-top:10px} .padt15{padding-top:15px} .padt20{padding-top:20px} .padt25{padding-top:25px} .padt30{padding-top:30px} .padt40{padding-top:40px} .padt50{padding-top:50px} .padt60{padding-top:60px}
    4686    .padr5{padding-right:5px} .padr10{padding-right:10px} .padr15{padding-right:15px} .padr20{padding-right:20px} .padr25{padding-right:25px} .padr30{padding-right:30px} .padr40{padding-right:40px} .padr50{padding-right:50px} .padr60{padding-right:60px}
     87    .padl10{padding-left: 10px;}
    4788    .marr5{margin-right:5px} .marr10{margin-right:10px} .marr15{margin-right:15px} .marr20{margin-right:20px} .marr25{margin-right:25px} .marr30{margin-right:30px} .marr40{margin-right:40px} .marr50{margin-right:50px} .marr60{margin-right:60px}
    4889    .marl5{margin-left:5px} .marl10{margin-left:10px} .marl15{margin-left:15px} .marl20{margin-left:20px} .marl25{margin-left:25px} .marl30{margin-left:30px} .marl40{margin-left:40px} .marl50{margin-left:50px} .marl60{margin-left:60px}
     
    5091    .pad0{padding:0px} .pad5{padding:5px} .pad10{padding:10px} .pad15{padding:15px} .pad20{padding:20px} .pad25{padding:25px}.pad30{padding:30px}
    5192    .mar0{margin:0px}.mar5{margin:5px} .mar10{margin:10px} .mar15{margin:15px} .mar20{margin:20px} .mar25{margin:25px}
     93    .lppad10{padding: 10px;}
    5294   
    5395    .pad0-20{padding: 0 20px;}
    5496    .pad0-30{padding: 0 30px;}
    55     .posr{position: relative;} .posa{position: absolute;}
     97    .lpposr, .posr{position: relative;} .posa, .lpposa{position: absolute;}
     98
     99    .lpmar0i{margin: 0!important}
    56100
    57101    /* Display */
    58102        .dfx,.lpdfx{display: -webkit-flex;display: -moz-flex;display: -ms-flex;display: -o-flex;display: flex;}
    59103        .lpgap5{gap:5px;}.lpgap10{gap:10px;}.lpgap15{gap:15px;}.lpgap20{gap: 20px;}
    60         .lpfx_jc_c{-ms-flex-pack:center;justify-content:center;}
    61         .lpfx_jc_sb,.jutc-spacebt{-ms-flex-pack:space-between;justify-content:space-between;}
     104        .lpfxjcc, .lpfx_jc_c{-ms-flex-pack:center;justify-content:center;}
     105        .lpfxjcsb, .lpfx_jc_sb,.jutc-spacebt{-ms-flex-pack:space-between;justify-content:space-between;}
    62106        .lpfx_jc_se{-ms-flex-pack:space-evenly;justify-content:space-evenly;}
    63107        .lpfx_jc_sa{-ms-flex-pack:space-around;justify-content:space-around;}
    64108        .lpfx_jc_fe{-ms-flex-pack:flex-end;justify-content:flex-end;}
    65109        .lpfx_jc_fs{-ms-flex-pack:flex-start;justify-content:flex-start;}
    66         .lpfx_ai_c, .alic{align-items:center;}
    67         .lpfx_ai_fe{align-items:flex-end;}
    68         .lpfx_ai_fs{align-items:flex-start;}
    69         .lpfx_dr_c{flex-direction:column;}
    70         .lpfx_dr_cr{flex-direction:column-reverse;}
    71         .lpfx_dr_r{flex-direction:row;}
    72         .lpfx_dr_rr{flex-direction:row-reverse;}
    73         .lpfx_ww{flex-wrap: wrap;}
     110        .lpfxaic, .lpfx_ai_c, .alic{align-items:center;}
     111        .lpfxaife, .lpfx_ai_fe{align-items:flex-end;}
     112        .lpfxaifs, .lpfx_ai_fs{align-items:flex-start;}
     113        .lpfxdrc, .lpfx_dr_c{flex-direction:column;}
     114        .lpfxdrcr, .lpfx_dr_cr{flex-direction:column-reverse;}
     115        .lpfxdrr, .lpfx_dr_r{flex-direction:row;}
     116        .lpfxdrrr, .lpfx_dr_rr{flex-direction:row-reverse;}
     117        .lpfxww, .lpfx_ww{flex-wrap: wrap;}
    74118        .lpfx_b_50{flex-basis: 50%}
    75119        .lpfx_110{flex:1}
     
    81125        .lpdib{display:inline-block}
    82126   
     127    /* border */
     128        .lpbr5{border-radius: 5px;}.lpbr10{border-radius: 10px;}.lpbr15{border-radius: 15px;}.lpbr20{border-radius: 20px;}.lpbr25{border-radius: 25px;}
     129        .lpbr50p{border-radius: 50%;}
    83130   
    84131    .w100{width: 100%;}
     
    92139        -moz-box-sizing: border-box;
    93140        box-sizing: border-box;}
     141    .lpofh{overflow: hidden;}
    94142
    95143    /* fonts */
    96144    .lpfont1, .lpff_1{font-family: var(--lp_font_1)}.lpfont2, .lpff_2{font-family: var(--lp_font_2)}
    97145
    98     .lpfz14{font-size: 14px;}.lpfz16,.fz16{font-size: 16px;}.lpfz18{font-size: 18px;}.lpfz24{font-size: 24px;}.lpfz30{font-size: 30px;}
     146    .lpfz10{font-size: 10px;}.lpfz11{font-size: 11px;}.lpfz12{font-size: 12px;}.lpfz14{font-size: 14px;}.lpfz16,.fz16{font-size: 16px;}.lpfz18{font-size: 18px;}.lpfz24{font-size: 24px;}.lpfz30{font-size: 30px;}
    99147
    100148    /* hover */
     
    106154    .lpop0{opacity:0}.lpop1{opacity:.1}.lpop2{opacity:.2}.lpop3{opacity:.3}.lpop4{opacity:.4}.lpop5{opacity:.5}.lpop6{opacity:.6}.lpop7{opacity:.7}.lpop8{opacity:.8}.lpop9{opacity:.9}.lpop10{opacity:1}
    107155
    108     .lp_trans{
    109         -webkit-transition: all .2s ease;
    110         -moz-transition: all .2s ease;
    111         -ms-transition: all .2s ease;
    112         -o-transition: all .2s ease;
    113         transition: all .2s ease;
     156   
     157
     158    @media (max-width: 850px){
     159        .lpdn_m{display: none;}
     160    }
     161    @media (max-width: 550px){
     162        .lpfxjccS{justify-content: center;}
     163        .lpdn_s{display: none;}
    114164    }
    115165
     
    133183    body.lifepress{
    134184        margin: 0; padding: 0; color:var(--lp_color_1);
    135         background-color: #fff; font-size: 14px;
     185        font-size: 14px;
    136186        box-sizing:border-box;
     187        font-family: var(--lp_font_1);
     188        background-color: var(--lp_color_1);
    137189    }
    138190    body.lifepress *{box-sizing:border-box;line-height: 100%;
     
    152204
    153205    .lp_dashboard{
     206        top:0;
    154207        box-sizing:border-box;     
    155208        font-size: 14px;
    156209        line-height: 100%;
    157210        flex-direction:column;
    158         width: 100%; height: 100%;
     211            border-radius: 10px;
     212        margin: 5px;
     213        background-color: #ffffff;
     214        box-sizing: border-box;
     215        width: calc(100% - 10px);
     216        height: calc(100% - 10px);
     217        overflow: hidden;
    159218        position: absolute;
    160219    }
     
    169228    }
    170229    .lp_new_btn{
    171         font-size: 24px;
     230        font-size: 18px;
    172231        padding: 0;
    173         border-radius: 50%;
     232        border-radius: 10px;
     233        margin: 0px;
    174234        height: 35px;
    175235        width: 35px;
     
    177237        text-align: center;
    178238        border: none;
    179         /* font-weight: normal; */
    180         background-color: #fd5f00;
    181         color: #fff;
    182239    }
    183240    .lp_new_btn:hover{background-color:#9ad8e2 }
    184     .top_views .view{font-size: 20px;padding:14px 15px;cursor: pointer;}
     241    .top_views .view{font-size: 20px;min-width: 40px; text-align: center;}
    185242    .top_views .view:hover{background-color: #efefef}
    186243    .top_views .view.focus{background-color: var(--lp_color_blue);color:#fff; }
     
    268325    }
    269326    .lp_topbar .header_right .homelink{display: none;}
     327    .lp_footer{border-top:1px solid var(--lp_border_color_1);}
    270328/* in page layout */
    271329    :root{
     
    287345    border: none;}
    288346
     347
     348/* Moon */
     349    :root{
     350        --moon_color:#fff;
     351        --moon_dark:#111;
     352    }
     353    .lp_moon_data{ overflow: hidden;}
     354    .lpmoon_container {
     355        display: flex;
     356        justify-content: space-between;
     357        align-items: flex-start;
     358        flex-wrap: nowrap;
     359        max-width: 1100px;
     360        margin: 0 auto;
     361    }
     362    .lp_moonphase {
     363        text-align: center;
     364        flex: 1;
     365        min-width: 40px;
     366    }
     367    .lp_moonphase .lp_moon, .lunarday.lp_moon {
     368        width: 20px;
     369        height: 20px;
     370        border-radius: 50%;
     371        margin: 0 auto 12px;
     372        background: #fff;
     373        position: relative;
     374        overflow: hidden;
     375        border:1px solid var(--moon_dark);
     376    }
     377    /* moon bar */
     378    .lp_moon_bar{
     379        background-color: #d8d8d8;
     380        height: 3px;
     381        border-radius: 10px;
     382        margin-top: 10px;
     383    }
     384    .lp_moon_bar .lp_moon_bar_on{
     385        background-color: #5f5f5f;border-radius: 10px;
     386        height: 3px;
     387        display: block;
     388        width: 40%;    position: relative;
     389    }
     390    .lp_moon_bar .lp_moon_bar_on b{
     391        background-color: #5f5f5f;
     392        display: block;
     393        width: 5px;
     394        height: 5px;
     395        border-radius: 50%;
     396        margin-top: -1px;
     397        position: absolute;
     398        right: 0;
     399    }
     400
     401    /* 8 Moon Phases */
     402    .lp_moon.new  , .lunarday.lp_moon.new      { background: #111; box-shadow: inset 0 0 30px #000; }
     403    .lp_moon.waxing-crescent::before { content:""; position:absolute; width:70%; height:100%; left:0; background:#111; border-radius:0 50% 50% 0; }
     404    .lp_moon.first-quarter { background: linear-gradient(to right, #111 50%, #fff 50%); }
     405    .lp_moon.waxing-gibbous::before { content:""; position:absolute; width:70%; height:100%; right:0px; background:var(--moon_color); border-radius:50%; }
     406    .lp_moon.full       { background: #fff;  }
     407    .lp_moon.waning-gibbous::before { content:""; position:absolute; width:70%; height:100%; left:0%; background:var(--moon_color); border-radius:0 50% 50% 0; }
     408    .lp_moon.last-quarter { background: linear-gradient(to right, #fff 50%, #111 50%); }
     409    .lp_moon.waning-crescent::before { content:""; position:absolute; width:70%; height:100%; right:0%; background:#111; border-radius:50% 0 0 50%; }
     410
     411    .lp_moonphase .lp_moon.waxing-gibbous,
     412    .lp_moonphase .lp_moon.waning-gibbous
     413    {background-color: var(--moon_dark)}
     414
     415    .lp_moonphase .lp_label {  font-size: 0.9rem;   margin-top: 8px; opacity: 0.9; display: none;}
     416
     417    .lp_current-moon-highlight {
     418        transform: scale(1.25);
     419        border: 3px solid #4fc3f7;
     420        box-shadow: 0 0 30px #4fc3f7 !important;
     421    }
     422
    289423/* no access */
    290424    .lp_no_access{text-align: center;padding: 50px;}
     
    294428    #lp_lightboxes .lp_one_lightbox{
    295429        opacity: 0; visibility: hidden;
    296         transition: all 0.3s;
     430        transition: all 0.1s ease;
    297431        background: rgba(222, 222, 222, 0.7);
    298432            position: fixed;
     
    303437    #lp_lightboxes .lp_one_lightbox.show{opacity: 1; visibility: visible;}
    304438    .lp_one_lightbox .lp_one_lb_in{
    305         -webkit-transition: -webkit-transform 0.2s;
    306         transition: transform 0.2s;
     439        -webkit-transition: -webkit-transform 0.15s ease;
     440        transition: transform 0.15s ease;
    307441        -webkit-transform: translateY(50px);
    308442        transform: translateY(50px);
     
    379513    }
    380514    .lp_one_lightbox{}
     515    .lp_entry_image{
     516        background-color: #333;
     517        border-radius: 15px;
     518        text-align: center;
     519        padding: 10px;
     520    }
    381521    .lp_entry_image img{border-radius: 10px;}
    382522    .lp_editor_box {flex:1;}
     
    398538        0% {}
    399539        100% {  transform: translateY(-66.67%);}
     540    }
     541    @keyframes preload_anim {
     542        0% {}
     543        100% {  transform: translateX(140%);}
    400544    }
    401545    .lp_loader:before{
     
    430574    }
    431575    .lp_loading.lp_lightbox_in:before{top: 0;left: 0; border-radius: 20px;}
     576    .lp_lazy_loading{position: relative;  overflow: hidden; min-height: 30px; display: block;
     577        background-color:rgb(233 233 233);border-radius: 10px;}
     578    .lp_lazy_loading:before{
     579        background: linear-gradient(90deg, rgba(233, 233, 233,1) 0%, rgba(226,226,226,1) 25%, rgba(226,226,226,1) 75%, rgba(233, 233, 233,1) 100%);
     580        content:"";
     581        width: 100%;
     582        height: 100%;
     583        display: block;
     584        position: absolute;
     585        left: 0;
     586        animation:preload_anim 1.5s ease-in-out 0s infinite normal none running;       
     587        top:0;
     588        transform:translateX(-100%);
     589    }
    432590/* tooltip */
    433591    .lp_elms{    position: absolute; z-index: 48392749832;pointer-events: none;}
     
    511669
    512670    form.lp_form .no_icon{padding-left: 30px;}
    513     form .existing_tags{
    514         display: none;
    515         left: 30px;
    516         top: 28px;
    517         z-index: 2;
    518         background-color: #e8e8e8;
    519         padding: 15px 10px;
    520         border-radius: 15px;
    521         min-width: 50%;
    522     }
     671    form .existing_tags{  min-width: 50%;   }
    523672    form .form_tags_in{}
    524673    .lp_form .selected_tag{
     
    528677        margin-right: 10px;line-height: 100%; font-size: 13px;
    529678    }
    530     form .existing_tags{display: block;}
    531679    form .existing_tags.dn{display: none;}
    532     form .form_tags_in{display:inline-block;}
    533680    form .existing_tags i{
    534681        cursor: pointer;
    535         padding: 7px 10px;
     682        padding: 5px 10px;
    536683        border-radius: 5px;
    537684        background-color: #f3f3f3;
    538         margin-right: 5px; margin-bottom:5px;
    539685        display:inline-block; font-style: normal;
    540686    }
     687    form .existing_tags i.on{    box-shadow: 0px 0px 0px 2px #333;}
    541688    form .existing_tags i:hover{opacity: 0.7}
    542689    form.lp_form .tag_colors em{
     
    610757        box-shadow: none;
    611758        border-radius: 30px;
    612         padding: 10px 20px;
     759        padding: 10px 20px 10px 50px;
    613760        font-size:18px;
    614761        background-color: #f2f2f2;
     
    620767        border:1px solid transparent;
    621768    }
    622     body .lp_search_input input:focus{outline:none;border-color: var(--lp_border_color_1)}
     769    body .lp_search_input input:focus{
     770        outline:none;border-color: var(--lp_color_1)}
    623771    .lp_search_input .lp_btn{
    624             right: 10px; top: 30px; margin-right: 0px
    625     }
    626     .search_entry:hover{opacity: 1}
     772            right: 15px; top: 33px; margin-right: 0px
     773    }
     774    .search_entry .entry_date{background-color: transparent;padding: 0px;}
    627775    .search_entry{
    628         transition: all 0.3s;opacity: 0.6;
    629         color:#808080;
     776        color:var(--lp_color_1);
    630777        background-color: #f5f5f5;
    631778        margin-bottom: 10px;
    632779        padding: 10px 10px 5px;
    633780        border-radius: 10px;cursor: pointer;}
    634     .search_entry .entry_date{margin-bottom: 5px;color:#808080;}
     781    .search_entry .entry_date{margin-bottom: 5px;color:var(--lp_color_1);}
    635782    .search_entry h3{padding: 0;
    636783        margin: 0;
     
    659806    .lp_weeks_grid .dot.past{border-color:#c7c7c7 }
    660807    .lp_weeks_grid .dot.before{opacity: 0.2; }
    661 /* month view */
     808/* month view & Lunisolar */
    662809    .date_range .prev, .date_range .next{
    663810        width: 30px;
     
    672819    }
    673820    .date_range .prev:hover, .date_range .next:hover{background-color: #808080;color:#fff;}
    674     .lp_month_view .day_names .date_box{
     821    .lp_month_view .day_names .date_box,
     822    .lp_moon_view .day_names .date_box
     823    {
    675824        display: block;
    676825        float: left;
     
    694843        box-sizing: border-box;
    695844    }
    696     .lp_month_view .day_names .date_box em{display:none;}
     845    .lp_month_view .day_names .date_box em,.lp_moon_view .day_names .date_box em{display:none;}
     846    .lp_moon_view .days .date_box,
    697847    .lp_month_view .days .date_box{
    698848        display: block;
     
    719869        box-sizing: border-box;
    720870    }
    721     .lp_month_view{flex-direction:column;}
    722     .lp_month_view .weeks{flex-direction:column; }
    723     .lp_month_view .week{       
     871    .lp_month_view, .lp_moon_view{flex-direction:column;}
     872    .lp_month_view .weeks, .lp_moon_view .weeks{flex-direction:column; }
     873    .lp_month_view .week, .lp_moon_view .week{     
    724874        flex-direction:row;
    725875    }
    726     .lp_month_view .week .day{
     876    .lp_month_view .week .day, .lp_moon_view .week .day{
    727877        min-height: 120px;
    728878        /*flex:1 1 0%;*/
     
    736886        width:calc(100%/7);
    737887    }
    738     .lp_month_view .week .day:hover{background-color: #fbfbfb}
    739     .lp_month_view .day_top{
     888    .lp_month_view .week .day:hover,.lp_moon_view .week .day:hover{background-color: #fbfbfb}
     889    .lp_month_view .day_top, .lp_moon_view .day_top{
    740890        display: block;
    741891        padding: 0px 0 5px;
     
    744894        font-family: var(--lp_font_1);
    745895    }
    746     .lp_month_view .lp_entry_item{
     896    .lp_month_view .lp_entry_item, .lp_moon_view .lp_entry_item{
    747897        border-radius: 5px;
    748898        padding: 4px 6px 6px;
     
    753903        flex: 0 1 auto;
    754904    }
    755     .lp_month_view .lp_entry_in{ /*overflow: hidden;*/text-align: left}
     905    .lp_month_view .lp_entry_in,
     906    .lp_moon_view .lp_entry_in
     907    { /*overflow: hidden;*/text-align: left}
    756908    .lp_month_view .day.past{background-color: var(--bgc_past)}
    757909    .lp_month_view .day.prev{background-color: var(--bgc_prev)}
    758910    .lp_month_view .day.next{background-color: var(--bgc_next)}
    759     .lp_month_view .day.today,.lp_month_view .day.today.focus_mo{background-color: var(--bgc_focus)}
     911    .lp_moon_view .day.today,
     912    .lp_month_view .day.today,
     913    .lp_month_view .day.today.focus_mo{background-color: var(--bgc_focus)}
    760914    .lp_month_view .day.focus_mo{background-color: #ffffff}
    761     .lp_month_view .list_entries{
     915    .lp_month_view .list_entries,
     916    .lp_moon_view .list_entries{
    762917        display: flex;
    763918        flex-wrap: wrap;
    764919        align-content: flex-start;
    765920    }
     921/* lunar month */
     922    .lp_moon_view .week .day{display: flex;flex-direction: column;}
     923    .lp_moon_view .lunar_new_month{display: block;}
     924    .lp_moon_view .lunar_otherday{    opacity: 0.5;}
     925    .lp_moon_view .lunarday{    margin-right: 3px;}
     926    .lp_moon_view .day_top{  display: flex;   justify-content: space-between;  }
     927    .lp_moon_view .lunar_reg_day{ opacity: 0.5; display:flex; gap:3px;}
     928    .lp_moon_view .lunar_top{ display:flex;  }
     929    .lp_moon_view .lunarday.lp_moon{    margin: 0 5px 0 0; height: 13px; width: 13px;    text-indent: -9999px;}
     930    .lp_moon_view .day.full{background-color: #f5f5f5;}
     931    .lp_moon_view .day.new{    background-color: #f8f8f8;}
     932    .lp_moon_view .day.newMonth{    border-left: 3px solid var(--lp_color_blue);}
    766933
    767934/* list view */
     
    822989    .lp_week_view .week_col .day_name em,
    823990    .lp_list_view .list_row .date em,
    824     .lp_month_view .week .day_top em
     991    .lp_month_view .week .day_top em,
     992    .lp_moon_view .week .day_top em
    825993    {display:none; font-style: normal;}
    826994    .lp_week_view .lp_entry_item{
     
    8551023    .lp_lb_single_entry .entry_footer b{margin: 0 10px 0 0;}
    8561024
     1025/* metrics */
     1026    .lppmss{
     1027        border-radius: 10px;
     1028        margin-bottom: 15px;
     1029        border: 1px solid #c5c5c5;
     1030    }
     1031    .lpps{ 
     1032        padding: 10px 15px;margin:0;
     1033        border-bottom: 1px solid #c5c5c5
     1034    }
     1035    .lpps:last-child{border:none;}
     1036    .lpps p.lpps_{cursor: pointer;margin:0;padding:0;}
     1037    .lpps p.lpps_.select{}
     1038    .lpps p.lpps_:hover{    opacity: 0.7}
     1039    .lpps .lppsf{display: none; padding:15px 0 0;}
     1040    .lpps.select .lppsf{display: flex;gap:20px;flex-wrap: wrap;}
     1041
     1042    .lp_week_view .lp_entry_item .lpp_ti{margin:0 0px 0 0px;}
     1043    .lp_week_view .lp_entry_item .lpp_metrics{font-size: 11px;}
     1044    .lp_list_view .list_row .lp_entry_item .lpp_metrics{display: inline-block; margin:0;padding:0 0 0 10px;}
     1045
     1046    .lp_entry_item .lpp_metrics,
     1047    .lp_entry_item.notitle .lp_entry_in > .lpp_metrics ~ .lpp_metrics
     1048    {display: block;border-top: 1px solid #ffffff4a; margin-top: 5px; padding-top: 5px;}
     1049    .lp_entry_item.notitle .lp_entry_in > .lpp_metrics {border:none; padding-top: 0; margin-top: 0}
     1050
     1051    .lppsf .lpps_check{cursor: pointer;
     1052        background-color: #ddfaff;
     1053        border-radius: 10px;
     1054        padding: 5px 15px;
     1055        box-sizing: border-box;
     1056    }
     1057    .lppsf .lpps_check:hover{opacity: 0.7}
     1058    .lppsf .lpps_check svg{margin-top:0;font-size: 24px;}
     1059
     1060    .lppsf .lp_metrics_box.lpps_select{flex-direction: column;gap:5px; align-items: flex-start;}
     1061    .lppsf .lpps_select .lpps_selectable{
     1062        padding: 8px 10px;
     1063        display: inline-block;
     1064        background-color: #e3edec;
     1065        border-radius: 10px;
     1066        margin: 0 5px 5px 0;
     1067        cursor: pointer;
     1068    }
     1069    .lppsf .lpps_select .lpps_selectable:hover{opacity: 0.7}
     1070    .lppsf .lpps_select .lpps_selectable.select{    background-color: #c5c5c5;    color: #fff;}
     1071    .lppsf{}
     1072    .lppsf .lp_metrics_box{
     1073            min-width: 200px;
     1074        margin: 0;
     1075        display: flex;
     1076        align-items: center;
     1077        flex: 1;
     1078    }
     1079
    8571080/* footer notices */
    8581081    .footer_notices{
     
    8891112 @media (max-width: 1000px){
    8901113    .lp_lightbox_in{width: 90%}
    891     .lp_month_view .list_entries{overflow:hidden;}
    892     .lp_month_view .lp_entry_in{overflow:hidden;}
    893     .lp_month_view .lp_entry_item{
     1114    .lp_month_view .list_entries, .lp_moon_view .list_entries{overflow:hidden;}
     1115    .lp_month_view .lp_entry_in, .lp_moon_view .lp_entry_in{overflow:hidden;}
     1116    .lp_month_view .lp_entry_item, .lp_moon_view .lp_entry_item{
    8941117        height: 16px;padding: 2px 5px 3px;
    8951118        margin-right: 0px;width: 100%;
     
    9011124    .lp_range_title{font-size: 18px;}
    9021125    .lp_topbar .lifepress_title{display:none;}
     1126
     1127    .lp_moon_view .lunar_new_month
     1128    {display: none;}
    9031129 }
    9041130 @media (max-width: 500px){
    9051131    .lp_topbar{height:auto; padding:0;}
     1132    .header_right{padding: 4px 0;}
    9061133   
    9071134    .top_right{width: 100%;align-content: center;   flex-direction: column;}
     
    9391166    .lp_month_view .day_names .date_box span
    9401167    {display:none;}
     1168
     1169    .lp_moon_view .lunar_otherday
     1170    {display: none;}
     1171    .lp_moon_view .lunar_miniday{display: block;}
    9411172   
    9421173    .lp_month_view .week .day_top em,
  • lifepress/trunk/assets/script.js

    r3244643 r3428394  
    11/**
    22 * JS
    3  * @version 2.1.3
     3 * @version 2.2
    44 */
    55jQuery(document).ready(function($){
     
    2020DD = LIFEPRESS_DATA = false; // other data
    2121var TAGS_DATA = {}; // tags data
     22var FOOTER_DATA = {}; // footer data
    2223_TEMP_DATA  = {} // ajax loaded temp data
    2324VIEW = 'week_view';
     
    5960 //154,759,680,0000 --php 1547596800
    6061//1547625600  - 154762560
     62const LUNAR_CYCLE_MS = 29.530588853 * 86400000;
     63var LUNAR_DATA = {}; // all lunar data phases, moon index.
     64var LUNAR_REF = {}; // lunar month index ref
     65var LUNAR_NOW = {}; // current lunar cycle data
    6166
    6267// UTC
     
    8792        var defaults = {
    8893            'd':{},
     94            footer:{},
    8995            'entry':{},
    9096            'temp':{},
     
    105111
    106112            range_title();
    107             interaction()
     113            interaction();
     114            footer();
    108115
    109116        }
     
    111118        var range_title = function(){
    112119            if(!('mo_names' in dash.O.d)) return false;
    113 
    114             txt = dash.O.d.mo_names[ FOCUS.getMonth() ]+' '+FOCUS.getFullYear();
    115             el.find('.lp_range_title').html(txt);
    116120        }
    117121
     
    129133                var inp = $(this).siblings('input');
    130134                AJAXDATA['s'] = inp.val();
     135                AJAXDATA['nonce'] = lp_ajax.lp_nonce;
    131136
    132137                $.ajax({
     
    188193        }
    189194
     195        var footer = function(e){
     196            if( dash.O.footer ){
     197                BODY.find('.lp_footer').html( dash.O.footer );
     198                __draw_footer();
     199            }
     200        }
     201
    190202        init();
    191203    }
     
    203215        AJAXDATA['sM'] = DS.getMonth();
    204216        AJAXDATA['sY'] = DS.getFullYear();
    205 
    206 
     217        AJAXDATA['nonce'] = lp_ajax.lp_nonce;
    207218
    208219        $.ajax({
     
    216227                    TEMP = data.temp;
    217228                    TAGS_DATA = data.tags;
     229                    FOOTER_DATA = data.footer_data;
    218230                    DD = data.d;
    219231
     
    222234                    LOADED_date_range['s'] = parseInt(data.d.start_u)*1000;
    223235                    LOADED_date_range['e'] = parseInt(data.d.end_u)*1000;
     236
     237                    if( 'lunar_data' in data.d){
     238                        LUNAR_DATA = data.d.lunar_data;
     239                        update_lunar_ref( data.d.lunar_data.ref );
     240                        LUNAR_NOW = {'s': data.d.lunar_data.start, 'e': data.d.lunar_data.end};
     241                    }
     242                   
    224243
    225244                    modify_range_start();
     
    233252                                       
    234253                    _draw_entries();
    235                     __draw_tags();
     254                    __draw_tags(); 
     255                    mod_range_title();             
    236256
    237257                    $('body').lp_dash({
    238258                        d: data.d,
    239                         entry: data.entry
     259                        entry: data.entry,
     260                        footer: data.footer,
    240261                    });
    241262                }               
     
    290311           
    291312        }
     313        if(VIEW == 'moon_view' ){
     314            //const LUNAR_CYCLE_MS = 29.530588853 * 86400000;
     315
     316            // initialize focus on first load
     317            if (!FOCUS)  FOCUS = new Date(parseInt(LUNAR_DATA.start) * 1000);
     318
     319            DS = new Date( parseInt( LUNAR_DATA.start ) * 1000 );
     320            DE = new Date( parseInt( LUNAR_DATA.end ) * 1000 );
     321
     322            if( direction == 'today'){
     323                DS = new Date( parseInt( LUNAR_NOW.s ) * 1000 );
     324                DE = new Date( parseInt( LUNAR_NOW.e ) * 1000 );
     325            }
     326
     327            // move focus by ONE lunar cycle
     328            if (direction === 'next'){
     329
     330                DE.setDate( DE.getDate() + 1 );
     331                const  nextRange = LUNAR_REF[ DE.getFullYear()+'-'+ (DE.getMonth()+1) +'-'+ DE.getDate()  ];
     332               
     333                if( nextRange[0] && nextRange[1]){
     334                    LUNAR_DATA.start = nextRange[0];
     335                    LUNAR_DATA.end = nextRange[1];
     336                    DS = new Date( parseInt( nextRange[0] ) * 1000 );
     337                    DE = new Date( parseInt( nextRange[1] ) * 1000 );
     338                }else{
     339                    DS = new Date( DS.getTime() + LUNAR_CYCLE_MS - 1000 );
     340                    DE = new Date( DE.getTime() + LUNAR_CYCLE_MS - 1000 );
     341                }               
     342            }
     343            if (direction === 'prev'){
     344
     345                const currentDate = DS.getFullYear()+'-'+ (DS.getMonth()+1) +'-'+ DS.getDate();
     346                //console.log('CUR '+currentDate);
     347                //console.log(LUNAR_REF);
     348
     349                const keys = Object.keys(LUNAR_REF);
     350                keys.sort((a, b) => new Date(a) - new Date(b));
     351
     352                const index = keys.indexOf(currentDate);
     353                const prevKey = index > 0 ? keys[index - 1] : null;
     354                const prevItem = prevKey ? LUNAR_REF[prevKey] : null;
     355                //console.log('PREV '+ prevItem);
     356                if( prevItem[0] && prevItem[1]){
     357                    LUNAR_DATA.start = prevItem[0];
     358                    LUNAR_DATA.end = prevItem[1];
     359                    DS = new Date( parseInt( prevItem[0] ) * 1000 );
     360                    DE = new Date( parseInt( prevItem[1] ) * 1000 );
     361                    //console.log('NEW C '+ DS.getFullYear()+'-'+ (DS.getMonth()+1) +'-'+ DS.getDate() );
     362                }else{
     363                    DS = new Date( DS.getTime() - LUNAR_CYCLE_MS - 1000 );
     364                    DE = new Date( DE.getTime() - LUNAR_CYCLE_MS - 1000 );
     365                }         
     366            }   
     367
     368        }
    292369        if(VIEW == 'week_view' ){
    293370
     
    305382
    306383        }
     384
     385        mod_range_title();
    307386    }
    308387
     
    349428
    350429            // do translative month name
    351             txt = DD.mo_names[ FOCUS.getMonth() ]+' '+FOCUS.getFullYear();
     430            var txt = DD.mo_names[ FOCUS.getMonth() ]+' '+FOCUS.getFullYear(); 
     431            //console.log(txt);
     432
     433            if(VIEW == 'moon_view' ){
     434                txt = LUNAR_DATA.moon_title ;       
     435                var currentMoonRef = '';
     436               
     437                currentMoonRef = LUNAR_REF[ DS.getFullYear()+'-'+ (DS.getMonth()+1) +'-'+ DS.getDate()  ];
     438                //console.log('TITLE'+currentMoonRef);
     439
     440                txt = currentMoonRef[2];               
     441               
     442            }   
    352443            BODY.find('.lp_range_title').html(txt);
    353 
    354444        }
    355445
    356446    // draw the entries view on body
    357447        function get_temp_processed_html(temp_type, data){
     448            //console.log(TEMP);
     449            //console.log(temp_type);
     450            //console.log(data);
    358451            template = Handlebars.compile( TEMP[temp_type]);
    359452            return template( data );
     
    523616        }
    524617
     618        // Moon View
     619        if(VIEW == 'moon_view'){
     620
     621            tempDATA['weeks'] = {};         
     622            var box_count = 0;
     623            _week = 0;
     624            lunarday = 1;
     625
     626            //console.log( DS);
     627            //console.log( DE);
     628            var lunar_sow = DS.getDay();
     629           
     630
     631            // EACH DAY
     632            for( var d = new Date( DS.getFullYear() , DS.getMonth() , DS.getDate()) ;
     633                d.getTime() <= DE.getTime();
     634                d.setDate( d.getDate() +1)
     635            ){
     636
     637                if( lunar_sow > 6) lunar_sow = 0;
     638                var day_of_week = DD.day_names[ lunar_sow ];
     639                var daybox_classes = [];
     640           
     641                i = box_count;     
     642               
     643                // week
     644                    if( box_count % 7 == 0 ){
     645                        _week++;
     646                        tempDATA.weeks[ _week] = {};
     647                        tempDATA.weeks[ _week]['days'] = {};
     648                    }
     649
     650                var month_start_html = '';
     651                var attr = '';
     652                if( d.getDate() == 1){
     653                    month_start_html = `<span class='lunar_new_month'>${ DD.mo_names[ (d.getMonth() ) ]}</span>`;
     654                }
     655
     656                var moon_occasions = '';
     657                if( lunarday == 1 ) {
     658                    moon_occasions = 'lp_moon new lp_tooltip';
     659                    daybox_classes.push('new');
     660                    attr = `title="${LUNAR_DATA.phases_plus[0]['time']}"`;
     661                }
     662                if( LUNAR_DATA && LUNAR_DATA.phases.first_quarter ==  d.getFullYear() +'-'+ ( d.getMonth()+1) +'-'+ d.getDate()){
     663                    moon_occasions = 'lp_moon first-quarter';
     664                    daybox_classes.push('first-quarter');
     665                }
     666                if( LUNAR_DATA && LUNAR_DATA.phases.full_moon ==  d.getFullYear() +'-'+ ( d.getMonth()+1) +'-'+ d.getDate()) {
     667                    moon_occasions = 'lp_moon full lp_tooltip';
     668                    daybox_classes.push('full');
     669                    attr = `title="${LUNAR_DATA.phases_plus[4]['time']}"`;
     670                }
     671                if( LUNAR_DATA && LUNAR_DATA.phases.last_quarter ==  d.getFullYear() +'-'+ ( d.getMonth()+1) +'-'+ d.getDate()) {
     672                    moon_occasions = 'lp_moon last-quarter';
     673                }
     674                if( LUNAR_DATA && LUNAR_DATA.phases.next_new_moon ==  d.getFullYear() +'-'+ ( d.getMonth()+1) +'-'+ d.getDate()) {
     675                    moon_occasions = 'lp_moon new';
     676                }
     677
     678                // new month
     679                if( d.getDate() == 1 ) daybox_classes.push('newMonth');
     680                const lunar_day_html =  `<spam class='lunarday ${moon_occasions}' ${attr}>${lunarday}</spam>`;
     681
     682
     683                tempDATA.weeks[_week].days[i] = {};
     684                tempDATA.weeks[_week].days[i]['lunarday'] = lunarday;
     685                tempDATA.weeks[_week].days[i]['time'] = d.getTime()/1000;
     686                tempDATA.weeks[_week].days[i]['this_date'] = `<span class='lunar_top'>${lunar_day_html}<span class='lunar_reg_day'>${d.getDate()} <span class='lunar_otherday ${lunar_sow}'>${day_of_week.s}</span>
     687                    <span class='lunar_miniday lpdn'>${day_of_week.m}</span>
     688                    </span>                 
     689                    </span>${month_start_html}`;
     690
     691                thisD_SU = Math.floor(d.getTime()/1000);
     692                thisD_EU = thisD_SU + 86400; // day ending unix
     693               
     694
     695                // start of week
     696                    if( NOW.getDate() == d.getDate() && NOW.getMonth() == d.getMonth() && NOW.getFullYear() == d.getFullYear() ) tempDATA.weeks[_week].days[i]['today'] = true ;
     697                    if(NOW.getTime() > d.getTime()) tempDATA.weeks[_week].days[i]['past'] = true ;
     698                    if(FOCUS.getMonth() == d.getMonth()) tempDATA.weeks[_week].days[i]['focus_mo'] = true ;
     699
     700                // previous and next month
     701                    if( FOCUS.getMonth() != d.getMonth() ) {
     702                        if( d.getMonth() > FOCUS.getMonth() )
     703                            tempDATA.weeks[_week].days[i]['next'] = true ;
     704
     705                        if( d.getMonth() < FOCUS.getMonth() )
     706                            tempDATA.weeks[_week].days[i]['prev'] = true ;
     707                    }
     708
     709                // entries
     710                if(EN && typeof EN === 'object' ){
     711                    tempDATA.weeks[_week].days[i]['entries'] = {};
     712                    $.each(EN, function(ind,val){
     713                        if( val === undefined) return;
     714                        if(val.time >= thisD_SU && val.time < thisD_EU){                       
     715                            tempDATA.weeks[_week].days[i].entries[ind] = __populate_with_tag_data(val);
     716                        }
     717                    });
     718                }
     719
     720                // day box classes
     721                tempDATA.weeks[_week].days[i]['classes'] = daybox_classes.join(' ');
     722
     723                box_count++;
     724                lunarday++;
     725                lunar_sow++;
     726            }
     727               
     728        }
     729
    525730        //console.log( tempDATA);
    526731        BODY.trigger('populate_tempDATA',[tempDATA]);
     
    528733        _html = get_temp_processed_html(VIEW, tempDATA);
    529734       
    530         BODY.find('.lp_body_view_content').html( _html );       
     735        BODY.find('.lp_body_view_content').html( _html );
     736   
    531737    }
    532738
     
    540746        _html = get_temp_processed_html('tags_view', tempDATA);
    541747        BODY.find('.lp_tags').html( _html );
     748    }
     749
     750    function __draw_footer(){
     751        //console.log(FOOTER_DATA);
     752
     753        _html = get_temp_processed_html('footer_left', FOOTER_DATA);
     754        _htmlR = get_temp_processed_html('footer_right', FOOTER_DATA);
     755        BODY.find('.lp_footer_left').html( _html );
     756        BODY.find('.lp_footer_right').html( _htmlR );
     757    }
     758
     759// LUNAR Functions
     760    function update_lunar_ref(REF_DATA){
     761        console.log('REF UPDATE');
     762        $.each( REF_DATA , function(index, val){
     763            LUNAR_REF[ index ] = val;
     764        });
    542765    }
    543766
     
    551774
    552775// Click interactions
     776    const LP_Actions = {
     777        E:{
     778            BB: $('body'),
     779        },
     780        init(){
     781            const { E } = this;
     782            // bind events
     783            E.BB.on('get_temp_data', (e, data) => this.handle_get_temp_data(e, data) );
     784
     785            // metrics
     786            E.BB.on('click','.lpps_',function(){
     787                const box = $(this).parent();
     788                box.toggleClass("select");
     789            });
     790            // select a check field
     791            E.BB.on('click','.lpps_check',function(){
     792                const $el = $(this);
     793                $el.toggleClass('uncheck');
     794                $el.find('svg').toggleClass('fa-circle fa-circle-check');
     795                $el.find('input').val( $el.hasClass('uncheck') ? '':'y' );
     796            });
     797
     798            // select selectable field
     799            E.BB.on('click','.lpps_selectable',function(){
     800                const $el = $(this);
     801                const type = $el.closest('.lpps_select').hasClass('single') ? 'single':'multi';
     802
     803                if( type == 'single'){
     804                    $el.siblings('span').removeClass('select');
     805                    $el.addClass('select');
     806                }else{
     807                    $el.toggleClass('select');
     808                }
     809
     810                var value = [];
     811                $el.parent().find('span.select').each(function(){
     812                    value.push( $(this).data('val') );
     813                });
     814
     815                $el.siblings('input').val( value.join(', ') );
     816            });
     817
     818        },
     819        handle_get_temp_data(e, data){
     820            var AJAXDATA = {}
     821            AJAXDATA['action'] = 'lp_load_temp_content';
     822            AJAXDATA['d'] = data;
     823            AJAXDATA['nonce'] = lp_ajax.lp_nonce;
     824
     825            $.ajax({
     826                beforeSend: function(){  },
     827                type: 'POST',url:lp_ajax.ajaxurl,data: AJAXDATA,dataType:'json',
     828                success:function(data){     
     829                    if(data.status == 'good'){
     830                        _TEMP_DATA = data.content;
     831                    }   
     832                },complete:function(){  }
     833            });
     834        }
     835    }
     836    LP_Actions.init();
     837
    553838    BODY
    554839        // others
    555             .on('get_temp_data',function(e,data){
    556                 var AJAXDATA = {}
    557                 AJAXDATA['action'] = 'lp_load_temp_content';
    558                 AJAXDATA['d'] = data;
    559 
    560                 $.ajax({
    561                     beforeSend: function(){  },
    562                     type: 'POST',url:lp_ajax.ajaxurl,data: AJAXDATA,dataType:'json',
    563                     success:function(data){     
    564                         if(data.status == 'good'){
    565                             _TEMP_DATA = data.content;
    566                         }   
    567                     },complete:function(){  }
    568                 });
    569             })
    570840            .on('click','.lp_trig_action',function(event, other_data){
    571841                O = $(this);
    572842                d = O.data('d');
    573843
     844                // select a month
     845                    if(d.type == 'lb_temp' && d.temp_key == 'month_select_view' && VIEW == 'moon_view') {
     846                        console.log('Moon View does not support month selecting');
     847                        return;
     848                    }
     849                   
     850
    574851                //console.log(d);
    575852
     
    592869                    d['tags'] = {};
    593870                    d.tags = TAGS_DATA;
    594                    
     871
     872
    595873                    //console.log(d);
    596874
     
    602880                    _content = get_temp_processed_html(d.temp_key, d );
    603881                    BODY.find('.lp_lb_content').html( _content );
     882
     883                    // if search
     884                    if( d.temp_key == 'search_view'){
     885                        setTimeout( () => { BODY.find('.lp_search_inputfield').focus();},500 );
     886                    }
    604887
    605888                    // for entry form process text editor
     
    713996
    714997        // click on entry items from anywhere
    715             .on('click','.lp_entry_item',function(){               
     998            .on('click','.lp_entry_item',function(e){
     999                e.preventDefault(); e.stopPropagation();               
    7161000           
    7171001                entry_id = $(this).data('id');
     
    7691053            })
    7701054
    771         // when navigated to new date ranges
     1055        // when navigated to new date ranges -- month arrow click
    7721056        .on('click','.lp_view_change',function(){
    7731057               
     
    7791063
    7801064        // click on a month date box
    781         .on('click','.lp_month_view .day',function(event){
     1065        .on('click','.lp_month_view .day, .lp_moon_view .day',function(event){
    7821066            event.stopImmediatePropagation();
    7831067            //console.log($(event.target).attr('class'));
     
    8941178
    8951179        AJAXDATA['start_u'] = DS.getTime();
    896         AJAXDATA['end_u'] = DE.getTime();           
     1180        AJAXDATA['end_u'] = DE.getTime();   
     1181        AJAXDATA['nonce'] = lp_ajax.lp_nonce;       
    8971182
    8981183        // console.log( LOADED_date_range.s+' '+ AJAXDATA.start_u);
     
    9091194            $.ajax({
    9101195                beforeSend: function(){                     
    911                     //_draw_entries(); // draw the grids before entried populated
    912                     mod_range_title();
     1196                    //_draw_entries(); // draw the grids before entried populated                   
    9131197                    BODY.find('.lp_body_view_content').addClass('lp_loading');
    9141198                },
     
    9251209                    LOADED_date_range['e'] = (LOADED_date_range.e >= data.end_u? LOADED_date_range.e :data.end_u);
    9261210
     1211                    if( 'lunar_data' in data.d){
     1212                        LUNAR_DATA = data.d.lunar_data;
     1213                        update_lunar_ref( data.d.lunar_data.ref );
     1214                    }
     1215
     1216                    modify_range_start();
    9271217                    _draw_entries();
     1218                    mod_range_title();
    9281219
    9291220                },complete:function(){
     
    10601351            FOCUS.setFullYear( NOW.getFullYear() );
    10611352
    1062             modify_range_start();
     1353            modify_range_start('today');
    10631354
    10641355            _load_new_entry_content_after_set();   
     
    10891380
    10901381        BODY.on('click','.lp_entry_tag',function(){
    1091             O = $(this);
    1092             term = O.html();
    1093             term_id = O.data('id');
    1094             c = O.data('c');
    1095 
     1382            const O = $(this);
     1383            const term = O.html();
     1384            const term_id = O.data('id');
     1385            const c = O.data('c');
     1386
     1387            O.addClass('on').siblings('i').removeClass('on');
    10961388            O.closest('form').find('input[name=tag]').val(term);
    10971389            O.closest('form').find('input[name=tag_id]').val(term_id);
    10981390            O.closest('form').find('input[name=tag_color]').val(c);
    10991391            O.closest('.lp_entry_tags').find('.selected_tag').html(term).css('background-color', c);
    1100 
    1101             O.parent().parent().addClass('dn');
    11021392
    11031393        })
     
    11101400            row.find('input').val( $(this).data('id') );
    11111401        });
    1112         BODY.on('click','.create_new_tag_btn',function(){
    1113             O = $(this);
    1114 
    1115             // select existing
    1116             if(O.siblings('.lp_tag_new').is(':visible')){
    1117                 O.siblings('.selected_tag').show();
    1118                 O.siblings('.lp_tag_new').addClass('dn');
    1119             // create new
    1120             }else{
    1121                 O.siblings('.selected_tag').hide();
    1122                 O.siblings('.existing_tags').addClass('dn');
    1123                 O.siblings('.lp_tag_new').removeClass('dn');
    1124             }           
     1402        BODY.on('click','.create_new_tag_btn',function(){           
     1403            $(this).closest('.lp_post_tags_content').find('.lp_tag_new').toggleClass('dn');
     1404        })
     1405        // adding new tag to list and selecting it
     1406        .on('click','.add_new_tag_btn',function(){
     1407            const O = $(this);
     1408            const $box = O.closest('.lp_post_tags_content');
     1409            const $form = $box.find('.lp_tag_new');
     1410            const color = $form.find('.newtag_c').val();
     1411
     1412            const html = `<i class='lp_tag_added_new lp_entry_tag lpfz12 on' data-id='new' style='background-color:#${color}' data-c='#${color}'>${$form.find('.tags').val()}</i>`;
     1413
     1414            $box.find('.form_tags_in').append( html );
     1415            $box.find('.lp_tag_added_new').trigger('click');
     1416            // reset form
     1417            $form.find('.tags').val('');
     1418            $form.find('.lp1.lp_new_tag_color').trigger('click');// close new tag form
     1419            $form.addClass('dn');
    11251420        })
    11261421        .on('click','.lp_new_tag_color',function(){
     
    12391534            //console.log(v1);
    12401535            return '';
     1536        });
     1537        Handlebars.registerHelper('tagSelect',function(v1, v2,  options){
     1538           
     1539            return v1 == v2 ? 'on':'off';
    12411540        });
    12421541
  • lifepress/trunk/includes/admin/class-admin.php

    r3244643 r3428394  
    22/**
    33 * Admin Section
    4  * @versino 2.1.3
     4 * @versino 2.2
    55 */
    66
     
    3434
    3535    public function admin_styles(){
     36        wp_register_script('fontawesome_solid', LIFEPRESS_URL. '/assets/libs/fontawesome/solid.js', array(),LIFEPRESS()->version,true );
     37        wp_register_script('fontawesome_fa', LIFEPRESS_URL. '/assets/libs/fontawesome/fontawesome.js', array(),LIFEPRESS()->version,true );
     38        wp_register_script('fontawesome', LIFEPRESS_URL. '/assets/libs/fontawesome/all.js', array(),LIFEPRESS()->version,true );
     39
     40        wp_enqueue_script('fontawesome_solid');
     41        wp_enqueue_script('fontawesome_fa');
    3642        wp_enqueue_style('admin', LIFEPRESS_URL. '/assets/admin.css','',LIFEPRESS()->version );
    37 
     43        wp_enqueue_script('lifepress_admin', LIFEPRESS_URL. '/assets/admin.js',array('jquery', 'jquery-ui-sortable'),LIFEPRESS()->version , true);
     44        wp_localize_script('lifepress_admin', 'lifepress_vars',
     45            [
     46                'url' => admin_url('admin-ajax.php'),
     47                'nonce' => wp_create_nonce('lp_ajax_nonce')
     48            ]
     49        );
    3850        do_action('lifepress_admin_styles');
    39 
    4051    }
    4152
     
    5667            ?>
    5768
     69            <div id='lp_lightboxes'></div>
    5870            <div id='lifepress_settings' style=''>
    5971
     
    7991                    ),
    8092                    array(
    81                         'type'=>'select',
     93                        'type'=>'yesno',
    8294                        'label'=> __('Add a home page link to top header in dashboard'),
    8395                        'name'=>'_homelink',
    84                         'options'=> array(
    85                             'no'=> __('No','lp'),
    86                             'yes'=> __('Yes','lp'),
    87                         ),
     96                    ),
     97                    array(
     98                        'type'=>'yesno',
     99                        'label'=> __('Show moon and sun information'),
     100                        'name'=>'_moonsun',
     101                        'tooltip'=> __('Display moon and sun information in the footer'),
     102                    ),array(
     103                        'type'=>'yesno',
     104                        'label'=> __('Enable Moon Month View [Beta]'),
     105                        'name'=>'_moonview',
     106                        'tooltip'=> __('Allow calendar to show as moon month view'),
    88107                    ),
    89108                    array(
     
    93112                            'week_view'=> __('Week View','lp'),
    94113                            'month_view'=> __('Month View','lp'),
     114                            'moon_view'=> __('Moon Month View (If enabled)','lp'),
    95115                        )),
    96116                        'default'=>'Week View',
     
    127147                        'default'=>'5',
    128148                        'name'=>'_years_count',
    129                     )
     149                    ),
     150                    array(
     151                        'type'=>'custom1',
     152                        'label'=> __('Configure Data Metrics'),
     153                        'name'=>'_datametrics',
     154                        'tooltip'=> __('Add measurable data types for each entry')
     155                    ),
    130156                ));
    131157
    132 
    133158                do_action('lifepress_admin_settings_end');
    134 
    135159                ?>
    136 
    137160                <div class='lp_settings_row'>
    138161                    <p class='submit'>
     
    163186
    164187            switch( $type){
     188                case 'custom1':
     189                    ?>
     190                    <p>
     191                        <span class='lpdfx lpfxdrc' style='flex-basis: 50%'>
     192                            <label><?php echo $label;?></label>
     193                            <?php if( !empty($tooltip) ) echo "<span class='lpop7'>{$tooltip}</span>"; ?>
     194                        </span>
     195                        <button class='lp_trig_datametric_trig button button-primary' data-action='lp_get_metric_init'><?php _e('Configure');?></button>
     196                    </p>
     197                    <?php
     198                break;
    165199                case 'notice':
    166200                    ?>
    167201                    <p><?php echo $content;?></p>
     202                    <?php
     203                break;
     204                case 'yesno':
     205                    $value = $value == 'yes'? 'yes':'no';
     206                    ?>
     207                    <p>
     208                        <span class='lpdfx lpfxdrc' style="flex-basis: 50%;">
     209                            <label><?php echo esc_html( $label );?></label>
     210                            <?php if( !empty($tooltip) ) echo "<span class='lpop7'>{$tooltip}</span>"; ?>
     211                        </span>
     212                        <span>
     213                            <input type="hidden" name='<?php echo $name;?>' value='<?php echo $value;?>'>
     214                          <svg class="lp_toggle toggle-svg <?php echo $value == 'yes'? 'on':'';?>" viewBox="0 0 550 500" width="50" height="34">
     215                            <!-- Background pill -->
     216                            <rect class="track" x="8" y="90" width="600" height="330" rx="170" fill="#333"></rect>
     217                            <circle class="knob" cx="180" cy="256" r="112" fill="white"/>
     218                          </svg>
     219                        </span>
     220                    </p>
    168221                    <?php
    169222                break;
     
    186239                                echo "<option {$S} value='". esc_html( $F )."'>". esc_html( $V )."</option>";
    187240                            }
    188 
    189241                            ?>
    190242                        </select>
     
    223275        return ob_get_clean();
    224276    }
     277
    225278
    226279    function save_settings(){
  • lifepress/trunk/includes/class-ajax.php

    r3229860 r3428394  
    55 */
    66
     7
     8
    79class LIFEPRESS_AJAX{
    810    public $SOW;
     
    1719
    1820        $ajax_events = array(
    19             'init_load'=>'init_load',
    20             'load_temp_content'=>'load_temp_content',           
    21             'load_entries'=>'load_entries',
    22             'get_item_data'=>'get_item_data',
    23             'form_submit'=>'form_submit',
    24             'delete_item'=>'delete_item',
    25             'search_entries'=>'search_entries',
    26             'load_months'=>'load_months',
     21            'init_load'             =>'init_load',
     22            'load_temp_content'     =>'load_temp_content',         
     23            'load_entries'          =>'load_entries',
     24            'get_item_data'         =>'get_item_data',
     25            'form_submit'           =>'form_submit',
     26            'delete_item'           =>'delete_item',
     27            'search_entries'        =>'search_entries',
     28            'load_months'           =>'load_months',
    2729        );
    2830        foreach ( $ajax_events as $ajax_event => $class ) {
     
    5658
    5759    // initial load data and templates
    58         function init_load(){
     60        public function init_load(){
     61
     62            check_ajax_referer('lp_nonce_key', 'nonce');
    5963
    6064            global $current_user;
    61 
    6265            if(!empty($current_user)) $this->user_id = $current_user->ID;
     66            $settings = new LIFEPRESS_Settings();
     67
     68            $view = sanitize_text_field( $_POST['view']);
    6369
    6470            $J = array();
     
    8995            $DD->setDate($sY,$sM ,1)->setTime( 0,0,0);
    9096            $sD = $DD->format('d');
    91 
    9297                       
    9398            $startDate = clone $DD;
     
    107112           
    108113            // end of month
    109                 $DD->modify( 'last day of this month' )
    110                     ->setTime(23, 59, 59);
    111 
     114                $DD->modify( 'last day of this month' )->setTime(23, 59, 59);
    112115                $end_range = $DD->format('U');     
    113116
     
    122125                }
    123126
    124            
     127            // lunisolar inclusion
     128                $LUN = LIFEPRESS()->lunisolar;
     129                $LUN->set_time();
     130                $LUNDATA = $LUN->get_moon_data();
     131
     132                if( $settings->check_yn('_moonview')){
     133                   
     134
     135                    $startDate->setTimestamp( $LUNDATA['start'] );
     136                    $DD->setTimestamp( $LUNDATA['end'] );
     137
     138                    $date_range = apply_filters('lifepress_ajax_date_range', [$startDate, $DD]);                   
     139
     140
     141                    // lunar data
     142                    $J['d']['lunar_data'] = $LUNDATA;
     143                    /*
     144                    [
     145                        'index'         => $LUNDATA['moon_index'],
     146                        'lun_date'      => $startDate->format('Y-m-d'),
     147                        'lun_start_u'   => $startDate->format('U'),
     148                        'lun_end_u'     => $DD->format('U'),
     149                        'lun_end_date'  => $DD->format('Y-m-d'), // for debug
     150                        'lun_sow'       => $startDate->format('w'),
     151                        'lun_moonth'    => __('Moon','lp'). ' '. $LUNDATA['moon_index'],
     152                        'lun_phases'    => $LUNDATA['phases'],
     153                        'ref'           => $LUNDATA['ref'],
     154                        'moons_in_year' => $LUNDATA['moons_in_year'],
     155                    ];
     156                    */
     157
     158                }else{
     159                    $date_range = apply_filters('lifepress_ajax_date_range', [$startDate, $DD]);
     160                }
     161       
    125162            $ENT = new LIFEPRESS_Entries();
    126163
    127             $J['entry'] = $ENT->get_entries( $start_range, $end_range);
     164            $J['entry'] = $ENT->get_entries(
     165                $date_range[0]->format('U'),
     166                $date_range[1]->format('U')
     167            );
    128168            $J['temp'] = array(             
    129169                'week_view'=>LIFEPRESS()->temp->get('week_view'),
     
    138178                'search_res_view'=>LIFEPRESS()->temp->get('search_res_view'),
    139179                'month_select_view'=>LIFEPRESS()->temp->get('month_select_view'),
     180                'footer_left'=>LIFEPRESS()->temp->get('footer_left'),
     181                'footer_right'=>LIFEPRESS()->temp->get('footer_right'),
    140182            );
    141183
    142184            $J['d']['start_u'] = $start_range;
    143185            $J['d']['end_u'] = $end_range;
     186
    144187       
    145188            // day names
    146189                $J['d']['day_names'] =
    147190                    array(
    148                         0=> array('f'=> __('Sunday','lp'), 's'=> __('Sun','lp') ,'i'=>0),
    149                         array('f'=> __('Monday','lp'), 's'=> __('Mon','lp') ,'i'=>1),
    150                         array('f'=> __('Tuesday','lp'), 's'=> __('Tue','lp') ,'i'=>2),
    151                         array('f'=> __('Wednesday','lp'), 's'=> __('Wed','lp') ,'i'=>3),
    152                         array('f'=> __('Thursday','lp'), 's'=> __('Thu','lp') ,'i'=>4),
    153                         array('f'=> __('Friday','lp'), 's'=> __('Fri','lp') ,'i'=>5),
    154                         array('f'=> __('Saturday','lp'), 's'=> __('Sat','lp') ,'i'=>6)
     191                        0=> array('f'=> __('Sunday','lp'), 's'=> __('Sun','lp') ,'i'=>0, 'm'=> __('S','lp')),
     192                        array('f'=> __('Monday','lp'), 's'=> __('Mon','lp') ,'i'=>1, 'm'=> __('M','lp')),
     193                        array('f'=> __('Tuesday','lp'), 's'=> __('Tue','lp') ,'i'=>2, 'm'=> __('T','lp')),
     194                        array('f'=> __('Wednesday','lp'), 's'=> __('Wed','lp') ,'i'=>3, 'm'=> __('W','lp')),
     195                        array('f'=> __('Thursday','lp'), 's'=> __('Thu','lp') ,'i'=>4, 'm'=> __('T','lp')),
     196                        array('f'=> __('Friday','lp'), 's'=> __('Fri','lp') ,'i'=>5, 'm'=> __('F','lp')),
     197                        array('f'=> __('Saturday','lp'), 's'=> __('Sat','lp') ,'i'=>6, 'm'=> __('S','lp'))
    155198                     );
    156199
     
    182225                $Dx->setTime(0,0,01);
    183226
    184                 $J['d']['debugs'] = $Dx;
     227                $J['d']['debugs'] = [
     228                    'now'=> $Dx,
     229                    'start'=> $date_range[0],
     230                    'end'=> $date_range[1],
     231                ];
     232
     233            // footer content               
     234                $tz_string = LIFEPRESS()->time->timezone_string;
     235                $z = $LUN::getSunConstellation('traditional');
     236
     237                $J['footer'] = $this->get_footer_content();
     238                $J['footer_data'] = [
     239                    'icon'                  => true,
     240                    'today_daylight'        => $LUN::getDaylightLength( $tz_string ),
     241                    'days_till_solar_event' => $LUN::getDaysToNextSolsticeEquinox( $tz_string ),
     242                    'solar_constellation'   => (( $z && isset($z['name']) )? $z['name'] :''),
     243                    'phases'                => $LUNDATA['phases_plus'],
     244                    'moon_progress'         => $LUNDATA['progress'],
     245                    'age'                   => $LUNDATA['age'],
     246                ];
     247
     248
    185249
    186250            wp_send_json( apply_filters('lifepress_ajax_init_load', $J ) ); wp_die();
     
    211275
    212276    // load months
    213         public function load_months(){         
    214 
     277        public function load_months(){
    215278            wp_send_json(array(
    216279                'status'=>'bad', 'error_msg'=>__('Could not create an entry','lp'),
     
    223286        public function form_submit(){
    224287
    225 
    226             // verify nonce
    227             if( empty($_POST['lp_nonce']) || !wp_verify_nonce( wp_unslash( $_POST['lp_nonce'] ), 'lp_nonce_key') ){
    228                 wp_die( esc_html__( 'Action failed. Please refresh the page and retry.','lp') );
    229             }
     288            check_ajax_referer( 'lp_nonce_key', 'lp_nonce' );
    230289
    231290            $HELP = new LIFEPRESS_Helper();
     
    270329
    271330                        // creating a new tag
    272                         if( isset($post['new_tag']) && !empty($post['new_tag'])){                       
    273                             $new_tag_id = $EN->set_lp_type_term( $post['new_tag']  );
    274 
    275                             if(!is_wp_error($new_tag_id ) ){
    276                                 $C = isset($post['c'])? $post['c']:'808080';
    277                                 $C = str_replace('#', '', $C); 
    278                                 $ETD = new LIFEPRESS_Type_Data();
    279 
    280                                 $ETD->set_id($new_tag_id);
    281                                 $ETD->set_new_meta('c',$C);
    282                                 $tag_data = $ETD->get_one_tag_json_data($new_tag_id);
    283                             }
     331                        if( isset($post['tag_id']) && $post['tag_id'] == 'new'){                       
     332                            $tag_data = $this->create_new_tag($EN, $post);
    284333                        }else{
    285334                            $new_tag_id = $EN->set_lp_type_term( $post['tag']  );
     
    336385
    337386                        // creating a new tag
    338                         if( isset($post['new_tag']) && !empty($post['new_tag'])){
    339                                                    
    340                             $new_tag_id = $EN->set_lp_type_term( $post['new_tag'] );
    341 
    342                             if(!is_wp_error($new_tag_id ) ){
    343                                 $C = isset($post['c'])? $post['c']:'808080';
    344                                 $C = str_replace('#', '', $C); 
    345 
    346                                 $ETD = new LIFEPRESS_Type_Data();
    347 
    348                                 $ETD->set_id($new_tag_id);
    349                                 $ETD->set_new_meta('c',$C);
    350                                 $tag_data = $ETD->get_one_tag_json_data($new_tag_id);
    351                             }
     387                        if( isset($post['tag_id']) && $post['tag_id'] == 'new'){   
     388                            $tag_data = $this->create_new_tag($EN, $post);
    352389
    353390                        }else{
     
    425462        }
    426463
     464        private function create_new_tag($EN, $post){
     465            $new_tag_id = $EN->set_lp_type_term( $post['tag']  );
     466            //error_log($new_tag_id);
     467            $tag_data = '';
     468
     469            if(!is_wp_error($new_tag_id ) ){
     470                $C = isset($post['tag_color'])? $post['tag_color']:'808080';
     471                $C = str_replace('#', '', $C); 
     472                $ETD = new LIFEPRESS_Type_Data();
     473
     474                $ETD->set_id($new_tag_id);
     475                $ETD->set_new_meta('c',$C);
     476                $tag_data = $ETD->get_one_tag_json_data($new_tag_id);
     477            }
     478            return $tag_data;
     479        }
     480
     481    // get footer content
     482        private function get_footer_content(){
     483           
     484            $settings = new LIFEPRESS_Settings();
     485
     486            // if moon sun data not enabled
     487            if( !$settings->check_yn('_moonsun')) return;
     488
     489            ob_start();?>
     490            <div class='lp_footer_in lpdfx lpfxdrr lpfxjcsb lpgap10 lpfxaic pad5 lpofh lpbr15 lpfxjccS' style="">
     491                <div class='lp_footer_left lpdfx lpfxdrr lpgap15 padl10 lpdn_s'></div>
     492
     493                <div class='lp_footer_right lpdfx lpfxdrr lpfxaic lpgap15 pad5 lpbr15 lpofh'></div>
     494            </div>
     495            <?php
     496            return ob_get_clean();
     497        }
     498
    427499    // Save image as featured image to post
    428         public function save_featured_image($postid, $var_name){
     500        private function save_featured_image($postid, $var_name){
    429501            if ($_FILES[$var_name]['error'] !== UPLOAD_ERR_OK) __return_false();
    430502
     
    445517        public function delete_item(){
    446518
    447             // verify nonce
    448             if( empty($_POST['lp_nonce']) || !wp_verify_nonce( wp_unslash( $_POST['lp_nonce'] ), 'lp_nonce_key') ){
    449                 wp_die( esc_html__( 'Action failed. Please refresh the page and retry.','lp') );
    450             }
     519            check_ajax_referer( 'lp_nonce_key', 'lp_nonce' );
    451520
    452521            $HELP = new LIFEPRESS_Helper();
     
    483552    // get an item data
    484553        public function get_item_data(){
     554            check_ajax_referer('lp_nonce_key', 'nonce');
     555
    485556            if( !isset($_POST['item_id']) || !isset($_POST['item_type'])){
    486557                wp_send_json(array(
     
    504575
    505576    // LOAD all entries
    506         function load_entries(){
     577        public function load_entries(){
     578
     579            check_ajax_referer('lp_nonce_key', 'nonce');
    507580
    508581            $view = sanitize_text_field($_POST['view']);
     
    512585            $sY = (int)$_POST['sY'];
    513586
    514             if($view == 'list_view'){
    515                 $sD = 1;
    516             }
     587            $start_unix = (int)( (int)($_POST['start_u']) /1000);
     588            $end_unix = (int)( (int)($_POST['end_u']) /1000);
     589
     590            if($view == 'list_view')    $sD = 1;       
    517591
    518592            $cD = new DateTime($sY.'-'.$sM.'-'.$sD);
    519593            $cD->setTimezone( LIFEPRESS()->time->timezone );
     594            $startDate = clone $cD;
    520595           
    521596            $_ee = $cD->format('Y-m');
    522597            $S = $cD->format('U');
     598
     599            $JSON = [];
    523600
    524601            // end of month value
     
    536613                    $E = $cD->format('U');
    537614                break;
     615                case 'moon_view':
     616
     617                    $LUN = LIFEPRESS()->lunisolar;                 
     618                    $LUN->set_time();
     619                    $LUNDATA = $LUN->get_moon_data( $start_unix );
     620                    $startDate->setTimestamp( $LUNDATA['start'] );
     621
     622                    $start_unix = $LUNDATA['start'];
     623                    $end_unix = $LUNDATA['end'];
     624
     625                    $JSON['lun_moonth'] = __('Moon','lp'). ' '. $LUNDATA['moon_index'];
     626                    $JSON['d']['lunar_data'] = $LUNDATA;           
     627
     628                break;
    538629            }
    539630           
     
    542633           
    543634            $ENT = new LIFEPRESS_Entries();
    544             $DD = new DateTime();
    545             $DD->setTimestamp( ( sanitize_text_field( $_POST['start_u'] )/1000) );
     635            $DD = ( new DateTime() )->setTimestamp( $start_unix  );         
    546636            $S = $DD->format('U');
    547             $DD->setTimestamp( ( sanitize_text_field( $_POST['end_u'] )/1000) );
     637            $JSON['d']['s'] = $DD->format('Y-m-d');
     638            $DD->setTimestamp( $end_unix );
    548639            $E = $DD->format('U');
    549 
    550             wp_send_json( array(
    551                 'entries'=> $ENT->get_entries($S, $E),
    552                 'start_u'=> $S * 1000,
    553                 'end_u'=> $E * 1000,
    554             ) ); wp_die();
     640            $JSON['d']['e'] = $DD->format('Y-m-d');
     641
     642            $JSON['entries'] = $ENT->get_entries($S, $E);
     643            $JSON['start_u'] = $S * 1000;
     644            $JSON['end_u'] = $E * 1000;
     645
     646            wp_send_json( $JSON ); wp_die();
    555647        }
    556648
    557649    // search entries
    558         function search_entries(){
     650        public function search_entries(){
     651            check_ajax_referer('lp_nonce_key', 'nonce');
    559652           
    560653            $s = sanitize_text_field($_POST['s']);
     
    571664
    572665    // TEMPLATES
    573         function load_temp_content(){
     666        public function load_temp_content(){
     667            check_ajax_referer('lp_nonce_key', 'nonce');
    574668            $d = $_POST['d'];
    575669
  • lifepress/trunk/includes/class-entries.php

    r2432078 r3428394  
    5151    }
    5252
    53     function create_new($args){
     53    public function create_new($args){
    5454        if(!empty($args) && is_array($args)){
    5555            $valid_type = (function_exists('post_type_exists') &&  post_type_exists($args['post_type']));
  • lifepress/trunk/includes/class-helper.php

    r3138542 r3428394  
    22/**
    33 *  Helper functions
    4  *  @version 2.1
     4 *  @version 2.2
    55 */
    66
     
    2626
    2727    // color calculations
    28         function is_light_color($hex){
    29             $hex = str_replace( '#', '', $hex );
    30 
    31             $c_r = hexdec( substr( $hex, 0, 2 ) );
    32             $c_g = hexdec( substr( $hex, 2, 2 ) );
    33             $c_b = hexdec( substr( $hex, 4, 2 ) );
    34 
    35             $brightness = ( ( $c_r * 299 ) + ( $c_g * 587 ) + ( $c_b * 114 ) ) / 1000;
    36 
    37             return $brightness > 155? false: true; 
     28        public function is_light_color($hex){
     29            $hex = str_replace('#', '', $hex);
     30   
     31            // Handle short hex (#FFF)
     32            if (strlen($hex) == 3) {
     33                $hex = $hex[0] . $hex[0] . $hex[1] . $hex[1] . $hex[2] . $hex[2];
     34            }
     35           
     36            $r = hexdec(substr($hex, 0, 2));
     37            $g = hexdec(substr($hex, 2, 2));
     38            $b = hexdec(substr($hex, 4, 2));
     39           
     40            // YIQ weighted luminance (same weights as your original but scaled to 0-255 range)
     41            $yiq = (($r * 299) + ($g * 587) + ($b * 114)) / 1000;
     42           
     43            // Threshold of 128 works well in practice for black vs white text
     44            return ($yiq >= 128) ? true : false;
    3845        }
    3946
     
    4451
    4552    // Timezones
    46        
    47         // @updated 2.1
    48         // $unix value passed to calculate DST for a given date - otherwise DST for now
    49         function get_timezone_array( $unix = '' , $adjusted = true) {
    50            
    51             $tzs = $this->get_default_timezones_array();
     53        private function __get_evo_timezone_choices($selected_zone, $locale = null ){       
     54            return apply_filters(
     55                'lp_timezone_choice',
     56                wp_timezone_choice( $selected_zone, $locale ),
     57                $selected_zone,
     58                $locale
     59            );
     60        }
    5261
    53             if(!$adjusted) return $tzs;
    54        
    55             // adjust GMT values based on daylight savings time
     62        function get_timezone_array($unix = ''){
     63            // using WP timezones
     64            $html = $this->__get_evo_timezone_choices('UTC');
     65            //EVO_Debug($html);
     66
     67            preg_match_all('/<option value="([^"]+)">/', $html, $matches);
     68            $tzs = $matches[1];
     69
    5670            $DD = new DateTime( 'now' );
     71            $updated_zones = ['UTC' => '(GMT+00:00) Universal Time UTC'];
    5772
    58             if( !empty( $unix ))    $DD->setTimestamp( $unix );
    59            
    60             $updated_zones = array();
    61             foreach($tzs as $f=>$v){
    62                 $DD->setTimezone( new DateTimeZone( $f ));
    63                 $nv = explode(') ', $v);
    64                 $updated_zones[ $f] = '(GMT'. $DD->format('P').') '. $nv[1];
    65                
     73            // if unix is passed adjust according to time present in unix
     74            //if( !empty( $unix ))  $DD->setTimestamp( $unix );
     75
     76            //$updated_zones = array();
     77            foreach($tzs as $tz_string ){
     78
     79                if( strpos($tz_string, 'UTC') !== false ) continue;
     80
     81                try {
     82                    $DD->setTimezone( new DateTimeZone( $tz_string ));
     83                }
     84                catch (Exception $e) {
     85                    // invalid timezone name
     86                    error_log(print_r($e->getMessage(), TRUE));
     87                    continue;
     88                }
     89                $updated_zones[ $tz_string ] = '(GMT'. $DD->format('P').') '. $tz_string;               
    6690            }
    6791            return $updated_zones;
    68         }
    69 
     92        }   
     93       
    7094
    7195        function get_timezone_name($key){
     
    7498        }
    7599
    76         private function get_default_timezones_array(){
    77             return array(
    78                 "Pacific/Midway"                 => "(GMT-11:00) Midway Island, Samoa ",
    79                 "Pacific/Pago_Pago"              => "(GMT-11:00) Pago Pago ",
    80                 "Pacific/Honolulu"               => "(GMT-10:00) Hawaii ",
    81                 "America/Anchorage"              => "(GMT-8:00) Alaska ",
    82                 "America/Vancouver"              => "(GMT-7:00) Vancouver ",
    83                 "America/Los_Angeles"            => "(GMT-7:00) Pacific Time (US and Canada)",
    84                 "America/Tijuana"                => "(GMT-7:00) Tijuana ",
    85                 "America/Phoenix"                => "(GMT-7:00) Arizona ",
    86                 "America/Edmonton"               => "(GMT-6:00) Edmonton ",
    87                 "America/Denver"                 => "(GMT-6:00) Mountain Time (US and Canada)",
    88                 "America/Mazatlan"               => "(GMT-6:00) Mazatlan ",
    89                 "America/Regina"                 => "(GMT-6:00) Saskatchewan ",
    90                 "America/Guatemala"              => "(GMT-6:00) Guatemala ",
    91                 "America/El_Salvador"            => "(GMT-6:00) El Salvador ",
    92                 "America/Managua"                => "(GMT-6:00) Managua ",
    93                 "America/Costa_Rica"             => "(GMT-6:00) Costa Rica ",
    94                 "America/Tegucigalpa"            => "(GMT-6:00) Tegucigalpa ",
    95                 "America/Winnipeg"               => "(GMT-5:00) Winnipeg ",
    96                 "America/Chicago"                => "(GMT-5:00) Central Time (US and Canada)",
    97                 "America/Mexico_City"            => "(GMT-5:00) Mexico City ",
    98                 "America/Panama"                 => "(GMT-5:00) Panama ",
    99                 "America/Bogota"                 => "(GMT-5:00) Bogota ",
    100                 "America/Lima"                   => "(GMT-5:00) Lima ",
    101                 "America/Caracas"                => "(GMT-4:30) Caracas ",
    102                 "America/Montreal"               => "(GMT-4:00) Montreal ",
    103                 "America/New_York"               => "(GMT-4:00) Eastern Time (US and Canada)",
    104                 "America/Indianapolis"           => "(GMT-4:00) Indiana (East)",
    105                 "America/Puerto_Rico"            => "(GMT-4:00) Puerto Rico ",
    106                 "America/Santiago"               => "(GMT-4:00) Santiago ",
    107                 "America/Halifax"                => "(GMT-3:00) Halifax ",
    108                 "America/Montevideo"             => "(GMT-3:00) Montevideo ",
    109                 "America/Araguaina"              => "(GMT-3:00) Brasilia ",
    110                 "America/Argentina/Buenos_Aires" => "(GMT-3:00) Buenos Aires, Georgetown ",
    111                 "America/Sao_Paulo"              => "(GMT-3:00) Sao Paulo ",
    112                 "Canada/Atlantic"                => "(GMT-3:00) Atlantic Time (Canada)",
    113                 "America/St_Johns"               => "(GMT-2:30) Newfoundland and Labrador ",
    114                 "America/Godthab"                => "(GMT-2:00) Greenland ",
    115                 "Atlantic/Cape_Verde"            => "(GMT-1:00) Cape Verde Islands ",
    116                 "Atlantic/Azores"                => "(GMT+0:00) Azores ",
    117                 "UTC"                            => "(GMT+0:00) Universal Time UTC ",
    118                 "Etc/Greenwich"                  => "(GMT+0:00) Greenwich Mean Time ",
    119                 "Atlantic/Reykjavik"             => "(GMT+0:00) Reykjavik ",
    120                 "Africa/Nouakchott"              => "(GMT+0:00) Nouakchott ",
    121                 "Europe/Dublin"                  => "(GMT+1:00) Dublin ",
    122                 "Europe/London"                  => "(GMT+1:00) London ",
    123                 "Europe/Lisbon"                  => "(GMT+1:00) Lisbon ",
    124                 "Africa/Casablanca"              => "(GMT+1:00) Casablanca ",
    125                 "Africa/Bangui"                  => "(GMT+1:00) West Central Africa ",
    126                 "Africa/Algiers"                 => "(GMT+1:00) Algiers ",
    127                 "Africa/Tunis"                   => "(GMT+1:00) Tunis ",
    128                 "Europe/Belgrade"                => "(GMT+2:00) Belgrade, Bratislava, Ljubljana ",
    129                 "CET"                            => "(GMT+2:00) Sarajevo, Skopje, Zagreb ",
    130                 "Europe/Oslo"                    => "(GMT+2:00) Oslo ",
    131                 "Europe/Copenhagen"              => "(GMT+2:00) Copenhagen ",
    132                 "Europe/Brussels"                => "(GMT+2:00) Brussels ",
    133                 "Europe/Berlin"                  => "(GMT+2:00) Amsterdam, Berlin, Rome, Stockholm, Vienna ",
    134                 "Europe/Amsterdam"               => "(GMT+2:00) Amsterdam ",
    135                 "Europe/Rome"                    => "(GMT+2:00) Rome ",
    136                 "Europe/Stockholm"               => "(GMT+2:00) Stockholm ",
    137                 "Europe/Vienna"                  => "(GMT+2:00) Vienna ",
    138                 "Europe/Luxembourg"              => "(GMT+2:00) Luxembourg ",
    139                 "Europe/Paris"                   => "(GMT+2:00) Paris ",
    140                 "Europe/Zurich"                  => "(GMT+2:00) Zurich ",
    141                 "Europe/Madrid"                  => "(GMT+2:00) Madrid ",
    142                 "Africa/Harare"                  => "(GMT+2:00) Harare, Pretoria ",
    143                 "Europe/Warsaw"                  => "(GMT+2:00) Warsaw ",
    144                 "Europe/Prague"                  => "(GMT+2:00) Prague Bratislava ",
    145                 "Europe/Budapest"                => "(GMT+2:00) Budapest ",
    146                 "Africa/Tripoli"                 => "(GMT+2:00) Tripoli ",
    147                 "Africa/Cairo"                   => "(GMT+2:00) Cairo ",
    148                 "Africa/Johannesburg"            => "(GMT+2:00) Johannesburg ",
    149                 "Europe/Helsinki"                => "(GMT+3:00) Helsinki ",
    150                 "Africa/Nairobi"                 => "(GMT+3:00) Nairobi ",
    151                 "Europe/Sofia"                   => "(GMT+3:00) Sofia ",
    152                 "Europe/Istanbul"                => "(GMT+3:00) Istanbul ",
    153                 "Europe/Athens"                  => "(GMT+3:00) Athens ",
    154                 "Europe/Bucharest"               => "(GMT+3:00) Bucharest ",
    155                 "Asia/Nicosia"                   => "(GMT+3:00) Nicosia ",
    156                 "Asia/Beirut"                    => "(GMT+3:00) Beirut ",
    157                 "Asia/Damascus"                  => "(GMT+3:00) Damascus ",
    158                 "Asia/Jerusalem"                 => "(GMT+3:00) Jerusalem ",
    159                 "Asia/Amman"                     => "(GMT+3:00) Amman ",
    160                 "Europe/Moscow"                  => "(GMT+3:00) Moscow ",
    161                 "Asia/Baghdad"                   => "(GMT+3:00) Baghdad ",
    162                 "Asia/Kuwait"                    => "(GMT+3:00) Kuwait ",
    163                 "Asia/Riyadh"                    => "(GMT+3:00) Riyadh ",
    164                 "Asia/Bahrain"                   => "(GMT+3:00) Bahrain ",
    165                 "Asia/Qatar"                     => "(GMT+3:00) Qatar ",
    166                 "Asia/Aden"                      => "(GMT+3:00) Aden ",
    167                 "Africa/Khartoum"                => "(GMT+3:00) Khartoum ",
    168                 "Africa/Djibouti"                => "(GMT+3:00) Djibouti ",
    169                 "Africa/Mogadishu"               => "(GMT+3:00) Mogadishu ",
    170                 "Europe/Kiev"                    => "(GMT+3:00) Kiev ",
    171                 "Asia/Dubai"                     => "(GMT+4:00) Dubai ",
    172                 "Asia/Muscat"                    => "(GMT+4:00) Muscat ",
    173                 "Asia/Tehran"                    => "(GMT+4:30) Tehran ",
    174                 "Asia/Kabul"                     => "(GMT+4:30) Kabul ",
    175                 "Asia/Baku"                      => "(GMT+5:00) Baku, Tbilisi, Yerevan ",
    176                 "Asia/Yekaterinburg"             => "(GMT+5:00) Yekaterinburg ",
    177                 "Asia/Tashkent"                  => "(GMT+5:00) Islamabad, Karachi, Tashkent ",
    178                 "Asia/Calcutta"                  => "(GMT+5:30) India ",
    179                 "Asia/Kolkata"                   => "(GMT+5:30) Mumbai, Kolkata, New Delhi ",
    180                 "Asia/Kathmandu"                 => "(GMT+5:45) Kathmandu ",
    181                 "Asia/Novosibirsk"               => "(GMT+6:00) Novosibirsk ",
    182                 "Asia/Almaty"                    => "(GMT+6:00) Almaty ",
    183                 "Asia/Dacca"                     => "(GMT+6:00) Dacca ",
    184                 "Asia/Dhaka"                     => "(GMT+6:00) Astana, Dhaka ",
    185                 "Asia/Krasnoyarsk"               => "(GMT+7:00) Krasnoyarsk ",
    186                 "Asia/Bangkok"                   => "(GMT+7:00) Bangkok ",
    187                 "Asia/Saigon"                    => "(GMT+7:00) Vietnam ",
    188                 "Asia/Jakarta"                   => "(GMT+7:00) Jakarta ",
    189                 "Asia/Irkutsk"                   => "(GMT+8:00) Irkutsk, Ulaanbaatar ",
    190                 "Asia/Shanghai"                  => "(GMT+8:00) Beijing, Shanghai ",
    191                 "Asia/Hong_Kong"                 => "(GMT+8:00) Hong Kong ",
    192                 "Asia/Taipei"                    => "(GMT+8:00) Taipei ",
    193                 "Asia/Kuala_Lumpur"              => "(GMT+8:00) Kuala Lumpur ",
    194                 "Asia/Singapore"                 => "(GMT+8:00) Singapore ",
    195                 "Australia/Perth"                => "(GMT+8:00) Perth ",
    196                 "Asia/Yakutsk"                   => "(GMT+9:00) Yakutsk ",
    197                 "Asia/Seoul"                     => "(GMT+9:00) Seoul ",
    198                 "Asia/Tokyo"                     => "(GMT+9:00) Osaka, Sapporo, Tokyo ",
    199                 "Australia/Darwin"               => "(GMT+9:30) Darwin ",
    200                 "Australia/Adelaide"             => "(GMT+9:30) Adelaide ",
    201                 "Asia/Vladivostok"               => "(GMT+10:00) Vladivostok ",
    202                 "Pacific/Port_Moresby"           => "(GMT+10:00) Guam, Port Moresby ",
    203                 "Australia/Brisbane"             => "(GMT+10:00) Brisbane ",
    204                 "Australia/Sydney"               => "(GMT+10:00) Canberra, Melbourne, Sydney ",
    205                 "Australia/Hobart"               => "(GMT+10:00) Hobart ",
    206                 "Asia/Magadan"                   => "(GMT+10:00) Magadan ",
    207                 "SST"                            => "(GMT+11:00) Solomon Islands ",
    208                 "Pacific/Noumea"                 => "(GMT+11:00) New Caledonia ",
    209                 "Asia/Kamchatka"                 => "(GMT+12:00) Kamchatka ",
    210                 "Pacific/Fiji"                   => "(GMT+12:00) Fiji Islands, Marshall Islands ",
    211                 "Pacific/Auckland"               => "(GMT+12:00) Auckland, Wellington"
    212             );
    213         }
    214 
    215100}
  • lifepress/trunk/includes/class-settings.php

    r3244643 r3428394  
    22/**
    33 * Settings
    4  * @version 2.1.3
     4 * @version 2.2
    55 */
    66
     
    4545        $new = array();
    4646        foreach($post as $f=>$v){
    47             $new[$f] = addslashes(esc_html(stripslashes(($v))));
     47            $new[$f] = sanitize_text_field( addslashes(esc_html(stripslashes(($v)))) );
    4848        }
    4949        $this->props = $new;
  • lifepress/trunk/includes/class-time.php

    r3138542 r3428394  
    99    public $timezone;
    1010    public $timezone0, $time_format, $current_time, $date_format;
     11    public $timezone_string;
    1112
    1213    public function __construct(){
     
    1617            $settings = new LIFEPRESS_Settings();
    1718            $tz_string = $settings->get_prop('_tz');
     19            $this->timezone_string = $tz_string;
    1820
    1921            // fallback timezone from site
  • lifepress/trunk/lang/lifepress.po

    r2676775 r3428394  
    22msgstr ""
    33"Project-Id-Version: LifePress 2.0.2\n"
    4 "POT-Creation-Date: 2022-02-10 14:43-0800\n"
    5 "PO-Revision-Date: 2022-02-10 14:43-0800\n"
     4"POT-Creation-Date: 2025-12-27 12:27-0800\n"
     5"PO-Revision-Date: 2025-12-27 12:27-0800\n"
    66"Last-Translator: \n"
    77"Language-Team: Ashan Jay\n"
     
    1111"Content-Transfer-Encoding: 8bit\n"
    1212"Plural-Forms: nplurals=2; plural=(n != 1);\n"
    13 "X-Generator: Poedit 3.0.1\n"
     13"X-Generator: Poedit 3.4.4\n"
    1414"X-Poedit-Basepath: ..\n"
    1515"X-Poedit-KeywordsList: __;_e\n"
    1616"X-Poedit-SearchPath-0: .\n"
    1717
    18 #: includes/admin/class-admin.php:47
     18#: includes/admin/class-admin-ajax.php:36
     19msgid "Manage Metric Data"
     20msgstr ""
     21
     22#: includes/admin/class-admin-ajax.php:59
     23msgid "Missing Required fields"
     24msgstr ""
     25
     26#: includes/admin/class-admin-ajax.php:65
     27msgid "Successfully Saved"
     28msgstr ""
     29
     30#: includes/admin/class-admin-ajax.php:86
     31msgid "Successfully Deleted"
     32msgstr ""
     33
     34#: includes/admin/class-admin-ajax.php:101
     35msgid "Successfully Created"
     36msgstr ""
     37
     38#: includes/admin/class-admin-ajax.php:101
     39msgid "Successfully Updated"
     40msgstr ""
     41
     42#: includes/admin/class-admin-ajax.php:163
     43msgid "Missing Data Values"
     44msgstr ""
     45
     46#: includes/admin/class-admin-ajax.php:193
     47msgid "Create Metric Data Series"
     48msgstr ""
     49
     50#: includes/admin/class-admin-ajax.php:193
     51msgid "Update Metric Data Series"
     52msgstr ""
     53
     54#: includes/admin/class-admin-ajax.php:196
     55msgid "Metric Data Series Name"
     56msgstr ""
     57
     58#: includes/admin/class-admin-ajax.php:197
     59msgid "Description"
     60msgstr ""
     61
     62#: includes/admin/class-admin-ajax.php:200
     63#: includes/admin/class-admin-ajax.php:303 includes/admin/class-admin.php:162
     64msgid "Save Changes"
     65msgstr ""
     66
     67#: includes/admin/class-admin-ajax.php:212
     68msgid "Missing Series Slug"
     69msgstr ""
     70
     71#: includes/admin/class-admin-ajax.php:223
     72msgid "Create Metric Data Field For"
     73msgstr ""
     74
     75#: includes/admin/class-admin-ajax.php:223
     76msgid "Update Metric Data Field For"
     77msgstr ""
     78
     79#: includes/admin/class-admin-ajax.php:229
     80msgid "Field Full Name"
     81msgstr ""
     82
     83#: includes/admin/class-admin-ajax.php:230
     84msgid "This name will be used as the slug to save data."
     85msgstr ""
     86
     87#: includes/admin/class-admin-ajax.php:234
     88msgid "Field Abbreviation Code"
     89msgstr ""
     90
     91#: includes/admin/class-admin-ajax.php:235
     92msgid "Type in a field abbreviation code with less then 4 letters."
     93msgstr ""
     94
     95#: includes/admin/class-admin-ajax.php:237
     96msgid "e.g., BR"
     97msgstr ""
     98
     99#: includes/admin/class-admin-ajax.php:239
     100msgid "Measurement Unit Code (Optional)"
     101msgstr ""
     102
     103#: includes/admin/class-admin-ajax.php:240
     104msgid ""
     105"Use 8 or less characters to set data measuring unit code. This will show "
     106"after the data. Leave blank for no units."
     107msgstr ""
     108
     109#: includes/admin/class-admin-ajax.php:242
     110msgid "e.g., ft for feet"
     111msgstr ""
     112
     113#: includes/admin/class-admin-ajax.php:265
     114msgid "Field Data Type"
     115msgstr ""
     116
     117#: includes/admin/class-admin-ajax.php:270
     118msgid "Text Field"
     119msgstr ""
     120
     121#: includes/admin/class-admin-ajax.php:271
     122msgid "Multiple Selectable Values"
     123msgstr ""
     124
     125#: includes/admin/class-admin-ajax.php:272
     126msgid "Check Field"
     127msgstr ""
     128
     129#: includes/admin/class-admin-ajax.php:283
     130msgid "Field Option Values"
     131msgstr ""
     132
     133#: includes/admin/class-admin-ajax.php:284
     134msgid "Separate field option values by comma. eg. jump,run."
     135msgstr ""
     136
     137#: includes/admin/class-admin-ajax.php:286
     138msgid "Selection Type"
     139msgstr ""
     140
     141#: includes/admin/class-admin-ajax.php:291
     142msgid "Only one option at a time"
     143msgstr ""
     144
     145#: includes/admin/class-admin-ajax.php:292
     146msgid "Multiple options"
     147msgstr ""
     148
     149#: includes/admin/class-admin.php:59
    19150msgid "LifePress Settings"
    20151msgstr ""
    21152
    22 #: includes/admin/class-admin.php:52
     153#: includes/admin/class-admin.php:64
    23154msgid "Settings Saved"
    24155msgstr ""
    25156
    26 #: includes/admin/class-admin.php:67
     157#: includes/admin/class-admin.php:83
    27158msgid "Dashboard Title"
    28159msgstr ""
    29160
    30 #: includes/admin/class-admin.php:76
     161#: includes/admin/class-admin.php:89
     162msgid "LifePress dashboard page URL"
     163msgstr ""
     164
     165#: includes/admin/class-admin.php:94
     166msgid "Add a home page link to top header in dashboard"
     167msgstr ""
     168
     169#: includes/admin/class-admin.php:99
     170msgid "Show moon and sun information"
     171msgstr ""
     172
     173#: includes/admin/class-admin.php:101
     174msgid "Display moon and sun information in the footer"
     175msgstr ""
     176
     177#: includes/admin/class-admin.php:104
     178msgid "Enable Moon Month View [Beta]"
     179msgstr ""
     180
     181#: includes/admin/class-admin.php:106
     182msgid "Allow calendar to show as moon month view"
     183msgstr ""
     184
     185#: includes/admin/class-admin.php:110
    31186msgid "Default Dashboard View"
    32187msgstr ""
    33188
    34 #: includes/admin/class-admin.php:78
     189#: includes/admin/class-admin.php:112
    35190msgid "Week View"
    36191msgstr ""
    37192
    38 #: includes/admin/class-admin.php:79
     193#: includes/admin/class-admin.php:113
    39194msgid "Month View"
    40195msgstr ""
    41196
    42 #: includes/admin/class-admin.php:85
     197#: includes/admin/class-admin.php:114
     198msgid "Moon Month View (If enabled)"
     199msgstr ""
     200
     201#: includes/admin/class-admin.php:121
    43202msgid "Month data loading method"
    44203msgstr ""
    45204
    46 #: includes/admin/class-admin.php:87
     205#: includes/admin/class-admin.php:123
    47206msgid "Using previously loaded data, if available"
    48207msgstr ""
    49208
    50 #: includes/admin/class-admin.php:88
     209#: includes/admin/class-admin.php:124
    51210msgid "Load fresh data at all times"
    52211msgstr ""
    53212
    54 #: includes/admin/class-admin.php:102
     213#: includes/admin/class-admin.php:131
     214msgid "Default Timezone"
     215msgstr ""
     216
     217#: includes/admin/class-admin.php:138
     218msgid "Select the years count for past and future"
     219msgstr ""
     220
     221#: includes/admin/class-admin.php:152
     222msgid "Configure Data Metrics"
     223msgstr ""
     224
     225#: includes/admin/class-admin.php:154
     226msgid "Add measurable data types for each entry"
     227msgstr ""
     228
     229#: includes/admin/class-admin.php:162
    55230msgid "submit"
    56231msgstr ""
    57232
    58 #: includes/admin/class-admin.php:102
    59 msgid "Save Changes"
    60 msgstr ""
    61 
    62 #: includes/admin/class-admin.php:190
     233#: includes/admin/class-admin.php:195
     234msgid "Configure"
     235msgstr ""
     236
     237#: includes/admin/class-admin.php:288
    63238msgid "Settings not saved, nonce verification failed! Please try again later!"
    64239msgstr ""
    65240
    66 #: includes/admin/class-admin.php:202
     241#: includes/admin/class-admin.php:300
    67242msgid "LifePress Information"
    68243msgstr ""
    69244
    70 #: includes/admin/class-admin.php:205
     245#: includes/admin/class-admin.php:303
    71246msgid "Life Span Start Date"
    72247msgstr ""
    73248
    74 #: includes/class-ajax.php:38
     249#: includes/class-ajax.php:48
    75250msgid "Login required"
    76251msgstr ""
    77252
    78 #: includes/class-ajax.php:125
     253#: includes/class-ajax.php:189
    79254msgid "Sunday"
    80255msgstr ""
    81256
    82 #: includes/class-ajax.php:125
     257#: includes/class-ajax.php:189
    83258msgid "Sun"
    84259msgstr ""
    85260
    86 #: includes/class-ajax.php:126
     261#: includes/class-ajax.php:189 includes/class-ajax.php:195
     262msgid "S"
     263msgstr ""
     264
     265#: includes/class-ajax.php:190
    87266msgid "Monday"
    88267msgstr ""
    89268
    90 #: includes/class-ajax.php:126
     269#: includes/class-ajax.php:190
    91270msgid "Mon"
    92271msgstr ""
    93272
    94 #: includes/class-ajax.php:127
     273#: includes/class-ajax.php:190
     274msgid "M"
     275msgstr ""
     276
     277#: includes/class-ajax.php:191
    95278msgid "Tuesday"
    96279msgstr ""
    97280
    98 #: includes/class-ajax.php:127
     281#: includes/class-ajax.php:191
    99282msgid "Tue"
    100283msgstr ""
    101284
    102 #: includes/class-ajax.php:128
     285#: includes/class-ajax.php:191 includes/class-ajax.php:193
     286msgid "T"
     287msgstr ""
     288
     289#: includes/class-ajax.php:192
    103290msgid "Wednesday"
    104291msgstr ""
    105292
    106 #: includes/class-ajax.php:128
     293#: includes/class-ajax.php:192
    107294msgid "Wed"
    108295msgstr ""
    109296
    110 #: includes/class-ajax.php:129
     297#: includes/class-ajax.php:192
     298msgid "W"
     299msgstr ""
     300
     301#: includes/class-ajax.php:193
    111302msgid "Thursday"
    112303msgstr ""
    113304
    114 #: includes/class-ajax.php:129
     305#: includes/class-ajax.php:193
    115306msgid "Thu"
    116307msgstr ""
    117308
    118 #: includes/class-ajax.php:130
     309#: includes/class-ajax.php:194
    119310msgid "Friday"
    120311msgstr ""
    121312
    122 #: includes/class-ajax.php:130
     313#: includes/class-ajax.php:194
    123314msgid "Fri"
    124315msgstr ""
    125316
    126 #: includes/class-ajax.php:131
     317#: includes/class-ajax.php:194
     318msgid "F"
     319msgstr ""
     320
     321#: includes/class-ajax.php:195
    127322msgid "Saturday"
    128323msgstr ""
    129324
    130 #: includes/class-ajax.php:131
     325#: includes/class-ajax.php:195
    131326msgid "Sat"
    132327msgstr ""
    133328
    134 #: includes/class-ajax.php:135
     329#: includes/class-ajax.php:200
    135330msgid "January"
    136331msgstr ""
    137332
    138 #: includes/class-ajax.php:136
     333#: includes/class-ajax.php:201
    139334msgid "February"
    140335msgstr ""
    141336
    142 #: includes/class-ajax.php:137
     337#: includes/class-ajax.php:202
    143338msgid "March"
    144339msgstr ""
    145340
    146 #: includes/class-ajax.php:138
     341#: includes/class-ajax.php:203
    147342msgid "April"
    148343msgstr ""
    149344
    150 #: includes/class-ajax.php:139 templates/class-template_parts.php:96
     345#: includes/class-ajax.php:204 templates/class-template_parts.php:123
    151346msgid "May"
    152347msgstr ""
    153348
    154 #: includes/class-ajax.php:140
     349#: includes/class-ajax.php:205
    155350msgid "June"
    156351msgstr ""
    157352
    158 #: includes/class-ajax.php:141
     353#: includes/class-ajax.php:206
    159354msgid "July"
    160355msgstr ""
    161356
    162 #: includes/class-ajax.php:142
     357#: includes/class-ajax.php:207
    163358msgid "August"
    164359msgstr ""
    165360
    166 #: includes/class-ajax.php:143
     361#: includes/class-ajax.php:208
    167362msgid "September"
    168363msgstr ""
    169364
    170 #: includes/class-ajax.php:144
     365#: includes/class-ajax.php:209
    171366msgid "October"
    172367msgstr ""
    173368
    174 #: includes/class-ajax.php:145
     369#: includes/class-ajax.php:210
    175370msgid "November"
    176371msgstr ""
    177372
    178 #: includes/class-ajax.php:146
     373#: includes/class-ajax.php:211
    179374msgid "December"
    180375msgstr ""
    181376
    182 #: includes/class-ajax.php:186 includes/class-ajax.php:338
     377#: includes/class-ajax.php:277 includes/class-ajax.php:415
    183378msgid "Could not create an entry"
    184379msgstr ""
    185380
    186 #: includes/class-ajax.php:187 includes/class-ajax.php:339
     381#: includes/class-ajax.php:278 includes/class-ajax.php:416
    187382msgid "Could not create new entry"
    188383msgstr ""
    189384
    190 #: includes/class-ajax.php:218 includes/class-ajax.php:282
     385#: includes/class-ajax.php:315 includes/class-ajax.php:369
    191386msgid "Entry on"
    192387msgstr ""
    193388
    194 #: includes/class-ajax.php:261
     389#: includes/class-ajax.php:348
    195390msgid "Successfully updated entry"
    196391msgstr ""
    197392
    198 #: includes/class-ajax.php:262
     393#: includes/class-ajax.php:349
    199394msgid "Successfully updated draft entry"
    200395msgstr ""
    201396
    202 #: includes/class-ajax.php:330
     397#: includes/class-ajax.php:407
    203398msgid "Successfully created entry"
    204399msgstr ""
    205400
    206 #: includes/class-ajax.php:331
     401#: includes/class-ajax.php:408
    207402msgid "Successfully saved draft entry"
    208403msgstr ""
    209404
    210 #: includes/class-ajax.php:349 includes/class-ajax.php:350
     405#: includes/class-ajax.php:426 includes/class-ajax.php:427
    211406msgid "Tag ID Missing"
    212407msgstr ""
    213408
    214 #: includes/class-ajax.php:363 includes/class-ajax.php:364
     409#: includes/class-ajax.php:440 includes/class-ajax.php:441
    215410msgid "Tag does not exists"
    216411msgstr ""
    217412
    218 #: includes/class-ajax.php:380
     413#: includes/class-ajax.php:457
    219414msgid "Successfully updated tag"
    220415msgstr ""
    221416
    222 #: includes/class-ajax.php:421
    223 msgid "Successfully deleted "
    224 msgstr ""
    225 
    226 #: includes/class-ajax.php:426
    227 msgid "Could not delete "
    228 msgstr ""
    229 
    230 #: includes/class-ajax.php:436
     417#: includes/class-ajax.php:546
     418msgid "Successfully deleted"
     419msgstr ""
     420
     421#: includes/class-ajax.php:551
     422msgid "Could not delete"
     423msgstr ""
     424
     425#: includes/class-ajax.php:562
    231426msgid "Missing Required Data"
    232427msgstr ""
    233428
    234 #: includes/class-ajax.php:527
     429#: includes/class-ajax.php:626 includes/class-lunisolar.php:112
     430#: includes/class-lunisolar.php:117 includes/class-lunisolar.php:122
     431#: includes/class-lunisolar.php:128
     432msgid "Moon"
     433msgstr ""
     434
     435#: includes/class-ajax.php:672
    235436msgid "No Temp"
    236437msgstr ""
     
    284485msgstr ""
    285486
    286 #: templates/class-template_parts.php:22
     487#: includes/class-lunisolar.php:328
     488msgid "Today is"
     489msgstr ""
     490
     491#: includes/class-lunisolar.php:330
     492msgid "Tomorrow is"
     493msgstr ""
     494
     495#: includes/class-lunisolar.php:332
     496msgid "days to"
     497msgstr ""
     498
     499#: includes/class-metrics.php:184
     500msgid "Add Metric Data "
     501msgstr ""
     502
     503#: includes/class-metrics.php:358
     504msgid "Add New Field"
     505msgstr ""
     506
     507#: templates/class-template_parts.php:25
    287508msgid "You must login to view the LifePress Dashboard"
    288509msgstr ""
    289510
    290 #: templates/class-template_parts.php:24
     511#: templates/class-template_parts.php:27
    291512msgid "Login"
    292513msgstr ""
    293514
    294515#: templates/class-template_parts.php:39
    295 msgid "Life"
    296 msgstr ""
    297 
    298 #: templates/class-template_parts.php:92
     516msgid "Tooltip Test"
     517msgstr ""
     518
     519#: templates/class-template_parts.php:51
     520msgid "Life Journal"
     521msgstr ""
     522
     523#: templates/class-template_parts.php:56
     524msgid "Today"
     525msgstr ""
     526
     527#: templates/class-template_parts.php:84 templates/class-template_parts.php:361
     528msgid "Add New Entry"
     529msgstr ""
     530
     531#: templates/class-template_parts.php:119
    299532msgid "Jan"
    300533msgstr ""
    301534
    302 #: templates/class-template_parts.php:93
     535#: templates/class-template_parts.php:120
    303536msgid "Feb"
    304537msgstr ""
    305538
    306 #: templates/class-template_parts.php:94
     539#: templates/class-template_parts.php:121
    307540msgid "Mar"
    308541msgstr ""
    309542
    310 #: templates/class-template_parts.php:95
     543#: templates/class-template_parts.php:122
    311544msgid "Apr"
    312545msgstr ""
    313546
    314 #: templates/class-template_parts.php:97
     547#: templates/class-template_parts.php:124
    315548msgid "Jun"
    316549msgstr ""
    317550
    318 #: templates/class-template_parts.php:98
     551#: templates/class-template_parts.php:125
    319552msgid "Jul"
    320553msgstr ""
    321554
    322 #: templates/class-template_parts.php:99
     555#: templates/class-template_parts.php:126
    323556msgid "Aug"
    324557msgstr ""
    325558
    326 #: templates/class-template_parts.php:100
     559#: templates/class-template_parts.php:127
    327560msgid "Sep"
    328561msgstr ""
    329562
    330 #: templates/class-template_parts.php:101
     563#: templates/class-template_parts.php:128
    331564msgid "Oct"
    332565msgstr ""
    333566
    334 #: templates/class-template_parts.php:102
     567#: templates/class-template_parts.php:129
    335568msgid "Nov"
    336569msgstr ""
    337570
    338 #: templates/class-template_parts.php:103
     571#: templates/class-template_parts.php:130
    339572msgid "Dec"
    340573msgstr ""
    341574
    342 #: templates/class-template_parts.php:120
     575#: templates/class-template_parts.php:149
    343576msgid "Set Month"
    344577msgstr ""
    345578
    346 #: templates/class-template_parts.php:200
     579#: templates/class-template_parts.php:225
    347580msgid "No Results Found"
    348581msgstr ""
    349582
    350 #: templates/class-template_parts.php:222
     583#: templates/class-template_parts.php:247
     584msgid "Search Entries..."
     585msgstr ""
     586
     587#: templates/class-template_parts.php:248
    351588msgid "Search"
    352589msgstr ""
    353590
    354 #: templates/class-template_parts.php:284
     591#: templates/class-template_parts.php:309
    355592msgid "tag"
    356593msgstr ""
    357594
    358 #: templates/class-template_parts.php:288
     595#: templates/class-template_parts.php:314
    359596msgid "Update Entry Tag"
    360597msgstr ""
    361598
    362 #: templates/class-template_parts.php:293
    363 #: templates/class-template_parts.php:388
     599#: templates/class-template_parts.php:319
     600#: templates/class-template_parts.php:396
    364601msgid "Tag Name"
    365602msgstr ""
    366603
    367 #: templates/class-template_parts.php:318
    368 #: templates/class-template_parts.php:412
     604#: templates/class-template_parts.php:344
     605#: templates/class-template_parts.php:422
    369606msgid "New Color"
    370607msgstr ""
    371608
    372 #: templates/class-template_parts.php:321
    373 #: templates/class-template_parts.php:419
     609#: templates/class-template_parts.php:347
     610#: templates/class-template_parts.php:476
    374611msgid "Submit"
    375612msgstr ""
    376613
    377 #: templates/class-template_parts.php:330
     614#: templates/class-template_parts.php:356
    378615msgid "entry"
    379616msgstr ""
    380617
    381 #: templates/class-template_parts.php:334
    382 msgid "Add New Entry"
    383 msgstr ""
    384 
    385 #: templates/class-template_parts.php:338
     618#: templates/class-template_parts.php:383
     619msgid "Create New"
     620msgstr ""
     621
     622#: templates/class-template_parts.php:423
     623msgid "Add New Tag"
     624msgstr ""
     625
     626#: templates/class-template_parts.php:431
     627msgid "Add Date"
     628msgstr ""
     629
     630#: templates/class-template_parts.php:434
    386631msgid "Add title"
    387632msgstr ""
    388633
    389 #: templates/class-template_parts.php:352
     634#: templates/class-template_parts.php:440
     635msgid "Add description"
     636msgstr ""
     637
     638#: templates/class-template_parts.php:451
    390639msgid "Select Image"
    391640msgstr ""
    392641
    393 #: templates/class-template_parts.php:420
     642#: templates/class-template_parts.php:477
    394643msgid "Save Draft"
    395644msgstr ""
    396645
    397 #: templates/class-template_parts.php:429
     646#: templates/class-template_parts.php:486
    398647msgid "Successfully Created New Entry"
    399648msgstr ""
    400649
    401 #: templates/class-template_parts.php:435
     650#: templates/class-template_parts.php:492
    402651msgid "Successfully Updated New Entry"
    403652msgstr ""
    404653
    405 #: templates/class-template_parts.php:441
     654#: templates/class-template_parts.php:498
    406655msgid "Successfully Updated Tag"
    407656msgstr ""
     657
     658#: templates/class-template_parts.php:532
     659msgid "Daylight today"
     660msgstr ""
     661
     662#: templates/class-template_parts.php:536
     663msgid "Current Sun Constellation"
     664msgstr ""
     665
     666#: templates/class-template_parts.php:536
     667msgid "Constellation"
     668msgstr ""
     669
     670#: templates/class-template_parts.php:542
     671msgid "Moon day in lunar cycle"
     672msgstr ""
     673
     674#: templates/class-template_parts.php:543
     675msgid "Moon Day"
     676msgstr ""
  • lifepress/trunk/lifepress.php

    r3244643 r3428394  
    55 * Description: You are the creator of events in your life. Record and track progress in your life.
    66 * Author: Ashan Jay
    7  * Version: 2.1.3
     7 * Version: 2.2
    88 * Requires at least: 6.0
    9  * Tested up to: 6.7.2
     9 * Tested up to: 6.9
    1010 * Author URI: http://www.ashanjay.com/
    1111 *
     
    2020class LIFEPRESS{
    2121   
    22     public $version='2.1.3
     22    public $version='2.2
    2323    ';
    2424    public $name = 'LifePress';
    2525    public $date_format = 'Y-m-d';
    2626    public $template_url;
    27     public $temp, $time, $front, $props, $help, $shortcode, $assets_path;
     27    public $temp, $time, $front, $props, $help, $shortcode, $assets_path, $lunisolar, $metrics;
    2828
    2929    protected static $_instance = null;
     
    6060        private function includes(){
    6161            include_once('includes/class-install.php');
     62            //include_once('includes/class-planets.php');
     63            include_once('includes/class-lunisolar.php');
     64            include_once('includes/lib/MoonPhase.php');
    6265            include_once('includes/class-helper.php');
    6366            include_once('includes/class-time.php');
     
    6972            include_once('includes/class-frontend.php');
    7073            include_once('includes/class-settings.php');
     74            include_once('includes/class-metrics.php');
    7175
    7276            include_once('includes/admin/class-admin.php');
     
    7478            if ( defined('DOING_AJAX') ){
    7579                include_once('includes/class-ajax.php');
     80                include_once('includes/admin/class-admin-ajax.php');
    7681            }
    7782        }
     
    9095            $this->help = new LIFEPRESS_Helper();
    9196            $this->shortcode = new LIFEPRESS_Shortcodes();
     97            $this->metrics = new LIFEPRESS_Metrics();
     98            $this->lunisolar = new LIFEPRESS_Lunisolar();
    9299        }
    93100
  • lifepress/trunk/templates/class-template_parts.php

    r3244643 r3428394  
    1515
    1616        $SETTINGS = new LIFEPRESS_Settings();
     17       
    1718            $def_view = $SETTINGS->get_prop('_dash_def_view');
     19            if(! $SETTINGS->check_yn('_moonview')) $def_view = 'month_view';
     20
    1821            $mdata_loading_m = $SETTINGS->get_prop('_month_data_loading_method');
    1922            if( !$def_view ) $def_view = 'week_view';
     
    5154                <span class='top_right dfx alic'>
    5255                    <span class='date_range' data-mdld='<?php echo esc_html( $mdata_loading_m );?>'>
    53                         <span class='lp_btn lp_btn_grey lp_goto_today'><?php _e('Today','lp');?></span>
    54                         <span class='lp_view_change prev lpfx_10a'><i class='fas fa-angle-left'></i></span>
    55                         <span class='title lp_range_title lp_trig_action lpfw800'  data-t='lb' data-d='<?php echo $month_select_data;?>'><?php echo esc_html( date('F',$now).' '. date('Y',$now) );?></span>
    56                         <span class='lp_view_change next lpfx_10a'><i class='fas fa-angle-right'></i></span>
     56                        <span class='lp_btn outlined lp_trans lp_goto_today'><?php _e('Today','lp');?></span>
     57                        <span class='lp_view_change prev lpfx_10a lp_trans'><i class='fas fa-angle-left'></i></span>
     58                        <span class='title lp_range_title lp_trig_action lpfw800'  data-t='lb' data-d='<?php echo $month_select_data;?>'>
     59                            <span class='lp_lazy_loading' style='height:25px; width:100px;'></span>
     60                        </span>
     61                        <span class='lp_view_change next lpfx_10a lp_trans'><i class='fas fa-angle-right'></i></span>
    5762                    </span>
    5863                    <span class='header_right dfx alic'>
     
    6368                        ?>
    6469
    65                         <span class='top_views dfx' data-def_view='<?php echo esc_attr( $def_view );?>'>
     70                        <span class='top_views dfx lpgap5' data-def_view='<?php echo esc_attr( $def_view );?>'>
    6671
    6772                            <?php
     
    7176                            )) as $F=>$V){
    7277                                $FF = $def_view == $F. '_view' ? 'focus':'';
    73                                 echo "<span class='lp_view_style view ". esc_attr( $F )." ". esc_attr( $FF )."' data-t='". esc_attr( $F )."'><i class='". esc_attr( $V )."'></i></span>";
     78                                echo "<span class='lp_view_style view lppad10 lpbr10 lpcurp lp_trans ". esc_attr( $F )." ". esc_attr( $FF )."' data-t='". esc_attr( $F )."'><i class='". esc_attr( $V )."'></i></span>";
    7479                            }
    7580
     
    7782                        </span>
    7883                        <span class='lp_search_trig lp_trig_action' data-t='lb' data-d='<?php echo json_encode(array('type'=>'lb_temp','temp_key'=>'search_view'));?>' data-lbc='search'><i class='fas fa-search'></i></span>
    79                         <span class='lp_new_entry_btn lp_btn lp_trig_action lp_new_btn marl10 lpdfx lpfx_jc_c lpfx_ai_c' data-t='lb' data-d='<?php echo json_encode(array('type'=>'lb_temp','temp_key'=>'entry_form','form_type'=>'new'));?>' data-lbc='new_form'>+</span>
     84                        <span class='lp_new_entry_btn lp_btn lp_trig_action lp_new_btn lpdfx lpfx_jc_c lpfx_ai_c lp_trans ' title='<?php _e('Add New Entry','lp');?>' data-t='lb' data-d='<?php echo json_encode(array('type'=>'lb_temp','temp_key'=>'entry_form','form_type'=>'new'));?>' data-lbc='new_form'>
     85                            <i class='fa fa-pen-to-square'></i>
     86                        </span>
    8087                    </span>
    8188                </span>
     
    8996                <div class='footer_notices'></div>
    9097            </div>
     98            <div class='lp_footer'></div>
    9199        </div>
    92100        <?php
     
    169177
    170178        function month_view(){
    171 
    172 
    173            
    174179            ?>
    175180            <div class='lp_month_view dfx'>
     
    197202                    </div>
    198203                {{/each}}
    199             </div>
    200            
     204            </div>         
    201205            </div>
    202206            </div>
     
    208212            {{#if has_entries}}
    209213                {{#each entries}}       
    210                     <div class='search_entry padb10 lp_entry_item' style='background-color:#{{tag.c}}; color:#{{tag.tc}}' data-id='{{@key}}'>
    211                         <p class='entry_date'>{{timeR}}</p>
    212                         <h3>{{title}}</h3>
     214                    <div class='search_entry padb10 lp_entry_item lp_trans lphoop7' style='' data-id='{{@key}}'>
     215                        <div class='lpdfx lpfxdrr lpgap10 lpfxaic lpmarb10'>
     216                            <p class='entry_date lpmar0i'>{{timeR}}</p>
     217                            <div class='lp_search_tag lpdfx lpfxdrr lpgap5 lpfxaic lpfz12'>
     218                                <span class="lp_search_tag_cir lpbr50p lpdfx" style='background-color:#{{tag.c}};width: 15px;height: 15px;'></span> {{tag.n}}</div>
     219                        </div>
     220                        <h3 class='lpff_1'>{{title}}</h3>
    213221                        <p>{{{details}}}</p>
    214222                    </div>
     
    236244                <div class='lp_search'>
    237245                    <div class='lp_search_input padt20 padb20 posr boxsbb'>
     246                        <i class='fa fa-search lpposa lpfz24' style="top:33px; left:15px;"></i>
    238247                        <input class='w100 lp_search_inputfield' type='text' name='s' value='' placeholder='<?php _e('Search Entries...','lp');?>'/>
    239248                        <span class='lp_search_submit lp_btn blue posa'><?php _e('Search');?></span>
     
    352361                    <p class='padb30 lpfw800 lpfont1 lpfz30'><?php _e('Add New Entry','lp');?></p>
    353362                   
     363                    <p class='data_row tags lp_post_tags_content'>
     364                        <i class="fas fa-tag"></i>
     365                        <span class='lp_entry_tags db w100'>
     366                            <span class='existing_tags lpdfx lpfxdrr lpgap5'>
     367                                <?php
     368                                    $terms = get_terms('lp_type', array('hide_empty'=>false));
     369
     370                                    $ETD = new LIFEPRESS_Type_Data();
     371
     372                                    echo "<span class='form_tags_in lpdfx lpfxaic lpfxww lpgap5'>";
     373
     374                                    if(!empty($terms) && !is_wp_error($terms)){         
     375                                        ?>{{#if tags}}
     376                                        {{#each tags}}
     377                                            <i class='lp_entry_tag lpfz12 {{#tagSelect fields.tag.n n}}{{/tagSelect}}' data-id='{{@key}}' style='background-color:#{{c}};color:#{{tc}}' data-c='#{{c}}'>{{{n}}}</i>
     378                                        {{/each}}
     379                                        {{/if}}
     380                                        <?php
     381                                    }
     382                                ?>
     383                                    <span class='create_new_tag_btn lp_btn lp_svg'><i class='fa fa-plus'></i> <?php _e('Create New','lp');?></span>
     384                                </span>
     385
     386                               
     387                            </span>
     388
     389                            <input type="hidden" name='tag' value='{{#if fields.tag.n}}{{fields.tag.n}}{{else}}General{{/if}}'/>
     390                            <input type="hidden" name='tag_id' value='{{fields.tag.id}}'/>
     391                            <input type="hidden" name='tag_color' value='{{#if fields.tag.c}}{{fields.tag.c}}{{else}}808080{{/if}}'/>
     392
     393                           
     394                            <span class='lp_tag_new dn'>
     395                                <span class='db'>
     396                                    <input class='tags' type="text" placeholder='<?php _e('Tag Name','lp');?>' name='new_tag'>
     397                                    <input class='newtag_c' type="hidden" name='c' value='808080'/>
     398                                    <span class='tag_colors dfx padt5'>
     399                                        <?php
     400                                        $Cc = array(
     401                                            '808080','AD1457', 'D81B60','D50000','E67C73',
     402                                            'F4511E','EF6C00', 'F09300','f6bf26',
     403                                            'e4c441','c0ca33', '7cb342','33b679',
     404                                            '0b8043','009688', '039be5','4285f4',
     405                                            '3f51b5','7986cb', 'b39ddb','9e69af',
     406                                            '8e24aa','795548', '616161','a79b8e',
     407                                        );
     408
     409                                        $allC = $ETD->get_all_colors();
     410                                        if($allC) $Cc = array_merge($Cc, $allC);
     411                                        $Cc = array_unique($Cc);
     412
     413                                        $index = 1;
     414                                        foreach($Cc as $C){
     415                                            $C = str_replace('#', '', $C);
     416                                            echo "<em class='lp_new_tag_color lp{$index} ". ($C=='808080'?'select':'')."' style='background-color:#". esc_html($C)."' data-c='". esc_attr($C)."'></em>";
     417                                            $index++;
     418                                        }
     419
     420                                        ?>
     421                                    </span>
     422                                    <span class='tag_color_add_new lp_btn blue'><em></em><?php _e('New Color','lp');?></span>
     423                                    <span class='add_new_tag_btn lp_btn orange'><?php _e('Add New Tag','lp');?></span>
     424                                </span>
     425                            </span>
     426                           
     427                        </span>
     428                    </p>
    354429                    <p class='date data_row'>
    355430                        <i class="fas fa-clock"></i>
     
    397472                    <?php do_action('lifepress_entry_form_mid', $this);?>
    398473
    399                     <p class='data_row tags'>
    400                         <i class="fas fa-tag"></i>
    401                         <span class='lp_entry_tags db w100'>
    402                             <span class='selected_tag lp_toggles_dn' data-t='existing_tags' style="background-color:#{{#if fields.tag.c}}{{fields.tag.c}}{{else}}808080{{/if}}">{{#if fields.tag.n}}{{fields.tag.n}}{{else}}General{{/if}}</span>
    403                             <input type="hidden" name='tag' value='{{#if fields.tag.n}}{{fields.tag.n}}{{else}}General{{/if}}'/>
    404                             <input type="hidden" name='tag_id' value='{{fields.tag.id}}'/>
    405                             <input type="hidden" name='tag_color' value='{{#if fields.tag.c}}{{fields.tag.c}}{{else}}808080{{/if}}'/>
    406 
    407                             <span class='create_new_tag_btn lp_btn blue'><?php _e('Create New','lp');?></span>
    408                             <?php
    409                                 $terms = get_terms('lp_type', array('hide_empty'=>false));
    410 
    411                                 $ETD = new LIFEPRESS_Type_Data();
    412 
    413                                 if(!empty($terms) && !is_wp_error($terms)){                                 
    414                                     echo "<span class='existing_tags dn mart10'><span class='form_tags_in dfx'>";
    415                                     ?>{{#if tags}}
    416                                     {{#each tags}}
    417                                         <i class='lp_entry_tag' data-id='{{@key}}' style='background-color:#{{c}};color:#{{tc}}' data-c='#{{c}}'>{{{n}}}</i>
    418                                     {{/each}}
    419                                     {{/if}}
    420                                     <?php echo "</span></span>";
    421                                 }
    422                             ?>
    423                            
    424                             <span class='lp_tag_new dn'>
    425                                 <span class='db'>
    426                                     <input class='tags' type="text" placeholder='<?php _e('Tag Name','lp');?>' name='new_tag'>
    427                                     <input type="hidden" name='c' value='808080'/>
    428                                     <span class='tag_colors dfx padt5'>
    429                                         <?php
    430                                         $Cc = array(
    431                                             '808080','AD1457', 'D81B60','D50000','E67C73',
    432                                             'F4511E','EF6C00', 'F09300','f6bf26',
    433                                             'e4c441','c0ca33', '7cb342','33b679',
    434                                             '0b8043','009688', '039be5','4285f4',
    435                                             '3f51b5','7986cb', 'b39ddb','9e69af',
    436                                             '8e24aa','795548', '616161','a79b8e',
    437                                         );
    438 
    439                                         $allC = $ETD->get_all_colors();
    440                                         if($allC) $Cc = array_merge($Cc, $allC);
    441                                         $Cc = array_unique($Cc);
    442 
    443                                         foreach($Cc as $C){
    444                                             $C = str_replace('#', '', $C);
    445                                             echo "<em class='lp_new_tag_color ". ($C=='808080'?'select':'')."' style='background-color:#". esc_html($C)."' data-c='". esc_attr($C)."'></em>";
    446                                         }
    447 
    448                                         ?>
    449                                     </span>
    450                                     <span class='tag_color_add_new lp_btn blue'><em></em><?php _e('New Color','lp');?></span>
    451                                 </span>
    452                             </span>
    453                            
    454                         </span>
    455                     </p>
     474                   
    456475                    <p class="data_row no_icon padt30" style="justify-content: flex-start;">
    457476                        <span class='lp_btn orange form_submit'><?php _e('Submit','lp');?></span>
     
    480499                <?php
    481500            break;
     501
     502            case 'footer_left': ?>
     503                {{#if icon}}
     504                <span style="lpdfx">
     505                    <svg fill="#000000" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
     506                         width="20px" height="20px" viewBox="0 0 47.576 47.576"
     507                         xml:space="preserve">
     508                    <g>
     509                        <path d="M24.235,12.13c-6.478,0-11.748,5.269-11.748,11.748s5.27,11.747,11.748,11.747s11.748-5.27,11.748-11.747
     510                            S30.713,12.13,24.235,12.13z M24.235,33.275c-5.182,0-9.398-4.216-9.398-9.397c0-5.183,4.216-9.397,9.398-9.397
     511                            c5.183,0,9.397,4.217,9.397,9.397C33.632,29.06,29.418,33.275,24.235,33.275z M23.06,6.485V1.589c0-0.649,0.526-1.174,1.175-1.174
     512                            c0.648,0,1.175,0.525,1.175,1.174v4.896c0,0.648-0.528,1.175-1.175,1.175C23.586,7.66,23.06,7.133,23.06,6.485z M35.095,13.287
     513                            c-0.459-0.458-0.459-1.202,0-1.661l4.209-4.209c0.459-0.458,1.203-0.458,1.662,0c0.459,0.459,0.459,1.203,0,1.661l-4.209,4.209
     514                            c-0.229,0.229-0.528,0.344-0.83,0.344C35.627,13.631,35.326,13.516,35.095,13.287z M5.63,9.078c-0.458-0.458-0.458-1.202,0-1.661
     515                            c0.459-0.458,1.203-0.458,1.661,0l4.21,4.209c0.458,0.459,0.458,1.204,0,1.661c-0.229,0.229-0.53,0.344-0.83,0.344
     516                            c-0.301,0-0.602-0.115-0.831-0.344L5.63,9.078z M24.472,41.091v4.896c0,0.649-0.525,1.175-1.173,1.175
     517                            c-0.649,0-1.175-0.527-1.175-1.175v-4.896c0-0.649,0.526-1.176,1.175-1.176C23.947,39.915,24.472,40.441,24.472,41.091z
     518                             M12.437,34.288c0.459,0.458,0.459,1.202,0,1.661l-4.209,4.21c-0.229,0.23-0.53,0.346-0.831,0.346c-0.3,0-0.601-0.117-0.83-0.346
     519                            c-0.459-0.458-0.459-1.203,0-1.662l4.209-4.209C11.235,33.829,11.978,33.829,12.437,34.288z M41.902,38.497
     520                            c0.459,0.459,0.459,1.202,0,1.662c-0.229,0.23-0.527,0.346-0.83,0.346c-0.299,0-0.601-0.117-0.83-0.346l-4.209-4.21
     521                            c-0.459-0.459-0.459-1.202,0-1.661s1.201-0.459,1.66,0L41.902,38.497z M6.461,25.054H1.175C0.526,25.054,0,24.526,0,23.878
     522                            s0.526-1.176,1.175-1.176h5.286c0.649,0,1.175,0.527,1.175,1.176C7.635,24.526,7.11,25.052,6.461,25.054z M47.576,23.878
     523                            c0,0.649-0.526,1.176-1.174,1.176h-6.267c-0.649,0-1.176-0.527-1.176-1.176s0.526-1.176,1.176-1.176h6.267
     524                            C47.05,22.702,47.576,23.228,47.576,23.878z"/>
     525                    </g>
     526                    </svg>
     527                </span>
     528                {{/if}}
     529
     530                <p class='lpmar0i lpdfx lpfxdrc'>
     531                    <b>{{today_daylight}}</b>
     532                    <?php _e('Daylight today');?>
     533                </p>
     534                <p class='lpmar0i lpdfx lpfxdrc lpdn_m'>{{{days_till_solar_event}}}</p>
     535                {{#if solar_constellation}}
     536                    <p class='lpmar0i lpdfx lpfxdrc lpdn_m'><b class='lp_tooltip' title='<?php _e('Current Sun Constellation');?>'>{{solar_constellation}}</b><?php _e("Constellation");?></p>
     537                {{/if}}
     538                <?php
     539            break;
     540            case 'footer_right': ?>
     541                <div class='lpdfx lpfxdrc lpgap5 lpdn_m' style="font-size:14px;">
     542                    <b class='lpff_1 lpfz16 lp_tooltip'  title='<?php _e('Moon day in lunar cycle','lp');?>'>{{age}} </b>
     543                    <span class='lpdn '><?php _e('Moon Day');?></span>
     544                </div>
     545               
     546                <div class=''>
     547                    <div class="lpmoon_container">
     548                        {{#each phases}}
     549                            <div class="lp_moonphase">
     550                                <div class="lp_moon {{class}}"></div>
     551                                <div class="lp_label">{{name}}</div>
     552                                {{#if date}}<div class="date lpfz11">{{date}}</div>{{/if}}
     553                            </div>
     554                        {{/each}}
     555                    </div>
     556                    <div class='lp_moon_bar'>
     557                        <em class='lp_moon_bar_on' style="width: {{moon_progress}}%"><b></b></em>
     558                    </div>
     559                </div>
     560
     561            <?php break;
    482562        }
    483563
  • lifepress/trunk/templates/header.php

    r2432078 r3428394  
    55?>
    66<!DOCTYPE html>
    7 <html <?php language_attributes(); ?> style='margin-top:0!important'>
     7<html <?php language_attributes(); ?> style='margin-top:1px!important'>
    88<!--<![endif]-->
    99<head>
Note: See TracChangeset for help on using the changeset viewer.