Plugin Directory

Changeset 1313576


Ignore:
Timestamp:
12/21/2015 03:54:15 PM (10 years ago)
Author:
DarkWolf
Message:

New release 3.0!!!

Location:
my-custom-css
Files:
63 added
11 edited

Legend:

Unmodified
Added
Removed
  • my-custom-css/trunk/editor/ace_custom.css

    r1301563 r1313576  
    22/* !important, in some class/id/selector, is required to overwrite wp rules */
    33
     4/* Remove some element if screen is minor than 1024px */
     5@media only screen and (max-width : 979px) {
     6    .scrollup, #text-resizer, .ace_search.right {
     7        display: none !important;
     8    }
     9    .ace_gutter, .ace_scroller {
     10        top: 0 !important;
     11    }
     12    #my_custom_css {
     13        font-size: 14px !important;
     14        padding-bottom: 0 !important;
     15    }
     16    #my-custom-css > .button-primary {
     17        background-image: none !important;
     18        font-size: 15px !important;
     19        height: 25px !important;
     20        line-height: 15px !important;
     21        padding: 0 15px !important;
     22        top: 50px !important;
     23    }
     24    #thememenu, #backup {
     25        margin-right: 5px !important;       
     26    }
     27    #thememenu, #backup, #invisibles, #margin, #linenumbers, #disablebackup, #basicautocomplete {
     28        margin-top: 0 !important;
     29        margin-left: 0 !important;
     30    }
     31}
    432/* Scroll ToTop */
    533.scrollup,.scrollup:hover,.scrollup:visited,.scrollup:focus {
     
    2149    z-index: 10000;
    2250}
    23 .wrap {
    24     min-width: 820px;
    25 }
    26 .wrap > h2#h2left {
     51.wrap > #h2left {
    2752    float: left;
    2853}
     
    3156    height: 20px;
    3257}
     58input {
     59    vertical-align: middle !important;
     60}
     61label {
     62    cursor: default !important;
     63}
     64#advanced {
     65    display: none;
     66}
    3367#backup > input {
    34     background: rgb(0, 0, 0);
    35     background: rgba(0, 0, 0, 0) url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABVklEQVQ4jY3TT0tVURQF8J+vB4lESMkbi4QIQQMnQUioOGgg+AFq6ED8BkbkrIkjkbCguZEz/+BAHEqKhAPNQKUMLUGeTlS0EG1w9ovrRfQt2Bzuvnuts/c659RIKKATPWhFI+pwhj2sYQ6fcCCHFizjooo4RH9eYKVKcjbaKuQCinnFKvCfcyvaeoj7VRBPMYhv+F0RmMAAPuI4creD8Be7mMc7vMFzychlqMEPyfVNTOELdnAUrZZwHv9KuBfC3ytt9cYu15nWhW6M4WV+rq94hj5MXyF2jGaMxPd2llxEPWawgEkMoxxzlmMU0ollVxUP+jCEO7nOHqMBHUHqwqMQ/BA127CIdrzGEv5EqyWM3+DNSRFNmJVcHsWq5PIB1qW3AHdRK51IOXJb8CKzazbeu3xL30b+lyvQHAU/cyL72MCDmwSyKElP+imeBLmAVzjB52zxP6oLfiu3RGvKAAAAAElFTkSuQmCC") no-repeat scroll 95% center;
    36     padding: 0 30px 0 10px;
    37     vertical-align: middle;
    38 }
    39 #backup > input:disabled {
    40     background: rgb(0, 0, 0);   
    41     background: rgba(0, 0, 0, 0) url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABhUlEQVR42pWTIUhDURSGH2IQEYPBYDCKmEVMIiJiMCzIMIlJxGAwWBdMBpElk5gMm7i3TZwMkSEiIiILsjBERGQY5AUxDMPQ75fz4O3xxOeDj3vvufecd87573Ucvkql0um6bgL28vl8lfGN0YMG3EAa26QT9bE5AnX4isFFLpfrDweoxXT2yYQD1P8TgFKO2gJgWGbjKWaAW/UqnMEzzMOi0oMHDjUZP+HDStyXI+MKXEYFUPRaoVDYggWYgHF1HpZgl/0XO3cSLmHVJItTwmNUCfcYZ2BD6VnaQSePvVP1CgnnWJ+FM3jF2GI8J+31YrE4xXrUx4InUqlURzab7cO2Jj/Odf8EkJM17TfZmhweZH7I/E5ByGRIPWG9qRKuYRp2pEBEEA+nHpVq66pdcc2PHbv3kuyAeRLGfFSCqZFkPhC6tWXeUJdj2rb+6H7a0m4EbFWV4yuhhmX403tUCaVSqTdwD8qBcq7aFNGzpmHDUoLUZ3Wh1EBTa1s1K229SDVU0n4DdpZf1EjbaRYAAAAASUVORK5CYII=") no-repeat scroll 95% center !important;
    42 }
    43 form#erase, input#close {
     68    background-position: 95% center !important;
     69    background-repeat: no-repeat !important;
     70    padding: 0 30px 0 10px !important;
     71}
     72#backup > .button {
     73    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABVklEQVQ4jY3TT0tVURQF8J+vB4lESMkbi4QIQQMnQUioOGgg+AFq6ED8BkbkrIkjkbCguZEz/+BAHEqKhAPNQKUMLUGeTlS0EG1w9ovrRfQt2Bzuvnuts/c659RIKKATPWhFI+pwhj2sYQ6fcCCHFizjooo4RH9eYKVKcjbaKuQCinnFKvCfcyvaeoj7VRBPMYhv+F0RmMAAPuI4creD8Be7mMc7vMFzychlqMEPyfVNTOELdnAUrZZwHv9KuBfC3ytt9cYu15nWhW6M4WV+rq94hj5MXyF2jGaMxPd2llxEPWawgEkMoxxzlmMU0ollVxUP+jCEO7nOHqMBHUHqwqMQ/BA127CIdrzGEv5EqyWM3+DNSRFNmJVcHsWq5PIB1qW3AHdRK51IOXJb8CKzazbeu3xL30b+lyvQHAU/cyL72MCDmwSyKElP+imeBLmAVzjB52zxP6oLfiu3RGvKAAAAAElFTkSuQmCC") !important;
     74}
     75#backup > .button-secondary {
     76    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABhUlEQVR42pWTIUhDURSGH2IQEYPBYDCKmEVMIiJiMCzIMIlJxGAwWBdMBpElk5gMm7i3TZwMkSEiIiILsjBERGQY5AUxDMPQ75fz4O3xxOeDj3vvufecd87573Ucvkql0um6bgL28vl8lfGN0YMG3EAa26QT9bE5AnX4isFFLpfrDweoxXT2yYQD1P8TgFKO2gJgWGbjKWaAW/UqnMEzzMOi0oMHDjUZP+HDStyXI+MKXEYFUPRaoVDYggWYgHF1HpZgl/0XO3cSLmHVJItTwmNUCfcYZ2BD6VnaQSePvVP1CgnnWJ+FM3jF2GI8J+31YrE4xXrUx4InUqlURzab7cO2Jj/Odf8EkJM17TfZmhweZH7I/E5ByGRIPWG9qRKuYRp2pEBEEA+nHpVq66pdcc2PHbv3kuyAeRLGfFSCqZFkPhC6tWXeUJdj2rb+6H7a0m4EbFWV4yuhhmX403tUCaVSqTdwD8qBcq7aFNGzpmHDUoLUZ3Wh1EBTa1s1K229SDVU0n4DdpZf1EjbaRYAAAAASUVORK5CYII=") !important;
     77}
     78#erase, #close {
    4479    margin-top: 5px;
    4580    float: right;
    4681}
    47 form#erase > input[type="button"] {
    48     padding: 2px 5px;
    49 }
    50 form#erase > input[type="submit"] {
    51     background: rgb(0, 0, 0);   
    52     background: rgba(0, 0, 0, 0) url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAACB0RVh0U29mdHdhcmUATWFjcm9tZWRpYSBGaXJld29ya3MgTVi7kSokAAAAFnRFWHRDcmVhdGlvbiBUaW1lADExLzA1LzA33bqJ2wAAAp9JREFUeJxVk8tr1FcUxz/3/n55VFMT8gCtQ6uLUBqqCCbiSgqFgpa2mVIEQUo2QnFZioj0QQVduOhf0FXBnTQDpVJ3RkTETqXkYTudjRknhj6m6TiTYfL73XNOF7+ZMHM253Lvh/M9j3ucmdFry2feOOoGB7/GR7Pmo5yqoMlOVZOdoiU7X83dfbbcy7veAKv5Y4v4aL69WSGtbyEi2YOPiPaO4EbHIYTCybuVfF+Ayo3Phhs/L5XTrX9y29WniMHUhwtMX/4GQylf/5Q/C98RAX5sAoaGq63J3PQ73z9sOzNjNX9sMTTq883qU4JBMHjrUY2fzhyhFuDs7cfcOrGfAzHEDtzLY7g4Lpx6+HferX40O2eqj+prj0kNpvILzFz/FtTAFFMFU1Bl5YtP+OuHmww4kNEJnNkJrzvta+3NCtJRPnzxcxDFVDAR6HhT5bULl9hMM863mlhIr8Vu+KWZtL6FAAK8WPqRRhRlHeo2uOM1BJqacT4kpPHQjFe1gyKCkWUdHXqdqfwCmDH5wcdMvncegIl3z5G+cpghl3GYEVQPetVsVN1h1n/7tVO3ZWWo7J5rv6/gHLu8qeA1hA18ROee1sY6dOcvWQDDQJXGxjqDXRCHimx4bTWfRHtHcIB30Cgt96miCgYmQq20RuwyLjhHrPLEWzRwxY2OEwER0Cqt9KmaSJawCrXyGkMu49rmENUrfu5OqUgIBT82QeyA7Rf8W7zPyJtzu2McPPAqz395QNJssMdD4jxOtfB+WYvOzLh3/u1hXymVpbWds8Z/BIPNAA3p2zP2RTA+4EnUqs8Tm764bu2+Zbp3cmoxVZvPPkmS9aHTsOAcbXNd5f5l6rWl46NHgnE1qM2majlTAZGqUylGpl+e/kNXevn/AT0JpV86x3yxAAAAAElFTkSuQmCC') no-repeat scroll 95% center !important;
    53     color: red;
     82#erase > input.button-primary {
     83    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAACB0RVh0U29mdHdhcmUATWFjcm9tZWRpYSBGaXJld29ya3MgTVi7kSokAAAAFnRFWHRDcmVhdGlvbiBUaW1lADExLzA1LzA33bqJ2wAAAp9JREFUeJxVk8tr1FcUxz/3/n55VFMT8gCtQ6uLUBqqCCbiSgqFgpa2mVIEQUo2QnFZioj0QQVduOhf0FXBnTQDpVJ3RkTETqXkYTudjRknhj6m6TiTYfL73XNOF7+ZMHM253Lvh/M9j3ucmdFry2feOOoGB7/GR7Pmo5yqoMlOVZOdoiU7X83dfbbcy7veAKv5Y4v4aL69WSGtbyEi2YOPiPaO4EbHIYTCybuVfF+Ayo3Phhs/L5XTrX9y29WniMHUhwtMX/4GQylf/5Q/C98RAX5sAoaGq63J3PQ73z9sOzNjNX9sMTTq883qU4JBMHjrUY2fzhyhFuDs7cfcOrGfAzHEDtzLY7g4Lpx6+HferX40O2eqj+prj0kNpvILzFz/FtTAFFMFU1Bl5YtP+OuHmww4kNEJnNkJrzvta+3NCtJRPnzxcxDFVDAR6HhT5bULl9hMM863mlhIr8Vu+KWZtL6FAAK8WPqRRhRlHeo2uOM1BJqacT4kpPHQjFe1gyKCkWUdHXqdqfwCmDH5wcdMvncegIl3z5G+cpghl3GYEVQPetVsVN1h1n/7tVO3ZWWo7J5rv6/gHLu8qeA1hA18ROee1sY6dOcvWQDDQJXGxjqDXRCHimx4bTWfRHtHcIB30Cgt96miCgYmQq20RuwyLjhHrPLEWzRwxY2OEwER0Cqt9KmaSJawCrXyGkMu49rmENUrfu5OqUgIBT82QeyA7Rf8W7zPyJtzu2McPPAqz395QNJssMdD4jxOtfB+WYvOzLh3/u1hXymVpbWds8Z/BIPNAA3p2zP2RTA+4EnUqs8Tm764bu2+Zbp3cmoxVZvPPkmS9aHTsOAcbXNd5f5l6rWl46NHgnE1qM2majlTAZGqUylGpl+e/kNXevn/AT0JpV86x3yxAAAAAElFTkSuQmCC');
     84    background-position: 95% center;
     85    background-repeat: no-repeat;
     86    color: #fff;
    5487    padding: 0 30px 0 10px;
    5588}
     
    151184}
    152185#my-custom-css > .button-primary {
     186    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABKRJREFUeNqsVs1PHVUUP2fmzjyg5dEC5UuxqJhgtBsMXdWEGFcm1rix7shb4D9A4lYTF4R/wTTaQlxUF24UY62xGKJRsYbEGFNLmrCQgAgU3uN9zHtz/Z1zZ94HUD8Sh8xj7p1zz+/8fufcc4ettfSw68aHN/DLlvFrydkx/tLnI2O+8tqVE/3w/Pw8GWN0UK1WT5fL5Q+KxeLlSqVCvb29NDU1Rf/mmp+/Tjs7u+T7Pnmep3OlUqljZmamaGRC2MD5uUKh8Mn4+PjFjY0NNdre3qbDw0P68vZtBBCRjWN65eXLxwCiqEIIjIaHh3U8ODhIS0tL7yLQQyFiBACDx/P5/M2xsbHR5eVlwrMad/f00EH+gAqFPK189z09c+GCsD0CECGQAqIu0+rqqs6tra3R5OTkG4uLizo2WOSD1kcTExMKIJH7vqcql0sl2t3dpUK+oMYH+/vqNAKQOBbbGOwk0CJsnUyM+SJtbm5Smm+DRTWAPLe1taWUPeOTJFpQICHt7e0hyiL1DfRT/uCA7v52F8wjTTYnqRdjsZV8SJUw1qZpUJDp6Wmam5sj9ph8AMg8u9VgcEj7cPzU6Khzxi5Pid96fcljVClTR8dpSiNkOBFQBUmqCsg+Jk2T2payXVm6dfOLfy4tOO7p6a0jS1l7kDwMwwaIXD7opaUsdCy7HdA/MOCkkfXcQqHhUmWBNTck9L1GKddBZEKZiDfbiJCJWsb1YQraGCRrue4vvRRE9POgnwmMsnDxIkK2idP6TBOLNBiugzf3gjQfrXIJCOS6t9JLP376CMWRpf96Mfxeen2dhp/e1ZwcA5HJAEx++vxReufbi/TzHzH5LLRFX6eM15IPphisa3H6n+jZcx699bxPI2/nW4roGJPglE+/bMf0AzpLiMhEQeNZB1RPA+seEMdV3BGaQKWGIDgmc8r58U6SS0vYBBR0BhQapo7Q0ktjUnWWDCd5Eybsqi/GY4wkw7ey+exXqwGFnQhUQDzvJCaevgy7jDLoCJm+WcciWATCxLeI1BWDtYlENUsRUKIaUzvsM1gXnjHK5KGJ9/Gy7WxIAd63B5ZefFKkYgqEheSEKakwMAATvUEpgmS37ltdl+kK1I9/lIlQk1uYZM4aNW5DZCvISyaQxUzoOJDNyWVVqoRFlalStdQujGHX1h3oVjhWXZlMRnPiKUigDtuMpRceA7DnFvucyJX0qlhZAMRK0pm+Wk+Y6PpA/aUdxKRSCXK5UFC5DPTPBER3tvHfCJsYeXKlnHaEqshUExY4ASOxYy0SWV+Cn5Yu7FqVROnohWcQiUfq9NKAJBMRSl/TKuN6B64i+VAJclkqxR59/bsUB6ncbt+xHL8NEDl4urJZ6h8aokxsdC9I1Hd2LKoM0iEvaZXJu9i6/VFWFrgrafUhOCS+f2iQujqzej7VQeTAuX7t2r2pXG40eGDofKen1SWOdUMmtwBL0SAmlw9JPIKotOFGAfS1MYVZQyPnR+i9q1dz+GZ4P5fL+SzH6+zsbDfO+T9lw/W9OufK1DZ9BDV1X07PxLT7qnzNH0ZMWx+/qUczQJ5YWFi4z3/33fV/XX8JMACy4xzn2a+hdAAAAABJRU5ErkJggg==");
     187    background-position: 92% center;
     188    background-repeat: no-repeat;
    153189    border-radius: 15px !important;
    154     font-size: 30px;
    155     height: 50px;
     190    font-size: 25px;
     191    height: 35px;
    156192    position: fixed;
    157     right: 25px;
    158     top: 45px;
    159     width: 130px;
     193    right: 19px;
     194    top: 48px;
     195    padding: 0 38px 0 10px;
    160196    z-index: 9999;
    161197}
    162 #thememenu, #backup {
     198#thememenu, #backup, #invisibles, #margin, #linenumbers, #disablebackup, #basicautocomplete {
    163199    float: left;
    164     margin-left: 10px;
     200    margin-right: 7px;
    165201    margin-top: -5px;
     202    line-height: 25px;
     203}
     204#invisibles, #margin, #linenumbers, #disablebackup, #basicautocomplete {
     205    border: 1px solid #656565;
     206    border-radius: 5px;
     207    padding: 1px 3px;
     208    margin-bottom: 2px;
    166209}
    167210#thememenu > select {
    168211    height: 28px;
     212}
     213form > input[type="radio"] {
     214    margin: 0 !important;
     215    height: 14px !important;
     216    width: 14px !important;
    169217}
    170218/* Fix wordpress footer */
     
    179227    font-style: italic;
    180228}
    181 #mccss_credit a {
     229#mccss_credit a, #toggle {
    182230    text-decoration: none;
    183231}
  • my-custom-css/trunk/lang/default.pot

    r1301563 r1313576  
    44"Project-Id-Version: My Custom CSS\n"
    55"Report-Msgid-Bugs-To: \n"
    6 "POT-Creation-Date: 2015-12-06 19:38+0100\n"
     6"POT-Creation-Date: 2015-12-21 12:05+0100\n"
    77"PO-Revision-Date: \n"
    88"Last-Translator: Salvatore Noschese (DarkWolf) <[email protected]>\n"
     
    1818"X-Poedit-SearchPath-0: .\n"
    1919
    20 #: my-custom-css.php:66
     20#: my-custom-css.php:69
    2121msgid "Settings"
    2222msgstr ""
    2323
    24 #: my-custom-css.php:69
     24#: my-custom-css.php:72
    2525msgid "Support"
    2626msgstr ""
    2727
    28 #: my-custom-css.php:250 my-custom-css.php:423
     28#: my-custom-css.php:378 my-custom-css.php:576
    2929msgid "My Custom CSS Panel"
    3030msgstr ""
    3131
    32 #: my-custom-css.php:253
    33 msgid "Font Size:"
     32#: my-custom-css.php:381
     33msgid "Font:"
    3434msgstr ""
    3535
    36 #: my-custom-css.php:263
     36#: my-custom-css.php:391
    3737msgid "Theme:"
    3838msgstr ""
    3939
    40 #: my-custom-css.php:264
     40#: my-custom-css.php:392 my-custom-css.php:459 my-custom-css.php:463
     41#: my-custom-css.php:467 my-custom-css.php:471 my-custom-css.php:475
    4142msgid ""
    4243"Warning!!! This will refresh entire page (Unsaved data will be lost) - "
     
    4445msgstr ""
    4546
    46 #: my-custom-css.php:265
     47#: my-custom-css.php:393
    4748msgid "Bright:"
    4849msgstr ""
    4950
    50 #: my-custom-css.php:282
     51#: my-custom-css.php:410
    5152msgid "Dark:"
    5253msgstr ""
    5354
    54 #: my-custom-css.php:312
     55#: my-custom-css.php:440
    5556msgid "No backup found"
    5657msgstr ""
    5758
    58 #: my-custom-css.php:316
     59#: my-custom-css.php:444
    5960msgid "View backups"
    6061msgstr ""
    6162
    62 #: my-custom-css.php:316
     63#: my-custom-css.php:444
    6364msgid "Click to view all backups!"
    6465msgstr ""
    6566
    66 #: my-custom-css.php:320
     67#: my-custom-css.php:448
    6768msgid "Backup:"
    6869msgstr ""
    6970
    70 #: my-custom-css.php:334
     71#: my-custom-css.php:452
     72msgid "Enable"
     73msgstr ""
     74
     75#: my-custom-css.php:453
     76msgid "Disable"
     77msgstr ""
     78
     79#: my-custom-css.php:455
     80msgid "Advanced"
     81msgstr ""
     82
     83#: my-custom-css.php:458
     84msgid "Invisibles"
     85msgstr ""
     86
     87#: my-custom-css.php:462
     88msgid "Margin"
     89msgstr ""
     90
     91#: my-custom-css.php:466
     92msgid "LineNumbers"
     93msgstr ""
     94
     95#: my-custom-css.php:470
     96msgid "Backup"
     97msgstr ""
     98
     99#: my-custom-css.php:474
     100msgid "Autocomplete"
     101msgstr ""
     102
     103#: my-custom-css.php:487
    71104msgid "Save"
    72105msgstr ""
    73106
    74 #: my-custom-css.php:356
     107#: my-custom-css.php:509
    75108msgid "My custom CSS - Backup"
    76109msgstr ""
    77110
    78 #: my-custom-css.php:358 my-custom-css.php:378
     111#: my-custom-css.php:511 my-custom-css.php:531
    79112msgid "Close now!"
    80113msgstr ""
    81114
    82 #: my-custom-css.php:360
     115#: my-custom-css.php:513
    83116msgid "Erase all backup?"
    84117msgstr ""
    85118
    86 #: my-custom-css.php:360
     119#: my-custom-css.php:513
    87120msgid "Do you want really delete all backup?"
    88121msgstr ""
    89122
    90 #: my-custom-css.php:366
     123#: my-custom-css.php:519
    91124msgid "File:"
    92125msgstr ""
    93126
    94 #: my-custom-css.php:367
     127#: my-custom-css.php:520
    95128msgid "Path:"
    96129msgstr ""
    97130
    98 #: my-custom-css.php:368
     131#: my-custom-css.php:521
    99132msgid "Saved:"
    100133msgstr ""
    101134
    102 #: my-custom-css.php:369
     135#: my-custom-css.php:522
    103136msgid "Size:"
    104137msgstr ""
    105138
    106 #: my-custom-css.php:377
     139#: my-custom-css.php:530
    107140msgid "My custom CSS - Erase Backup"
    108141msgstr ""
    109142
    110 #: my-custom-css.php:384
     143#: my-custom-css.php:537
    111144msgid "bytes, was successfully deleted!!!"
    112145msgstr ""
    113146
    114 #: my-custom-css.php:423
     147#: my-custom-css.php:576
    115148msgid "My Custom CSS"
    116149msgstr ""
  • my-custom-css/trunk/lang/my-custom-css-it_IT.po

    r1301563 r1313576  
    33"Project-Id-Version: My Custom CSS\n"
    44"Report-Msgid-Bugs-To: \n"
    5 "POT-Creation-Date: 2015-12-06 19:39+0100\n"
     5"POT-Creation-Date: 2015-12-21 12:05+0100\n"
    66"PO-Revision-Date: \n"
    77"Last-Translator: Salvatore Noschese (DarkWolf) <[email protected]>\n"
     
    1212"Content-Transfer-Encoding: 8bit\n"
    1313"X-Poedit-KeywordsList: _e;__\n"
    14 "X-Poedit-Basepath: E:/WordPress/my-custom-css/trunk\n"
     14"X-Poedit-Basepath: .\n"
    1515"X-Poedit-SourceCharset: UTF-8\n"
    1616"X-Generator: Poedit 1.8.6\n"
    17 "X-Poedit-SearchPath-0: E:/WordPress/my-custom-css/trunk\n"
     17"X-Poedit-SearchPath-0: .\n"
    1818
    19 #: my-custom-css.php:66
     19#: my-custom-css.php:69
    2020msgid "Settings"
    2121msgstr "Opzioni"
    2222
    23 #: my-custom-css.php:69
     23#: my-custom-css.php:72
    2424msgid "Support"
    2525msgstr "Supporto"
    2626
    27 #: my-custom-css.php:250 my-custom-css.php:423
     27#: my-custom-css.php:378 my-custom-css.php:576
    2828msgid "My Custom CSS Panel"
    2929msgstr "Pannello My Custom CSS"
    3030
    31 #: my-custom-css.php:253
    32 msgid "Font Size:"
    33 msgstr "Dimensione dei font:"
     31#: my-custom-css.php:381
     32msgid "Font:"
     33msgstr "Font:"
    3434
    35 #: my-custom-css.php:263
     35#: my-custom-css.php:391
    3636msgid "Theme:"
    3737msgstr "Tema:"
    3838
    39 #: my-custom-css.php:264
     39#: my-custom-css.php:392 my-custom-css.php:459 my-custom-css.php:463
     40#: my-custom-css.php:467 my-custom-css.php:471 my-custom-css.php:475
    4041msgid ""
    4142"Warning!!! This will refresh entire page (Unsaved data will be lost) - "
     
    4546"andranno persi) - Continuare?"
    4647
    47 #: my-custom-css.php:265
     48#: my-custom-css.php:393
    4849msgid "Bright:"
    4950msgstr "Luminoso:"
    5051
    51 #: my-custom-css.php:282
     52#: my-custom-css.php:410
    5253msgid "Dark:"
    5354msgstr "Scuro:"
    5455
    55 #: my-custom-css.php:312
     56#: my-custom-css.php:440
    5657msgid "No backup found"
    5758msgstr "Nessun backup trovato"
    5859
    59 #: my-custom-css.php:316
     60#: my-custom-css.php:444
    6061msgid "View backups"
    6162msgstr "Visualizza i backup"
    6263
    63 #: my-custom-css.php:316
     64#: my-custom-css.php:444
    6465msgid "Click to view all backups!"
    6566msgstr "Clicca per vedere tutti i backup!"
    6667
    67 #: my-custom-css.php:320
     68#: my-custom-css.php:448
    6869msgid "Backup:"
    6970msgstr "Backup:"
    7071
    71 #: my-custom-css.php:334
     72#: my-custom-css.php:452
     73msgid "Enable"
     74msgstr "Abilita"
     75
     76#: my-custom-css.php:453
     77msgid "Disable"
     78msgstr "Disabilita"
     79
     80#: my-custom-css.php:455
     81msgid "Advanced"
     82msgstr "Avanzate"
     83
     84#: my-custom-css.php:458
     85msgid "Invisibles"
     86msgstr "Invisibili"
     87
     88#: my-custom-css.php:462
     89msgid "Margin"
     90msgstr "Margine"
     91
     92#: my-custom-css.php:466
     93msgid "LineNumbers"
     94msgstr "Numeri di riga"
     95
     96#: my-custom-css.php:470
     97msgid "Backup"
     98msgstr "Backup"
     99
     100#: my-custom-css.php:474
     101msgid "Autocomplete"
     102msgstr "Autocompletamento"
     103
     104#: my-custom-css.php:487
    72105msgid "Save"
    73106msgstr "Salva"
    74107
    75 #: my-custom-css.php:356
     108#: my-custom-css.php:509
    76109msgid "My custom CSS - Backup"
    77110msgstr "My custom CSS - Backup"
    78111
    79 #: my-custom-css.php:358 my-custom-css.php:378
     112#: my-custom-css.php:511 my-custom-css.php:531
    80113msgid "Close now!"
    81114msgstr "Chiudi ora!"
    82115
    83 #: my-custom-css.php:360
     116#: my-custom-css.php:513
    84117msgid "Erase all backup?"
    85118msgstr "Cancellare tutti i backup?"
    86119
    87 #: my-custom-css.php:360
     120#: my-custom-css.php:513
    88121msgid "Do you want really delete all backup?"
    89122msgstr "Vuoi davvero eliminare tutti i backup?"
    90123
    91 #: my-custom-css.php:366
     124#: my-custom-css.php:519
    92125msgid "File:"
    93126msgstr "File:"
    94127
    95 #: my-custom-css.php:367
     128#: my-custom-css.php:520
    96129msgid "Path:"
    97130msgstr "Percorso:"
    98131
    99 #: my-custom-css.php:368
     132#: my-custom-css.php:521
    100133msgid "Saved:"
    101134msgstr "Salvato:"
    102135
    103 #: my-custom-css.php:369
     136#: my-custom-css.php:522
    104137msgid "Size:"
    105138msgstr "Dimensioni:"
    106139
    107 #: my-custom-css.php:377
     140#: my-custom-css.php:530
    108141msgid "My custom CSS - Erase Backup"
    109142msgstr "My custom CSS - Cancella i backup"
    110143
    111 #: my-custom-css.php:384
     144#: my-custom-css.php:537
    112145msgid "bytes, was successfully deleted!!!"
    113146msgstr "byte, &egrave; stato cancellato con successo!!!"
    114147
    115 #: my-custom-css.php:423
     148#: my-custom-css.php:576
    116149msgid "My Custom CSS"
    117150msgstr "My Custom CSS"
     151
     152#~ msgid "Invisible"
     153#~ msgstr "Invisibile"
     154
     155#~ msgid "Invisible:"
     156#~ msgstr "Invisibile:"
     157
     158#~ msgid "Margin:"
     159#~ msgstr "Margine:"
     160
     161#~ msgid "LineNumbers:"
     162#~ msgstr "Line Numbers:"
     163
     164#~ msgid "Autocomplete:"
     165#~ msgstr "Autocompletamento:"
     166
     167#~ msgid "LineNumber:"
     168#~ msgstr "Numero di riga:"
     169
     170#~ msgid "Font Size:"
     171#~ msgstr "Dimensione dei font:"
    118172
    119173#~ msgid "No backup found..."
  • my-custom-css/trunk/my-custom-css.php

    r1301583 r1313576  
    88PS: support file backup and - very important - static css file (fantastic for performance) ;)
    99Author: DarkWolf
    10 Version: 2.9
     10Version: 3.0
    1111Author URI: https://laltroweb.it/
    1212Text Domain: my-custom-css
    1313*/
    1414
    15 // Prevent Direct Access with homepage redirect
    16 if (defined('DB_NAME'))
    17 {
    18 
    19     // Text Domain: my-custom-css
    20     load_plugin_textdomain('my-custom-css', false, dirname(plugin_basename(__FILE__)) . '/lang/');
    21 
    22     // Generate basedir and baseurl
    23     function plugin_basedir() { $upload_dir = wp_upload_dir(); $plugin_basedir = $upload_dir['basedir']; return $plugin_basedir; }
    24     function plugin_url() { $upload_dir = wp_upload_dir(); $plugin_url = set_url_scheme($upload_dir['baseurl']); return $plugin_url; }
    25 
    26     // Generate my_style_id url:
    27     function my_style_id() { $blog_id = get_current_blog_id(); $cssid = ( $blog_id > "1" ) ? $cssid = "_id-".$blog_id : $cssid = null; $my_style_id = "/my_custom_css/my_style".$cssid.".css"; return $my_style_id; }
    28 
    29     // Generate css url and css path
    30     function css_url() { $css_url = plugin_url().my_style_id(); return $css_url; }
    31     function css_path() { $css_path = plugin_basedir().my_style_id(); return $css_path; }
    32 
    33     // make my_style.css and write write css code!
    34     function getdata() { $getdata = strip_tags(get_option('my_custom_css')); return $getdata; }
    35 
    36     // Write in source!
    37     function mycustomcss_head()
    38     {
    39         $data = getdata();
    40         if (!empty($data))
    41         {
    42             echo "\n<!-- My Custom CSS -->\n<link rel='stylesheet' id='mccss_stylesheet' href='".css_url()."?".@filemtime(css_path())."' type='text/css' media='all' />\n<!-- My Custom CSS -->\n";
    43         }
    44     }
    45 
    46     // Make css file
    47     function makecss()
    48     {
    49         $makecss = file_put_contents(css_path(), "/******* Do not edit this file *******/\n/*\nMy Custom CSS - by Salvatore Noschese\naka L'AltroWeb - https://laltroweb.it/\n/*\nSaved: ".date("M d Y | h:i:s (a)",current_time('timestamp'))."\n/*\n/******* Do not edit this file *******/\n\n".getdata());
    50         return $makecss;
    51     }
    52 
    53     // Fix first upgrade from old release or manual my_style.css deletion!
    54     if (!file_exists(css_path()) || isset($_POST['save'])) { makecss(); }
    55    
    56     // Fix old backup folder or no exist
    57     if (!is_dir(plugin_basedir().'/my_custom_css/bkk')) { wp_mkdir_p(plugin_basedir().'/my_custom_css/bkk'); }
    58     // And Blank index.php to prevent listing directory
    59     else if(!file_exists(plugin_basedir()."/my_custom_css/index.php") || !file_exists(plugin_basedir()."/my_custom_css/bkk/index.php"))
    60     { file_put_contents(plugin_basedir()."/my_custom_css/index.php", "<?php \n// Prevent Directory Listing..."); file_put_contents(plugin_basedir()."/my_custom_css/bkk/index.php", "<?php \n// Prevent Directory Listing..."); }
    61 
    62     // Start Add link on plugins page
    63     function mycustomcss_links($links)
    64     {
    65         # Settings:
    66         $settings_link = '<a href="admin.php?page=my_custom_css" title="My Custom CSS">'.__('Settings','my-custom-css').'</a>';
    67         array_unshift($links, $settings_link);
    68         # Support:
    69         $support_forum = '<a href="https://laltroweb.it/" title="laltroweb.it">'.__('Support','my-custom-css').'</a>';
    70         array_unshift($links, $support_forum);
    71         # return:
    72         return $links;
    73     }
    74     function add_plugin_meta_links($links, $file)
    75     {
    76         if ($file == plugin_basename(__FILE__))
    77         {
    78             $links[] = '<a href="https://www.paypal.me/SalvatoreN" title="Buy Me a Beer ;)">Donate &#128522;</a>';
    79         }
    80         return $links;
    81     }
    82 
    83     function mccss_png()
    84     {
    85         $mccss_png = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAnFBMVEUAAAAAAABuRSAAAADJgjl3TCIAAADOgj3Ifjb/////qg//2IP/tSj/rRf/68LHfTT/uTH/siAqfQD/783/zFnI8E7/xk7/vjg6iQAvgQD/0W7/zlP/wkLbgEG/60CdxwAziAD/3IT/0Wf/z1rM8VjPfjul4gCi2ACd0gBJigBDhwD/6bz/1Xv/1Hr/zWP/1l3H7k2gzwCbwACatQA6TvqRAAAACHRSTlMACVkz8F4v8dedY+EAAACsSURBVBjTVY7ZDoIwEAAXq9jFAqXc93166///mwWMkUlmk53sw8KebtgDLU9/lBToRZPoX68UzOiMaOgG4mxkgnlDTUddjtlIXjhoMWahYc1WS2Ccc2YgYzZW7RIYci71fRGmQB0b0fYXhdsEQOvESxJPCM8TzduV4R7HcR26jzB0X3mRrq+3RZZnWf4s0iOoh91M0A9DH+wOKoCyQKaum4iiwA8yjgQ2kHX/AB8tDwIctw6nAAAAAElFTkSuQmCC";
    86         return $mccss_png;
    87     }
    88     // Change the CSS for this plugin on admin plugins page
    89     function mycustomcss_admin_style()
    90     {
    91         global $pagenow;
    92         if ($pagenow == "plugins.php")
    93         {
    94             echo "<style type='text/css'>\n#my-custom-css td.plugin-title strong {\n\tbackground: url(".mccss_png().") no-repeat scroll 115px 2px;\n}\n#my-custom-css div.row-actions-visible {\n\tpadding-top: 15px;\n}\n#my-custom-css div.plugin-version-author-uri {\n\tbackground-color: #EAEAEA;\n\tborder-radius: 5px;\n\tbox-shadow: 0 8px 6px -6px gray; \n\tfont-weight: bold; \n\tpadding: 7px; \n\tmargin-bottom: 12px;\n}\n</style>\n";
    95         }
    96     }
    97 
    98     // Get plugin version
    99     function plug_ver()
    100     {
    101         $plugin_data = get_plugin_data(__FILE__);
    102         $plug_ver = $plugin_data['Version'];
    103         return $plug_ver;
    104     }
    105 
    106     // Set Theme
    107     function thl()
    108     {
    109         if(isset($_POST["themelist"]))
    110         {
    111             $thl = $_POST["themelist"];
    112             return $thl;
    113         }
    114     }
     15/* To prevent PHP errors */
     16if (!defined('DB_NAME'))
     17{
     18    header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
     19    exit;
     20}
     21
     22// Text Domain: my-custom-css
     23load_plugin_textdomain('my-custom-css', false, dirname(plugin_basename(__FILE__)) . '/lang/');
     24
     25// Generate basedir and baseurl
     26function plugin_basedir() { $upload_dir = wp_upload_dir(); $plugin_basedir = $upload_dir['basedir']; return $plugin_basedir; }
     27function plugin_url() { $upload_dir = wp_upload_dir(); $plugin_url = set_url_scheme($upload_dir['baseurl']); return $plugin_url; }
     28
     29// Generate my_style_id url:
     30function my_style_id() { $blog_id = get_current_blog_id(); $cssid = ( $blog_id > "1" ) ? $cssid = "_id-".$blog_id : $cssid = null; $my_style_id = "/my_custom_css/my_style".$cssid.".css"; return $my_style_id; }
     31
     32// Generate css url and css path
     33function css_url() { $css_url = plugin_url().my_style_id(); return $css_url; }
     34function css_path() { $css_path = plugin_basedir().my_style_id(); return $css_path; }
     35
     36// make my_style.css and write write css code!
     37function getdata() { $getdata = strip_tags(get_option('my_custom_css')); return $getdata; }
     38
     39// Write in source!
     40function mycustomcss_head()
     41{
     42    $data = getdata();
     43    if (!empty($data))
     44    {
     45        echo "\n<!-- My Custom CSS -->\n<link rel='stylesheet' id='mccss_stylesheet' href='".css_url()."?".@filemtime(css_path())."' type='text/css' media='all' />\n<!-- My Custom CSS -->\n";
     46    }
     47}
     48
     49// Make css file
     50function makecss()
     51{
     52    $makecss = file_put_contents(css_path(), "/******* Do not edit this file *******/\n/*\nMy Custom CSS - by Salvatore Noschese\naka L'AltroWeb - https://laltroweb.it/\n/*\nSaved: ".date("M d Y | h:i:s (a)",current_time('timestamp'))."\n/*\n/******* Do not edit this file *******/\n\n".getdata());
     53    return $makecss;
     54}
     55
     56// Fix first upgrade from old release or manual my_style.css deletion!
     57if (!file_exists(css_path()) || isset($_POST['save'])) { makecss(); }
     58
     59// Fix old backup folder or no exist
     60if (!is_dir(plugin_basedir().'/my_custom_css/bkk')) { wp_mkdir_p(plugin_basedir().'/my_custom_css/bkk'); }
     61// And Blank index.php to prevent listing directory
     62else if(!file_exists(plugin_basedir()."/my_custom_css/index.php") || !file_exists(plugin_basedir()."/my_custom_css/bkk/index.php"))
     63{ file_put_contents(plugin_basedir()."/my_custom_css/index.php", "<?php \n// Prevent Directory Listing..."); file_put_contents(plugin_basedir()."/my_custom_css/bkk/index.php", "<?php \n// Prevent Directory Listing..."); }
     64
     65// Start Add link on plugins page
     66function mycustomcss_links($links)
     67{
     68    # Settings:
     69    $settings_link = '<a href="admin.php?page=my_custom_css" title="My Custom CSS">'.__('Settings','my-custom-css').'</a>';
     70    array_unshift($links, $settings_link);
     71    # Support:
     72    $support_forum = '<a href="https://laltroweb.it/" title="laltroweb.it">'.__('Support','my-custom-css').'</a>';
     73    array_unshift($links, $support_forum);
     74    # return:
     75    return $links;
     76}
     77function add_plugin_meta_links($links, $file)
     78{
     79    if ($file == plugin_basename(__FILE__))
     80    {
     81        $links[] = '<a href="https://www.paypal.me/SalvatoreN" title="Buy Me a Beer ;)">Donate &#128522;</a>';
     82    }
     83    return $links;
     84}
     85
     86function mccss_png()
     87{
     88    $mccss_png = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAnFBMVEUAAAAAAABuRSAAAADJgjl3TCIAAADOgj3Ifjb/////qg//2IP/tSj/rRf/68LHfTT/uTH/siAqfQD/783/zFnI8E7/xk7/vjg6iQAvgQD/0W7/zlP/wkLbgEG/60CdxwAziAD/3IT/0Wf/z1rM8VjPfjul4gCi2ACd0gBJigBDhwD/6bz/1Xv/1Hr/zWP/1l3H7k2gzwCbwACatQA6TvqRAAAACHRSTlMACVkz8F4v8dedY+EAAACsSURBVBjTVY7ZDoIwEAAXq9jFAqXc93166///mwWMkUlmk53sw8KebtgDLU9/lBToRZPoX68UzOiMaOgG4mxkgnlDTUddjtlIXjhoMWahYc1WS2Ccc2YgYzZW7RIYci71fRGmQB0b0fYXhdsEQOvESxJPCM8TzduV4R7HcR26jzB0X3mRrq+3RZZnWf4s0iOoh91M0A9DH+wOKoCyQKaum4iiwA8yjgQ2kHX/AB8tDwIctw6nAAAAAElFTkSuQmCC";
     89    return $mccss_png;
     90}
     91// Change the CSS for this plugin on admin plugins page
     92function mycustomcss_admin_style()
     93{
     94    global $pagenow;
     95    if ($pagenow == "plugins.php")
     96    {
     97        echo "<style type='text/css'>\n#my-custom-css td.plugin-title strong {\n\tbackground: url(".mccss_png().") no-repeat scroll 115px 2px;\n}\n#my-custom-css div.row-actions-visible {\n\tpadding-top: 15px;\n}\n#my-custom-css div.plugin-version-author-uri {\n\tbackground-color: #EAEAEA;\n\tborder-radius: 5px;\n\tbox-shadow: 0 8px 6px -6px gray; \n\tfont-weight: bold; \n\tpadding: 7px; \n\tmargin-bottom: 12px;\n}\n</style>\n";
     98    }
     99}
     100
     101// Get plugin version
     102function plug_ver()
     103{
     104    $plugin_data = get_plugin_data(__FILE__);
     105    $plug_ver = $plugin_data['Version'];
     106    return $plug_ver;
     107}
     108// Get plugin title
     109function plug_name()
     110{
     111    $plugin_data = get_plugin_data(__FILE__);
     112    $plug_name = $plugin_data['Name'];
     113    return $plug_name;
     114}
     115
     116// Set Theme
     117function thl()
     118{
     119    if(isset($_POST["themelist"]))
     120    {
     121        $thl = $_POST["themelist"];
     122        return $thl;
     123    }
     124}
     125$thl = thl();
     126if (isset($thl) && !empty($thl))
     127{
     128    setcookie('_mccss_ace_themelist_', $thl, time()+31556926 ,'/');
     129}
     130function sth()
     131{
    115132    $thl = thl();
    116133    if (isset($thl) && !empty($thl))
    117134    {
    118         setcookie('_mccss_ace_themelist_', $thl, time()+31556926 ,'/');
    119     }
    120     function sth()
    121     {
    122         $thl = thl();
    123         if (isset($thl) && !empty($thl))
    124         {
    125             $sth = $thl;
     135        $sth = $thl;
     136    }
     137    else if (!isset($_COOKIE['_mccss_ace_themelist_']))
     138    {
     139        $sth = 'ace/theme/textmate';
     140    }
     141    else
     142    {
     143        $sth = $_COOKIE['_mccss_ace_themelist_'];
     144    }
     145    return $sth;
     146}
     147
     148// Set Invisibles
     149function enable_invisibles()
     150{   
     151    if(!isset($_POST['invisibles']) && empty($_POST['invisibles']) && isset($_COOKIE['_mccss_enable_invisibles_']))
     152    {
     153        $invisibles = $_COOKIE['_mccss_enable_invisibles_'];
     154    }
     155    else if(isset($_POST['invisibles']) && !empty($_POST['invisibles']) && $_COOKIE['_mccss_enable_invisibles_'] === "false")
     156    {
     157        $invisibles = "true";
     158        header('location: '.$_SERVER['REQUEST_URI'].'');
     159    }
     160    else if(isset($_POST['invisibles']) && !empty($_POST['invisibles']) && $_COOKIE['_mccss_enable_invisibles_'] === "true")
     161    {
     162        $invisibles = "false";
     163        header('location: '.$_SERVER['REQUEST_URI'].'');
     164    }
     165    else
     166    {
     167        $invisibles = "false";
     168    }
     169    return $invisibles;
     170}
     171
     172// Set Margin
     173function enable_margin()
     174{   
     175    if(!isset($_POST['margin']) && empty($_POST['margin']) && isset($_COOKIE['_mccss_enable_margin_']))
     176    {
     177        $margin = $_COOKIE['_mccss_enable_margin_'];
     178    }
     179    else if(isset($_POST['margin']) && !empty($_POST['margin']) && $_COOKIE['_mccss_enable_margin_'] === "false")
     180    {
     181        $margin = "true";
     182        header('location: '.$_SERVER['REQUEST_URI'].'');
     183    }
     184    else if(isset($_POST['margin']) && !empty($_POST['margin']) && $_COOKIE['_mccss_enable_margin_'] === "true")
     185    {
     186        $margin = "false";
     187        header('location: '.$_SERVER['REQUEST_URI'].'');
     188    }
     189    else
     190    {
     191        $margin = "false";
     192    }
     193    return $margin;
     194}
     195
     196// Set LineNumbers
     197function enable_linenumbers()
     198{   
     199    if(!isset($_POST['linenumbers']) && empty($_POST['linenumbers']) && isset($_COOKIE['_mccss_enable_linenumbers_']))
     200    {
     201        $linenumbers = $_COOKIE['_mccss_enable_linenumbers_'];
     202    }
     203    else if(isset($_POST['linenumbers']) && !empty($_POST['linenumbers']) && $_COOKIE['_mccss_enable_linenumbers_'] === "false")
     204    {
     205        $linenumbers = "true";
     206        header('location: '.$_SERVER['REQUEST_URI'].'');
     207    }
     208    else if(isset($_POST['linenumbers']) && !empty($_POST['linenumbers']) && $_COOKIE['_mccss_enable_linenumbers_'] === "true")
     209    {
     210        $linenumbers = "false";
     211        header('location: '.$_SERVER['REQUEST_URI'].'');
     212    }
     213    else
     214    {
     215        $linenumbers = "true";
     216    }
     217    return $linenumbers;
     218}
     219
     220// Set disablebackup
     221function enable_backup()
     222{   
     223    if(!isset($_POST['disablebackup']) && empty($_POST['disablebackup']) && isset($_COOKIE['_mccss_enable_backup_']))
     224    {
     225        $disablebackup = $_COOKIE['_mccss_enable_backup_'];
     226    }
     227    else if(isset($_POST['disablebackup']) && !empty($_POST['disablebackup']) && $_COOKIE['_mccss_enable_backup_'] === "false")
     228    {
     229        $disablebackup = "true";
     230        header('location: '.$_SERVER['REQUEST_URI'].'');
     231    }
     232    else if(isset($_POST['disablebackup']) && !empty($_POST['disablebackup']) && $_COOKIE['_mccss_enable_backup_'] === "true")
     233    {
     234        $disablebackup = "false";
     235        header('location: '.$_SERVER['REQUEST_URI'].'');
     236    }
     237    else
     238    {
     239        $disablebackup = "true";
     240    }
     241    return $disablebackup;
     242}
     243
     244// Set basicautocomplete
     245function enable_autocomplete()
     246{   
     247    if(!isset($_POST['basicautocomplete']) && empty($_POST['basicautocomplete']) && isset($_COOKIE['_mccss_enable_autocomplete_']))
     248    {
     249        $basicautocomplete = $_COOKIE['_mccss_enable_autocomplete_'];
     250    }
     251    else if(isset($_POST['basicautocomplete']) && !empty($_POST['basicautocomplete']) && $_COOKIE['_mccss_enable_autocomplete_'] === "false")
     252    {
     253        $basicautocomplete = "true";
     254        header('location: '.$_SERVER['REQUEST_URI'].'');
     255    }
     256    else if(isset($_POST['basicautocomplete']) && !empty($_POST['basicautocomplete']) && $_COOKIE['_mccss_enable_autocomplete_'] === "true")
     257    {
     258        $basicautocomplete = "false";
     259        header('location: '.$_SERVER['REQUEST_URI'].'');
     260    }
     261    else
     262    {
     263        $basicautocomplete = "true";
     264    }
     265    return $basicautocomplete;
     266}
     267
     268// Option page code:
     269function mycustomcss_scripts()
     270{
     271    echo '
     272    <!-- Start My Custom CSS Code -->
     273    <script type="text/javascript" src="'.plugin_dir_url(__FILE__).'editor/_scrolltop.js?plug_ver='.plug_ver().'"></script>';
     274    if(!isset($_POST['viewbackup']) && !isset($_POST['erasebackup']))
     275    {
     276    echo '
     277    <!-- Ace Editor -->
     278    <script type="text/javascript" src="'.plugin_dir_url(__FILE__).'editor/ace.js?plug_ver='.plug_ver().'" charset="utf-8"></script>
     279    <script type="text/javascript" src="'.plugin_dir_url(__FILE__).'editor/ext-searchbox.js?plug_ver='.plug_ver().'" charset="utf-8"></script>
     280    <script type="text/javascript" src="'.plugin_dir_url(__FILE__).'editor/ext-language_tools.js?plug_ver='.plug_ver().'" charset="utf-8"></script>
     281    <script type="text/javascript">
     282    // Ace Setting
     283    ( function( global, $ ) {
     284        var editor,
     285            syncCSS = function() {
     286                $("#my_custom_css_textarea").val(editor.getSession().getValue());
     287            },
     288            loadAce = function() {
     289                editor = ace.edit("my_custom_css");
     290                global.safecss_editor = editor;
     291                editor.session.setMode("ace/mode/css");
     292                editor.$blockScrolling = Infinity;
     293                editor.getSession().setUseWrapMode(true);
     294                editor.getSession().setValue($("#my_custom_css_textarea").val());
     295                editor.getSession().setUseSoftTabs(true);
     296                editor.setHighlightActiveLine(true);
     297                editor.setOptions({minLines: 10});
     298                editor.setOptions({maxLines: Infinity});
     299                editor.setTheme("'.sth().'");
     300                editor.setOption("firstLineNumber", 1)
     301                editor.setShowPrintMargin('.enable_margin().');
     302                editor.setShowInvisibles('.enable_invisibles().');
     303                editor.setOption("showLineNumbers", '.enable_linenumbers().');
     304                editor.execCommand("find");
     305                // enable autocompletion and snippets
     306                ace.require("ace/ext/language_tools");
     307                    editor.setOptions({
     308                    enableBasicAutocompletion: '.enable_autocomplete().',
     309                    enableSnippets: '.enable_autocomplete().',
     310                    enableLiveAutocompletion: '.enable_autocomplete().'
     311                });
     312                jQuery.fn.spin&&$("#my_custom_css_container").spin(false);
     313                $("#my-custom-css").submit(syncCSS);
     314            };
     315        if ($.browser.msie&&parseInt($.browser.version, 10) <= 7) {
     316            $("#my_custom_css_container").hide();
     317            $("#my_custom_css_textarea").show();
     318            return false;
     319        } else {
     320            $(global).load(loadAce);
    126321        }
    127         else if (!isset($_COOKIE['_mccss_ace_themelist_']))
    128         {
    129             $sth = 'ace/theme/textmate';
    130         }
    131         else
    132         {
    133             $sth = $_COOKIE['_mccss_ace_themelist_'];
    134         }
    135         return $sth;
    136     }
    137 
    138            
    139     // Option page code:
    140     function mycustomcss_scripts()
    141     {
    142         echo '
    143         <!-- Start My Custom CSS Code -->
    144         <script type="text/javascript" src="'.plugin_dir_url(__FILE__).'editor/_scrolltop.js?plug_ver='.plug_ver().'"></script>';
     322        global.aceSyncCSS = syncCSS;
     323    } )(this, jQuery);
     324    </script>
     325    <script type="text/javascript" src="'.plugin_dir_url(__FILE__).'editor/textresizer/cookie.js?plug_ver='.plug_ver().'"></script>
     326    <script type="text/javascript" src="'.plugin_dir_url(__FILE__).'editor/textresizer/textresizer.min.js?plug_ver='.plug_ver().'"></script>
     327    <script type="text/javascript" src="'.plugin_dir_url(__FILE__).'editor/textresizer/textresizer_target.js?plug_ver='.plug_ver().'"></script>';
     328    }
     329    echo '
     330    <!-- CSS Code -->
     331    <link rel="stylesheet" id="ace-editor-custom-css" href="'.plugin_dir_url(__FILE__).'editor/ace_custom.css?plug_ver='.plug_ver().'" type="text/css" media="all" />
     332    <!-- End My Custom CSS Code -->';
     333}
     334
     335// Textarea/Form:
     336function mccss_admin_page()
     337{
     338    echo '
     339    <div class="wrap">';
    145340        if(!isset($_POST['viewbackup']) && !isset($_POST['erasebackup']))
    146341        {
    147         echo '
    148         <!-- Ace Editor -->
    149         <script type="text/javascript" src="'.plugin_dir_url(__FILE__).'editor/ace.js?plug_ver='.plug_ver().'" charset="utf-8"></script>
    150         <script type="text/javascript" src="'.plugin_dir_url(__FILE__).'editor/ext-searchbox.js?plug_ver='.plug_ver().'" charset="utf-8"></script>
    151         <script type="text/javascript" src="'.plugin_dir_url(__FILE__).'editor/ext-language_tools.js?plug_ver='.plug_ver().'" charset="utf-8"></script>
    152         <script type="text/javascript">
    153         // Ace Setting
    154         ( function( global, $ ) {
    155             var editor,
    156                 syncCSS = function() {
    157                     $("#my_custom_css_textarea").val(editor.getSession().getValue());
    158                 },
    159                 loadAce = function() {
    160                     editor = ace.edit("my_custom_css");
    161                     global.safecss_editor = editor;
    162                     editor.session.setMode("ace/mode/css");
    163                     editor.$blockScrolling = Infinity;
    164                     editor.getSession().setUseWrapMode(true);
    165                     editor.getSession().setValue($("#my_custom_css_textarea").val());
    166                     editor.getSession().setUseSoftTabs(true);
    167                     editor.setHighlightActiveLine(true);
    168                     editor.setOptions({minLines: 10});
    169                     editor.setOptions({maxLines: Infinity});
    170                     editor.setTheme("'.sth().'");
    171                     editor.setOption("firstLineNumber", 1)
    172                     editor.setShowPrintMargin(true);
    173                     editor.setShowInvisibles(true);
    174                     editor.execCommand("find");
    175                     // enable autocompletion and snippets
    176                     ace.require("ace/ext/language_tools");
    177                         editor.setOptions({
    178                         enableBasicAutocompletion: true,
    179                         enableSnippets: true,
    180                         enableLiveAutocompletion: true
    181                     });
    182                     jQuery.fn.spin&&$("#my_custom_css_container").spin(false);
    183                     $("#my-custom-css").submit(syncCSS);
    184                 };
    185             if ($.browser.msie&&parseInt($.browser.version, 10) <= 7) {
    186                 $("#my_custom_css_container").hide();
    187                 $("#my_custom_css_textarea").show();
    188                 return false;
    189             } else {
    190                 $(global).load(loadAce);
    191             }
    192             global.aceSyncCSS = syncCSS;
    193         } )(this, jQuery);
    194         </script>
    195         <script type="text/javascript" src="'.plugin_dir_url(__FILE__).'editor/textresizer/cookie.js?plug_ver='.plug_ver().'"></script>
    196         <script type="text/javascript" src="'.plugin_dir_url(__FILE__).'editor/textresizer/textresizer.min.js?plug_ver='.plug_ver().'"></script>
    197         <script type="text/javascript" src="'.plugin_dir_url(__FILE__).'editor/textresizer/textresizer_target.js?plug_ver='.plug_ver().'"></script>';
    198         }
    199         echo '
    200         <!-- CSS Code -->
    201         <link rel="stylesheet" id="ace-editor-custom-css" href="'.plugin_dir_url(__FILE__).'editor/ace_custom.css?plug_ver='.plug_ver().'" type="text/css" media="all" />
    202         <!-- End My Custom CSS Code -->';
    203     }
    204 
    205     // Textarea/Form:
    206     function mccss_admin_page()
    207     {
    208         echo '
    209         <div class="wrap">';
    210             if(!isset($_POST['viewbackup']) && !isset($_POST['erasebackup']))
    211             {
    212                 $at = "ace/theme/";
    213                 // BrightTheme
    214                 $b1 = $at."chrome";
    215                 $b2 = $at."clouds";
    216                 $b3 = $at."crimson_editor";
    217                 $b4 = $at."dawn";
    218                 $b5 = $at."dreamweaver";
    219                 $b6 = $at."eclipse";
    220                 $b7 = $at."github";
    221                 $b8 = $at."iplastic";
    222                 $b9 = $at."solarized_light";
    223                 $b10 = $at."textmate";
    224                 $b11 = $at."tomorrow";
    225                 $b12 = $at."xcode";
    226                 $b13 = $at."kuroir";
    227                 $b14 = $at."katzenmilch";
    228                 $b15 = $at."sqlserver";
    229                 // DarkTheme
    230                 $d1 = $at."ambiance";
    231                 $d2 = $at."chaos";
    232                 $d3 = $at."clouds_midnight";
    233                 $d4 = $at."cobalt";
    234                 $d5 = $at."idle_fingers";
    235                 $d6 = $at."kr_theme";
    236                 $d7 = $at."merbivore";
    237                 $d8 = $at."merbivore_soft";
    238                 $d9 = $at."mono_industrial";
    239                 $d10 = $at."monokai";
    240                 $d11 = $at."pastel_on_dark";
    241                 $d12 = $at."solarized_dark";
    242                 $d13 = $at."terminal";
    243                 $d14 = $at."tomorrow_night";
    244                 $d15 = $at."tomorrow_night_blue";
    245                 $d16 = $at."tomorrow_night_bright";
    246                 $d17 = $at."tomorrow_night_eighties";
    247                 $d18 = $at."twilight";
    248                 $d19 = $at."vibrant_ink";
     342            $at = "ace/theme/";
     343            // BrightTheme
     344            $b1 = $at."chrome";
     345            $b2 = $at."clouds";
     346            $b3 = $at."crimson_editor";
     347            $b4 = $at."dawn";
     348            $b5 = $at."dreamweaver";
     349            $b6 = $at."eclipse";
     350            $b7 = $at."github";
     351            $b8 = $at."iplastic";
     352            $b9 = $at."solarized_light";
     353            $b10 = $at."textmate";
     354            $b11 = $at."tomorrow";
     355            $b12 = $at."xcode";
     356            $b13 = $at."kuroir";
     357            $b14 = $at."katzenmilch";
     358            $b15 = $at."sqlserver";
     359            // DarkTheme
     360            $d1 = $at."ambiance";
     361            $d2 = $at."chaos";
     362            $d3 = $at."clouds_midnight";
     363            $d4 = $at."cobalt";
     364            $d5 = $at."idle_fingers";
     365            $d6 = $at."kr_theme";
     366            $d7 = $at."merbivore";
     367            $d8 = $at."merbivore_soft";
     368            $d9 = $at."mono_industrial";
     369            $d10 = $at."monokai";
     370            $d11 = $at."pastel_on_dark";
     371            $d12 = $at."solarized_dark";
     372            $d13 = $at."terminal";
     373            $d14 = $at."tomorrow_night";
     374            $d15 = $at."tomorrow_night_blue";
     375            $d16 = $at."tomorrow_night_bright";
     376            $d17 = $at."tomorrow_night_eighties";
     377            $d18 = $at."twilight";
     378            $d19 = $at."vibrant_ink";
     379            echo '
     380            <h2>' .  __('My Custom CSS Panel','my-custom-css') . ' - v'.plug_ver().'</h2>
     381            <div id="tools">
     382                <div id="text-resizer">
     383                    <p>' .  __('Font:','my-custom-css') . '</p>
     384                        <ul class="textresizer">
     385                          <li><a href="#nogo" class="small-text" title="12px (Small)">A-</a></li>
     386                          <li><a href="#nogo" class="medium-text" title="14px (Medium)">A</a></li>
     387                          <li><a href="#nogo" class="large-text" title="16px (Large)">A+</a></li>
     388                          <li><a href="#nogo" class="larger-text" title="18px (Larger)">A++</a></li>
     389                          <li><a href="#nogo" class="giga-text" title="26px (Giga)">A+++</a></li>
     390                        </ul>
     391                </div>
     392                <form action="" method="post" id="thememenu">
     393                    <label for="theme">' .  __('Theme:','my-custom-css') . '</label>
     394                        <select name="themelist" id="themelist" onchange="if(confirm(\'' .  __('Warning!!! This will refresh entire page (Unsaved data will be lost) - Continue?','my-custom-css') . '\')){this.form.submit()}">
     395                            <optgroup label="' .  __('Bright:','my-custom-css') . '">
     396                                <option value="'.$b1.'"'.(sth() == $b1 ? ' selected="selected"' : false).'>Chrome</option>
     397                                <option value="'.$b2.'"'.(sth() == $b2 ? ' selected="selected"' : false).'>Clouds</option>
     398                                <option value="'.$b3.'"'.(sth() == $b3 ? ' selected="selected"' : false).'>Crimson Editor</option>
     399                                <option value="'.$b4.'"'.(sth() == $b4 ? ' selected="selected"' : false).'>Dawn</option>
     400                                <option value="'.$b5.'"'.(sth() == $b5 ? ' selected="selected"' : false).'>Dreamweaver</option>
     401                                <option value="'.$b6.'"'.(sth() == $b6 ? ' selected="selected"' : false).'>Eclipse</option>
     402                                <option value="'.$b7.'"'.(sth() == $b7 ? ' selected="selected"' : false).'>GitHub</option>
     403                                <option value="'.$b8.'"'.(sth() == $b8 ? ' selected="selected"' : false).'>IPlastic</option>
     404                                <option value="'.$b9.'"'.(sth() == $b9 ? ' selected="selected"' : false).'>Solarized Light</option>
     405                                <option value="'.$b10.'"'.(sth() == $b10 ? ' selected="selected"' : false).'>TextMate</option>
     406                                <option value="'.$b11.'"'.(sth() == $b11 ? ' selected="selected"' : false).'>Tomorrow</option>
     407                                <option value="'.$b12.'"'.(sth() == $b12 ? ' selected="selected"' : false).'>XCode</option>
     408                                <option value="'.$b13.'"'.(sth() == $b13 ? ' selected="selected"' : false).'>Kuroir</option>
     409                                <option value="'.$b14.'"'.(sth() == $b14 ? ' selected="selected"' : false).'>KatzenMilch</option>
     410                                <option value="'.$b15.'"'.(sth() == $b15 ? ' selected="selected"' : false).'>SQL Server</option>
     411                            </optgroup>
     412                            <optgroup label="' .  __('Dark:','my-custom-css') . '">
     413                                <option value="'.$d1.'"'.(sth() == $d1 ? ' selected="selected"' : false).'>Ambiance</option>
     414                                <option value="'.$d2.'"'.(sth() == $d2 ? ' selected="selected"' : false).'>Chaos</option>
     415                                <option value="'.$d3.'"'.(sth() == $d3 ? ' selected="selected"' : false).'>Clouds Midnight</option>
     416                                <option value="'.$d4.'"'.(sth() == $d4 ? ' selected="selected"' : false).'>Cobalt</option>
     417                                <option value="'.$d5.'"'.(sth() == $d5 ? ' selected="selected"' : false).'>idle Fingers</option>
     418                                <option value="'.$d6.'"'.(sth() == $d6 ? ' selected="selected"' : false).'>krTheme</option>
     419                                <option value="'.$d7.'"'.(sth() == $d7 ? ' selected="selected"' : false).'>Merbivore</option>
     420                                <option value="'.$d8.'"'.(sth() == $d8 ? ' selected="selected"' : false).'>Merbivore Soft</option>
     421                                <option value="'.$d9.'"'.(sth() == $d9 ? ' selected="selected"' : false).'>Mono Industrial</option>
     422                                <option value="'.$d10.'"'.(sth() == $d10 ? ' selected="selected"' : false).'>Monokai</option>
     423                                <option value="'.$d11.'"'.(sth() == $d11 ? ' selected="selected"' : false).'>Pastel on dark</option>
     424                                <option value="'.$d12.'"'.(sth() == $d12 ? ' selected="selected"' : false).'>Solarized Dark</option>
     425                                <option value="'.$d13.'"'.(sth() == $d13 ? ' selected="selected"' : false).'>Terminal</option>
     426                                <option value="'.$d14.'"'.(sth() == $d14 ? ' selected="selected"' : false).'>Tomorrow Night</option>
     427                                <option value="'.$d15.'"'.(sth() == $d15 ? ' selected="selected"' : false).'>Tomorrow Night Blue</option>
     428                                <option value="'.$d16.'"'.(sth() == $d16 ? ' selected="selected"' : false).'>Tomorrow Night Bright</option>
     429                                <option value="'.$d17.'"'.(sth() == $d17 ? ' selected="selected"' : false).'>Tomorrow Night 80s</option>
     430                                <option value="'.$d18.'"'.(sth() == $d18 ? ' selected="selected"' : false).'>Twilight</option>
     431                                <option value="'.$d19.'"'.(sth() == $d19 ? ' selected="selected"' : false).'>Vibrant Ink</option>
     432                            </optgroup>
     433                        </select>
     434                </form>';
     435                // Hidden view/erase button for blog id > 1 (security fix in multisite)
     436                if(get_current_blog_id() == 1 && enable_backup() === "true")
     437                {
     438                    // If no backup exist, disable button!
     439                    $glob = glob(plugin_basedir()."/my_custom_css/bkk/*.css");
     440                    if ($glob == false)
     441                    {
     442                        $submit_backup = 'value="' .  __('No backup found','my-custom-css') . '" title="' .  __('No backup found','my-custom-css') . '" disabled="disabled" class="button-secondary"';
     443                    }
     444                    else
     445                    {
     446                        $submit_backup = 'value="' .  __('View backups','my-custom-css') . '" title="' .  __('Click to view all backups!','my-custom-css') . '" class="button"';
     447                    }
     448                    echo '
     449                    <form id="backup" method="post" action="'.admin_url( 'admin.php' ).'?page=my_custom_css">
     450                        <label for="backup">' .  __('Backup:','my-custom-css') . '</label>
     451                        <input type="submit" name="viewbackup" '.$submit_backup.' />
     452                    </form>';
     453                }
     454            $enable = __('Enable','my-custom-css');
     455            $disable = __('Disable','my-custom-css');           
     456            echo '
     457            <p><a href="#" onclick="jQuery(\'#advanced\').toggle();" id="toggle">' .  __('Advanced','my-custom-css') . ' &#x21D5;</a></p>
     458            <div id="advanced">
     459                <form action="" method="post" id="invisibles">
     460                    <label for="invisibles">'.(enable_invisibles() == "false" ? ''.$enable.'' : ''.$disable.'').'/' .  __('Invisibles','my-custom-css') . '</label>
     461                    <Input type="radio" name="invisibles" onchange="if(confirm(\'' .  __('Warning!!! This will refresh entire page (Unsaved data will be lost) - Continue?','my-custom-css') . '\')){this.form.submit()}" value="'.enable_invisibles().'" />
     462                </form>
     463                <form action="" method="post" id="margin">
     464                    <label for="margin">'.(enable_margin() == "false" ? ''.$enable.'' : ''.$disable.'').'/' .  __('Margin','my-custom-css') . '</label>
     465                    <Input type="radio" name="margin" onchange="if(confirm(\'' .  __('Warning!!! This will refresh entire page (Unsaved data will be lost) - Continue?','my-custom-css') . '\')){this.form.submit()}" value="'.enable_margin().'" />
     466                </form>
     467                <form action="" method="post" id="linenumbers">
     468                    <label for="linenumbers">'.(enable_linenumbers() == "false" ? ''.$enable.'' : ''.$disable.'').'/' .  __('LineNumbers','my-custom-css') . '</label>
     469                    <Input type="radio" name="linenumbers" onchange="if(confirm(\'' .  __('Warning!!! This will refresh entire page (Unsaved data will be lost) - Continue?','my-custom-css') . '\')){this.form.submit()}" value="'.enable_linenumbers().'" />
     470                </form>
     471                <form action="" method="post" id="disablebackup">
     472                    <label for="disablebackup">'.(enable_backup() == "false" ? ''.$enable.'' : ''.$disable.'').'/' .  __('Backup','my-custom-css') . '</label>
     473                    <Input type="radio" name="disablebackup" onchange="if(confirm(\'' .  __('Warning!!! This will refresh entire page (Unsaved data will be lost) - Continue?','my-custom-css') . '\')){this.form.submit()}" value="'.enable_backup().'" />
     474                </form>
     475                <form action="" method="post" id="basicautocomplete">
     476                    <label for="basicautocomplete">'.(enable_autocomplete() == "false" ? ''.$enable.'' : ''.$disable.'').'/' .  __('Autocomplete','my-custom-css') . '</label>
     477                    <Input type="radio" name="basicautocomplete" onchange="if(confirm(\'' .  __('Warning!!! This will refresh entire page (Unsaved data will be lost) - Continue?','my-custom-css') . '\')){this.form.submit()}" value="'.enable_autocomplete().'" />
     478                </form>
     479            </div>
     480            </div>
     481            <div id="my_custom_css_container">
     482                <form id="my-custom-css" method="post" action="options.php">';
     483                settings_fields( 'mccss_settings' );
    249484                echo '
    250                 <h2>' .  __('My Custom CSS Panel','my-custom-css') . ' - v'.plug_ver().'</h2>
    251                 <div id="tools">
    252                     <div id="text-resizer">
    253                         <p>' .  __('Font Size:','my-custom-css') . '</p>
    254                             <ul class="textresizer">
    255                               <li><a href="#nogo" class="small-text" title="12px (Small)">A-</a></li>
    256                               <li><a href="#nogo" class="medium-text" title="14px (Medium)">A</a></li>
    257                               <li><a href="#nogo" class="large-text" title="16px (Large)">A+</a></li>
    258                               <li><a href="#nogo" class="larger-text" title="18px (Larger)">A++</a></li>
    259                               <li><a href="#nogo" class="giga-text" title="26px (Giga)">A+++</a></li>
    260                             </ul>
    261                     </div>
    262                     <form action="" method="post" id="thememenu">
    263                         <label for="theme">' .  __('Theme:','my-custom-css') . '</label>
    264                             <select name="themelist" id="themelist" onchange="if(confirm(\'' .  __('Warning!!! This will refresh entire page (Unsaved data will be lost) - Continue?','my-custom-css') . '\')){this.form.submit()}">
    265                                 <optgroup label="' .  __('Bright:','my-custom-css') . '">
    266                                     <option value="'.$b1.'"'.(sth() == $b1 ? ' selected="selected"' : false).'>Chrome</option>
    267                                     <option value="'.$b2.'"'.(sth() == $b2 ? ' selected="selected"' : false).'>Clouds</option>
    268                                     <option value="'.$b3.'"'.(sth() == $b3 ? ' selected="selected"' : false).'>Crimson Editor</option>
    269                                     <option value="'.$b4.'"'.(sth() == $b4 ? ' selected="selected"' : false).'>Dawn</option>
    270                                     <option value="'.$b5.'"'.(sth() == $b5 ? ' selected="selected"' : false).'>Dreamweaver</option>
    271                                     <option value="'.$b6.'"'.(sth() == $b6 ? ' selected="selected"' : false).'>Eclipse</option>
    272                                     <option value="'.$b7.'"'.(sth() == $b7 ? ' selected="selected"' : false).'>GitHub</option>
    273                                     <option value="'.$b8.'"'.(sth() == $b8 ? ' selected="selected"' : false).'>IPlastic</option>
    274                                     <option value="'.$b9.'"'.(sth() == $b9 ? ' selected="selected"' : false).'>Solarized Light</option>
    275                                     <option value="'.$b10.'"'.(sth() == $b10 ? ' selected="selected"' : false).'>TextMate</option>
    276                                     <option value="'.$b11.'"'.(sth() == $b11 ? ' selected="selected"' : false).'>Tomorrow</option>
    277                                     <option value="'.$b12.'"'.(sth() == $b12 ? ' selected="selected"' : false).'>XCode</option>
    278                                     <option value="'.$b13.'"'.(sth() == $b13 ? ' selected="selected"' : false).'>Kuroir</option>
    279                                     <option value="'.$b14.'"'.(sth() == $b14 ? ' selected="selected"' : false).'>KatzenMilch</option>
    280                                     <option value="'.$b15.'"'.(sth() == $b15 ? ' selected="selected"' : false).'>SQL Server</option>
    281                                 </optgroup>
    282                                 <optgroup label="' .  __('Dark:','my-custom-css') . '">
    283                                     <option value="'.$d1.'"'.(sth() == $d1 ? ' selected="selected"' : false).'>Ambiance</option>
    284                                     <option value="'.$d2.'"'.(sth() == $d2 ? ' selected="selected"' : false).'>Chaos</option>
    285                                     <option value="'.$d3.'"'.(sth() == $d3 ? ' selected="selected"' : false).'>Clouds Midnight</option>
    286                                     <option value="'.$d4.'"'.(sth() == $d4 ? ' selected="selected"' : false).'>Cobalt</option>
    287                                     <option value="'.$d5.'"'.(sth() == $d5 ? ' selected="selected"' : false).'>idle Fingers</option>
    288                                     <option value="'.$d6.'"'.(sth() == $d6 ? ' selected="selected"' : false).'>krTheme</option>
    289                                     <option value="'.$d7.'"'.(sth() == $d7 ? ' selected="selected"' : false).'>Merbivore</option>
    290                                     <option value="'.$d8.'"'.(sth() == $d8 ? ' selected="selected"' : false).'>Merbivore Soft</option>
    291                                     <option value="'.$d9.'"'.(sth() == $d9 ? ' selected="selected"' : false).'>Mono Industrial</option>
    292                                     <option value="'.$d10.'"'.(sth() == $d10 ? ' selected="selected"' : false).'>Monokai</option>
    293                                     <option value="'.$d11.'"'.(sth() == $d11 ? ' selected="selected"' : false).'>Pastel on dark</option>
    294                                     <option value="'.$d12.'"'.(sth() == $d12 ? ' selected="selected"' : false).'>Solarized Dark</option>
    295                                     <option value="'.$d13.'"'.(sth() == $d13 ? ' selected="selected"' : false).'>Terminal</option>
    296                                     <option value="'.$d14.'"'.(sth() == $d14 ? ' selected="selected"' : false).'>Tomorrow Night</option>
    297                                     <option value="'.$d15.'"'.(sth() == $d15 ? ' selected="selected"' : false).'>Tomorrow Night Blue</option>
    298                                     <option value="'.$d16.'"'.(sth() == $d16 ? ' selected="selected"' : false).'>Tomorrow Night Bright</option>
    299                                     <option value="'.$d17.'"'.(sth() == $d17 ? ' selected="selected"' : false).'>Tomorrow Night 80s</option>
    300                                     <option value="'.$d18.'"'.(sth() == $d18 ? ' selected="selected"' : false).'>Twilight</option>
    301                                     <option value="'.$d19.'"'.(sth() == $d19 ? ' selected="selected"' : false).'>Vibrant Ink</option>
    302                                 </optgroup>
    303                             </select>
    304                     </form>';
    305                     // Hidden view/erase button for blog id > 1 (security fix in multisite)
    306                     if(get_current_blog_id() == 1)
    307                     {
    308                         // If no backup exist, disable button!
    309                         $glob = glob(plugin_basedir()."/my_custom_css/bkk/*.css");
    310                         if ($glob == false)
    311                         {
    312                             $submit_backup = 'value="' .  __('No backup found','my-custom-css') . '" title="' .  __('No backup found','my-custom-css') . '" disabled="disabled"';
    313                         }
    314                         else
    315                         {
    316                             $submit_backup = 'value="' .  __('View backups','my-custom-css') . '" title="' .  __('Click to view all backups!','my-custom-css') . '" ';
    317                         }
    318                         echo '
    319                         <form id="backup" method="post" action="'.admin_url( 'admin.php' ).'?page=my_custom_css">
    320                             <label for="backup">' .  __('Backup:','my-custom-css') . '</label>
    321                             <input type="submit" name="viewbackup" class="button-secondary" '.$submit_backup.' />
    322                         </form>';
    323                     }
    324                 echo '
    325                 </div>
    326                 <div id="my_custom_css_container">
    327                     <form id="my-custom-css" method="post" action="options.php">';
    328                     settings_fields( 'mccss_settings' );
    329                     echo '
    330                         <div name="my_custom_css" id="my_custom_css"></div>
     485                    <div name="my_custom_css" id="my_custom_css"></div>
    331486<!-- start textarea -->
    332487<textarea id="my_custom_css_textarea" name="my_custom_css" style="display: none;">'.get_option('my_custom_css').'</textarea>
    333488<!-- end textarea -->
    334                         <input type="submit" name="save" class="button-primary" value="' .  __("Save","my-custom-css") . '" />
    335                     </form>
     489                    <input type="submit" name="save" class="button-primary" value="' .  __("Save","my-custom-css") . '" />
     490                </form>
     491            </div>';
     492        }
     493
     494        // View backup (view only css)
     495        else if(isset($_POST['viewbackup']))
     496        {
     497            date_default_timezone_set(ini_get('date.timezone') ? ini_get('date.timezone') : 'UTC');
     498            $bd = plugin_basedir()."/my_custom_css/bkk/";
     499            $files=array();
     500            if ($dh=opendir($bd))
     501            {
     502                while (($file=readdir($dh))!==false)
     503                if ($file!="." && $file!=".." && preg_match("/\.(css)$/", $file))
     504                    $files[filemtime($bd.$file)]=$file;
     505                closedir($dh);
     506            }
     507            krsort($files);
     508            reset($files);
     509            $href = plugin_url()."/my_custom_css/bkk/";
     510            echo '
     511                <h2 id="h2left">' .  __('My custom CSS - Backup','my-custom-css') . '</h2>
     512                <form method="post" id="erase" action="">
     513                    <input type="button" class="button" value="' .  __('Close now!','my-custom-css') . '" onclick="location.reload();" />
     514                     |
     515                    <input type="submit" class="button-primary" name="erasebackup" value="' .  __('Erase all backup?','my-custom-css') . '" onclick="return confirm(\'' .  __('Do you want really delete all backup?','my-custom-css') . '\');" />
     516                </form>
     517                <br />';
     518            while (list($date,$file)=each($files))
     519            echo '
     520                <div class="backup_list">
     521                    <p><b>' .  __('File:','my-custom-css') . '</b> <a href="'.$href.$file.'">'.$href.$file.'</a></p>
     522                    <p><b>' .  __('Path:','my-custom-css') . '</b> '.$bd.$file.'</p>
     523                    <p><b>' .  __('Saved:','my-custom-css') . '</b> '.date("M d Y | h:i:s (a)",current_time($date)).'</p>
     524                    <p><b>' .  __('Size:','my-custom-css') . '</b> '.(round(filesize($bd.$file). " bytes")).' bytes</p>
    336525                </div>';
    337             }
    338 
    339             // View backup (view only css)
    340             else if(isset($_POST['viewbackup']))
    341             {
    342                 date_default_timezone_set(ini_get('date.timezone') ? ini_get('date.timezone') : 'UTC');
    343                 $bd = plugin_basedir()."/my_custom_css/bkk/";
    344                 $files=array();
    345                 if ($dh=opendir($bd))
    346                 {
    347                     while (($file=readdir($dh))!==false)
    348                     if ($file!="." && $file!=".." && preg_match("/\.(css)$/", $file))
    349                         $files[filemtime($bd.$file)]=$file;
    350                     closedir($dh);
    351                 }
    352                 krsort($files);
    353                 reset($files);
    354                 $href = plugin_url()."/my_custom_css/bkk/";
    355                 echo '
    356                     <h2 id="h2left">' .  __('My custom CSS - Backup','my-custom-css') . '</h2>
    357                     <form method="post" id="erase" action="">
    358                         <input type="button" value="' .  __('Close now!','my-custom-css') . '" onclick="location.reload();" />
    359                          |
    360                         <input type="submit" name="erasebackup" class="button" value="' .  __('Erase all backup?','my-custom-css') . '" onclick="return confirm(\'' .  __('Do you want really delete all backup?','my-custom-css') . '\');" />
    361                     </form>
    362                     <br />';
    363                 while (list($date,$file)=each($files))
    364                 echo '
    365                     <div class="backup_list">
    366                         <p><b>' .  __('File:','my-custom-css') . '</b> <a href="'.$href.$file.'">'.$href.$file.'</a></p>
    367                         <p><b>' .  __('Path:','my-custom-css') . '</b> '.$bd.$file.'</p>
    368                         <p><b>' .  __('Saved:','my-custom-css') . '</b> '.date("M d Y | h:i:s (a)",current_time($date)).'</p>
    369                         <p><b>' .  __('Size:','my-custom-css') . '</b> '.(round(filesize($bd.$file). " bytes")).' bytes</p>
    370                     </div>';
    371             }
    372 
    373             // Erase backup:
    374             else if(isset($_POST['erasebackup']))
     526        }
     527
     528        // Erase backup:
     529        else if(isset($_POST['erasebackup']))
     530        {
     531        echo '
     532            <h2 id="h2left">' .  __('My custom CSS - Erase Backup','my-custom-css') . '</h2>
     533                <input type="button" class="button-primary" id="close" value="' .  __('Close now!','my-custom-css') . '" onclick="location.reload();" />
     534            <br />';
     535            foreach (glob(plugin_basedir()."/my_custom_css/bkk/*.css") as $filename)
    375536            {
    376537            echo '
    377                 <h2 id="h2left">' .  __('My custom CSS - Erase Backup','my-custom-css') . '</h2>
    378                 <input type="button" id="close" value="' .  __('Close now!','my-custom-css') . '" onclick="location.reload();" />
    379                 <br />';
    380                 foreach (glob(plugin_basedir()."/my_custom_css/bkk/*.css") as $filename)
    381                 {
    382                 echo '
    383                     <div class="backup_list">
    384                         '.$filename.' - ' . filesize($filename) . '' .  __('bytes, was successfully deleted!!!','my-custom-css') . '
    385                     </div>';
    386                     unlink($filename);
    387                 }
     538                <div class="backup_list">
     539                    '.$filename.' - ' . filesize($filename) . '' .  __('bytes, was successfully deleted!!!','my-custom-css') . '
     540                </div>';
     541                unlink($filename);
    388542            }
    389             echo '
    390             <div id="mccss_credit">
    391                 <a href="https://wordpress.org/plugins/my-custom-css/" title="My Custom CSS">My Custom CSS v'.plug_ver().'</a> | Author: <a href="https://laltroweb.it/" title="Salvatore Noschese - (L\'AltroWeb)">Salvatore Noschese</a> - Support my work: <a href="https://www.paypal.me/SalvatoreN" title="Even 1$ can help... :)">Donate &#128522;</a>
    392             </div>
    393             <!-- Smooth Scroll --><a href="#" class="scrollup">&#9650;</a><!-- Smooth Scroll -->
    394         </div>';
    395     }
    396    
    397     // Make backup when save!
    398     if(isset($_POST['save']))
    399     {
    400         $directory = plugin_basedir()."/my_custom_css/bkk/*.css";
    401         if (glob($directory) != false)
    402         {
    403             $filecount = count(glob($directory))+1;
    404543        }
    405         else
    406         {
    407             $filecount = 1;
    408         }
    409         $oldname = css_path();
    410         $newname = plugin_basedir().'/my_custom_css/bkk/' . ( $filecount ++ ) . $cssid . '_' . filemtime($oldname) .'.css';
    411         rename($oldname, $newname);
    412     }
    413 
    414     // Register Settings
    415     function mycustomcss_registersetting()
    416     {
    417         register_setting('mccss_settings','my_custom_css');
    418     }
    419 
    420     // Admin section:
    421     function mycustomcss_admin()
    422     {
    423         $plugin_page = add_menu_page(__('My Custom CSS Panel','my-custom-css'),__('My Custom CSS','my-custom-css'), 'manage_options', 'my_custom_css', 'mccss_admin_page', mccss_png(), 61);
    424         add_action('admin_init', 'mycustomcss_registersetting');
    425         add_action('admin_head-'. $plugin_page, 'mycustomcss_scripts');
    426     }
    427 
    428     add_action('admin_menu', 'mycustomcss_admin');
    429     add_action('wp_head', 'mycustomcss_head', 99999);
    430     add_action('admin_print_styles', 'mycustomcss_admin_style');
    431     add_filter('plugin_row_meta', 'add_plugin_meta_links', 10, 2);
    432     add_filter('plugin_action_links_'.plugin_basename(__FILE__).'', 'mycustomcss_links');
    433    
    434 }
     544        echo '
     545        <div id="mccss_credit">
     546            <a href="https://wordpress.org/plugins/my-custom-css/" title="My Custom CSS">My Custom CSS v'.plug_ver().'</a> | Author: <a href="https://laltroweb.it/" title="Salvatore Noschese - (L\'AltroWeb)">Salvatore Noschese</a> - Support my work: <a href="https://www.paypal.me/SalvatoreN" title="Even 1$ can help... :)">Donate &#128522;</a>
     547        </div>
     548        <!-- Smooth Scroll --><a href="#" class="scrollup">&#9650;</a><!-- Smooth Scroll -->
     549    </div>';
     550}
     551
     552
     553// Make backup when save!
     554$data = getdata();
     555if(isset($_POST['save']) && !empty($data) && enable_backup() === "true")
     556{
     557    $directory = plugin_basedir()."/my_custom_css/bkk/*.css";
     558    if (glob($directory) != false)
     559    {
     560        $filecount = count(glob($directory))+1;
     561    }
     562    else
     563    {
     564        $filecount = 1;
     565    }
     566    $oldname = css_path();
     567    $newname = plugin_basedir().'/my_custom_css/bkk/' . ( $filecount ++ ) . $cssid . '_' . filemtime($oldname) .'.css';
     568    rename($oldname, $newname);
     569}
     570
     571// Register Settings
     572function mycustomcss_registersetting()
     573{   
     574    // Set cookie only if can manage plugin
     575    if ( current_user_can( 'manage_options' ) )
     576    {
     577        setcookie('_mccss_enable_invisibles_', enable_invisibles(), time()+31556926 ,'/');
     578        setcookie('_mccss_enable_margin_', enable_margin(), time()+31556926 ,'/');
     579        setcookie('_mccss_enable_linenumbers_', enable_linenumbers(), time()+31556926 ,'/');
     580        setcookie('_mccss_enable_backup_', enable_backup(), time()+31556926 ,'/');
     581        setcookie('_mccss_enable_autocomplete_', enable_autocomplete(), time()+31556926 ,'/');
     582    }
     583    register_setting('mccss_settings','my_custom_css');
     584}
     585
     586// Admin section:
     587function mycustomcss_admin()
     588{
     589    $plugin_page = add_menu_page(__('My Custom CSS Panel','my-custom-css'),__('My Custom CSS','my-custom-css'), 'manage_options', 'my_custom_css', 'mccss_admin_page', mccss_png(), 61);
     590    add_action('admin_init', 'mycustomcss_registersetting');
     591    add_action('admin_head-'. $plugin_page, 'mycustomcss_scripts');
     592}
     593
     594add_action('admin_menu', 'mycustomcss_admin');
     595add_action('wp_head', 'mycustomcss_head', 99999);
     596add_action('admin_print_styles', 'mycustomcss_admin_style');
     597add_filter('plugin_row_meta', 'add_plugin_meta_links', 10, 2);
     598add_filter('plugin_action_links_'.plugin_basename(__FILE__).'', 'mycustomcss_links');
  • my-custom-css/trunk/readme.txt

    r1301583 r1313576  
    44Tags: css, style, custom, theme, plugin, stylesheet, darkwolf, laltroweb, ace, cloud9 editor
    55Requires at least: 4.0
    6 Tested up to: 4.4-RC1-35769
    7 Stable tag: 2.9
     6Tested up to: 4.4.1
     7Stable tag: 3.0
    88
    99Enable to add Custom CSS Code via admin panel with Ace (Ajax.org Cloud9 Editor)
     
    3232* English
    3333* Italian
    34 * (If you translate in your language, please, send me) :)
     34* Full translatable!
    3535
    3636== Screenshots ==
    3737
    38 1. My Custom CSS Panel with All feature and DarkTheme
    39 2. My Custom CSS Panel with LightTheme
    40 3. Preview in browser sourcecode
    41 4. Backup List (New Feature)!
    42 5. Confirm when delete backup!
     381. New advanced menu, in 3.0!!!
     392. My Custom CSS Panel with All feature and DarkTheme
     403. My Custom CSS Panel with LightTheme
     414. Preview in browser sourcecode
     425. Backup List (New Feature)!
     436. Confirm when delete backup!
    4344
    4445== Installation ==
     
    4950== Upgrade Notice ==
    5051
     52= 3.0 =
     53
     54* More advanced setting for enable/disable many feature!
     55
     56== Changelog ==
     57
     58= 3.0 =
     59
     60* More advanced setting for enable/disable many feature:
     61* Enable/Disable invisible elements;
     62* Enable/Disable print margin;
     63* Enable/Disable line numbers;
     64* Enable/Disable backups (end, if enabled, save only if exist data to save = no more empty backup)!
     65* Enable/Disable autocomplete;
     66* All setting saved with cookies only when an admin access in backend!
     67
    5168= 2.9 =
    5269
    53 * Fixed some bug, rewrite more css and sourcecode.
    54 
    55 == Changelog ==
    56 
    57 = 2.9 =
    58 
    5970* Added version querystring in css and javascript (prevent cache issue from old release).
    60 * Fixed more bug in sourcecode and css.
    61 * Tested with wp-dev "4.4-RC1-35769 (debug enabled - now no warning, nor error!)
    62 * Added some little background icon in input button.
    6371
    6472= 2.8 =
Note: See TracChangeset for help on using the changeset viewer.