}
+ function addReference(){
+ var selection = window.getSelection();
+ var n = selection.rangeCount;
+
+ if (n == 0) {
+ window.alert("Nie zaznaczono żadnego obszaru");
+ return false;
+ }
+
+ // for now allow only 1 range
+ if (n > 1) {
+ window.alert("Zaznacz jeden obszar");
+ return false;
+ }
+
+ // remember the selected range
+ var range = selection.getRangeAt(0);
+
+ if (!verifyTagInsertPoint(range.endContainer)) {
+ window.alert("Nie można wstawić w to miejsce przypisu.");
+ return false;
+ }
+
+ var tag = $('<span></span>');
+ range.collapse(false);
+ range.insertNode(tag[0]);
+
+ xml2html({
+ xml: '<ref href=""/>',
+ success: function(text){
+ var t = $(text);
+ tag.replaceWith(t);
+ openForEdit(t);
+ },
+ error: function(){
+ tag.remove();
+ alert('Błąd przy dodawaniu referncji:' + errors);
+ }
+ })
+ }
+
+
+
+
/* Insert theme using current selection */
function addTheme(){
var w = $box.outerWidth();
var h = $box.innerHeight();
- if ($origin.is(".annotation-inline-box")) {
+ if ($origin.is(".annotation-inline-box") | $origin.is('*[x-edit-no-format]')) {
w = Math.max(w, 400);
h = Math.max(h, 60);
if($('.htmlview div').offset().left + $('.htmlview div').width() > ($('.vsplitbar').offset().left - 480)){
}).appendTo($box[0].offsetParent || $box.parent()).show();
- if ($origin.is('.motyw')) {
+ if ($origin.is('*[x-edit-no-format]')) {
$('.akap-edit-button').remove();
+ }
+
+ if ($origin.is('.motyw')) {
$.themes.autocomplete($('textarea', $overlay));
}
};
});
}
- else if($box.is('*[x-annotation-box]')) {
+ else if($box.is('*[x-annotation-box]') || $origin.is('*[x-edit-attribute]')) {
$('.delete-button', $overlay).click(function(){
if (window.confirm("Czy jesteś pewien, że chcesz usunąć ten przypis?")) {
$origin.remove();
var serializer = new XMLSerializer();
+ if($box.attr("x-edit-attribute")) {
+ source = $('<span x-pass-thru="true"/>');
+ source.text($box.attr("data-wlf-" + $box.attr("x-edit-attribute")));
+ source = source[0];
+ } else {
+ source = $box[0];
+ }
+
html2text({
- element: $box[0],
+ element: source,
stripOuter: true,
success: function(text){
$('textarea', $overlay).val($.trim(text));
insertedText = insertedText.replace(/,\s*$/, '');
}
+ if($box.attr("x-edit-attribute")) {
+ xml = '<' + nodeName + ' ' + $box.attr("x-edit-attribute") + '="' + insertedText + '"/>';
+ } else {
+ xml = '<' + nodeName + '>' + insertedText + '</' + nodeName + '>';
+ }
+
+
xml2html({
- xml: '<' + nodeName + '>' + insertedText + '</' + nodeName + '>',
+ xml: xml,
success: function(element){
if (nodeName == 'out-of-flow-text') {
$(element).children().insertAfter($origin);
$origin.remove()
}
+ else if ($box.attr('x-edit-attribute')) {
+ $(element).insertAfter($origin);
+ $origin.remove();
+ }
else {
$origin.html($(element).html());
}
});
}
+
function VisualPerspective(options){
var old_callback = options.callback;
}
});
+ $('#insert-reference-button').click(function(){
+ addReference();
+ return false;
+ });
+
$('#insert-annotation-button').click(function(){
addAnnotation();
return false;
</span>
</xsl:template>
+ <xsl:template match="ref">
+ <span x-editable="true" x-common="common" x-edit-no-format="true" x-edit-attribute="href">
+ <xsl:call-template name="standard-attributes"/>
+ <a class="reference">📌</a>
+ </span>
+ </xsl:template>
+
<xsl:template match="begin">
<span>
<xsl:call-template name="standard-attributes" />
</xsl:template>
<xsl:template match="motyw">
- <span x-editable="true" x-common="common">
+ <span x-editable="true" x-edit-no-format="true" x-common="common">
<xsl:call-template name="standard-attributes" />
<xsl:attribute name="theme-class">
<xsl:value-of select="substring-after(@id, 'm')" />
msgstr ""
"Project-Id-Version: Platforma Redakcyjna\n"
"Report-Msgid-Bugs-To: \n"
-"PO-Revision-Date: 2013-07-10 16:58+0100\n"
+"PO-Revision-Date: 2020-11-06 17:26+0100\n"
"Last-Translator: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>\n"
"Language-Team: Fundacja Nowoczesna Polska <fundacja@nowoczesnapolska.org."
"pl>\n"
-"Language: \n"
+"Language: pl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: Poedit 1.5.4\n"
+"X-Generator: Poedit 2.3\n"
#: wiki/forms.py:17 wiki/forms.py:61 wiki/views.py:284
msgid "Publishable"
#: wiki/forms.py:50
msgid "Describe changes you made."
-msgstr "Opisz swoje zmiany"
+msgstr "Opisz swoje zmiany."
#: wiki/forms.py:56
msgid "Completed"
#: wiki/templates/wiki/document_details_base.html:52
msgid "Unknown"
-msgstr "nieznana"
+msgstr "Nieznana"
#: wiki/templates/wiki/document_details_base.html:54
#: wiki/templates/wiki/pubmark_dialog.html:16
#: wiki/templates/wiki/tabs/summary_view.html:41
msgid "without footnotes and themes"
-msgstr ""
+msgstr "bez przypisów i motywów"
#: wiki/templates/wiki/tabs/summary_view.html:42
msgid "with footnotes and themes"
-msgstr ""
+msgstr "z przypisami i motywami"
#: wiki/templates/wiki/tabs/summary_view.html:45
msgid "untagged"
msgid "Insert annotation"
msgstr "Wstaw przypis"
+#: wiki/templates/wiki/tabs/wysiwyg_editor.html:13
+msgid "Insert reference"
+msgstr "Wstaw referencję"
+
#: wiki/templates/wiki/tabs/wysiwyg_editor_item.html:3
msgid "Visual editor"
msgstr "Edytor wizualny"