|
4
|
|
|
*/(function(t,e){"use strict";t.widget("Midgard.midgardCreate",{options:{toolbar:"full",saveButton:null,state:"browse",highlight:!0,highlightColor:"#67cc08",editorWidgets:{"default":"hallo"},editorOptions:{hallo:{widget:"halloWidget"}},collectionWidgets:{"default":"midgardCollectionAdd"},url:function(){},storagePrefix:"node",workflows:{url:null},notifications:{},vie:null,domService:"rdfa",stanbolUrl:null,dbPediaUrl:null,metadata:{},buttonContainer:".create-ui-toolbar-statustoolarea .create-ui-statustools",templates:{buttonContent:'<%= label %> <i class="icon-<%= icon %>"></i>',button:'<li id="<%= id %>"><a class="create-ui-btn"><%= buttonContent %></a></li>'},localize:function(t,e){return window.midgardCreate.localize(t,e)},language:null},_create:function(){this.vie=this._setupVIE(this.options),this.domService=this.vie.service(this.options.domService);var e=this;window.setTimeout(function(){e._checkSession()},10),this.options.language||(this.options.language=t("html").attr("lang")),this._enableToolbar(),this._enableMetadata(),this._saveButton(),this._editButton(),this._prepareStorage(),this.element.midgardWorkflows&&this.element.midgardWorkflows(this.options.workflows),this.element.midgardNotifications&&this.element.midgardNotifications(this.options.notifications),this._bindShortcuts()},destroy:function(){this.element.midgardStorage("destroy"),this.element.midgardToolbar("destroy"),this.domService.findSubjectElements(this.element).each(function(){t(this).midgardEditable("destroy")}),this.element.midgardWorkflows&&this.element.midgardWorkflows("destroy"),this.element.midgardNotifications&&this.element.midgardNotifications("destroy"),_.isEmpty(this.options.metadata)||this.element.midgardMetadata("destroy"),t.Widget.prototype.destroy.call(this)},_setupVIE:function(t){var e;return e=t.vie?t.vie:new VIE,e.hasService(this.options.domService)||"rdfa"!==this.options.domService||e.use(new e.RdfaService),!e.hasService("stanbol")&&t.stanbolUrl&&e.use(new e.StanbolService({proxyDisabled:!0,url:t.stanbolUrl})),!e.hasService("dbpedia")&&t.dbPediaUrl&&e.use(new e.DBPediaService({proxyDisabled:!0,url:t.dbPediaUrl})),e},_prepareStorage:function(){this.element.midgardStorage({vie:this.vie,url:this.options.url,localize:this.options.localize,language:this.options.language,storagePrefix:this.options.storagePrefix});var e=this;this.element.on("midgardstoragesave",function(){t("#midgardcreate-save a").html(_.template(e.options.templates.buttonContent,{label:e.options.localize("Saving",e.options.language),icon:"upload"}))}),this.element.on("midgardstoragesaved midgardstorageerror",function(){t("#midgardcreate-save a").html(_.template(e.options.templates.buttonContent,{label:e.options.localize("Save",e.options.language),icon:"ok"}))})},_init:function(){this.setState(this.options.state)},setState:function(t){this._setOption("state",t),"edit"===t?this._enableEdit():this._disableEdit(),this._setEditButtonState(t)},setToolbar:function(t){this.options.toolbar=t,(this.element.data("Midgard-midgardToolbar")||this.element.data("midgardToolbar"))&&this.element.midgardToolbar("setDisplay",t)},showNotification:function(t){return this.element.midgardNotifications?this.element.midgardNotifications("create",t):e},configureEditor:function(t,e,i){this.options.editorOptions[t]={widget:e,options:i}},setEditorForContentType:function(t,i){if(this.options.editorOptions[i]===e&&null!==i)throw Error("No editor "+i+" configured");this.options.editorWidgets[t]=i},setEditorForProperty:function(t,i){if(this.options.editorOptions[i]===e&&null!==i)throw Error("No editor "+i+" configured");this.options.editorWidgets[t]=i},_checkSession:function(){if(window.sessionStorage){var t=this.options.storagePrefix+"Midgard.create.toolbar";window.sessionStorage.getItem(t)&&this.setToolbar(window.sessionStorage.getItem(t));var e=this.options.storagePrefix+"Midgard.create.state";window.sessionStorage.getItem(e)&&this.setState(window.sessionStorage.getItem(e)),this.element.on("midgardcreatestatechange",function(t,i){window.sessionStorage.setItem(e,i.state)})}},_bindShortcuts:function(){if(window.Mousetrap){var t=this;window.Mousetrap.bind(["command+e","ctrl+e"],function(){"edit"!==t.options.state&&t.setState("edit")}),window.Mousetrap.bind("esc",function(e){"browse"!==t.options.state&&(e.stopPropagation(),t.setState("browse"))}),window.Mousetrap.bind(["command+s","ctrl+s"],function(e){e.preventDefault(),t.options.saveButton&&(t.options.saveButton.hasClass("ui-state-disabled")||t.options.saveButton.click())})}},_saveButton:function(){if(this.options.saveButton)return this.options.saveButton;var e=this;t(this.options.buttonContainer,this.element).append(t(_.template(this.options.templates.button,{id:"midgardcreate-save",buttonContent:_.template(this.options.templates.buttonContent,{label:e.options.localize("Save",e.options.language),icon:"ok"})}))),this.options.saveButton=t("#midgardcreate-save",this.element),this.options.saveButton.hide(),this.options.saveButton.click(function(){e.element.midgardStorage("saveRemoteAll")}),this.element.on("midgardeditablechanged midgardstorageloaded",function(){e.options.saveButton.button({disabled:!1})}),this.element.on("midgardstoragesaved",function(){e.options.saveButton.button({disabled:!0})}),this.element.on("midgardeditableenable",function(){e.options.saveButton.button({disabled:!0}),e.options.saveButton.show()}),this.element.on("midgardeditabledisable",function(){e.options.saveButton.hide()})},_editButton:function(){var i=this;t(this.options.buttonContainer,this.element).append(t(_.template(this.options.templates.button,{id:"midgardcreate-edit",buttonContent:""}))),t("#midgardcreate-edit",this.element).on("click",function(){return"edit"===i.options.state?(i.setState("browse"),e):(i.setState("edit"),e)})},_setEditButtonState:function(e){var i=this,o={edit:_.template(this.options.templates.buttonContent,{label:i.options.localize("Cancel",i.options.language),icon:"remove"}),browse:_.template(this.options.templates.buttonContent,{label:i.options.localize("Edit",i.options.language),icon:"edit"})},n=t("#midgardcreate-edit a",this.element);n&&("edit"===e&&n.addClass("selected"),n.html(o[e]))},_enableToolbar:function(){var t=this;this.element.on("midgardtoolbarstatechange",function(e,i){t.setToolbar(i.display),window.sessionStorage&&window.sessionStorage.setItem(t.options.storagePrefix+"Midgard.create.toolbar",i.display)}),this.element.midgardToolbar({display:this.options.toolbar,vie:this.vie})},_enableMetadata:function(){_.isEmpty(this.options.metadata)||t(".create-ui-tool-metadataarea",this.element).midgardMetadata({vie:this.vie,localize:this.options.localize,language:this.options.language,editors:this.options.metadata,createElement:this.element,editableNs:"midgardeditable"})},_enableEdit:function(){this._setOption("state","edit");var e=this,i={toolbarState:e.options.toolbar,disabled:!1,vie:e.vie,domService:e.options.domService,widgets:e.options.editorWidgets,editors:e.options.editorOptions,collectionWidgets:e.options.collectionWidgets,localize:e.options.localize,language:e.options.language};e.options.enableEditor&&(i.enableEditor=e.options.enableEditor),e.options.disableEditor&&(i.disableEditor=e.options.disableEditor),this.domService.findSubjectElements(this.element).each(function(){var o=this;if(e.options.highlight){var n=function(i,n){t(n.element).is(":visible")&&n.entityElement.get(0)===o&&(window.Mousetrap&&n.element.addClass("mousetrap"),n.element.stop(!0,!0),n.element.effect("highlight",{color:e.options.highlightColor},3e3))};t(this).on("midgardeditableenableproperty",n)}t(this).on("midgardeditabledisable",function(){t(this).off("midgardeditableenableproperty",n)}),t(this).midgardEditable(i)}),this._trigger("statechange",null,{state:"edit"})},_disableEdit:function(){var e=this,i={disabled:!0,vie:e.vie,domService:e.options.domService,editorOptions:e.options.editorOptions,localize:e.options.localize,language:e.options.language};this.domService.findSubjectElements(this.element).each(function(){t(this).midgardEditable(i),t(this).removeClass("ui-state-disabled")}),this._setOption("state","browse"),this._trigger("statechange",null,{state:"browse"})}})})(jQuery),function(t,e){"use strict";t.widget("Midgard.midgardEditable",{options:{propertyEditors:{},collections:[],model:null,propertyEditorWidgetsConfiguration:{hallo:{widget:"halloWidget",options:{}}},propertyEditorWidgets:{"default":"hallo"},collectionWidgets:{"default":"midgardCollectionAdd"},toolbarState:"full",vie:null,domService:"rdfa",predicateSelector:"[property]",disabled:!1,localize:function(t,e){return window.midgardCreate.localize(t,e)},language:null,state:null,acceptStateChange:!0,stateChange:null,decorateEditableEntity:null,decoratePropertyEditor:null,editables:[],editors:{},widgets:{}},_params:function(t,e){var i={entity:this.options.model,editableEntity:this,entityElement:this.element,editable:this,element:this.element,instance:this.options.model},o=t?{predicate:t,propertyEditor:this.options.propertyEditors[t],propertyElement:this.options.propertyEditors[t].element,property:t,element:this.options.propertyEditors[t].element}:{};return _.extend(i,o,e)},_create:function(){if(this.options.widgets&&(this.options.propertyEditorWidgets=_.extend(this.options.propertyEditorWidgets,this.options.widgets)),this.options.editors&&(this.options.propertyEditorWidgetsConfiguration=_.extend(this.options.propertyEditorWidgetsConfiguration,this.options.editors)),this.vie=this.options.vie,this.domService=this.vie.service(this.options.domService),!this.options.model){var t=this;this.vie.load({element:this.element}).from(this.options.domService).execute().done(function(e){t.options.model=e[0]})}_.isFunction(this.options.decorateEditableEntity)&&this.options.decorateEditableEntity(this._params())},_init:function(){return this.options.widgets&&(this.options.propertyEditorWidgets=_.extend(this.options.propertyEditorWidgets,this.options.widgets)),this.options.editors&&(this.options.propertyEditorWidgetsConfiguration=_.extend(this.options.propertyEditorWidgetsConfiguration,this.options.editors)),this.options.disabled===!0?(this.setState("inactive"),e):this.options.disabled===!1&&"inactive"===this.options.state?(this.setState("candidate"),e):(this.options.disabled=!1,this.options.state?(this.setState(this.options.state),e):(this.setState("candidate"),e))},setState:function(t,i,o,n){var a=this.options.state,s=t;if(s!==a){if(this.options.acceptStateChange===e||!_.isFunction(this.options.acceptStateChange))return this._doSetState(a,s,i,o),_.isFunction(n)&&n(!0),e;var r=this;this.options.acceptStateChange(a,s,i,o,function(t){t&&r._doSetState(a,s,i,o),_.isFunction(n)&&n(t)})}},getState:function(){return this.options.state},_doSetState:function(t,e,i,o){this.options.state=e,"inactive"===e?this.disable():null!==t&&"inactive"!==t||"inactive"===e||this.enable(),this._trigger("statechange",null,this._params(i,{previous:t,current:e,context:o}))},findEditablePredicateElements:function(e){this.domService.findPredicateElements(this.options.model.id,t(this.options.predicateSelector,this.element),!1).each(e)},getElementPredicate:function(t){return this.domService.getElementPredicate(t)},enable:function(){var e=this;this.options.model&&(this.findEditablePredicateElements(function(){e._enablePropertyEditor(t(this))}),this._trigger("enable",null,this._params()),this.vie.view&&this.vie.view.Collection&&_.each(this.domService.views,function(t){if(t instanceof this.vie.view.Collection&&this.options.model===t.owner){var i=t.collection.predicate,o=_.clone(this.options);o.state=null;var n=this.enableCollection({model:this.options.model,collection:t.collection,property:i,definition:this.getAttributeDefinition(i),view:t,element:t.el,vie:e.vie,editableOptions:o});e.options.collections.push(n)}},this))},disable:function(){_.each(this.options.propertyEditors,function(t){this.disablePropertyEditor({widget:this,editable:t,entity:this.options.model,element:t.element})},this),this.options.propertyEditors={},this.options.editables=[],_.each(this.options.collections,function(t){var e=_.clone(this.options);e.state="inactive",this.disableCollection({widget:this,model:this.options.model,element:t,vie:this.vie,editableOptions:e})},this),this.options.collections=[],this._trigger("disable",null,this._params())},_enablePropertyEditor:function(t){var e=this,i=this.getElementPredicate(t);if(!i)return!0;if(this.options.model.get(i)instanceof Array)return!0;var o=this.enablePropertyEditor({widget:this,element:t,entity:this.options.model,property:i,vie:this.vie,decorate:this.options.decoratePropertyEditor,decorateParams:_.bind(this._params,this),changed:function(t){e.setState("changed",i);var o={};o[i]=t,e.options.model.set(o,{silent:!0}),e._trigger("changed",null,e._params(i))},activating:function(){e.setState("activating",i)},activated:function(){e.setState("active",i),e._trigger("activated",null,e._params(i))},deactivated:function(){e.setState("candidate",i),e._trigger("deactivated",null,e._params(i))}});if(o){var n=o.data("createWidgetName");this.options.propertyEditors[i]=o.data("Midgard-"+n),this.options.propertyEditors[i]||(this.options.propertyEditors[i]=o.data(n)),this.options.editables.push(o),this._trigger("enableproperty",null,this._params(i))}},_propertyEditorName:function(t){if(this.options.propertyEditorWidgets[t.property]!==e)return this.options.propertyEditorWidgets[t.property];var i="default",o=this.getAttributeDefinition(t.property);return o&&(i=o.range[0]),this.options.propertyEditorWidgets[i]!==e?this.options.propertyEditorWidgets[i]:this.options.propertyEditorWidgets["default"]},_propertyEditorWidget:function(t){return this.options.propertyEditorWidgetsConfiguration[t].widget},_propertyEditorOptions:function(t){return this.options.propertyEditorWidgetsConfiguration[t].options},getAttributeDefinition:function(t){var e=this.options.model.get("@type");if(e&&e.attributes)return e.attributes.get(t)},enableEditor:function(t){return this.enablePropertyEditor(t)},enablePropertyEditor:function(e){var i=this._propertyEditorName(e);if(null!==i){var o=this._propertyEditorWidget(i);if(e.editorOptions=this._propertyEditorOptions(i),e.toolbarState=this.options.toolbarState,e.disabled=!1,e.editorName=i,e.editorWidget=o,"function"!=typeof t(e.element)[o])throw Error(o+" widget is not available");return t(e.element)[o](e),t(e.element).data("createWidgetName",o),t(e.element)}},disableEditor:function(t){return this.disablePropertyEditor(t)},disablePropertyEditor:function(e){e.element[e.editable.widgetName]({disabled:!0}),t(e.element).removeClass("ui-state-disabled"),e.element.is(":focus")&&e.element.blur()},collectionWidgetName:function(t){if(this.options.collectionWidgets[t.property]!==e)return this.options.collectionWidgets[t.property];var i="default",o=this.getAttributeDefinition(t.property);return o&&(i=o.range[0]),this.options.collectionWidgets[i]!==e?this.options.collectionWidgets[i]:this.options.collectionWidgets["default"]},enableCollection:function(e){var i=this.collectionWidgetName(e);if(null!==i){if(e.disabled=!1,"function"!=typeof t(e.element)[i])throw Error(i+" widget is not available");return t(e.element)[i](e),t(e.element).data("createCollectionWidgetName",i),t(e.element)}},disableCollection:function(e){var i=t(e.element).data("createCollectionWidgetName");null!==i&&(e.disabled=!0,i&&(t(e.element)[i](e),t(e.element).removeClass("ui-state-disabled")))}})}(jQuery),function(t){"use strict";t.widget("Midgard.midgardMetadata",{contentArea:null,editorElements:{},options:{vie:null,templates:{button:'<button class="create-ui-btn"><i class="icon-<%= icon %>"></i> <%= label %></button>',contentArea:'<div class="dropdown-menu"></div>'},localize:function(t,e){return window.midgardCreate.localize(t,e)},language:null,createElement:"body",editableNs:"midgardeditable"},_create:function(){this._render()},_init:function(){this._prepareEditors(),this._bindEditables()},_prepareEditors:function(){_.each(this.options.editors,function(e,i){var o=t("<div></div>").addClass(i);if(this.contentArea.append(o),!_.isFunction(o[i]))throw Error("Metadata editor widget "+i+" is not available");_.extend(e,{vie:this.options.vie,language:this.options.language,localize:this.options.localize,createElement:this.options.createElement,editableNs:this.options.editableNs}),o[i](e),this.editorElements[i]=o},this)},activateEditors:function(t){this.element.show(),_.each(this.options.editors,function(e,i){this.editorElements[i]&&this.editorElements[i][i]("activate",t)},this)},_bindEditables:function(){var e=this,i=t(this.options.createElement);i.on(this.options.editableNs+"activated",function(t,i){e.activateEditors({entity:i.entity,entityElement:i.entityElement,predicate:i.predicate})})},_prepareEditorArea:function(){var e=t(_.template(this.options.templates.contentArea,{}));return e.hide(),e},_render:function(){var e=this,i=t(_.template(this.options.templates.button,{icon:"info-sign",label:this.options.localize("Metadata",this.options.language)}));this.element.empty(),this.element.append(i),this.element.hide(),this.contentArea=this._prepareEditorArea(i),i.after(this.contentArea),i.on("click",function(t){t.preventDefault();var o=i.position();e.contentArea.css({position:"absolute",left:o.left}),e.contentArea.toggle()})}})}(jQuery),function(t){"use strict";var e=[],i=function(i,o){var n={class_prefix:"midgardNotifications",timeout:3e3,auto_show:!0,body:"",bindTo:null,gravity:"T",effects:{onShow:function(t,e){t.animate({opacity:"show"},600,e)},onHide:function(t,e){t.animate({opacity:"hide"},600,e)}},actions:[],callbacks:{}},a={},s={},r=null,l=null,d=null,c=i,u=null,g={constructor:function(t){a=_.extend(n,t||{}),s={container:a.class_prefix+"-container",item:{wrapper:a.class_prefix+"-item",arrow:a.class_prefix+"-arrow",disregard:a.class_prefix+"-disregard",content:a.class_prefix+"-content",actions:a.class_prefix+"-actions",action:a.class_prefix+"-action"}},this._generate()},getId:function(){return l},getElement:function(){return r},_generate:function(){var i,o,n=this,d=null;if(r=i=t('<div class="'+s.item.wrapper+'-outer"/>'),i.css({display:"none"}),o=t('<div class="'+s.item.wrapper+'-inner"/>'),o.appendTo(i),a.bindTo){i.addClass(s.item.wrapper+"-binded");var g=t('<div class="'+s.item.arrow+'"/>');g.appendTo(i)}else i.addClass(s.item.wrapper+"-normal");if(d=t('<div class="'+s.item.content+'"/>'),d.html(a.body),d.appendTo(o),a.actions.length){var p=t('<div class="'+s.item.actions+'"/>');p.appendTo(o),t.each(a.actions,function(e,i){var o=t('<button name="'+i.name+'" class="button-'+i.name+'">'+i.label+"</button>").button();o.on("click",function(t){u?i.cb(t,u,n):i.cb(t,n)}),i.className&&o.addClass(i.className),p.append(o)})}r.on("click",function(t){a.callbacks.onClick?a.callbacks.onClick(t,n):u||n.close()}),a.auto_show&&this.show(),this._setPosition(),l=e.push(this),c.append(r)},_calculatePositionForGravity:function(t,e,i,o){switch(t.find("."+s.item.arrow).addClass(s.item.arrow+"_"+e),e){case"TL":return{left:i.left,top:i.top+i.height+"px"};case"TR":return{left:i.left+i.width-o.width+"px",top:i.top+i.height+"px"};case"BL":return{left:i.left+"px",top:i.top-o.height+"px"};case"BR":return{left:i.left+i.width-o.width+"px",top:i.top-o.height+"px"};case"LT":return{left:i.left+i.width+"px",top:i.top+"px"};case"LB":return{left:i.left+i.width+"px",top:i.top+i.height-o.height+"px"};case"RT":return{left:i.left-o.width+"px",top:i.top+"px"};case"RB":return{left:i.left-o.width+"px",top:i.top+i.height-o.height+"px"};case"T":return{left:i.left+i.width/2-o.width/2+"px",top:i.top+i.height+"px"};case"R":return{left:i.left-o.width+"px",top:i.top+i.height/2-o.height/2+"px"};case"B":return{left:i.left+i.width/2-o.width/2+"px",top:i.top-o.height+"px"};case"L":return{left:i.left+i.width+"px",top:i.top+i.height/2-o.height/2+"px"}}},_isFixed:function(t){if(t===document)return!1;if("fixed"===t.css("position"))return!0;var e=t.offsetParent();return e.get(0)===t.get(0)?!1:this._isFixed(e)},_setPosition:function(){var i;if(a.bindTo){var o={width:r.width()?r.width():280,height:r.height()?r.height():109};d=t(a.bindTo);var n={},s={width:d.outerWidth(),height:d.outerHeight()};return this._isFixed(d)?(n.position="fixed",s.left=d.offset().left,s.top=d.position().top):(n.position="absolute",s.left=d.offset().left,s.top=d.offset().top),i=this._calculatePositionForGravity(r,a.gravity,s,o),n.top=i.top,n.left=i.left,r.css(n),undefined}a.position||(a.position="top right");var l=t(".create-ui-toolbar-wrapper").outerHeight(!0)+6;i={position:"fixed"};var c,u=function(e){var i=0;return t.each(e,function(t,e){e&&(i+=e.getElement().height())}),i};a.position.match(/top/)&&(i.top=l+u(e)+"px"),a.position.match(/bottom/)&&(i.bottom=e.length-1*c.height()+c.height()+10+"px"),a.position.match(/right/)&&(i.right="20px"),a.position.match(/left/)&&(i.left="20px"),r.css(i)},show:function(){var e,i,o,n,s,l,d=this;if(a.callbacks.beforeShow&&a.callbacks.beforeShow(d),a.bindTo){var c=t(a.bindTo);e=t(window).scrollTop(),i=t(window).scrollTop()+t(window).height(),n=parseFloat(r.offset().top,10),s=c.offset().top,l=c.outerHeight(),n>s&&(n=s),o=parseFloat(r.offset().top,10)+r.height(),s+l>o&&(o=s+l)}a.timeout>0&&!a.actions.length&&window.setTimeout(function(){d.close()},a.timeout),a.bindTo&&(e>n||n>i)||e>o||o>i?t("html, body").stop().animate({scrollTop:n},500,"easeInOutExpo",function(){a.effects.onShow(r,function(){a.callbacks.afterShow&&a.callbacks.afterShow(d)})}):a.effects.onShow(r,function(){a.callbacks.afterShow&&a.callbacks.afterShow(d)})},close:function(){var t=this;a.callbacks.beforeClose&&a.callbacks.beforeClose(t),a.effects.onHide(r,function(){a.callbacks.afterClose&&a.callbacks.afterClose(t),t.destroy()})},destroy:function(){var i=this;t.each(e,function(t,o){o&&o.getId()==i.getId()&&delete e[t]}),t(r).remove()},setStory:function(t){u=t},setName:function(t){r.addClass(s.item.wrapper+"-custom-"+t),this.name=t}};return g.constructor(o),delete g.constructor,g},o=function(e,o){var n={},a={},s={},r=null,l=null,d=null,c=null,u={constructor:function(t){a=_.extend(n,t||{})},setStoryline:function(e){var i={content:"",actions:[],show_actions:!0,notification:{},back:null,back_label:null,forward:null,forward_label:null,beforeShow:null,afterShow:null,beforeClose:null,afterClose:null};s={},c=null,r=null,l=null,d=null;var o=this;return t.each(e,function(e,n){var a=t.extend({},i,n);a.name=e;var c=t.extend({},i.notification,n.notification||{});if(c.body=a.content,c.auto_show=!1,a.actions.length&&(c.delay=0),c.callbacks={beforeShow:function(t){a.beforeShow&&a.beforeShow(t,o)},afterShow:function(t){a.afterShow&&a.afterShow(t,o)},beforeClose:function(t){a.beforeClose&&a.beforeClose(t,o)},afterClose:function(t){a.afterClose&&a.afterClose(t,o),r=t.name}},c.actions=[],a.show_actions){if(a.back){var u=a.back_label;u||(u="Back"),c.actions.push({name:"back",label:u,cb:function(t,e){e.previous()}})}if(a.forward){var g=a.forward_label;g||(g="Back"),c.actions.push({name:"forward",label:g,cb:function(t,e){e.next()}})}a.actions.length&&t.each(a.actions,function(t){c.actions.push(a.actions[t])})}l||(l=e),d=e,a.notification=c,s[e]=a}),s},start:function(){this._showNotification(s[l])},stop:function(){c.close(),c=null,r=null},next:function(){if(c.close(),s[c.name].forward){var t=s[c.name].forward;this._showNotification(s[t])}else this._showNotification(s[d])},previous:function(){if(r)if(c.close(),s[c.name].back){var t=s[c.name].back;this._showNotification(s[t])}else this._showNotification(s[r]);else this.stop()},_showNotification:function(e){return c=new i(t("body"),e.notification),c.setStory(this),c.setName(e.name),c.show(),c}};return u.constructor(e),delete u.constructor,o&&u.setStoryline(o),u},n={start:{content:"Welcome to CreateJS tutorial!",forward:"toolbar_toggle",forward_label:"Start tutorial",actions:[{name:"quit",label:"Quit",cb:function(t,e){e.stop()}}]},toolbar_toggle:{content:"This is the CreateJS toolbars toggle button.<br />You can hide and show the full toolbar by clicking here.<br />Try it now.",forward:"edit_button",show_actions:!1,afterShow:function(e,i){t("body").on("midgardtoolbarstatechange",function(e,o){"full"==o.display&&(i.next(),t("body").off("midgardtoolbarstatechange"))})},notification:{bindTo:"#midgard-bar-hidebutton",timeout:0,gravity:"TL"}},edit_button:{content:"This is the edit button.<br />Try it now.",show_actions:!1,afterShow:function(e,i){t("body").on("midgardcreatestatechange",function(e,o){"edit"==o.state&&(i.next(),t("body").off("midgardcreatestatechange"))})},notification:{bindTo:".ui-button[for=midgardcreate-edit]",timeout:0,gravity:"TL"}},end:{content:"Thank you for watching!<br />Happy content editing times await you!"}};t.widget("Midgard.midgardNotifications",{options:{notification_defaults:{class_prefix:"midgardNotifications",position:"top right"}},_create:function(){this.classes={container:this.options.notification_defaults.class_prefix+"-container"},t("."+this.classes.container,this.element).length?(this.container=t("."+this.classes.container,this.element),this._parseFromDOM()):(this.container=t('<div class="'+this.classes.container+'" />'),this.element.append(this.container))},destroy:function(){this.container.remove(),t.Widget.prototype.destroy.call(this)},_init:function(){},_parseFromDOM:function(){},showStory:function(t,e){var i=new o(t,e);return i.start(),i},create:function(e){e=t.extend({},this.options.notification_defaults,e||{});var o=new i(this.container,e);return o.show(),o},showTutorial:function(){this.showStory({},n)}})}(jQuery),function(t){"use strict";t.widget("Midgard.midgardStorage",{saveEnabled:!0,options:{localStorage:!1,storagePrefix:"",removeLocalstorageOnIgnore:!0,vie:null,url:"",autoSave:!1,autoSaveInterval:5e3,saveReferencedNew:!1,saveReferencedChanged:!1,editableNs:"midgardeditable",editSelector:"#midgardcreate-edit a",localize:function(t,e){return window.midgardCreate.localize(t,e)},language:null},_create:function(){var t=this;this.changedModels=[],window.localStorage&&(this.options.localStorage=!0),this.vie=this.options.vie,this.vie.entities.on("add",function(e){e.url=t.options.url,e.toJSON=e.toJSONLD}),t._bindEditables(),t.options.autoSave&&t._autoSave()},_autoSave:function(){var t=this;t.saveEnabled=!0;var e=function(){t.saveEnabled&&0!==t.changedModels.length&&t.saveRemoteAll({silent:!0})},i=window.setInterval(e,t.options.autoSaveInterval);this.element.on("startPreventSave",function(){i&&(window.clearInterval(i),i=null),t.disableAutoSave()}),this.element.on("stopPreventSave",function(){i||(i=window.setInterval(e,t.options.autoSaveInterval)),t.enableAutoSave()})},enableAutoSave:function(){this.saveEnabled=!0},disableAutoSave:function(){this.saveEnabled=!1},_bindEditables:function(){var t=this;this.restorables=[];var e;t.element.on(t.options.editableNs+"changed",function(e,i){-1===_.indexOf(t.changedModels,i.instance)&&t.changedModels.push(i.instance),t._saveLocal(i.instance)}),t.element.on(t.options.editableNs+"disable",function(e,i){t.revertChanges(i.instance)}),t.element.on(t.options.editableNs+"enable",function(e,i){i.instance._originalAttributes||(i.instance._originalAttributes=_.clone(i.instance.attributes)),!i.instance.isNew()&&t._checkLocal(i.instance)&&t.restorables.push(i.instance)}),t.element.on("midgardcreatestatechange",function(i,o){return"browse"===o.state||0===t.restorables.length?(t.restorables=[],e&&e.close(),undefined):(e=t.checkRestore(),undefined)}),t.element.on("midgardstorageloaded",function(e,i){-1===_.indexOf(t.changedModels,i.instance)&&t.changedModels.push(i.instance)})},checkRestore:function(){var e=this;if(0!==e.restorables.length){var i,o;i=1===e.restorables.length?_.template(e.options.localize("localModification",e.options.language),{label:e.restorables[0].getSubjectUri()}):_.template(e.options.localize("localModifications",e.options.language),{number:e.restorables.length});var n=function(){e.restoreLocalAll(),o.close()},a=function(){e.ignoreLocal(),o.close()};return o=t("body").midgardNotifications("create",{bindTo:e.options.editSelector,gravity:"TR",body:i,timeout:0,actions:[{name:"restore",label:e.options.localize("Restore",e.options.language),cb:n,className:"create-ui-btn"},{name:"ignore",label:e.options.localize("Ignore",e.options.language),cb:a,className:"create-ui-btn"}],callbacks:{beforeShow:function(){window.Mousetrap&&(window.Mousetrap.bind(["command+shift+r","ctrl+shift+r"],function(t){t.preventDefault(),n()}),window.Mousetrap.bind(["command+shift+i","ctrl+shift+i"],function(t){t.preventDefault(),a()}))},afterClose:function(){window.Mousetrap&&(window.Mousetrap.unbind(["command+shift+r","ctrl+shift+r"]),window.Mousetrap.unbind(["command+shift+i","ctrl+shift+i"]))}}})}},restoreLocalAll:function(){_.each(this.restorables,function(t){this.readLocal(t)},this),this.restorables=[]},ignoreLocal:function(){this.options.removeLocalstorageOnIgnore&&_.each(this.restorables,function(t){this._removeLocal(t)},this),this.restorables=[]},saveReferences:function(t){_.each(t.attributes,function(t){t&&t.isCollection&&t.each(function(t){return-1===this.changedModels.indexOf(t)?t.isNew()&&this.options.saveReferencedNew?t.save():t.hasChanged()&&this.options.saveReferencedChanged?t.save():undefined:undefined},this)},this)},saveRemote:function(t,e){this.saveReferences(t),this._trigger("saveentity",null,{entity:t,options:e});var i=this;t.save(null,_.extend({},e,{success:function(o,n){t._originalAttributes=_.clone(t.attributes),i._removeLocal(t),window.setTimeout(function(){i.changedModels.splice(i.changedModels.indexOf(t),1)},0),_.isFunction(e.success)&&e.success(o,n),i._trigger("savedentity",null,{entity:t,options:e})},error:function(t,i){_.isFunction(e.error)&&e.error(t,i)}}))},saveRemoteAll:function(e){var i=this;if(0!==i.changedModels.length){i._trigger("save",null,{entities:i.changedModels,options:e,models:i.changedModels});var o,n=i.changedModels.length;o=n>1?_.template(i.options.localize("saveSuccessMultiple",i.options.language),{number:n}):_.template(i.options.localize("saveSuccess",i.options.language),{label:i.changedModels[0].getSubjectUri()}),i.disableAutoSave(),_.each(i.changedModels,function(a){this.saveRemote(a,{success:function(a,s){n--,0>=n&&(i._trigger("saved",null,{options:e}),e&&_.isFunction(e.success)&&e.success(a,s),t("body").midgardNotifications("create",{body:o}),i.enableAutoSave())},error:function(o,n){e&&_.isFunction(e.error)&&e.error(o,n),t("body").midgardNotifications("create",{body:_.template(i.options.localize("saveError",i.options.language),{error:n.responseText||""}),timeout:0}),i._trigger("error",null,{instance:a})}})},this)}},_saveLocal:function(t){if(this.options.localStorage){if(t.isNew()){if(!t.primaryCollection)return;return this._saveLocalReferences(t.primaryCollection.subject,t.primaryCollection.predicate,t)}var e=this.options.storagePrefix+t.getSubjectUri();window.localStorage.setItem(e,JSON.stringify(t.toJSONLD()))}},_getReferenceId:function(t,e){return t.id+":"+e},_saveLocalReferences:function(t,e,i){if(this.options.localStorage&&t&&e){var o=this.options.storagePrefix+t+":"+e,n=i.toJSONLD();if(window.localStorage.getItem(o)){var a=JSON.parse(window.localStorage.getItem(o)),s=_.pluck(a,"@").indexOf(n["@"]);return-1!==s?a[s]=n:a.push(n),window.localStorage.setItem(o,JSON.stringify(a)),undefined}window.localStorage.setItem(o,JSON.stringify([n]))}},_checkLocal:function(t){if(!this.options.localStorage)return!1;var e=this.options.storagePrefix+t.getSubjectUri(),i=window.localStorage.getItem(e);return i?!0:!1},hasLocal:function(t){if(!this.options.localStorage)return!1;var e=this.options.storagePrefix+t.getSubjectUri();return window.localStorage.getItem(e)?!0:!1},readLocal:function(t){if(this.options.localStorage){var e=this.options.storagePrefix+t.getSubjectUri(),i=window.localStorage.getItem(e);if(i){t._originalAttributes||(t._originalAttributes=_.clone(t.attributes));var o=JSON.parse(i),n=this.vie.entities.addOrUpdate(o,{overrideAttributes:!0});this._trigger("loaded",null,{instance:n})}}},_readLocalReferences:function(t,e,i){if(this.options.localStorage){var o=this.options.storagePrefix+this._getReferenceId(t,e),n=window.localStorage.getItem(o); |
|
5
|
|
|
n&&i.add(JSON.parse(n))}},revertChanges:function(t){var e=this;if(t)return _.each(t.attributes,function(t){if(t instanceof e.vie.Collection){var i=[];t.forEach(function(t){t.isNew()&&i.push(t)}),t.remove(i)}}),t.changedAttributes()?(t.set(t.previousAttributes()),undefined):(t._originalAttributes&&t.set(t._originalAttributes),undefined)},_removeLocal:function(t){if(this.options.localStorage){var e=this.options.storagePrefix+t.getSubjectUri();window.localStorage.removeItem(e)}}})}(jQuery),function(t){"use strict";t.widget("Midgard.midgardToolbar",{options:{display:"full",templates:{minimized:'<div class="create-ui-logo"><a class="create-ui-toggle" id="create-ui-toggle-toolbar"></a></div>',full:'<div class="create-ui-toolbar-wrapper"><div class="create-ui-toolbar-toolarea"><%= dynamic %><%= status %></div></div>',toolcontainer:'<div class="create-ui-toolbar-<%= name %>toolarea"><ul class="create-ui-<%= name %>tools"><%= content %></ul></div>',toolarea:'<li class="create-ui-tool-<%= name %>area"></li>'}},_create:function(){this.element.append(this._getMinimized()),this.element.append(this._getFull());var e=this;t(".create-ui-toggle",this.element).click(function(){"full"===e.options.display?e.setDisplay("minimized"):e.setDisplay("full")}),t(this.element).on("midgardcreatestatechange",function(t,i){"browse"==i.state&&e._clearWorkflows()}),t(this.element).on("midgardworkflowschanged",function(i,o){e._clearWorkflows(),o.workflows.length&&o.workflows.each(function(i){var n=t("body").data("Midgard-midgardWorkflows");n||(n=t("body").data("midgardWorkflows"));var a=n.prepareItem(o.instance,i,function(t){e._clearWorkflows(),t});t(".create-ui-tool-workflowarea",e.element).append(a)})})},_init:function(){this.setDisplay(this.options.display)},setDisplay:function(t){t!==this.options.display&&("minimized"===t?(this.hide(),this.options.display="minimized"):(this.show(),this.options.display="full"),this._trigger("statechange",null,this.options))},hide:function(){t("div.create-ui-toolbar-wrapper").fadeToggle("fast","linear")},show:function(){t("div.create-ui-toolbar-wrapper").fadeToggle("fast","linear")},_getMinimized:function(){return t(_.template(this.options.templates.minimized,{}))},_getFull:function(){return t(_.template(this.options.templates.full,{dynamic:_.template(this.options.templates.toolcontainer,{name:"dynamic",content:_.template(this.options.templates.toolarea,{name:"metadata"})+_.template(this.options.templates.toolarea,{name:"workflow"})+_.template(this.options.templates.toolarea,{name:"free"})}),status:_.template(this.options.templates.toolcontainer,{name:"status",content:""})}))},_clearWorkflows:function(){t(".create-ui-tool-workflowarea",this.element).empty()}})}(jQuery),function(t){"use strict";t.widget("Midgard.midgardWorkflows",{options:{url:function(){},templates:{button:'<button class="create-ui-btn" id="<%= id %>"><%= label %></button>'},renderers:{button:function(e,i,o,n){var a="midgardcreate-workflow_"+i.get("name"),s=t(_.template(this.options.templates.button,{id:a,label:i.get("label")})).button();return s.on("click",function(){o(e,i,n)}),s}},action_types:{backbone_save:function(t,e,i){var o=t.url,n=t.clone();n.url=o;var a=e.get("action");a.url&&(t.url=a.url),n.save(null,{success:function(){t.url=o,t.change(),i(null,t)},error:function(e,n){t.url=o,t.change(),i(n,t)}})},backbone_destroy:function(t,e,i){var o=t.url,n=t.clone();n.url=o;var a=e.get("action");a.url&&(t.url=a.url),t.destroy({success:function(e){t.url=o,t.change(),i(null,e)},error:function(e,n){t.url=o,t.change(),i(n,t)}})},http:function(e,i,o){var n=i.get("action");if(!n.url)return o("No action url defined!");var a={};n.http&&(a=n.http);var s=t.extend({url:n.url,type:"POST",data:e.toJSON(),success:function(){e.fetch({success:function(t){o(null,t)},error:function(t,e){o(e,t)}})}},a);t.ajax(s)}}},_init:function(){this._renderers={},this._action_types={},this._parseRenderersAndTypes(),this._last_instance=null,this.ModelWorkflowModel=Backbone.Model.extend({defaults:{name:"",label:"",type:"button",action:{type:"backbone_save"}}}),this.workflows={};var e=this;t(this.element).on("midgardeditableactivated",function(t,i){e._fetchWorkflows(i.instance)})},_fetchWorkflows:function(t){var e=this;if(t.isNew())return e._trigger("changed",null,{instance:t,workflows:[]}),undefined;if(e._last_instance==t)return e.workflows[t.cid]&&e._trigger("changed",null,{instance:t,workflows:e.workflows[t.cid]}),undefined;if(e._last_instance=t,e.workflows[t.cid])return e._trigger("changed",null,{instance:t,workflows:e.workflows[t.cid]}),undefined;if(e.options.url)e._fetchModelWorkflows(t);else{var i=new(e._generateCollectionFor(t))([],{});e._trigger("changed",null,{instance:t,workflows:i})}},_parseRenderersAndTypes:function(){var e=this;t.each(this.options.renderers,function(t,i){e.setRenderer(t,i)}),t.each(this.options.action_types,function(t,i){e.setActionType(t,i)})},setRenderer:function(t,e){this._renderers[t]=e},getRenderer:function(t){return this._renderers[t]?this._renderers[t]:!1},setActionType:function(t,e){this._action_types[t]=e},getActionType:function(t){return this._action_types[t]},prepareItem:function(t,e,i){var o=this,n=this.getRenderer(e.get("type")),a=this.getActionType(e.get("action").type);return n.call(this,t,e,a,function(n,a){delete o.workflows[t.cid],o._last_instance=null,"backbone_destroy"!==e.get("action").type&&o._fetchModelWorkflows(t),i(n,a)})},_generateCollectionFor:function(t){var e={model:this.ModelWorkflowModel};return this.options.url&&(e.url=this.options.url(t)),Backbone.Collection.extend(e)},_fetchModelWorkflows:function(t){if(!t.isNew()){var e=this;e.workflows[t.cid]=new(this._generateCollectionFor(t))([],{}),e.workflows[t.cid].fetch({success:function(i){e.workflows[t.cid].reset(i.models),e._trigger("changed",null,{instance:t,workflows:e.workflows[t.cid]})},error:function(){}})}}})}(jQuery),void 0===window.midgardCreate&&(window.midgardCreate={}),window.midgardCreate.localize=function(t,e){return window.midgardCreate.locale?window.midgardCreate.locale[e]&&window.midgardCreate.locale[e][t]?window.midgardCreate.locale[e][t]:window.midgardCreate.locale.en[t]?window.midgardCreate.locale.en[t]:t:t},function(t,e){"use strict";t.widget("Midgard.midgardCollectionAdd",{options:{editingWidgets:null,collection:null,model:null,definition:null,view:null,disabled:!1,vie:null,editableOptions:null,templates:{button:'<button class="btn"><i class="icon-<%= icon %>"></i> <%= label %></button>'}},_create:function(){this.addButtons=[];var t=this;if(!t.options.collection.localStorage)try{t.options.collection.url=t.options.model.url()}catch(e){window.console&&console.log(e)}t.options.collection.on("add",function(e){e.primaryCollection=t.options.collection,t.options.vie.entities.add(e),e.collection=t.options.collection}),t.options.collection.on("add remove reset",t.checkCollectionConstraints,t),t._bindCollectionView(t.options.view)},_bindCollectionView:function(t){var e=this;t.on("add",function(t){t.$el.effect("slide",function(){e._makeEditable(t)})})},_makeEditable:function(t){this.options.editableOptions.disabled=this.options.disabled,this.options.editableOptions.model=t.model,t.$el.midgardEditable(this.options.editableOptions)},_init:function(){return this.options.disabled?(this.disable(),e):(this.enable(),e)},hideButtons:function(){_.each(this.addButtons,function(t){t.hide()})},showButtons:function(){_.each(this.addButtons,function(t){t.show()})},checkCollectionConstraints:function(){return this.options.disabled?e:this.options.view.canAdd()?this.options.definition?this.options.definition.max&&-1!==this.options.definition.max?this.options.collection.length<this.options.definition.max?(this.showButtons(),e):(this.hideButtons(),e):(this.showButtons(),e):(this.showButtons(),e):(this.hideButtons(),e)},enable:function(){var e=this,i=t(_.template(this.options.templates.button,{icon:"plus",label:this.options.editableOptions.localize("Add",this.options.editableOptions.language)})).button();i.addClass("midgard-create-add"),i.click(function(){e.addItem(i)}),t(e.options.view.el).after(i),e.addButtons.push(i),e.checkCollectionConstraints()},disable:function(){_.each(this.addButtons,function(t){t.remove()}),this.addButtons=[]},_getTypeActions:function(t){var e=this,i=[];return _.each(this.options.definition.range,function(o){var n=e.options.collection.vie.namespaces.uri(o);e.options.view.canAdd(n)&&i.push({name:o,label:o,cb:function(){e.options.collection.add({"@type":o},t)},className:"create-ui-btn"})}),i},addItem:function(i,o){o===e&&(o={});var n=_.extend({},o,{validate:!1}),a={};if(this.options.definition&&this.options.definition.range){if(1!==this.options.definition.range.length)return t("body").midgardNotifications("create",{bindTo:i,gravity:"L",body:this.options.editableOptions.localize("Choose type to add",this.options.editableOptions.language),timeout:0,actions:this._getTypeActions(n)}),e;a["@type"]=this.options.definition.range[0]}else{var s=_.keys(this.options.view.templates);2==s.length&&(a["@type"]=s[0])}this.options.collection.add(a,n)}})}(jQuery),function(t){"use strict";t.widget("Midgard.midgardCollectionAddBetween",t.Midgard.midgardCollectionAdd,{_bindCollectionView:function(t){var e=this;t.on("add",function(t){e._makeEditable(t),e._refreshButtons()}),t.on("remove",function(){e._refreshButtons()})},_refreshButtons:function(){var t=this;window.setTimeout(function(){t.disable(),t.enable()},1)},prepareButton:function(e){var i=this,o=t(_.template(this.options.templates.button,{icon:"plus",label:""})).button();return o.addClass("midgard-create-add"),o.click(function(){i.addItem(o,{at:e})}),o},enable:function(){var e=this,i=e.prepareButton(0);t(e.options.view.el).prepend(i),e.addButtons.push(i),t.each(e.options.view.entityViews,function(i,o){var n=e.options.collection.indexOf(o.model),a=e.prepareButton(n+1);t(o.el).append(a),e.addButtons.push(a)}),this.checkCollectionConstraints()},disable:function(){var e=this;t.each(e.addButtons,function(t,e){e.remove()}),e.addButtons=[]}})}(jQuery),function(t){"use strict";t.widget("Midgard.editWidget",{options:{disabled:!1,vie:null},enable:function(){this.element.attr("contenteditable","true")},disable:function(){this.element.attr("contenteditable","false")},_create:function(){this._registerWidget(),this._initialize(),_.isFunction(this.options.decorate)&&_.isFunction(this.options.decorateParams)&&this.options.decorate(this.options.decorateParams(null,{propertyName:this.options.property,propertyEditor:this,propertyElement:this.element,editor:this,predicate:this.options.property,element:this.element}))},_init:function(){return this.options.disabled?(this.disable(),undefined):(this.enable(),undefined)},_initialize:function(){var e=this;this.element.on("focus",function(){e.options.disabled||e.options.activated()}),this.element.on("blur",function(){e.options.disabled||e.options.deactivated()});var i=this.element.html();this.element.on("keyup paste",function(){if(!e.options.disabled){var o=t(this).html();i!==o&&(i=o,e.options.changed(o))}})},_registerWidget:function(){this.element.data("createWidgetName",this.widgetName)}})}(jQuery),function(t){"use strict";t.widget("Midgard.alohaWidget",t.Midgard.editWidget,{_initialize:function(){},enable:function(){var t,e=this.options,i=Aloha.jQuery(e.element.get(0)).aloha();_.each(Aloha.editables,function(e){e.obj.get(0)===i.get(0)&&(t=e)}),t&&(t.vieEntity=e.entity,Aloha.bind("aloha-editable-activated",function(i,o){o.editable===t&&e.activated()}),Aloha.bind("aloha-editable-deactivated",function(i,o){o.editable===t&&e.deactivated()}),Aloha.bind("aloha-smart-content-changed",function(i,o){if(o.editable===t){if(!o.editable.isModified())return!0;e.changed(o.editable.getContents()),o.editable.setUnmodified()}}),this.options.disabled=!1)},disable:function(){Aloha.jQuery(this.options.element.get(0)).mahalo(),this.options.disabled=!0}})}(jQuery),function(t){"use strict";t.widget("Midgard.ckeditorWidget",t.Midgard.editWidget,{enable:function(){this.element.attr("contentEditable","true"),this.editor=CKEDITOR.inline(this.element.get(0)),this.options.disabled=!1;var e=this;this.editor.on("focus",function(){e.options.activated()}),this.editor.on("blur",function(){e.options.activated(),e.options.changed(e.editor.getData())}),this.editor.on("key",function(){e.options.changed(e.editor.getData())}),this.editor.on("paste",function(){e.options.changed(e.editor.getData())}),this.editor.on("afterCommandExec",function(){e.options.changed(e.editor.getData())}),this.editor.on("configLoaded",function(){t.each(e.options.editorOptions,function(t,i){e.editor.config[t]=i})})},disable:function(){this.editor&&(this.element.attr("contentEditable","false"),this.editor.destroy(),this.editor=null)},_initialize:function(){CKEDITOR.disableAutoInline=!0}})}(jQuery),function(t){"use strict";t.widget("Midgard.halloWidget",t.Midgard.editWidget,{options:{editorOptions:{},disabled:!0,toolbarState:"full",vie:null,entity:null},enable:function(){t(this.element).hallo({editable:!0}),this.options.disabled=!1},disable:function(){t(this.element).hallo({editable:!1}),this.options.disabled=!0},_initialize:function(){t(this.element).hallo(this.getHalloOptions());var e=this;t(this.element).on("halloactivated",function(){e.options.activated()}),t(this.element).on("hallodeactivated",function(){e.options.deactivated()}),t(this.element).on("hallomodified",function(t,i){e.options.changed(i.content),i.editable.setUnmodified()}),t(document).on("midgardtoolbarstatechange",function(t,i){if(i.display!==e.options.toolbarState&&(e.options.toolbarState=i.display,e.element.data("IKS-hallo")||e.element.data("hallo"))){var o=e.getHalloOptions();e.element.hallo("changeToolbar",o.parentElement,o.toolbar,!0)}})},getHalloOptions:function(){var e={plugins:{halloformat:{},halloblock:{},hallolists:{},hallolink:{},halloimage:{entity:this.options.entity}},buttonCssClass:"create-ui-btn-small",placeholder:"["+this.options.property+"]"};return"function"==typeof this.element.annotate&&this.options.vie.services.stanbol&&(e.plugins.halloannotate={vie:this.options.vie}),"full"===this.options.toolbarState?(e.parentElement=t(".create-ui-toolbar-dynamictoolarea .create-ui-tool-freearea"),e.toolbar="halloToolbarFixed"):(e.parentElement="body",e.toolbar="halloToolbarContextual"),_.extend(e,this.options.editorOptions)}})}(jQuery),function(t){"use strict";t.widget("Midgard.redactorWidget",t.Midgard.editWidget,{editor:null,options:{editorOptions:{},disabled:!0},enable:function(){t(this.element).redactor(this.getRedactorOptions()),this.options.disabled=!1},disable:function(){t(this.element).destroyEditor(),this.options.disabled=!0},_initialize:function(){var e=this;t(this.element).on("focus",function(){e.options.activated()})},getRedactorOptions:function(){var e=this,i={keyupCallback:function(){e.options.changed(t(e.element).getCode())},execCommandCallback:function(){e.options.changed(t(e.element).getCode())}};return _.extend(e.options.editorOptions,i)}})}(jQuery),function(t){"use strict";t.widget("Midgard.midgardGeo",{options:{layer:null,map:null,coordSystem:"EPSG:4326",defaultCenter:null,defaultZoomLevel:3,geoProperty:"http://schema.org/geo",geoCoordinateType:"http://schema.org/GeoCoordinates",geoLonProperty:"http://schema.org/longitude",geoLatProperty:"http://schema.org/latitude",marker:{url:"http://www.openlayers.org/dev/img/marker.png",size:{w:21,h:25},offset:{w:-10,h:-25}}},data:{},coordsObj:null,activate:function(t){this.data=t,this.coordsObj=null;var e=this.data.entity.get(this.options.geoProperty);if(_.isUndefined(e)){var i=this.data.entity.attributes["@type"];_.isArray(i)||(i=[i]),_.indexOf(i,"<"+this.options.geoCoordinateType+">")>0&&(this.coordsObj=this.data.entity)}else this.coordsObj=e.models[0];if(_.isNull(this.coordsObj))return this.element.hide(),undefined;this.element.show();var o=parseFloat(this.coordsObj.get(this.options.geoLatProperty)),n=parseFloat(this.coordsObj.get(this.options.geoLonProperty));this.centerMap(n,o)},_createMap:function(){if(_.isNull(this.options.map)){var e=this,i=t("<div>",{id:"midgardGeoMap",style:"height:200px; width:300px"});this.element.append(i),this.options.map=new OpenLayers.Map("midgardGeoMap"),_.isNull(this.options.layer)&&(this.options.layer=new OpenLayers.Layer.OSM("OSM")),this.options.map.addLayer(this.options.layer),this.options.markers=new OpenLayers.Layer.Markers("Markers"),this.options.map.addLayer(this.options.markers),OpenLayers.Control.Click=OpenLayers.Class(OpenLayers.Control,{defaultHandlerOptions:{single:!0,"double":!1,pixelTolerance:0,stopSingle:!1,stopDouble:!1},initialize:function(){this.handlerOptions=OpenLayers.Util.extend({},this.defaultHandlerOptions),OpenLayers.Control.prototype.initialize.apply(this,arguments),this.handler=new OpenLayers.Handler.Click(this,{click:function(t){e.mapClick(t)}},this.handlerOptions)}});var o=new OpenLayers.Control.Click;this.options.map.addControl(o),o.activate();var n=this.options.defaultCenter.clone();n.transform(new OpenLayers.Projection(this.options.coordSystem),this.options.map.getProjectionObject()),this.options.map.setCenter(n,this.options.defaultZoomLevel)}},mapClick:function(t){var e=this.options.map.getLonLatFromPixel(t.xy);e.transform(this.options.map.getProjectionObject(),new OpenLayers.Projection(this.options.coordSystem));var i=e.clone();this.centerMap(i.lon,i.lat),this.setCoordinates(e.lat,e.lon)},disable:function(){},setCoordinates:function(t,e){var i=this.data.entity.get(this.options.geoProperty),o=i.models[0];o.set(this.options.geoLatProperty,t),o.set(this.options.geoLonProperty,e)},_init:function(){this.element.hide(),this.element.append(t("<h3>GEO</h3>")),_.isNull(this.options.defaultCenter)&&(this.options.defaultCenter=new OpenLayers.LonLat(0,0)),this._createMap()},centerMap:function(t,e){var i=new OpenLayers.LonLat(t,e).transform(new OpenLayers.Projection(this.options.coordSystem),this.options.map.getProjectionObject());this.options.centermark&&this.options.centermark.destroy();var o=new OpenLayers.Size(this.options.marker.size.w,this.options.marker.size.h),n=new OpenLayers.Pixel(this.options.marker.offset.w,this.options.marker.offset.h),a=new OpenLayers.Icon(this.options.marker.url,o,n);this.options.centermark=new OpenLayers.Marker(i,a),this.options.markers.addMarker(this.options.centermark),this.options.map.panTo(i)}})}(jQuery),function(t,e){"use strict";t.widget("Midgard.midgardTags",{enhanced:!1,options:{predicate:"skos:related",vie:null,templates:{tags:'<div class="create-ui-tags <%= type %>Tags"><h3><%= label %></h3><input type="text" class="tags" value="" /></div>'},localize:function(t,e){return window.midgardCreate.localize(t,e)},language:null},_init:function(){this.vie=this.options.vie},activate:function(t){var e=this._render(t.entity);this.loadTags(t.entity,t.predicate,e)},_normalizeSubject:function(t){return this.vie.entities.isReference(t)?t:("http://"!==t.substr(0,7)&&(t="urn:tag:"+t),t=this.vie.entities.toReference(t))},_tagLabel:function(t){return t=this.vie.entities.fromReference(t),"urn:tag:"===t.substr(0,8)&&(t=t.substr(8,t.length-1)),"http://"==t.substring(0,7)&&(t=t.substr(t.lastIndexOf("/")+1,t.length-1),t=t.replace(/_/g," ")),t},addTag:function(t,i,o,n){o===e&&(o=this._tagLabel(i)),i=this._normalizeSubject(i);var a=t.get(this.options.predicate);if(!(a&&a.isCollection&&a.get(i))){n&&!t.isReference(n)&&(n=t.toReference(n));var s=this.vie.entities.addOrUpdate({"@subject":i,"rdfs:label":o,"@type":n});return a?(a.addOrUpdate(s),e):(t.set(this.options.predicate,s),e)}},removeTag:function(t,e){var i=t.get(this.options.predicate);if(i){e=this._normalizeSubject(e);var o=i.get(e);o&&i.remove(e)}},_listenAnnotate:function(t,e){var i=this;e.on("annotateselect",function(e,o){i.addTag(t,o.linkedEntity.uri,o.linkedEntity.label,o.linkedEntity.type[0])}),e.on("annotateremove",function(e,o){i.removeTag(t,o.linkedEntity.uri)})},_render:function(e){this.element.empty();var i=t(_.template(this.options.templates.tags,{type:"article",label:this.options.localize("Item tags",this.options.language)})),o=t(_.template(this.options.templates.tags,{type:"suggested",label:this.options.localize("Suggested tags",this.options.language)}));return t("input",i).attr("id","articleTags-"+e.cid),t("input",o).attr("id","suggestedTags-"+e.cid),this.element.append(i),this.element.append(o),this._renderInputs(e,i,o),{tags:i,suggested:o}},_renderInputs:function(e,i,o){var n=this;e.getSubject(),i.tagsInput({width:"auto",height:"auto",onAddTag:function(t){n.addTag(e,t)},onRemoveTag:function(t){n.removeTag(e,t)},defaultText:this.options.localize("add a tag",this.options.language)});var a=function(){var i=t.trim(t(this).text());n.addTag(e,i),o.removeTag(i)};o.tagsInput({width:"auto",height:"auto",interactive:!1,onAddTag:function(){t(".tag span",o).off("click",a),t(".tag span",o).on("click",a)},onRemoveTag:function(){t(".tag span",o).off("click",a),t(".tag span",o).on("click",a)},remove:!1})},_getTagStrings:function(t){var e=[];return _.isString(t)?(e.push(t),e):t.isCollection?(t.each(function(t){e.push(t.get("rdfs:label"))}),e):(_.each(t,function(t){e.push(this._tagLabel(t))},this),e)},loadTags:function(e,i,o){var n=this,a=e.get(this.options.predicate);if(a){var s=this._getTagStrings(a);_.each(s,o.tags.addTag,o.tags)}this.vie.services.stanbol||t(".suggestedTags",n.element).hide()},_getLabelLang:function(t){if(!_.isArray(t))return null;var e;return _.each(t,function(t){"en"===t["@language"]&&(e=t["@value"])}),e},_addEnhancement:function(t,e){if(e.isEntity){var i=this._getLabelLang(e.get("rdfs:label"));if(i){var o=t.get(this.options.predicate);o&&o.isCollection&&-1!==o.indexOf(e)||this.suggestedTags.addTag(i)}}},enhance:function(e,i){if(!this.enhanced){this.enhanced=!0;var o=this;this.vie.analyze({element:t("[property]",i)}).using(["stanbol"]).execute().success(function(t){_.each(t,function(t){o._addEnhancement(e,t)})}).fail(function(){})}}})}(jQuery),void 0===window.midgardCreate&&(window.midgardCreate={}),void 0===window.midgardCreate.locale&&(window.midgardCreate.locale={}),window.midgardCreate.locale.bg={Save:"Запази",Saving:"Запазване",Cancel:"Откажи",Edit:"Редактирай",localModification:'Елементът "<%= label %>" има локални модификации',localModifications:"<%= number %> елемента на тази страница имат локални модификации",Restore:"Възстанови",Ignore:"Игнорирай",saveSuccess:'Елементът "<%= label %>" беше успешно запазен',saveSuccessMultiple:"<%= number %> елемента бяха успешно запазени",saveError:"Възника грешка при запазване<br /><%= error %>","Item tags":"Етикети на елемента","Suggested tags":"Препоръчани етикети",Tags:"Етикети","add a tag":"добави етикет",Add:"Добави","Choose type to add":"Избери тип за добавяне"},void 0===window.midgardCreate&&(window.midgardCreate={}),void 0===window.midgardCreate.locale&&(window.midgardCreate.locale={}),window.midgardCreate.locale.cs={Save:"Uložit",Saving:"Probíhá ukládání",Cancel:"Zrušit",Edit:"Upravit",localModification:'Blok "<%= label %>" obsahuje lokální změny',localModifications:"<%= number %> bloků na této stránce má lokální změny",Restore:"Aplikovat lokální změny",Ignore:"Zahodit lokální změny",saveSuccess:'Blok "<%= label %>" byl úspěšně uložen',saveSuccessMultiple:"<%= number %> bloků bylo úspěšně uloženo",saveError:"Při ukládání došlo k chybě<br /><%= error %>","Item tags":"Štítky bloku","Suggested tags":"Navrhované štítky",Tags:"Štítky","add a tag":"Přidat štítek",Add:"Přidat","Choose type to add":"Vyberte typ k přidání"},void 0===window.midgardCreate&&(window.midgardCreate={}),void 0===window.midgardCreate.locale&&(window.midgardCreate.locale={}),window.midgardCreate.locale.da={Save:"Gem",Saving:"Gemmer",Cancel:"Annullér",Edit:"Rediger",localModification:'Element "<%= label %>" har lokale ændringer',localModifications:"<%= number %> elementer på denne side har lokale ændringer",Restore:"Gendan",Ignore:"Ignorer",saveSuccess:'Element "<%= label %>" er gemt',saveSuccessMultiple:"<%= number %> elementer er gemt",saveError:"Der opstod en fejl under lagring<br /><%= error %>","Item tags":"Element tags","Suggested tags":"Foreslåede tags",Tags:"Tags","add a tag":"tilføj et tag",Add:"Tilføj","Choose type to add":"Vælg type der skal tilføjes"},void 0===window.midgardCreate&&(window.midgardCreate={}),void 0===window.midgardCreate.locale&&(window.midgardCreate.locale={}),window.midgardCreate.locale.de={Save:"Speichern",Saving:"Speichert",Cancel:"Abbrechen",Edit:"Bearbeiten",localModification:'Das Dokument "<%= label %>" auf dieser Seite hat lokale Änderungen',localModifications:"<%= number %> Dokumente auf dieser Seite haben lokale Änderungen",Restore:"Wiederherstellen",Ignore:"Ignorieren",saveSuccess:'Dokument "<%= label %>" erfolgreich gespeichert',saveSuccessMultiple:"<%= number %> Dokumente erfolgreich gespeichert",saveError:"Fehler beim Speichern<br /><%= error %>","Item tags":"Schlagwörter des Dokuments","Suggested tags":"Schlagwortvorschläge",Tags:"Schlagwörter","add a tag":"Neues Schlagwort",Add:"Hinzufügen","Choose type to add":"Typ zum Hinzufügen wählen"},void 0===window.midgardCreate&&(window.midgardCreate={}),void 0===window.midgardCreate.locale&&(window.midgardCreate.locale={}),window.midgardCreate.locale.en={Save:"Save",Saving:"Saving",Cancel:"Cancel",Edit:"Edit",localModification:'Item "<%= label %>" has local modifications',localModifications:"<%= number %> items on this page have local modifications",Restore:"Restore",Ignore:"Ignore",saveSuccess:'Item "<%= label %>" saved successfully',saveSuccessMultiple:"<%= number %> items saved successfully",saveError:"Error occurred while saving<br /><%= error %>","Item tags":"Item tags","Suggested tags":"Suggested tags",Tags:"Tags","add a tag":"add a tag",Add:"Add","Choose type to add":"Choose type to add"},void 0===window.midgardCreate&&(window.midgardCreate={}),void 0===window.midgardCreate.locale&&(window.midgardCreate.locale={}),window.midgardCreate.locale.es={Save:"Guardar",Saving:"Guardando",Cancel:"Cancelar",Edit:"Editar",localModification:'El elemento "<%= label %>" tiene modificaciones locales',localModifications:"<%= number %> elementos en la página tienen modificaciones locales",Restore:"Restaurar",Ignore:"Ignorar",saveSuccess:'El elemento "<%= label %>" se guardó exitosamente',saveSuccessMultiple:"<%= number %> elementos se guardaron exitosamente",saveError:"Ha ocurrido un error cuando se guardaban los datos<br /><%= error %>","Item tags":"Etiquetas de los elementos","Suggested tags":"Etiquetas sugeridas",Tags:"Etiquetas","add a tag":"añadir una etiqueta",Add:"Añadir","Choose type to add":"Escoge el tipo a añadir"},void 0===window.midgardCreate&&(window.midgardCreate={}),void 0===window.midgardCreate.locale&&(window.midgardCreate.locale={}),window.midgardCreate.locale.fi={Save:"Tallenna",Saving:"Tallennetaan",Cancel:"Peruuta",Edit:"Muokkaa",localModification:'Dokumentilla "<%= label %>" on paikallisia muutoksia',localModifications:"<%= number %> dokumenttia sivulla omaa paikallisia muutoksia",Restore:"Palauta",Ignore:"Poista",saveSuccess:'Dokumentti "<%= label %>" tallennettu',saveSuccessMultiple:"<%= number %> dokumenttia tallennettu",saveError:"Virhe tallennettaessa<br /><%= error %>","Item tags":"Avainsanat","Suggested tags":"Ehdotukset",Tags:"Avainsanat","add a tag":"lisää avainsana",Add:"Lisää","Choose type to add":"Mitä haluat lisätä?"},void 0===window.midgardCreate&&(window.midgardCreate={}),void 0===window.midgardCreate.locale&&(window.midgardCreate.locale={}),window.midgardCreate.locale.fr={Save:"Enregistrer",Saving:"Enregistrement en cours",Cancel:"Annuler",Edit:"Éditer",localModification:'L\'élément "<%= label %>" comporte des modifications locales',localModifications:"<%= number %> éléments sur cette page comportent des modifications locales",Restore:"Restaurer",Ignore:"Ignorer",saveSuccess:'L\'élément "<%= label %>" a été enregistré avec succès',saveSuccessMultiple:"<%= number %> éléments ont été enregistrés avec succès",saveError:"Une erreur est survenue durant l'enregistrement<br /><%= error %>","Item tags":"Tags des éléments","Suggested tags":"Tags suggérés",Tags:"Tags","add a tag":"ajouter un tag",Add:"Ajouter","Choose type to add":"Choisir le type à ajouter"},void 0===window.midgardCreate&&(window.midgardCreate={}),void 0===window.midgardCreate.locale&&(window.midgardCreate.locale={}),window.midgardCreate.locale.he={Save:"שמור",Saving:"שומר",Cancel:"בטל",Edit:"ערוך",localModification:'לפריט "<%= label %>" שינויים מקומיים',localModifications:"ל<%= number %> פריטים בדף זה שינויים מקומיים",Restore:"שחזר",Ignore:"התעלם",saveSuccess:'פריט "<%= label %>" נשמר בהצלחה',saveSuccessMultiple:"<%= number %> פריטים נשמרו בהצלחה",saveError:"שגיאה בשמירה<br /><%= error %>","Item tags":"סיווגי פריט","Suggested tags":"סיווגים מומלצים",Tags:"סיווגים","add a tag":"הוסף סיווג",Add:"הוסף","Choose type to add":"בחר סוג להוספה"},void 0===window.midgardCreate&&(window.midgardCreate={}),void 0===window.midgardCreate.locale&&(window.midgardCreate.locale={}),window.midgardCreate.locale.it={Save:"Salva",Saving:"Salvataggio",Cancel:"Cancella",Edit:"Modifica",localModification:'Articolo "<%= label %>" in questa pagina hanno modifiche locali',localModifications:"<%= number %> articoli in questa pagina hanno modifiche locali",Restore:"Ripristina",Ignore:"Ignora",saveSuccess:'Articolo "<%= label %>" salvato con successo',saveSuccessMultiple:"<%= number %> articoli salvati con successo",saveError:"Errore durante il salvataggio<br /><%= error %>","Item tags":"Tags articolo","Suggested tags":"Tags suggerite",Tags:"Tags","add a tag":"Aggiungi una parola chiave",Add:"Aggiungi","Choose type to add":"Scegli il tipo da aggiungere"},void 0===window.midgardCreate&&(window.midgardCreate={}),void 0===window.midgardCreate.locale&&(window.midgardCreate.locale={}),window.midgardCreate.locale.nl={Save:"Opslaan",Saving:"Bezig met opslaan",Cancel:"Annuleren",Edit:"Bewerken",localModification:'Items "<%= label %>" op de pagina heeft lokale wijzigingen',localModifications:"<%= number %> items op de pagina hebben lokale wijzigingen",Restore:"Herstellen",Ignore:"Negeren",saveSuccess:'Item "<%= label %>" succesvol opgeslagen',saveSuccessMultiple:"<%= number %> items succesvol opgeslagen",saveError:"Fout opgetreden bij het opslaan<br /><%= error %>","Item tags":"Item tags","Suggested tags":"Tag suggesties",Tags:"Tags","add a tag":"tag toevoegen",Add:"Toevoegen","Choose type to add":"Kies type om toe te voegen"},void 0===window.midgardCreate&&(window.midgardCreate={}),void 0===window.midgardCreate.locale&&(window.midgardCreate.locale={}),window.midgardCreate.locale.no={Save:"Lagre",Saving:"Lagrer",Cancel:"Avbryt",Edit:"Rediger",localModification:'Element "<%= label %>" på denne siden er modifisert lokalt',localModifications:"<%= number %> elementer på denne siden er modifisert lokalt",Restore:"Gjenopprett",Ignore:"Ignorer",saveSuccess:'Element "<%= label %>" ble lagret',saveSuccessMultiple:"<%= number %> elementer ble lagret",saveError:"En feil oppstod under lagring<br /><%= error %>","Item tags":"Element-tagger","Suggested tags":"Anbefalte tagger",Tags:"Tagger","add a tag":"legg til tagg",Add:"Legg til","Choose type to add":"Velg type å legge til"},void 0===window.midgardCreate&&(window.midgardCreate={}),void 0===window.midgardCreate.locale&&(window.midgardCreate.locale={}),window.midgardCreate.locale.pl={Save:"Zapisz",Saving:"Zapisuję",Cancel:"Anuluj",Edit:"Edytuj",localModification:'Artykuł "<%= label %>" posiada lokalne modyfikacje',localModifications:"<%= number %> artykułów na tej stronie posiada lokalne modyfikacje",Restore:"Przywróć",Ignore:"Ignoruj",saveSuccess:'Artykuł "<%= label %>" został poprawnie zapisany',saveSuccessMultiple:"<%= number %> artykułów zostało poprawnie zapisanych",saveError:"Wystąpił błąd podczas zapisywania<br /><%= error %>","Item tags":"Tagi artykułów","Suggested tags":"Sugerowane tagi",Tags:"Tagi","add a tag":"dodaj tag",Add:"Dodaj","Choose type to add":"Wybierz typ do dodania"},void 0===window.midgardCreate&&(window.midgardCreate={}),void 0===window.midgardCreate.locale&&(window.midgardCreate.locale={}),window.midgardCreate.locale.pt_BR={Save:"Salvar",Saving:"Salvando",Cancel:"Cancelar",Edit:"Editar",localModification:'Item "<%= label %>" nesta página possuem modificações locais',localModifications:"<%= number %> itens nesta página possuem modificações locais",Restore:"Restaurar",Ignore:"Ignorar",saveSuccess:'Item "<%= label %>" salvo com sucesso',saveSuccessMultiple:"<%= number %> itens salvos com sucesso",saveError:"Erro ocorrido ao salvar<br /><%= error %>","Item tags":"Tags de item","Suggested tags":"Tags sugeridas",Tags:"Tags","add a tag":"adicionar uma tag",Add:"Adicionar","Choose type to add":"Selecione o tipo para adicionar"},void 0===window.midgardCreate&&(window.midgardCreate={}),void 0===window.midgardCreate.locale&&(window.midgardCreate.locale={}),window.midgardCreate.locale.ro={Save:"Salvează",Saving:"Se salvează",Cancel:"Anulează",Edit:"Editare",localModification:'Zona "<%= label %>" a fost modificată',localModifications:"<%= number %> zone din această pagină au fost modificate",Restore:"Revenire",Ignore:"Ignoră",saveSuccess:'Zona "<%= label %>" a fost salvată',saveSuccessMultiple:"<%= number %> zone au fost salvate",saveError:"S-a produs o eroare în timpul salvării<br /><%= error %>","Item tags":"Etichetele zonei","Suggested tags":"Etichete sugerate",Tags:"Etichete","add a tag":"adaugă o etichetă",Add:"Adăugare","Choose type to add":"Alegeți un tip pentru adăugare"},void 0===window.midgardCreate&&(window.midgardCreate={}),void 0===window.midgardCreate.locale&&(window.midgardCreate.locale={}),window.midgardCreate.locale.ru={Save:"Сохранить",Saving:"Сохраняю",Cancel:"Отмена",Edit:"Редактировать",localModification:'В запись "<%= label %>" внесены несохранённые изменения',localModifications:"В записи на этой странице (<%= number %> шт.) внесены несохранённые изменения",Restore:"Восстановить",Ignore:"Игнорировать",saveSuccess:'Запись "<%= label %>" была успешно сохранена',saveSuccessMultiple:" Записи (<%= number %> шт.) были успешно сохранены",saveError:"Во время сохранения произошла ошибка<br /><%= error %>","Item tags":"Теги записей","Suggested tags":"Предлагаемые теги",Tags:"Теги","add a tag":"добавить тег",Add:"Добавить","Choose type to add":"Выбрать тип для добавления"},void 0===window.midgardCreate&&(window.midgardCreate={}),void 0===window.midgardCreate.locale&&(window.midgardCreate.locale={}),window.midgardCreate.locale.sv={Save:"Spara",Saving:"Sparar",Cancel:"Avbryt",Edit:"Redigera",localModification:'Elementet "<%= label %>" har lokala förändringar',localModifications:"<%= number %> element på den här sidan har lokala förändringar",Restore:"Återställ",Ignore:"Ignorera",saveSuccess:'Elementet "<%= label %>" sparades',saveSuccessMultiple:"<%= number %> element sparades",saveError:"Ett fel uppstod under sparande<br /><%= error %>","Item tags":"Element-taggar","Suggested tags":"Föreslagna taggar",Tags:"Taggar","add a tag":"lägg till en tagg",Add:"Lägg till","Choose type to add":"Välj typ att lägga till"}; |