Created
December 18, 2012 09:59
-
-
Save adou600/4326769 to your computer and use it in GitHub Desktop.
Based on https://github.com/bergie/create/blob/master/examples/example.html, this html file illustrates the bug that doesn't allow to use Chrome or Safari to edit content with createjs, with RDFa types other than http://rdfs.org/sioc or http://purl.org/dc/terms/. Here, http://schema.org types are used. The JS error: "Uncaught Error: No prefix fo…
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <title>Midgard Create example</title> | |
| <script src="../deps/jquery-1.7.1.min.js"></script> | |
| <script src="../deps/jquery-ui-1.8.18.custom.min.js"></script> | |
| <script src="../deps/underscore-min.js"></script> | |
| <script src="../deps/backbone-min.js"></script> | |
| <script src="../deps/vie-min.js"></script> | |
| <!-- Tags input is needed for the Tag widget --> | |
| <script src="../deps/jquery.tagsinput.min.js"></script> | |
| <!-- rdfQuery and annotate are only needed for the Hallo | |
| annotations plugin --> | |
| <script src="../deps/jquery.rdfquery.min.js"></script> | |
| <script src="../deps/annotate-min.js"></script> | |
| <script src="../deps/rangy-core-1.2.3.js"></script> | |
| <script src="../deps/hallo-min.js"></script> | |
| <script src="./create.js"></script> | |
| <script> | |
| jQuery(document).ready(function () { | |
| jQuery('body').midgardCreate({ | |
| url: function () { | |
| return 'javascript:false;'; | |
| }, | |
| metadata: { | |
| midgardTags: {} | |
| }, | |
| collectionWidgets: { | |
| 'default': 'midgardCollectionAdd', | |
| 'skos:related': null | |
| }, | |
| stanbolUrl: 'http://dev.iks-project.eu:8081'/*, | |
| language: 'pt_BR'*/ | |
| }); | |
| // Set a simpler editor for title fields | |
| jQuery('body').midgardCreate('configureEditor', 'title', 'halloWidget', { | |
| plugins: { | |
| halloformat: {}, | |
| halloblacklist: { | |
| tags: ['br'] | |
| } | |
| } | |
| }); | |
| jQuery('body').midgardCreate('setEditorForProperty', 'dcterms:title', 'title'); | |
| // Disable editing of author fields | |
| jQuery('body').midgardCreate('setEditorForProperty', 'dcterms:author', null); | |
| }); | |
| // Fake Backbone.sync since there is no server to communicate with | |
| Backbone.sync = function(method, model, options) { | |
| if (console && console.log) { | |
| console.log('Model contents', model.toJSONLD()); | |
| } | |
| options.success(model); | |
| }; | |
| </script> | |
| <link rel="stylesheet" href="./font-awesome/css/font-awesome.css" | |
| /> | |
| <link rel="stylesheet" href="../themes/create-ui/css/create-ui.css" | |
| /> | |
| <link rel="stylesheet" href="../themes/midgard-notifications/midgardnotif.css" | |
| /> | |
| <link rel="stylesheet" href="demo.css" /> | |
| </head> | |
| <body> | |
| <div id="content"> | |
| <div id="main"> | |
| <div xmlns:dcterms="http://purl.org/dc/terms/" xmlns:sc="http://schema.org/" xmlns:cw="http://schema.org/CreativeWork/" xmlns:ar="http://schema.org/Article/" typeof="sc:WebPage" about="/cms/simple/get-started"> | |
| <h2 property="cw:headline">Content title</h2> | |
| <div property="cw:text" > | |
| <p> | |
| This is a content | |
| </p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment