Skip to content
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

Changed whole node- and window-reference structure in the js-player. Now... #210

Closed
wants to merge 5 commits into from

Conversation

kai-wegner
Copy link
Contributor

... it's possible to embed a Sozi presentation and use the API to listen to events and fire them. Needs some testing for the media-plugin and might need some improvements when multiple presentations are embedded into a single page (untested). Standalone mode (without embedding) and embedded version is tested - could not find any issues.
I will commit a working sample for a embedded sozi presentation with a angular-js frontend (even mustaches in the SVG are supported!) next week.

Kind regards,
Kai

…Now it's possible to embed a Sozi presentation and use the API to listen to events and fire them. Needs some testing for the media-plugin and might need some improvements when multiple presentations are embedded into a single page (untested).
@aumouvantsillage
Copy link
Collaborator

Hi Kai.
Sorry for not answering earlier.

I am currently working on a new implementation of the editor in JavaScript and HTML.
Part of the player code will be reused in the editor, but this will require to reorganize the current JS sources.

On of my concerns is to be able to open a Sozi document either as a standalone SVG or "inlined" inside an HTML document, which seems to be what you are doing.
So I'm very interested by your proposal, even if I do not integrate it immediately. I will see how it can fit in the new design.

@kai-wegner
Copy link
Contributor Author

Hi,

check this out:
http://code.o511.de/soziPresentator/

I will move this to my sozi-fork this evening so you can check it out.

It's not finished yet and work in progress.
Press "p" to open the presentator where you can change values and the image on the fly (replace image1.png with image2.png will show the magic) you can also resize the presentation and turn off "your" default keybindings by disable the "presentation mode".

Yesterday I added "SnapSvg" for scaling, rotating and animating svg-elements.

Open up your javascript-developer console and try something like:

// Transform svg based on its ID 
svgJS.select("#text8953").transform("r180")
// get the description of the current frame (entered in inkscape)
// use "right-click --> object properties --> description" on the element you link in the sozi-plugin
// and enter your description
sozi.getCurrentFrameNotes() 

We should really have a Hangout to get us in sync. :-)

+ Now you can create additional viewports
+ Change of the viewport size and update of the display-area is now possible
+ Added reference of the current svg-element which is shown for having the description which was added to the element in inkscape at hand (use getCurrentFrame(), getCurrentFrameSVG() or getCurrentFrameNotes()-methods on the sozi-object

Added presentator which is a angularJS powered presentation file. You can set every parameter you want in a json file (default.json is used - if no other is specified) and use this parameters as {{mustaches}} in your svg. Even images are possible. Press "p" to activate the presentator-example.
Please deactivtate the "presentation mode" which will bypass the sozi keybinding-events as long as deactivated, so you don't get in trouble when typing "f","t" or using the arrow-keys.

Added SnapSVG - you can now transform every SVG-Element (or even groups) via javascript. Support for frame based interaction with scaling, rotating, hiding, aso. will be added in the next release. I'm not really sure about the implementation within inkscape - any comments are welcome.
@aumouvantsillage
Copy link
Collaborator

I will have a closer look at your work when I have a little time.
Thanks for sharing it.
Currently, it seems to work in Chrome but not in Firefox (I only get the "Loading presentation" message).

@kai-wegner
Copy link
Contributor Author

Yep, sorry didn't test it in firefox - I currently use chrome for development. I'll get this fixed today.
Update: Of course firefox don't like changing the data-attribute afterwards ... don't want change the stuff again if you plan to move the whole API into the SVG and provide functionality outside of the SVG also. ;-) So: Chrome support only

@kai-wegner kai-wegner closed this Feb 4, 2014
@kai-wegner kai-wegner reopened this Feb 4, 2014
@kai-wegner kai-wegner mentioned this pull request Feb 6, 2014
@aumouvantsillage
Copy link
Collaborator

Closing this pull request since it is no longer relevant for Sozi 15.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants