How to create a polymer component library? - polymer

I can see how when you generate a new component that you also get some great documentation for the element. It includes detail about the properties and shows a code example of how to use the element.
What I'm trying to figure out is how to create a way for component library to find all my components and to show them in one place instead of just having individual pages that show each individual element.
Is that possible and if so, how?

webcomponents provide collections.
This is propably what you are looking for. Acording to manual
Creating a collection is easy. Simply create an empty GitHub repository with bower dependencies to all the elements or collections you want to include.
https://www.webcomponents.org/publish-collection

Related

Need to modify dynamic content after rendering without breaking bindings

I have a service which is called after events which trigger page content changes. This service currently inspects all the viewable HTML on the rendered page for key words and then creates links to a glossary where those key words are used. The page content comes from many sources, including various components and external textual data. Initially this was done by finding all the elements and then searching and modifying the nativeElement.innerHTML which works fine on events that trigger a complete page refresh; in components where the text is based on template bindings, those bindings won't update after the innerHTML changes. I know modifying the innerHTML is bad...
I've tried using the root ViewContainerRef, and ViewRef as starting points but don't see way to access all the page content including content in multi-level child components. Additionally some of the content is added via router-outlet. I was hoping to either dynamically modify the templates, or the rendered content while allowing the component to still render the content when data changes and my service to post process again. Some components are from imported libraries, or receive their data directly, so modifying the component source code doesn't seem like the best option.
I found that by temporarily disabling, forcing change detection, then enabling the component on a data change, it would cause the component to be removed and recreated with working bindings. This is not an optimal solution, but did work as an initial fix. I'll attempt to try the above solution.
Using a MutationObserver you can subscribe to changes of text in the document, then you can manipulate the DOM in a way that doesn't break Angular, i.e. don't change the innerHTML of a node, but rather, insert a sibling with the new HTML and hide (don't remove) the original node.
I've written a stackblitz that demonstrates this.
https://stackblitz.com/edit/angular-highlighter2
EDIT I created an Angular library with all the code, see https://www.npmjs.com/package/ngx-html-highlighter

Two menu widgets in Asidefirst zone in Orchard CMS

According to design specification I have to add two different menu lists with own Titles on AsideFirst zone in Orchard CMS.
As far as I'm concerned there is no need to create your own zones, it could be done via your own Content Definition and creating your own View for Menu widget. It that correct, can you please share some info about it?
BTW: How do I add my custom View for replacing some widgets? Should I simply add .cshtml file with proper naming?
Download the shape tracing tool, found here: gallery.orchardproject.net/List/Modules/… and use it to inspect your menus to find the correct names for alternate shapes to use. These will be created in your enabled theme.
I believe you can copy the view generated by Shape Tracing into one of your modules and place it in the Views folder, not Views/Parts/.

How to add Navlinks (or article path) in Mediawiki?

I have installed mediawiki 1.21. I am wondering how you can add navlinks (meaning the path to the page. Not sure if I am using the right work to describe it) at the top similar to the way it is in wikihow website? Below is an image so you know what I am referring to.. I find this to be very useful so users can understand where they are when reading an article.
I have created a custom skin and I have a Navlink DIV at the top where I would to show the path to that page there like: wiki -> xyz Category -> Article Name. I have semantic extension installed. Can this be achieved with that? Or is there another way to do it? How can I add the code directly in my skin.php file so this navlink is generated and listed depending on what page the user is on?
Terminology
This kind of feature is called a breadcrumb.
Has MediaWiki already this kind of feature?
Yes, for subpages.
A subpage is a page intitulated Quux/Foo/Bar in a namespace with the subpage feature enabled. By default, this is the User namespace for example, but not the main one (For example, on Wikipedia projects, we want to be able to use titles like AC/DC).
In this situation, a breadcrumb Quux > Foo will be printed.
This doesn't solve your issue, as you want to use categories, but it allows you if you write your custom code to know there already is some code somewhere doing that :)
Breadcrumbs extensions
Some extensions have been developed to solve this particular issue:
BreadCrumbs2
CategoryBreadcrumb
The first is more exhaustive and gives you more flexibility, the second simpler and so a good starting point to write a custom stuff.

What's the best way to convert HTML/JS project to GWT

A designer company have made a prototype of a web application using HTML/CSS/JS, with forms, menus, roll-over sub-menus ... Now I have to take this prototype and build GWT views using widgets.
My question is : Do I have to start from scratch and build every view with UIBuinders and integrate the CSS files or there is an easy way to do this ?
Thanks
My suggestion - don't generate HTML. This basically means not using GWT widgets (or only using widgets that provide .wrap(element) method.
I'm taking this approach with my projects and works very well. I put all HTML in one big file and then hide (display: none) all divs. Then I use gwtQuery to identify, copy and show relevant parts. qwtQuery is also used inject behavior (event handlers).

Node Tabs in Drupal 7

Can someone point me out a module for creating tabs in node?
I already try the QuickTabs but it uses the same tabs in all nodes i want to create different tabs in every node.
I found out that there has been Multigroup module which supported grouping CCK fields and repeating them but there isnt any version for drupal 7
I tried Node reference module but it only shows Links of referenced module not the whole content.
Can someone point me ideas on how to accomplish this maybe views can help some how but i dont know how to reference view with node.
Quicktabs will work fine, just override the look of the tabs with css and or tpl.php theme override files.
Or set up lots of different quicktabs and give them each a different display style, there are quite a few built in, and you can specify your own.
Or you could look at jQuery UI Tabs and use built in theme settings...