diff --git a/README.md b/README.md index ef531df..5d14d72 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ Everest uses Maven, so building from the source code is very simple. You need to 1. Clone the repository: `git clone https://github.com/RohitAwate/Everest.git` 2. Enter the repository: `cd Everest` 3. Build a binary: `mvn package` -4. Run the binary: `java -jar target\Everest-Alpha-1.X.jar` replacing 'X' with the current version. +4. Run the binary: `java -jar target/Everest-Alpha-1.X.jar` replacing 'X' with the current version. # Suggestions and improvements Use these options to reach me: diff --git a/src/main/java/com/rohitawate/everest/controllers/DashboardController.java b/src/main/java/com/rohitawate/everest/controllers/DashboardController.java index 8d771c1..fc02c35 100644 --- a/src/main/java/com/rohitawate/everest/controllers/DashboardController.java +++ b/src/main/java/com/rohitawate/everest/controllers/DashboardController.java @@ -210,7 +210,7 @@ public class DashboardController implements Initializable { } try { - String address = addressField.getText(); + String address = addressField.getText().trim(); if (address.equals("")) { promptLayer.setVisible(true); @@ -221,10 +221,12 @@ public class DashboardController implements Initializable { // Prepends "https://" to the address if not already done. if (!(address.startsWith("https://") || address.startsWith("http://"))) { address = "https://" + address; - addressField.setText(address); responseArea.requestFocus(); } + // Set again in case the address is manipulated by the above logic + addressField.setText(address); + switch (httpMethodBox.getValue()) { case "GET": if (getRequest == null) diff --git a/src/main/java/com/rohitawate/everest/controllers/codearea/EverestCodeArea.java b/src/main/java/com/rohitawate/everest/controllers/codearea/EverestCodeArea.java index 42759df..edd7dbe 100644 --- a/src/main/java/com/rohitawate/everest/controllers/codearea/EverestCodeArea.java +++ b/src/main/java/com/rohitawate/everest/controllers/codearea/EverestCodeArea.java @@ -1,3 +1,19 @@ +/* + * Copyright 2018 Rohit Awate. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.rohitawate.everest.controllers.codearea; import com.rohitawate.everest.controllers.codearea.highlighters.Highlighter; diff --git a/src/main/java/com/rohitawate/everest/controllers/codearea/highlighters/Highlighter.java b/src/main/java/com/rohitawate/everest/controllers/codearea/highlighters/Highlighter.java index c3ea16d..138a6eb 100644 --- a/src/main/java/com/rohitawate/everest/controllers/codearea/highlighters/Highlighter.java +++ b/src/main/java/com/rohitawate/everest/controllers/codearea/highlighters/Highlighter.java @@ -1,3 +1,19 @@ +/* + * Copyright 2018 Rohit Awate. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.rohitawate.everest.controllers.codearea.highlighters; import org.fxmisc.richtext.model.StyleSpans; diff --git a/src/main/java/com/rohitawate/everest/controllers/codearea/highlighters/JSONHighlighter.java b/src/main/java/com/rohitawate/everest/controllers/codearea/highlighters/JSONHighlighter.java index 1c5a29a..1a30c5d 100644 --- a/src/main/java/com/rohitawate/everest/controllers/codearea/highlighters/JSONHighlighter.java +++ b/src/main/java/com/rohitawate/everest/controllers/codearea/highlighters/JSONHighlighter.java @@ -1,3 +1,19 @@ +/* + * Copyright 2018 Rohit Awate. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.rohitawate.everest.controllers.codearea.highlighters; import org.fxmisc.richtext.model.StyleSpans; diff --git a/src/main/java/com/rohitawate/everest/controllers/codearea/highlighters/PlaintextHighlighter.java b/src/main/java/com/rohitawate/everest/controllers/codearea/highlighters/PlaintextHighlighter.java index 6eaa437..388f0c1 100644 --- a/src/main/java/com/rohitawate/everest/controllers/codearea/highlighters/PlaintextHighlighter.java +++ b/src/main/java/com/rohitawate/everest/controllers/codearea/highlighters/PlaintextHighlighter.java @@ -1,3 +1,19 @@ +/* + * Copyright 2018 Rohit Awate. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.rohitawate.everest.controllers.codearea.highlighters; import org.fxmisc.richtext.model.StyleSpans; diff --git a/src/main/java/com/rohitawate/everest/controllers/codearea/highlighters/XMLHighlighter.java b/src/main/java/com/rohitawate/everest/controllers/codearea/highlighters/XMLHighlighter.java index 70eae7a..c23db12 100644 --- a/src/main/java/com/rohitawate/everest/controllers/codearea/highlighters/XMLHighlighter.java +++ b/src/main/java/com/rohitawate/everest/controllers/codearea/highlighters/XMLHighlighter.java @@ -1,3 +1,45 @@ +/* + * This highlighter is heavily based on the XMLEditorDemo provided by the contributors of RichTextFX (https://github.com/FXMisc/RichTextFX). + * https://github.com/FXMisc/RichTextFX/blob/master/richtextfx-demos/src/main/java/org/fxmisc/richtext/demo/XMLEditorDemo.java + * RichTextFX is dual-licensed under BSD 2-Clause License and GPLv2 with the Classpath Exception. + * + * Copyright (c) 2013-2017, Tomas Mikula and contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the + * following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the + * following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Copyright 2018 Rohit Awate. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.rohitawate.everest.controllers.codearea.highlighters; import org.fxmisc.richtext.model.StyleSpans; @@ -44,13 +86,13 @@ public class XMLHighlighter implements Highlighter { lastKwEnd = 0; - Matcher amatcher = ATTRIBUTES.matcher(attributesText); - while (amatcher.find()) { - spansBuilder.add(Collections.emptyList(), amatcher.start() - lastKwEnd); - spansBuilder.add(Collections.singleton("xml_attribute"), amatcher.end(GROUP_ATTRIBUTE_NAME) - amatcher.start(GROUP_ATTRIBUTE_NAME)); - spansBuilder.add(Collections.singleton("xml_bracket"), amatcher.end(GROUP_EQUAL_SYMBOL) - amatcher.end(GROUP_ATTRIBUTE_NAME)); - spansBuilder.add(Collections.singleton("xml_attribute_value"), amatcher.end(GROUP_ATTRIBUTE_VALUE) - amatcher.end(GROUP_EQUAL_SYMBOL)); - lastKwEnd = amatcher.end(); + Matcher attributesMatcher = ATTRIBUTES.matcher(attributesText); + while (attributesMatcher.find()) { + spansBuilder.add(Collections.emptyList(), attributesMatcher.start() - lastKwEnd); + spansBuilder.add(Collections.singleton("xml_attribute"), attributesMatcher.end(GROUP_ATTRIBUTE_NAME) - attributesMatcher.start(GROUP_ATTRIBUTE_NAME)); + spansBuilder.add(Collections.singleton("xml_bracket"), attributesMatcher.end(GROUP_EQUAL_SYMBOL) - attributesMatcher.end(GROUP_ATTRIBUTE_NAME)); + spansBuilder.add(Collections.singleton("xml_attribute_value"), attributesMatcher.end(GROUP_ATTRIBUTE_VALUE) - attributesMatcher.end(GROUP_EQUAL_SYMBOL)); + lastKwEnd = attributesMatcher.end(); } if (attributesText.length() > lastKwEnd) spansBuilder.add(Collections.emptyList(), attributesText.length() - lastKwEnd); @@ -62,6 +104,7 @@ public class XMLHighlighter implements Highlighter { } lastKwEnd = matcher.end(); } + spansBuilder.add(Collections.emptyList(), text.length() - lastKwEnd); return spansBuilder.create(); } diff --git a/src/main/resources/css/syntax/Moondust.css b/src/main/resources/css/syntax/Moondust.css index fe6d6b6..793da02 100644 --- a/src/main/resources/css/syntax/Moondust.css +++ b/src/main/resources/css/syntax/Moondust.css @@ -1,3 +1,19 @@ +/* + * Copyright 2018 Rohit Awate. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /*General rules for EverestCodeArea*/ .everest-code-area {