Skip to content

Commit

Permalink
🎉 Version 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kraklin committed Oct 2, 2020
1 parent 20120ce commit ff2560f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 39 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "elm-debug-browser-extension",
"version": "0.0.6",
"version": "0.1.0",
"description": "This extension helps you with debugging your Elm applications by transforming the debug produced by Elm to expandable tree",
"private": true,
"license": "MIT",
Expand Down
20 changes: 17 additions & 3 deletions source/options/Options.elm
Original file line number Diff line number Diff line change
Expand Up @@ -408,11 +408,19 @@ debugModeSettings debugTurnedOn =
{ label = Element.text " ", onPress = Nothing }

debugForm =
Element.row [ Element.spacing 20 ]
Element.row [ Element.width Element.fill, Element.spacing 20 ]
[ Input.checkbox [] { onChange = SetDebug, icon = checkbox, checked = debugTurnedOn, label = Input.labelLeft [] (Element.text "Debug mode") }
]

help =
Element.column [ Element.width Element.fill, Element.spacing 12 ]
[ Element.paragraph [ Font.size 12, Font.color grey ]
[ Element.text "When Debug is on, it shows the original string generated by Debug.log before the transformed object in console." ]
, Element.paragraph [ Font.size 12, Font.color grey ]
[ Element.text "It is useful for checking if the parser is working properly." ]
]
in
section "Debug mode" debugForm Element.none
section "Debug mode" debugForm help


saveButton : SavedResult -> Element Msg
Expand Down Expand Up @@ -463,7 +471,13 @@ content model =
else
Element.none
, debugModeSettings model.form.debug
, saveButton model.savedResult
, Element.row [ Element.width Element.fill ]
[ Element.link [ Element.width Element.fill ]
{ url = "https://github.com/kraklin/elm-debug-extension"
, label = Element.text "Source code on GitHub"
}
, saveButton model.savedResult
]
]


Expand Down
28 changes: 1 addition & 27 deletions source/popup/Popup.elm
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ port sendRequest : Request -> Cmd msg
port openOptionsPage : () -> Cmd msg


port openPage : String -> Cmd msg


port receive : (DebugOptions -> msg) -> Sub msg


Expand Down Expand Up @@ -58,7 +55,6 @@ type Msg
= NoOp
| UpdateOptions DebugOptions
| OpenOptionsPage
| OpenFeedbackForm
| ToggleDebug


Expand All @@ -77,9 +73,6 @@ update msg model =
OpenOptionsPage ->
( model, openOptionsPage () )

OpenFeedbackForm ->
( model, openPage "https://forms.gle/DaUmAMj8PVTc6zpa6" )



-- VIEW
Expand Down Expand Up @@ -176,29 +169,10 @@ header =
footer : String -> Html Msg
footer version =
HtmlStyled.div [ css [ Css.displayFlex, Css.padding2 (px 12) (px 18) ] ]
[ HtmlStyled.button
[ css
[ Css.padding (px 0)
, Css.border (px 0)
, Css.cursor Css.pointer
, Css.color grey
, Css.hover
[ Css.color dark
]
, Transitions.transition
[ Transitions.color 200
]
]
, Events.onClick OpenFeedbackForm
, Attrs.title "Feedback"
]
[ HtmlStyled.div [ css [ Css.width (px 16), Css.height (px 16) ] ] [ commentIcon ]
]
, HtmlStyled.div
[ HtmlStyled.div
[ css
[ Css.flex (int 1)
, Css.fontSize (px 9)
, Css.margin2 (px 0) (px 12)
, Css.color (Css.hex "5A6378")
, Css.alignSelf Css.center
]
Expand Down
11 changes: 3 additions & 8 deletions source/popup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,11 @@ browser.tabs.query({active: true, currentWindow: true}).then((tabs) => {

app.ports.sendRequest.subscribe((request) => {
send(request);
})
})

app.ports.openOptionsPage.subscribe(() => {
browser.runtime.openOptionsPage();
})

app.ports.openPage.subscribe((url) => {
console.log("url", url);
browser.tabs.create({url});
})
})

function handleError(error) {
console.error('Error:', error.message);
Expand All @@ -32,7 +27,7 @@ browser.tabs.query({active: true, currentWindow: true}).then((tabs) => {

sending.then((message) => {
if(message && message.opts){
app.ports.receive.send(message.opts);
app.ports.receive.send(message.opts);
}
}, handleError);
}
Expand Down

0 comments on commit ff2560f

Please sign in to comment.