-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
William Troup
committed
Jul 18, 2024
1 parent
5cb6b2e
commit 340366d
Showing
8 changed files
with
760 additions
and
689 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/** | ||
* Peek.js | ||
* | ||
* A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position. | ||
* | ||
* @file config.ts | ||
* @version v1.6.1 | ||
* @author Bunoon | ||
* @license MIT License | ||
* @copyright Bunoon 2024 | ||
*/ | ||
|
||
|
||
import { type Configuration, type ConfigurationText } from "../type"; | ||
import { Default } from "../data/default"; | ||
|
||
|
||
export namespace Config { | ||
export namespace Options { | ||
export function get( newConfiguration: Configuration = null! ) : Configuration { | ||
let configuration: Configuration = Default.getObject( newConfiguration, {} as Configuration ); | ||
configuration.dialogDisplayDelay = Default.getNumber( configuration.dialogDisplayDelay, 1000 ); | ||
configuration.searchDelayDelay = Default.getNumber( configuration.searchDelayDelay, 500 ); | ||
|
||
configuration = getText( configuration ); | ||
|
||
return configuration; | ||
} | ||
|
||
function getText( configuration: Configuration ) : Configuration { | ||
configuration.text = Default.getObject( configuration.text, {} as ConfigurationText ); | ||
configuration.text!.cssText = Default.getAnyString( configuration.text!.cssText, "CSS" ); | ||
configuration.text!.attributesText = Default.getAnyString( configuration.text!.attributesText, "Attributes" ); | ||
configuration.text!.sizeText = Default.getAnyString( configuration.text!.sizeText, "Size" ); | ||
configuration.text!.classesText = Default.getAnyString( configuration.text!.classesText, "Classes" ); | ||
configuration.text!.noAttributesAvailableText = Default.getAnyString( configuration.text!.noAttributesAvailableText, "No attributes are available." ); | ||
configuration.text!.closeText = Default.getAnyString( configuration.text!.closeText, "Close" ); | ||
configuration.text!.copyText = Default.getAnyString( configuration.text!.copyText, "Copy" ); | ||
configuration.text!.copySymbolText = Default.getAnyString( configuration.text!.copySymbolText, "❐" ); | ||
configuration.text!.pasteText = Default.getAnyString( configuration.text!.pasteText, "Paste" ); | ||
configuration.text!.pasteSymbolText = Default.getAnyString( configuration.text!.pasteSymbolText, "☐" ); | ||
configuration.text!.removeText = Default.getAnyString( configuration.text!.removeText, "Remove" ); | ||
configuration.text!.removeSymbolText = Default.getAnyString( configuration.text!.removeSymbolText, "✕" ); | ||
configuration.text!.noClassesAvailableText = Default.getAnyString( configuration.text!.noClassesAvailableText, "No classes are available." ); | ||
configuration.text!.searchPropertiesPlaceHolderText = Default.getAnyString( configuration.text!.searchPropertiesPlaceHolderText, "Search properties..." ); | ||
configuration.text!.clearText = Default.getAnyString( configuration.text!.clearText, "Clear" ); | ||
configuration.text!.clearSymbolText = Default.getAnyString( configuration.text!.clearSymbolText, "✕" ); | ||
configuration.text!.noPropertiesFoundForSearchText = Default.getAnyString( configuration.text!.noPropertiesFoundForSearchText, "No properties were found for your search." ); | ||
configuration.text!.dialogMovedSymbolText = Default.getAnyString( configuration.text!.dialogMovedSymbolText, "✱" ); | ||
configuration.text!.propertyValuePlaceHolderText = Default.getAnyString( configuration.text!.propertyValuePlaceHolderText, "Enter value..." ); | ||
configuration.text!.modeNotSupportedText = Default.getAnyString( configuration.text!.modeNotSupportedText, "The mode you have specified is not supported." ); | ||
configuration.text!.unknownModeText = Default.getAnyString( configuration.text!.unknownModeText, "Unknown Mode" ); | ||
configuration.text!.moveUpText = Default.getAnyString( configuration.text!.moveUpText, "Move Up" ); | ||
configuration.text!.moveUpSymbolText = Default.getAnyString( configuration.text!.moveUpSymbolText, "↑" ); | ||
configuration.text!.moveDownText = Default.getAnyString( configuration.text!.moveDownText, "Move Down" ); | ||
configuration.text!.moveDownSymbolText = Default.getAnyString( configuration.text!.moveDownSymbolText, "↓" ); | ||
configuration.text!.removeElementSymbolText = Default.getAnyString( configuration.text!.removeElementSymbolText, "⌫" ); | ||
|
||
return configuration; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* Peek.js | ||
* | ||
* A lightweight JavaScript library that attaches a viewer to a specific node type, allowing you to view the CSS properties, attributes, and size/position. | ||
* | ||
* @file options.ts | ||
* @version v1.6.1 | ||
* @author Bunoon | ||
* @license MIT License | ||
* @copyright Bunoon 2024 | ||
*/ | ||
|
||
|
||
import { Default } from "../data/default"; | ||
import { Char, Mode } from "../data/enum"; | ||
import { type Options } from "../type"; | ||
|
||
|
||
export namespace Start { | ||
export namespace Options { | ||
export function get( newOptions: any ) : Options { | ||
let options: Options = Default.getObject( newOptions, {} as Options ); | ||
options.nodeType = Default.getStringOrArray( options.nodeType, [] ); | ||
options.mode = Default.getNumber( options.mode, Mode.css ); | ||
options.titleText = Default.getString( options.titleText, Char.empty ); | ||
options.showOnly = Default.getStringOrArray( options.showOnly, [] ); | ||
options.allowEditing = Default.getBoolean( options.allowEditing, false ); | ||
options.showIdOrNameInTitle = Default.getBoolean( options.showIdOrNameInTitle, true ); | ||
options.showNodeNameInTitle = Default.getBoolean( options.showNodeNameInTitle, false ); | ||
|
||
return options; | ||
} | ||
} | ||
} |