Closed marco9446 closed 8 years ago
Using iframe you have less difficulties in merging different stylesheet since the files used in the iframe are isolated from the others.
Ability to prevent errors in the editor that could block the entire web-app
It is heavier that non iframe approach and in a huge application could cause some performance problems.
Since an iframe is an external page embedded in an other web-site, it is more difficult to modify or access to an component via javascript from the main web-page.
In order to fetch all the custom components, users has to insert manually the path of metadata.html, a file necessary to specify the default style and behaviour of the elements dragged in the canvas. Inside the metadata.html, we can find 3 main tag types:
<x-meta id="core-ajax" label="Ajax" group="Core">...<x-meta>
The x-meta tag specifies basic properties of the component, such as its name and the group of appurtenance and act as a container for the other more specific properties<template>...<\template>
or <template id="imports">...<\template>
The template tag specify the appearance(markup) of the component after it has been dragged in the canvas.
Templates with id "imports", are used to specify all the dependencies of the current component<property name="method" kind="select" options="GET,POST,PUT,DELETE"></property>
The property tag is used to show all the specific properties related to that component inside the editor's property sectionWhenever an element is dragged from the editor palette, a function, paletteDrag
in designer-element.html is called. This function has the role to identify the object that is being dragged and check if the target is suitable for drop.
When the drag action reach a suitable target (over iframe), is been called a function paletteDrag
in design-frame.html passing the information contained in the metadata file of the dragged element and the coordinates.
The paletteDrag
function has the role to draw the element in correct position inside the iframe
Whenever an user clicks on an item dropped in the iframe, this idem is being selected and all its properties and attributes are analysed by the function calcAttributeValues
in dom-serializer.html
.
This function utilizes binding Reflection, a tool in the platform file of polymer 0.5 able to scan a custom element, return its attributes and bind to them.
calcAttributeValues
finally returns a json containing the attributes used to render the property editor in the sidenav.
Polymer designer 1.0 is the upgrade of version 0.5. It introduces more features and better management of the created components (even if is still very buggy). Google has decided to upgrade the editor since it wanted to have an enterprice ready app capable of creating, from scratch, entire web-sites. in order to do so, Google has introduced these features:
differently from 0.5, Designer 1.0 uses hydrolysis to extract and modify the attributes of the elements.
With Google form, Google utilized a different form factor for the creation of questions.
First of all the user has the ability to choose between different types of templates ( some pre-built questionnaires for the most common situations ) saving time and problem for the inexperts users.
The second key feature is the simplicity whereby the user can customize and create new questions. The questions can only be positioned one at the top/bottom of the others surely limiting the freedom of the users but improving the building process and the readability of the final survey.
The last useful feature of Google Forms is the fact that each question, when the user clicks on it, is highlighted and some buttons are added in order to customize the position and structure of the question, as shown in the figure below. This behavior, in my opinion, is easier to implement, but still very functional and intuitive, than the system used in Polymer Designer.
What's the format provided by hydrolysis?
When a user clicks on an element, this action fires a function "_selectionChanged" in designer-property-inspector.html.
This function finds all the element's properties by calling the "_getAnalysisInfo(tagName)" in designer-documents.html, a function that calls the hydrolisis function analyzer.elementsByTagName[tagName] that according to the specifics should return Object.<string, ElementDescriptor>
.
Finally, when someone change a property value, in order to be propagate in the DOM, the function "setAttribute" in DomCommandApplier.js is called
Milestone 1
1) Design decisions of Polymer Designer 0.5
2) Design decisions of Polymer Designer 1.0
3) Design decisions of Google Forms