-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate web component to webkit #116
Open
saadnoor
wants to merge
28
commits into
master
Choose a base branch
from
Integrate-web-component-to-webkit-
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+184
−7
Open
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
5a74f99
webcomponents added as submodule
saadnoor 97e94d5
add - successful test implementation of avatar icons.
saadnoor 819fe75
Fix - get library via npm cdn
saadnoor fc62869
Removed submodule
saadnoor 2b9e0a3
Fix - submodule trace removal
saadnoor d793389
Add - avatar icon full implementation
saadnoor 828833e
Update - CDN Url for always getting the latest version webcomponent f…
saadnoor 259f142
fix - code review feedback
saadnoor d260e98
Merge remote-tracking branch 'origin/master' into Integrate-web-compo…
saadnoor 285a135
fix - code cleanup based of review
saadnoor d095629
Add - native event capture support
saadnoor 41dbc61
Add - showcase for avatar Icons
saadnoor ee7f5c1
Refactor - Code cleanup on showcase
saadnoor 2da8fe6
Refactor - Improved code of webcomponents (avatar icon)
saadnoor f7093fa
Fix - Updated icons
saadnoor d7ca88c
Merge remote-tracking branch 'origin/master' into Integrate-web-compo…
saadnoor 48ca83e
Fix - Added the dialog showcase again
saadnoor dd08c04
merge conflict resolved
saadnoor 0fe6673
Fix - Updated Id for avatar inital
saadnoor b536857
Fix - upper case issue with windows OS
saadnoor 564b64e
Fix - syntax error related method end and removed code duplication
saadnoor a109909
Fix - introduced redraw method for avatar initial based on review
saadnoor cb68faf
Fix - code cleanup for redraw design in avatar initial
saadnoor 8406c8e
Fix - removed code duplicacy
saadnoor 0ca6ae4
Fix - avatar initial spelling mistake
saadnoor d1e22f0
Refactor - Updated circular avatar and removed dynamic loader
saadnoor a56af55
Fix - Updated avatar initial with latest webcomponent changes
saadnoor 82db059
Merge remote-tracking branch 'origin/master' into Integrate-web-compo…
saadnoor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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,68 @@ | ||
use ::WebKit/demo/Showcase/ShowcaseWidget/ShowcaseWidget.bbj::ShowcaseWidget | ||
use ::WebKit/widgets/InputField/InputField.bbj::InputField | ||
use ::WebKit/framework/DialogPanel/DialogPanel.bbj::DialogPanel | ||
use ::WebKit/util/ClientUtil.bbj::ClientUtil | ||
use ::WebKit/widgets/WebComponents/WebComponents.bbj::WebComponents | ||
use ::WebKit/widgets/WebComponents/AvatarIcon/AvatarIcon.bbj::AvatarIcon | ||
|
||
class public AvatarInitial extends ShowcaseWidget | ||
|
||
field private BBjChildWindow window! | ||
field private BBjHtmlView avatarWnd! | ||
field private InputField avatarSize! | ||
field private InputField AvatarName! | ||
field private BBjCheckBox CbModal! | ||
field private BBjCheckBox CbCloseIcon! | ||
field private BBjCheckBox CbCloseOutside! | ||
field private BBjChildWindow panel! | ||
|
||
method public AvatarInitial(BBjWindow wnd!) | ||
#super!(wnd!) | ||
|
||
#setTitle("Avatar Initial Demo") | ||
#setIntro("This demo shows the Avatar initial") | ||
methodend | ||
method public void redraw(Boolean init!) | ||
#super!.redraw(init!) | ||
|
||
if init! then | ||
|
||
#panel! = #getContentWindow() | ||
#panel!.setStyle("display","flex") | ||
#panel!.setStyle("flex-direction","column") | ||
#panel!.setStyle("row-gap","10px") | ||
|
||
#AvatarName! = new InputField(#panel!) | ||
#AvatarName!.setLabel("Avatar Name") | ||
#AvatarName!.setInput("Stephan Wald") | ||
|
||
#avatarSize! = new InputField(#panel!) | ||
#avatarSize!.setLabel("Size") | ||
#avatarSize!.setInput("50") | ||
|
||
BtnShow! = #panel!.addButton(#panel!.getAvailableControlID(),0,0,0,0,"Create Avatar") | ||
BtnShow!.setStyle("display","flex") | ||
BtnShow!.setStyle("justify-content","flex-end") | ||
BtnShow!.setAttribute("theme","primary") | ||
BtnShow!.setAttribute("expanse","l") | ||
BtnShow!.setCallback(BBjAPI().ON_BUTTON_PUSH,#this!,"onShowDialog") | ||
|
||
endif | ||
methodend | ||
|
||
method public void onShowDialog(BBjButtonPushEvent ev!) | ||
|
||
if #avatarWnd! <> null() then | ||
#avatarWnd!.destroy() | ||
endif | ||
|
||
webComponents! = new AvatarIcon(#panel!) | ||
#avatarWnd! = CAST(BBjHtmlView, webComponents!.getView()) | ||
webComponents!.setName(#AvatarName!.getInput()) | ||
webComponents!.setSize(#avatarSize!.getInput()) | ||
|
||
#avatarWnd!.setStyle("margin","auto") | ||
|
||
methodend | ||
|
||
classend |
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,56 @@ | ||
use ::WebKit/widgets/WebComponents/WebComponents.bbj::WebComponents | ||
use ::WebKit/util/ClientUtil.bbj::ClientUtil | ||
|
||
class public AvatarIcon extends WebComponents | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This class is missing some setters to update the avatar values - See BBjWidget pattern |
||
field private static BBjTopLevelWindow Wnd! | ||
field private static BBjWindow wnd! | ||
field public static BBjNumber ON_AVATAR_INITIAL_CLICK = 1234 | ||
field public static BBjHtmlView htmlView! | ||
field public static BBjString size$ | ||
field public static BBjString name$ | ||
|
||
method public AvatarIcon() | ||
|
||
methodend | ||
|
||
method public AvatarIcon(BBjWindow canvas!) | ||
#wnd! = canvas! | ||
#redraw(1) | ||
methodend | ||
|
||
method private BBjHtmlView configureAvatarView(BBjHtmlView htmlView!) | ||
htmlView!.setCallback(BBjAPI.ON_NATIVE_JAVASCRIPT, #this!,"onClickAvatarInitial") | ||
htmlView!.setStyle("border","none") | ||
htmlView!.executeScript(#script$) | ||
methodret htmlView! | ||
methodend | ||
|
||
method public void onClickAvatarInitial(BBjNativeJavaScriptEvent ev!) | ||
#fireEvent(#ON_AVATAR_INITIAL_CLICK, ev!) | ||
methodend | ||
|
||
method public void redraw(Boolean init!) | ||
if init! > 0 then | ||
#htmlView! = #wnd!.addHtmlView(#wnd!.getAvailableControlID(),0,0,300,300,"") | ||
#htmlView!.setText("<avatar-initial size="""+#size$+""" name="""+name$+"""></avatar-initial>") | ||
#htmlView! = #configureAvatarView(#htmlView!) | ||
else | ||
#htmlView!.setText("<avatar-initial size="""+#size$+""" name="""+#name$+"""></avatar-initial>") | ||
fi | ||
methodend | ||
|
||
method public void setSize(BBjString size$) | ||
#size$ = size$ | ||
#redraw(0) | ||
methodend | ||
|
||
method public void setName(BBjString name$) | ||
#name$ = name$ | ||
#redraw(0) | ||
methodend | ||
|
||
method public BBjHtmlView getView() | ||
methodret #htmlView! | ||
methodend | ||
|
||
classend |
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,23 @@ | ||
use ::BBjWidget/BBjWidget.bbj::BBjWidget | ||
|
||
class public WebComponents extends BBjWidget | ||
|
||
field public BBjString script$ | ||
|
||
method public WebComponents() | ||
|
||
webComponentLibaryURL$ = STBL("web-component-library-url", err=*next) | ||
if webComponentLibaryURL$ = "" THEN | ||
webComponentLibaryURL$ = "https://cdn.jsdelivr.net/npm/webkit-web-components@latest/dist/web-component/web-component.esm.js" | ||
endif | ||
|
||
#script$ = "var script = document.createElement(""script"");" | ||
|
||
#script$ = #script$ + "script.setAttribute(""src"",""" + webComponentLibaryURL$ + """);" | ||
|
||
#script$ = #script$ + "script.setAttribute(""type"",""module"");" | ||
|
||
#script$ = #script$ + "document.head.appendChild(script)" | ||
methodend | ||
|
||
classend |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class should follow the BBjWidget pattern and not use some custom methods to use the widget (drawAvatarIcon)