diff --git a/assets/js/icecoder.js b/assets/js/icecoder.js index 5484472..9ba5d45 100644 --- a/assets/js/icecoder.js +++ b/assets/js/icecoder.js @@ -1204,7 +1204,8 @@ var ICEcoder = { this.scrollInt = setInterval(function(ic) { // Aim for this step to go 1/5th towards the target line we want as next scroll "step" - ic.scrollingOnLine = ic.scrollingOnLine + ((tgtLineNo - ic.scrollingOnLine) / 5); + // 1 = instant, 20 = very slow + ic.scrollingOnLine = ic.scrollingOnLine + ((tgtLineNo - ic.scrollingOnLine) / ICEcoder.goToLineScrollSpeed); // Scroll on the Y axis to the pixels in this step + 8 to handle margin - 1/10th of editor visible height thisCM.scrollTo(0, (thisCM.defaultTextHeight() * ic.scrollingOnLine) + 8 - (thisCM.getScrollInfo().clientHeight / 10)); // Clear interval if we're at the target line now @@ -2818,12 +2819,12 @@ var ICEcoder = { ? "inline-block" : "none"; }, - findReplaceOnInput: function() { - // Realtime finding - only action for finding/replacing in current doc + findOnInput: function() { + // Realtime finding - only action for finding in current doc if ("" !== get('find').value && t['this document'] === document.findAndReplace.target.value) { - ICEcoder.findReplace(get('find').value, true, false, false); + // Considers selecting next on value input, according to user setting + ICEcoder.findReplace(get('find').value, true === ICEcoder.selectNextOnFindInput, false, false); get("find").focus(); - return false; } }, @@ -2836,6 +2837,10 @@ var ICEcoder = { replace = get('replace').value; results = get('results'); + // TODO: This is still a problem if you have unterminated character classes + // Simply enable regex finding and press [ or ( ... { doesn't seem to be a problem + // Solution: We could check also that the number of [] () pairs match + // Return early if we're finding with regex and only have ^ or $ or .*, avoids CPU crash if (true === parent.ICEcoder.findRegex && "" === find.replace(/\^|\$|\.\*/g, "")) { results.innerHTML = "No results"; @@ -3885,6 +3890,10 @@ var ICEcoder = { get('plugins').style.left = "left" === settings.pluginPanelAligned ? "0" : "auto"; get('plugins').style.right = "right" === settings.pluginPanelAligned ? "0" : "auto"; + // Enable/disable select next on find input and set goToLine scroll speed + this.selectNextOnFindInput = settings.selectNextOnFindInput; + this.goToLineScrollSpeed = settings.goToLineScrollSpeed; + // Restart bug checking this.bugFilePaths = settings.bugFilePaths; this.bugFileCheckTimer = settings.bugFileCheckTimer; @@ -4502,6 +4511,9 @@ var ICEcoder = { // Update the title tag to indicate any changes this.indicateChanges(); + + // Set bool value to false to avoid being stuck on true + this.overCloseLink = false; } // Lastly, set the widths this.setTabWidths(true); diff --git a/index.php b/index.php index 2c2d723..b9ddfab 100644 --- a/index.php +++ b/index.php @@ -140,6 +140,8 @@ if (true === $havePrettier && true === file_exists(dirname(__FILE__) . "/plugins "ICEcoder.demoMode = " . ($ICEcoder["demoMode"] ? 'true' : 'false') . ";" . "ICEcoder.tagWrapperCommand = '" . $ICEcoder["tagWrapperCommand"] . "';" . "ICEcoder.autoComplete = '" . $ICEcoder["autoComplete"] . "';" . + "ICEcoder.selectNextOnFindInput = " . ($ICEcoder["selectNextOnFindInput"] ? 'true' : 'false') . ";" . + "ICEcoder.goToLineScrollSpeed = '" . $ICEcoder["goToLineScrollSpeed"] . "';" . "ICEcoder.bugFilePaths = ['" . implode("','",$ICEcoder["bugFilePaths"]) . "'];" . "ICEcoder.bugFileCheckTimer = ".$ICEcoder["bugFileCheckTimer"] . ";" . "ICEcoder.bugFileMaxLines = " . $ICEcoder["bugFileMaxLines"] . ";" . @@ -311,7 +313,7 @@ if (true === $havePrettier && true === file_exists(dirname(__FILE__) . "/plugins
^$
- +


+

go to line


+ scroll speed
+ " onchange="showButton()" style="width: 150px">
+
instant
slow

find & replace


:
- "> + ">

+ > select next result on find input


diff --git a/lib/settings-update.php b/lib/settings-update.php index 6a3c504..9697828 100644 --- a/lib/settings-update.php +++ b/lib/settings-update.php @@ -28,48 +28,50 @@ if (false === $demoMode && true === isset($_SESSION['loggedIn']) && true === $_S // Prepare all our vars $updatedSettings = [ - "versionNo" => $currentSettings['versionNo'], - "configCreateDate" => $currentSettings['configCreateDate'], - "root" => xssClean($_POST['root'], "html"), - "checkUpdates" => isset($_POST['checkUpdates']), - "openLastFiles" => isset($_POST['openLastFiles']), - "updateDiffOnSave" => isset($_POST['updateDiffOnSave']), - "languageUser" => $_POST['languageUser'], - "backupsKept" => isset($_POST['backupsKept']), - "backupsDays" => intval($_POST['backupsDays']), - "deleteToTmp" => isset($_POST['deleteToTmp']), - "findFilesExclude" => explode(",", str_replace(" ", "", $_POST['findFilesExclude'])), - "codeAssist" => isset($_POST['codeAssist']), - "visibleTabs" => isset($_POST['visibleTabs']), - "lockedNav" => isset($_POST['lockedNav']), - "tagWrapperCommand" => $_POST['tagWrapperCommand'], - "autoComplete" => $_POST['autoComplete'], - "password" => $currentSettings['password'], - "bannedFiles" => explode(",", str_replace(" ", "", $_POST['bannedFiles'])), - "bannedPaths" => explode(",", str_replace(" ", "", $_POST['bannedPaths'])), - "allowedIPs" => explode(",", str_replace(" ", "", $_POST['allowedIPs'])), - "autoLogoutMins" => intval($_POST['autoLogoutMins']), - "theme" => $_POST['theme'], - "fontSize" => $_POST['fontSize'], - "lineWrapping" => isset($_POST['lineWrapping']), - "lineNumbers" => isset($_POST['lineNumbers']), - "showTrailingSpace" => isset($_POST['showTrailingSpace']), - "matchBrackets" => isset($_POST['matchBrackets']), - "autoCloseTags" => isset($_POST['autoCloseTags']), - "autoCloseBrackets" => isset($_POST['autoCloseBrackets']), - "indentType" => $_POST['indentType'], - "indentAuto" => isset($_POST['indentAuto']), - "indentSize" => intval($_POST['indentSize']), - "pluginPanelAligned" => $_POST['pluginPanelAligned'], - "scrollbarStyle" => $_POST['scrollbarStyle'], - "bugFilePaths" => explode(",", str_replace(" ", "", $_POST['bugFilePaths'])), - "bugFileCheckTimer" => intval($_POST['bugFileCheckTimer']) >= 0 ? intval($_POST['bugFileCheckTimer']) : 0, - "bugFileMaxLines" => intval($_POST['bugFileMaxLines']), - "plugins" => $currentSettings['plugins'], - "tutorialOnLogin" => isset($_POST['tutorialOnLogin']), - "previousFiles" => $currentSettings['previousFiles'], - "last10Files" => $currentSettings['last10Files'], - "favoritePaths" => $currentSettings['favoritePaths'], + "versionNo" => $currentSettings['versionNo'], + "configCreateDate" => $currentSettings['configCreateDate'], + "root" => xssClean($_POST['root'], "html"), + "checkUpdates" => isset($_POST['checkUpdates']), + "openLastFiles" => isset($_POST['openLastFiles']), + "updateDiffOnSave" => isset($_POST['updateDiffOnSave']), + "languageUser" => $_POST['languageUser'], + "backupsKept" => isset($_POST['backupsKept']), + "backupsDays" => intval($_POST['backupsDays']), + "deleteToTmp" => isset($_POST['deleteToTmp']), + "findFilesExclude" => explode(",", str_replace(" ", "", $_POST['findFilesExclude'])), + "codeAssist" => isset($_POST['codeAssist']), + "visibleTabs" => isset($_POST['visibleTabs']), + "lockedNav" => isset($_POST['lockedNav']), + "tagWrapperCommand" => $_POST['tagWrapperCommand'], + "autoComplete" => $_POST['autoComplete'], + "password" => $currentSettings['password'], + "bannedFiles" => explode(",", str_replace(" ", "", $_POST['bannedFiles'])), + "bannedPaths" => explode(",", str_replace(" ", "", $_POST['bannedPaths'])), + "allowedIPs" => explode(",", str_replace(" ", "", $_POST['allowedIPs'])), + "autoLogoutMins" => intval($_POST['autoLogoutMins']), + "theme" => $_POST['theme'], + "fontSize" => $_POST['fontSize'], + "lineWrapping" => isset($_POST['lineWrapping']), + "lineNumbers" => isset($_POST['lineNumbers']), + "showTrailingSpace" => isset($_POST['showTrailingSpace']), + "matchBrackets" => isset($_POST['matchBrackets']), + "autoCloseTags" => isset($_POST['autoCloseTags']), + "autoCloseBrackets" => isset($_POST['autoCloseBrackets']), + "indentType" => $_POST['indentType'], + "indentAuto" => isset($_POST['indentAuto']), + "indentSize" => intval($_POST['indentSize']), + "pluginPanelAligned" => $_POST['pluginPanelAligned'], + "scrollbarStyle" => $_POST['scrollbarStyle'], + "selectNextOnFindInput" => isset($_POST['selectNextOnFindInput']), + "goToLineScrollSpeed" => intval($_POST['goToLineScrollSpeed']), + "bugFilePaths" => explode(",", str_replace(" ", "", $_POST['bugFilePaths'])), + "bugFileCheckTimer" => intval($_POST['bugFileCheckTimer']) >= 0 ? intval($_POST['bugFileCheckTimer']) : 0, + "bugFileMaxLines" => intval($_POST['bugFileMaxLines']), + "plugins" => $currentSettings['plugins'], + "tutorialOnLogin" => isset($_POST['tutorialOnLogin']), + "previousFiles" => $currentSettings['previousFiles'], + "last10Files" => $currentSettings['last10Files'], + "favoritePaths" => $currentSettings['favoritePaths'], ]; if ("" !== $_POST['password']) { @@ -137,6 +139,8 @@ if (false === $demoMode && true === isset($_SESSION['loggedIn']) && true === $_S "indentSize: " . $ICEcoder["indentSize"] . ", " . "pluginPanelAligned: '" . $ICEcoder["pluginPanelAligned"] . "', " . "scrollbarStyle: '" . $ICEcoder["scrollbarStyle"] . "', " . + "selectNextOnFindInput: " . (true === $ICEcoder["selectNextOnFindInput"] ? "true" : "false") . ", " . + "goToLineScrollSpeed: " . $ICEcoder["goToLineScrollSpeed"] . ", " . "bugFilePaths: " . $jsBugFilePaths . ", " . "bugFileCheckTimer: " . $ICEcoder["bugFileCheckTimer"] . ", " . "bugFileMaxLines: " . $ICEcoder["bugFileMaxLines"] . ", " . diff --git a/lib/template-config-users.php b/lib/template-config-users.php index bc3dd06..f59ac13 100644 --- a/lib/template-config-users.php +++ b/lib/template-config-users.php @@ -1,7 +1,7 @@