|
|
Namespace:"Nice" NamesThis allows for displaying nice names in the status bar and the context menu helptextWill add a browser-native yellow popup with the text to menuentries of that element and attribute texts in attribute dialog Don't Show in context menuThere are cases, where you don't want to display certain tags in the context menu or the menulist on the top left. With <bxe:dontshow/> you remove them from those lists. Works also for attributes. This can be useful, if you have legacy elements in your documents, but you don't want, that people can choose them for newly created content. Not EditableIf you want to make an element non editable, assign the bxe:noteditable instruction. If the element has subelements, then those are still editable. also possible the context menu will then still be available, but the content is still not editable. Automatic Next Element On ReturnAppends for example a <p> element after a <h1> element, when you hit return. By default the same element will be appended. It only does append the nextelement, if the cursor is at the end of the element. If you are in the middle of it, then it just splits it. or with a namespace Default ContentIf we append or insert a new element, some text usually has to be inserted. If you don't specify bxe:defaultcontent then BXE just inserts the localname of that element. Otherwise it takes the content of this tag. This works also for attributes. type="function"Furthermore you can call a userdefined function, if you define the type attribute. This can for example be used for automatically inserting the current date. (See http://svn.liip.ch/repos/bxe/branches/bxe_2_0/examples/rss/rss.js for such an example) This works also for attributes. type="element"Inserts now automatically also a para element, when you insert a block element. Caution: You have to be sure, that you the XML document is valid afterwards. There will be no auto-appending of other elements currently (even if the RNG says so). If you need to insert more than one element, you have to create your own onnew function handler (for the block element in this example) OnNew CallbackThe onnew instruction is used, when a new element (or attribute) is created. It's similar to defaultcontent, but instead of just defining the content of the text node, you can do much more advanced stuff here as you can manipulate the whole node. If you define type="popup", then a popup is opened with the url defined. From there you can for example show a image chooser dialog and then insert that image to the document. For more information about that topic, see OnNewCallbacks (for attributes only function-type is supported)
Difference to defaultcontentThe difference between onnew and defaultcontent is (with type="function"), that onnew has full control over the element (meaning, it has to set the content by itself or the attribute), but defaultcontent can only return a text-string. onempty callbackbxe:onempty defines, what should happen, if an element is "emptied" (by deleting the textcontent)
1) wenn ein <bxe:onempty ... /> gesetzt ist, wird immer das ausgeführt. 2) wenn kein bxe:onempty, aber bxe:defaultcontent, dann wird dieser 3) wenn kein bxe:onempty und kein bxe:defaultcontent -> element wird 3a) wird fall 3) ausgeführt, sind auch das Parent-Element (und Eine Beispiel funktion würde folgendermassen aussehen: Wenn man return false macht, dann wird der node gelöscht, wenn true, Add Menu entryYou can add context menu entries based on the element called. <bxe:menuentry type="seebelow" name="Text for menu entry">value</bxe:menuentry> The popup and function calls work similar to the one mentioned above in bxe:onnew. For popup calls window.bxe_lastNode is set with the calling element, for function calls, the calling element is in the first parameter (both as XMLNode Objects)
Attribute selectorOffers a [ ... ] box in "Edit Attributes.." instead of just a textfield (or a selector) <bxe:selector type="seebelow">value</bxe:selector>
If you use the popup type, you have to use the function bxe_insertAttributeValue to insert the choosen value. Example: window.opener.bxe_insertAttributeValue("chregu@bitflux.ch"); If you use a callback function, it has to return a string with the value. Or if you do it asynchronous, you can also use the bxe_insertAttributeValue function. In popup, it's possible to get actual value of attribute with bxe_getAttributeValue. Example : print window.opener.bxe_getAttributeValue(); |