Procházet zdrojové kódy

Finally 1.0

Added Custom CSS Editor
Added new Language Strings
Changed CSS
causefx před 9 roky
rodič
revize
d72a613ffa

+ 1 - 0
.gitignore

@@ -51,3 +51,4 @@ Temporary Items
 # =========================
 databaseLocation.ini.php
 loginLog.json
+custom.css

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
bower_components/bootstrap/dist/css/bootstrap.min.css


+ 26 - 0
bower_components/numbered/jquery.numberedtextarea.css

@@ -0,0 +1,26 @@
+
+div.numberedtextarea-wrapper { position: relative; }
+
+div.numberedtextarea-wrapper textarea {
+  display: block;
+  -webkit-box-sizing: border-box;
+  -moz-box-sizing: border-box;
+  box-sizing: border-box;
+}
+
+div.numberedtextarea-line-numbers {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  width: 50px;
+  border-right: 1px solid rgba(255, 255, 255, 0.5);
+  color: rgba(255, 255, 255, 0.5);
+  overflow: hidden;
+}
+
+div.numberedtextarea-number {
+  padding-right: 6px;
+  text-align: right;
+}

+ 146 - 0
bower_components/numbered/jquery.numberedtextarea.js

@@ -0,0 +1,146 @@
+/*
+ * NumberedTextarea - jQuery Plugin
+ * Textarea with line numbering
+ *
+ * Copyright (c) 2015 Dariusz Arciszewski
+ *
+ * Requires: jQuery v2.0+
+ *
+ * Licensed under the GPL licenses:
+ *   http://www.gnu.org/licenses/gpl.html
+ */
+
+(function ($) {
+ 
+    $.fn.numberedtextarea = function(options) {
+ 
+        var settings = $.extend({
+            color:          null,        // Font color
+            borderColor:    null,        // Border color
+            class:          null,        // Add class to the 'numberedtextarea-wrapper'
+            allowTabChar:   false,       // If true Tab key creates indentation
+        }, options);
+ 
+        this.each(function() {
+            if(this.nodeName.toLowerCase() !== "textarea") {
+                console.log('This is not a <textarea>, so no way Jose...');
+                return false;
+            }
+            
+            addWrapper(this, settings);
+            addLineNumbers(this, settings);
+            
+            if(settings.allowTabChar) {
+                $(this).allowTabChar();
+            }
+        });
+        
+        return this;
+    };
+    
+    $.fn.allowTabChar = function() {
+        if (this.jquery) {
+            this.each(function() {
+                if (this.nodeType == 1) {
+                    var nodeName = this.nodeName.toLowerCase();
+                    if (nodeName == "textarea" || (nodeName == "input" && this.type == "text")) {
+                        allowTabChar(this);
+                    }
+                }
+            })
+        }
+        return this;
+    }
+    
+    function addWrapper(element, settings) {
+        var wrapper = $('<div class="numberedtextarea-wrapper"></div>').insertAfter(element);
+        $(element).detach().appendTo(wrapper);
+    }
+    
+    function addLineNumbers(element, settings) {
+        element = $(element);
+        
+        var wrapper = element.parents('.numberedtextarea-wrapper');
+        
+        // Get textarea styles to implement it on line numbers div
+        var paddingLeft = parseFloat(element.css('padding-left'));
+        var paddingTop = parseFloat(element.css('padding-top'));
+        var paddingBottom = parseFloat(element.css('padding-bottom'));
+        
+        var lineNumbers = $('<div class="numberedtextarea-line-numbers"></div>').insertAfter(element);
+        
+        element.css({
+            paddingLeft: paddingLeft + lineNumbers.width() + 'px'
+        }).on('input propertychange change keyup paste', function() {
+            renderLineNumbers(element, settings);
+        }).on('scroll', function() {
+            scrollLineNumbers(element, settings);
+        }); 
+        
+        lineNumbers.css({
+            paddingLeft: paddingLeft + 'px',
+            paddingTop: paddingTop + 'px',
+            lineHeight: element.css('line-height'),
+            fontFamily: element.css('font-family'),
+            width: lineNumbers.width() - paddingLeft + 'px',
+        });
+        
+        element.trigger('change');
+    }
+    
+    function renderLineNumbers(element, settings) {
+        element = $(element);
+        
+        var linesDiv = element.parent().find('.numberedtextarea-line-numbers');
+        var count = element.val().split("\n").length;
+        var paddingBottom = parseFloat(element.css('padding-bottom'));
+        
+        linesDiv.find('.numberedtextarea-number').remove();
+        
+        for(i = 1; i<=count; i++) {
+            var line = $('<div class="numberedtextarea-number numberedtextarea-number-' + i + '">' + i + '</div>').appendTo(linesDiv);
+            
+            if(i === count) {
+            	line.css('margin-bottom', paddingBottom + 'px');
+            }
+        }
+    }
+    
+    function scrollLineNumbers(element, settings) {
+        element = $(element);
+        var linesDiv = element.parent().find('.numberedtextarea-line-numbers');
+        linesDiv.scrollTop(element.scrollTop());
+    }
+    
+    function pasteIntoInput(el, text) {
+        el.focus();
+        if (typeof el.selectionStart == "number") {
+            var val = el.value;
+            var selStart = el.selectionStart;
+            el.value = val.slice(0, selStart) + text + val.slice(el.selectionEnd);
+            el.selectionEnd = el.selectionStart = selStart + text.length;
+        } else if (typeof document.selection != "undefined") {
+            var textRange = document.selection.createRange();
+            textRange.text = text;
+            textRange.collapse(false);
+            textRange.select();
+        }
+    }
+
+    function allowTabChar(el) {
+        $(el).keydown(function(e) {
+            if (e.which == 9) {
+                pasteIntoInput(this, "\t");
+                return false;
+            }
+        });
+
+        // For Opera, which only allows suppression of keypress events, not keydown
+        $(el).keypress(function(e) {
+            if (e.which == 9) {
+                return false;
+            }
+        });
+    }
+ 
+}(jQuery));

+ 68 - 8
index.php

@@ -37,9 +37,23 @@ function registration_callback($username, $email, $userdir){
 
 function printArray($arrayName){
     
+    $messageCount = count($arrayName);
+    
+    $i = 0;
+    
     foreach ( $arrayName as $item ) :
-        
-        echo "<small class='text-uppercase'>" . $item . "</small> ";
+    
+        $i++; 
+    
+        if($i < $messageCount) :
+    
+            echo "<small class='text-uppercase'>" . $item . "</small> & ";
+    
+        elseif($i = $messageCount) :
+    
+            echo "<small class='text-uppercase'>" . $item . "</small>";
+    
+        endif;
         
     endforeach;
     
@@ -266,13 +280,17 @@ else :
 
     else : 
 
-        $showPic = "<img style='height: " . $userSize . "px'; src='images/login.png'>"; 
+        //$showPic = "<img style='height: " . $userSize . "px'; src='images/login.png'>"; 
+        $showPic = "<login class='login-btn text-uppercase'>" . $language->translate("LOGIN") . "</login>"; 
 
     endif;
 
 endif;
 
 if(!defined('SLIMBAR')) : define('SLIMBAR', 'false'); endif;
+if(!defined('AUTOHIDE')) : define('AUTOHIDE', 'false'); endif;
+if(!defined('ENABLEMAIL')) : define('ENABLEMAIL', 'false'); endif;
+if(!defined('CUSTOMCSS')) : define('CUSTOMCSS', 'false'); endif;
 if(!defined('LOADINGSCREEN')) : define('LOADINGSCREEN', 'true'); endif;
 if(!isset($notifyExplode)) :
 
@@ -280,9 +298,10 @@ if(!isset($notifyExplode)) :
 
 endif;
 
-
 if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; else : $slimBar = "56"; $userSize = "40"; endif;
 
+if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon = "settings2.png"; else: $iconRotate = "true"; $settingsIcon = "settings.png"; endif;
+
 ?>
 <!--
 
@@ -354,6 +373,7 @@ if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; else : $slimBar = "56
     </head>
     
     <style>
+
         .bottom-bnts a {
 
             background: <?=$bottombar;?> !important;
@@ -508,6 +528,30 @@ if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; else : $slimBar = "56
             
             }
             
+        }.login-btn {
+            
+            -webkit-border-radius: 4;
+            -moz-border-radius: 4;
+            border-radius: 4px;
+            -webkit-box-shadow: 0px 1px 3px #666666;
+            -moz-box-shadow: 0px 1px 3px #666666;
+            box-shadow: 0px 1px 3px #666666;
+            font-family: Arial;
+            color: <?=$topbar;?>;
+            font-size: 10px;
+            vertical-align: top;
+            background: <?=$topbartext;?>;
+            padding: 5px 10px 5px 10px;
+            text-decoration: none;
+            font-weight: 700;
+            
+        }.login-btn:hover {
+            
+            background: <?=$hoverbg;?>;
+            color: <?=$hovertext;?>;
+            text-decoration: none;
+            font-weight: 700;
+            
         }
 
         <?php if(SLIMBAR == "true") : ?>
@@ -578,7 +622,7 @@ if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; else : $slimBar = "56
             
         }.ns-effect-slidetop {
          
-            padding: 5px 22px;
+            padding: 6px 22px;
             
         }.ns-effect-exploader {
          
@@ -586,6 +630,13 @@ if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; else : $slimBar = "56
             
         }
         <?php endif; ?>
+        <?php if(CUSTOMCSS == "true") : 
+$template_file = "custom.css";
+$file_handle = fopen($template_file, "rb");
+echo fread($file_handle, filesize($template_file));
+fclose($file_handle);
+echo "\n";
+endif; ?>
 
     </style>
 
@@ -687,7 +738,7 @@ if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; else : $slimBar = "56
                                         <?php if($settingsicon == "Yes") :
                                         
                                             echo '<i style="font-size: 19px; padding: 0 10px; font-size: 19px;">
-                                                <img id="settings-icon" src="images/settings.png" style="height: 30px; margin-top: -2px;"></i>';
+                                                <img id="settings-icon" src="images/' . $settingsIcon . '" style="height: 30px; margin-top: -2px;"></i>';
                                         
                                         else :
                                         
@@ -1755,7 +1806,7 @@ if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; else : $slimBar = "56
             $("#contentRight").html('');
 
         });
-            
+        <?php if($iconRotate == "true") : ?>   
         $("li[id^='settings.phpx']").on('click tap', function(){
 
             $("img[id^='settings-icon']").attr("class", "fa-spin");
@@ -1769,6 +1820,7 @@ if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; else : $slimBar = "56
             },1000);
 
         });
+        <?php endif; ?>
 
         $('#logoutSubmit').on('click tap', function(){
 
@@ -1797,6 +1849,8 @@ if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; else : $slimBar = "56
             if (currentframe.attr("class") == "iframe active") {
 
                 console.log(thisid + " is active already");
+                
+                setHeight();
 
             }else if (currentframe.attr("class") == "iframe hidden") {
 
@@ -1964,7 +2018,13 @@ if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; else : $slimBar = "56
 
             notify("<?php echo $language->translate('UPDATE_COMPLETE');?>","exclamation-circle ","success","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
 
-        }    
+        }
+            
+        if(ref.indexOf("submit")>=0){
+
+            notify("<?php echo $language->translate('CUSTOM_COMPLETE');?>","exclamation-circle ","success","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
+
+        } 
             
         </script>
 

+ 4 - 1
lang/de.ini

@@ -165,4 +165,7 @@ ICON_COPY = "Icon Path Copied To Clipboard"
 TEST_MESSAGE = "This is a test message"
 TEST = "Test"
 SHOW_MORE = "Show More"
-SHOW_LESS = "Show Less"
+SHOW_LESS = "Show Less"
+EDIT_CUSTOM_CSS = "Custom CSS"
+CUSTOM_COMPLETE = "CUSTOM CSS SAVED!"
+SAVE_CSS = "Save CSS"

+ 4 - 1
lang/en.ini

@@ -165,4 +165,7 @@ ICON_COPY = "Icon Path Copied To Clipboard"
 TEST_MESSAGE = "This is a test message"
 TEST = "Test"
 SHOW_MORE = "Show More"
-SHOW_LESS = "Show Less"
+SHOW_LESS = "Show Less"
+EDIT_CUSTOM_CSS = "Custom CSS"
+CUSTOM_COMPLETE = "CUSTOM CSS SAVED!"
+SAVE_CSS = "Save CSS"

+ 4 - 1
lang/es.ini

@@ -165,4 +165,7 @@ ICON_COPY = "Icon Path Copied To Clipboard"
 TEST_MESSAGE = "This is a test message"
 TEST = "Test"
 SHOW_MORE = "Show More"
-SHOW_LESS = "Show Less"
+SHOW_LESS = "Show Less"
+EDIT_CUSTOM_CSS = "Custom CSS"
+CUSTOM_COMPLETE = "CUSTOM CSS SAVED!"
+SAVE_CSS = "Save CSS"

+ 4 - 1
lang/fr.ini

@@ -165,4 +165,7 @@ ICON_COPY = "Icon Path Copied To Clipboard"
 TEST_MESSAGE = "This is a test message"
 TEST = "Test"
 SHOW_MORE = "Show More"
-SHOW_LESS = "Show Less"
+SHOW_LESS = "Show Less"
+EDIT_CUSTOM_CSS = "Custom CSS"
+CUSTOM_COMPLETE = "CUSTOM CSS SAVED!"
+SAVE_CSS = "Save CSS"

+ 4 - 1
lang/it.ini

@@ -165,4 +165,7 @@ ICON_COPY = "Icon Path Copied To Clipboard"
 TEST_MESSAGE = "This is a test message"
 TEST = "Test"
 SHOW_MORE = "Show More"
-SHOW_LESS = "Show Less"
+SHOW_LESS = "Show Less"
+EDIT_CUSTOM_CSS = "Custom CSS"
+CUSTOM_COMPLETE = "CUSTOM CSS SAVED!"
+SAVE_CSS = "Save CSS"

+ 4 - 1
lang/nl.ini

@@ -165,4 +165,7 @@ ICON_COPY = "Icon Path Copied To Clipboard"
 TEST_MESSAGE = "This is a test message"
 TEST = "Test"
 SHOW_MORE = "Show More"
-SHOW_LESS = "Show Less"
+SHOW_LESS = "Show Less"
+EDIT_CUSTOM_CSS = "Custom CSS"
+CUSTOM_COMPLETE = "CUSTOM CSS SAVED!"
+SAVE_CSS = "Save CSS"

+ 112 - 8
settings.php

@@ -27,9 +27,23 @@ endif;
 
 function printArray($arrayName){
     
+    $messageCount = count($arrayName);
+    
+    $i = 0;
+    
     foreach ( $arrayName as $item ) :
-        
-        echo "<small class='text-uppercase'>" . $item . "</small> ";
+    
+        $i++; 
+    
+        if($i < $messageCount) :
+    
+            echo "<small class='text-uppercase'>" . $item . "</small> & ";
+    
+        elseif($i = $messageCount) :
+    
+            echo "<small class='text-uppercase'>" . $item . "</small>";
+    
+        endif;
         
     endforeach;
     
@@ -667,6 +681,7 @@ endif;
         <link rel="stylesheet" href="bower_components/animate.css/animate.min.css">
         <link rel="stylesheet" href="bower_components/DataTables/media/css/jquery.dataTables.css">
         <link rel="stylesheet" href="bower_components/datatables-tabletools/css/dataTables.tableTools.css">
+        <link rel="stylesheet" href="bower_components/numbered/jquery.numberedtextarea.css">
 
         <link rel="stylesheet" href="css/style.css">
         <link href="css/jquery.filer.css" rel="stylesheet">
@@ -679,10 +694,10 @@ endif;
         
     </head>
 
-    <body style="padding: 0; background: #273238;">
+    <body class="scroller-body" style="padding: 0; background: #273238; overflow-x: hidden !important">
         
         <style>
-        
+
             input.form-control.material.icp-auto.iconpicker-element.iconpicker-input {
                 display: none;
             }input.form-control.iconpicker-search {
@@ -727,9 +742,18 @@ endif;
                 left: 160px;
                 top: 0px;
                 height: 400px;
-            }.chooseTheme a span { position:absolute; display:none; z-index:99; }
-            .chooseTheme a:hover span { display:block; }
-        
+            }.chooseTheme a span { 
+                position:absolute; display:none; z-index:99; 
+            }.chooseTheme a:hover span { 
+                display:block; 
+            }<?php if(CUSTOMCSS == "true") : 
+$template_file = "custom.css";
+$file_handle = fopen($template_file, "rb");
+echo fread($file_handle, filesize($template_file));
+fclose($file_handle);
+echo "\n";
+endif; ?>
+       
         </style>
        
         <div id="main-wrapper" class="main-wrapper">
@@ -1848,6 +1872,12 @@ endif;
                                             
                                         </div>
                                         
+                                        <button id="editCssButton" class="btn waves btn-labeled btn-primary btn-sm text-uppercase waves-effect waves-float" type="button">
+                                                
+                                                <span class="btn-label"><i class="fa fa-css3"></i></span><?php echo $language->translate("EDIT_CUSTOM_CSS");?>
+                                                
+                                        </button>
+                                        
                                         <button class="btn waves btn-labeled btn-success btn-sm pull-right text-uppercase waves-effect waves-float" type="submit">
                                                 
                                                 <span class="btn-label"><i class="fa fa-floppy-o"></i></span><?php echo $language->translate("SAVE_OPTIONS");?>
@@ -1989,6 +2019,39 @@ endif;
                                         </div>
                                         
                                     </form>
+                                    
+                                     <form style="display: none" id="editCssForm" method="POST" action="submitCSS.php">
+                                         
+                                         <button class="btn waves btn-labeled btn-warning btn-sm pull-left text-uppercase waves-effect waves-float" type="button" id="backToThemeButton">
+
+                                            <span class="btn-label"><i class="fa fa-arrow-left"></i></span><?php echo $language->translate("GO_BACK");?>
+                                                
+                                        </button>
+                                        
+                                         
+                                         <button class="btn waves btn-labeled btn-success btn-sm pull-right text-uppercase waves-effect waves-float" type="submit">
+
+                                            <span class="btn-label"><i class="fa fa-floppy-o"></i></span><?php echo $language->translate("SAVE_CSS");?>
+                                                
+                                        </button>
+                                         
+                                        <br><br>
+                                        
+                                        <input type="hidden" name="submit" value="editCSS" /> 
+                                         
+                                        <h1><?php echo $language->translate("EDIT_CUSTOM_CSS");?></h1> 
+                                         
+                                         <!--<p>Variables Available<code>$topbar - $topbartext - $bottombar - $sidebar - $hoverbg - $activetabBG - $activetabicon - $activetabtext - $inactiveicon - $inactivetext - $loading - $hovertext</code></p>-->
+                                         
+                                        <textarea class="form-control" id="css-show" name="css-show" rows="25" style="background: #000; color: #FFF;">
+<?php if(CUSTOMCSS == "true") :
+$template_file = "custom.css";
+$file_handle = fopen($template_file, "rb");
+echo fread($file_handle, filesize($template_file));
+fclose($file_handle);
+endif;?></textarea>
+                                                                        
+                                    </form>
                       
                                 </div>
                                 
@@ -2037,6 +2100,8 @@ endif;
         <script src="bower_components/sweetalert/dist/sweetalert.min.js"></script>
 
         <script src="bower_components/smoke/dist/js/smoke.min.js"></script>
+        <script src="bower_components/numbered/jquery.numberedtextarea.js"></script>
+
 
         <!--Notification-->
         <script src="js/notifications/notificationFx.js"></script>
@@ -2332,6 +2397,20 @@ endif;
      
             });
             
+            $("#editCssButton").click(function(){
+
+                $( "#add_optionz" ).toggle();
+                $( "#editCssForm" ).toggle();
+     
+            });
+            
+            $("#backToThemeButton").click(function(){
+
+                $( "#add_optionz" ).toggle();
+                $( "#editCssForm" ).toggle();
+     
+            });
+            
             $(".deleteUser").click(function(){
 
                 var parent_id = $(this).parent().attr('id');
@@ -2467,6 +2546,7 @@ endif;
                 
                 var definedElement = document.getElementById(elementName);
                 
+                definedElement.focus();
                 definedElement.value = elementColor;
                 definedElement.style.backgroundColor = elementColor;
                 
@@ -2641,6 +2721,23 @@ endif;
                 changeColor("hovertext", "#000000");
 
             });
+            
+            $('textarea').numberedtextarea({
+
+              // font color for line numbers
+              color: null,
+
+              // border color
+              borderColor: 'null',
+
+              // CSS class to be added to the line numbers
+              class: null, 
+
+              // if true Tab key creates indentation
+              allowTabChar: true,       
+
+            });
+
         
         </script>
         
@@ -2648,6 +2745,13 @@ endif;
         
         $( document ).ready(function() {
             
+            $(".scroller-body").mCustomScrollbar({
+                theme:"inset-2",
+                scrollInertia: 300,
+                autoHideScrollbar: true,
+                autoExpandScrollbar: true
+            });
+            
             $("div[class^='DTTT_container']").append('<form style="display: inline; margin-left: 3px;" id="deletelog" method="post"><input type="hidden" name="action" value="deleteLog" /><button class="btn waves btn-labeled btn-danger text-uppercase waves-effect waves-float" type="submit"><span class="btn-label"><i class="fa fa-trash"></i></span><?php echo $language->translate("PURGE_LOG");?> </button></form>')
             $("a[id^='ToolTables_datatable_0'] span").html('<?php echo $language->translate("PRINT");?>')
             
@@ -2664,7 +2768,7 @@ endif;
                 dataType: "json",
                 success: function(github) {
                     
-                    var currentVersion = "0.99998";
+                    var currentVersion = "1.0";
                    
                     infoTabVersion = $('#about').find('#version');
                     infoTabVersionHistory = $('#about').find('#versionHistory');

+ 29 - 0
submitCSS.php

@@ -0,0 +1,29 @@
+<?php
+
+function write_ini_file($content, $path) { 
+    
+    if (!$handle = fopen($path, 'w')) {
+        
+        return false; 
+    
+    }
+    
+    $success = fwrite($handle, $content);
+    
+    fclose($handle); 
+    
+    return $success; 
+
+}
+
+if ($_POST['submit'] == "editCSS" ) {
+
+    $text = $_POST["css-show"];
+    
+    write_ini_file($text, "custom.css");
+
+}
+
+?>
+
+<script>window.top.location = window.top.location.href.split('#')[0];</script>

+ 1 - 0
user.php

@@ -20,6 +20,7 @@
     if(!empty($databaseConfig['cookiePassword'])) : define('COOKIEPASSWORD', $databaseConfig['cookiePassword']); else : define('COOKIEPASSWORD', ''); endif;
     if(!empty($databaseConfig['registerPassword'])) : define('REGISTERPASSWORD', $databaseConfig['registerPassword']); else : define('REGISTERPASSWORD', ''); endif;
     if(!empty($databaseConfig['notifyEffect'])) : define('NOTIFYEFFECT', $databaseConfig['notifyEffect']); else : define('NOTIFYEFFECT', 'bar-slidetop'); endif;
+    if(file_exists('custom.css')) : define('CUSTOMCSS', 'true'); else : define('CUSTOMCSS', 'false'); endif; 
     $notifyExplode = explode("-", NOTIFYEFFECT);
     define('FAIL_LOG', 'loginLog.json');
     date_default_timezone_set(TIMEZONE);

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů