Skip to content

Commit

Permalink
compiled
Browse files Browse the repository at this point in the history
  • Loading branch information
thet committed Jun 20, 2019
1 parent ee430b2 commit 48a3840
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 35 deletions.

Large diffs are not rendered by default.

119 changes: 87 additions & 32 deletions src/plone/staticresources/static/plone-logged-in-compiled.js
Original file line number Diff line number Diff line change
Expand Up @@ -56613,7 +56613,7 @@ return (function () { this.tinyMCE.DOM.events.domLoaded = true; return this.tiny
define('text!mockup-patterns-tinymce-url/templates/link.xml',[],function () { return '<div>\n <div class="linkModal">\n <h1><%- insertHeading %></h1>\n <% if(upload){ %>\n <p class="info">Specify the object to link to. It can be on this site already ("Internal"), an object you upload ("Upload"), from an external site ("External"), an email address ("Email"), or an anchor on this page ("Anchor").</p>\n <% } %>\n\n <div class="linkTypes pat-autotoc autotabs"\n data-pat-autotoc="section:fieldset;levels:legend;IDPrefix:tinymce-autotoc-">\n\n <fieldset class="linkType internal" data-linkType="internal">\n <legend id="tinylink-internal">Internal</legend>\n <div>\n <div class="form-group main">\n <!-- this gives the name to the "linkType" -->\n <input type="text" name="internal" />\n </div>\n </div>\n </fieldset>\n\n <% if(upload){ %>\n <fieldset class="linkType upload" data-linkType="upload">\n <legend id="tinylink-upload">Upload</legend>\n <div class="uploadify-me"></div>\n </fieldset>\n <% } %>\n\n <fieldset class="linkType external" data-linkType="external">\n <legend id="tinylink-external">External</legend>\n <div class="form-group main">\n <label for="external"><%- externalText %></label>\n <input type="text" name="external" />\n </div>\n </fieldset>\n\n <fieldset class="linkType email" data-linkType="email">\n <legend id="tinylink-email">Email</legend>\n <div class="form-inline">\n <div class="form-group main">\n <label><%- emailText %></label>\n <input type="text" name="email" />\n </div>\n <div class="form-group">\n <label><%- subjectText %></label>\n <input type="text" name="subject" />\n </div>\n </div>\n </fieldset>\n\n <fieldset class="linkType anchor" data-linkType="anchor">\n <legend id="tinylink-anchor">Anchor</legend>\n <div>\n <div class="form-group main">\n <label>Select an anchor</label>\n <div class="input-wrapper">\n <select name="anchor" class="pat-select2" data-pat-select2="width:500px" />\n </div>\n </div>\n </div>\n </fieldset>\n\n </div><!-- / tabs -->\n\n <div class="common-controls">\n <div class="form-group">\n <label>Target</label>\n <select name="target">\n <% _.each(targetList, function(target){ %>\n <option value="<%- target.value %>"><%- target.text %></option>\n <% }); %>\n </select>\n </div>\n <div class="form-group">\n <label><%- titleText %></label>\n <input type="text" name="title" />\n </div>\n </div>\n\n <input type="submit" class="plone-btn" name="cancel" value="<%- cancelBtn %>" />\n <input type="submit" class="plone-btn plone-btn-primary context" name="insert" value="<%- insertBtn %>" />\n </div>\n</div>\n';});


define('text!mockup-patterns-tinymce-url/templates/image.xml',[],function () { return '<div>\n <div class="linkModal">\n <h1><%- insertHeading %></h1>\n <% if(_.contains(linkTypes, \'uploadImage\')){ %>\n <p class="info">Specify an image. It can be on this site already ("Internal Image"), an image you upload ("Upload"), or from an external site ("External Image").</p>\n <% } %>\n\n <div class="linkTypes pat-autotoc autotabs"\n data-pat-autotoc="section:fieldset;levels:legend;IDPrefix:tinymce-autotoc-">\n\n <% if(_.contains(linkTypes, \'image\')){ %>\n <fieldset class="linkType image" data-linkType="image">\n <legend id="tinylink-image">Internal Image</legend>\n <div class="form-inline">\n <div class="form-group main">\n <input type="text" name="image" />\n </div>\n <div class="form-group scale">\n <label><%- scaleText %></label>\n <select name="scale">\n <option value="">Original</option>\n <% _.each(imageScales, function(scale){ %>\n <option value="<%- scale.value %>" <% if(scale.value === options.defaultScale){ %>selected<% } %> >\n <%- scale.title %>\n </option>\n <% }); %>\n </select>\n </div>\n </div>\n </fieldset>\n <% } %>\n\n <% if(_.contains(linkTypes, \'uploadImage\')){ %>\n <fieldset class="linkType uploadImage" data-linkType="uploadImage">\n <legend id="tinylink-uploadImage">Upload</legend>\n <div class="uploadify-me"></div>\n </fieldset>\n <% } %>\n\n <% if(_.contains(linkTypes, \'externalImage\')){ %>\n <fieldset class="linkType externalImage" data-linkType="externalImage">\n <legend id="tinylink-externalImage">External Image</legend>\n <div>\n <div class="form-group main">\n <label><%- externalImageText %></label>\n <input type="text" name="externalImage" />\n </div>\n </div>\n </fieldset>\n <% } %>\n\n </div><!-- / tabs -->\n\n <div class="common-controls">\n <div class="form-group title">\n <label><%- titleText %></label>\n <input type="text" name="title" />\n </div>\n <div class="form-group text">\n <label><%- altText %></label>\n <input type="text" name="alt" />\n </div>\n <div class="form-group align">\n <label><%- imageAlignText %></label>\n <select name="align">\n <% _.each(Object.keys(options.imageClasses), function(align){ %>\n <option value="<%- align %>">\n <%- options.imageClasses[align] %>\n </option>\n <% }); %>\n <select>\n </div>\n </div>\n\n <input type="submit" class="plone-btn" name="cancel" value="<%- cancelBtn %>" />\n <input type="submit" class="plone-btn plone-btn-primary context" name="insert" value="<%- insertBtn %>" />\n\n </div>\n</div>\n';});
define('text!mockup-patterns-tinymce-url/templates/image.xml',[],function () { return '<div>\n <div class="linkModal">\n <h1><%- insertHeading %></h1>\n <% if(_.contains(linkTypes, \'uploadImage\')){ %>\n <p class="info">Specify an image. It can be on this site already ("Internal Image"), an image you upload ("Upload"), or from an external site ("External Image").</p>\n <% } %>\n\n <div class="linkTypes pat-autotoc autotabs"\n data-pat-autotoc="section:fieldset;levels:legend;IDPrefix:tinymce-autotoc-">\n\n <% if(_.contains(linkTypes, \'image\')){ %>\n <fieldset class="linkType image" data-linkType="image">\n <legend id="tinylink-image">Internal Image</legend>\n <div class="form-inline">\n <div class="form-group main">\n <input type="text" name="image" />\n </div>\n <div class="form-group scale">\n <label><%- scaleText %></label>\n <select name="scale">\n <option value="">Original</option>\n <% _.each(imageScales, function(scale){ %>\n <option value="<%- scale.value %>" <% if(scale.value === options.defaultScale){ %>selected<% } %> >\n <%- scale.title %>\n </option>\n <% }); %>\n </select>\n </div>\n </div>\n </fieldset>\n <% } %>\n\n <% if(_.contains(linkTypes, \'uploadImage\')){ %>\n <fieldset class="linkType uploadImage" data-linkType="uploadImage">\n <legend id="tinylink-uploadImage">Upload</legend>\n <div class="uploadify-me"></div>\n </fieldset>\n <% } %>\n\n <% if(_.contains(linkTypes, \'externalImage\')){ %>\n <fieldset class="linkType externalImage" data-linkType="externalImage">\n <legend id="tinylink-externalImage">External Image</legend>\n <div>\n <div class="form-group main">\n <label><%- externalImageText %></label>\n <input type="text" name="externalImage" />\n </div>\n </div>\n </fieldset>\n <% } %>\n\n </div><!-- / tabs -->\n\n <div class="common-controls">\n <div class="form-group title">\n <label><%- titleText %></label>\n <input type="text" name="title" />\n </div>\n <div class="form-group text">\n <label><%- altText %></label>\n <input type="text" name="alt" />\n </div>\n <div class="form-group captionFromDescription">\n <label>\n <input type="checkbox" name="captionFromDescription" />\n <%- captionFromDescriptionText %>\n </label>\n </div>\n <div class="form-group caption">\n <label><%- captionText %></label>\n <textarea name="caption" />\n </div>\n <div class="form-group align">\n <label><%- imageAlignText %></label>\n <select name="align">\n <% _.each(Object.keys(options.imageClasses), function(align){ %>\n <option value="<%- align %>">\n <%- options.imageClasses[align] %>\n </option>\n <% }); %>\n <select>\n </div>\n </div>\n\n <input type="submit" class="plone-btn" name="cancel" value="<%- cancelBtn %>" />\n <input type="submit" class="plone-btn plone-btn-primary context" name="insert" value="<%- insertBtn %>" />\n\n </div>\n</div>\n';});

define('mockup-patterns-tinymce-url/js/links',[
'jquery',
Expand Down Expand Up @@ -57092,6 +57092,8 @@ define('mockup-patterns-tinymce-url/js/links',[
externalImageText: this.options.text.externalImage,
altText: this.options.text.alt,
imageAlignText: this.options.text.imageAlign,
captionFromDescriptionText: this.options.text.captionFromDescription,
captionText: this.options.text.caption,
scaleText: this.options.text.scale,
imageScales: this.options.imageScales,
cancelBtn: this.options.text.cancelBtn,
Expand All @@ -57113,6 +57115,8 @@ define('mockup-patterns-tinymce-url/js/links',[
self.$alt = $('input[name="alt"]', self.modal.$modal);
self.$align = $('select[name="align"]', self.modal.$modal);
self.$scale = $('select[name="scale"]', self.modal.$modal);
self.$captionFromDescription = $('input[name="captionFromDescription"]', self.modal.$modal);
self.$caption = $('textarea[name="caption"]', self.modal.$modal);

/* load up all the link types */
_.each(self.options.linkTypes, function(type) {
Expand All @@ -57132,6 +57136,15 @@ define('mockup-patterns-tinymce-url/js/links',[
}
});
});

self.$captionFromDescription.change(function () {
if (this.checked) {
self.$caption.prop('disabled', true);
} else {
self.$caption.prop('disabled', false);
}
});

},

getLinkUrl: function() {
Expand Down Expand Up @@ -57191,17 +57204,23 @@ define('mockup-patterns-tinymce-url/js/links',[
updateImage: function(src) {
var self = this;
var title = self.$title.val();
var captionFromDescription = self.$captionFromDescription.prop('checked')

self.tiny.focus();
self.tiny.selection.setRng(self.rng);

var cssclasses = ['image-richtext', self.$align.val()];
if (captionFromDescription) {
cssclasses.push('captioned');
}

var data = $.extend(true, {}, {
src: src,
title: title ? title : null,
alt: self.$alt.val(),
'class': self.$align.val(),
'class': cssclasses.join(' '),
'data-linkType': self.linkType,
'data-scale': self.$scale.val()
'data-scale': self.$scale.val(),
}, self.linkTypes[self.linkType].attributes());
if (self.imgElm && !self.imgElm.getAttribute('data-mce-object')) {
data.width = self.dom.getAttrib(self.imgElm, 'width');
Expand All @@ -57217,14 +57236,30 @@ define('mockup-patterns-tinymce-url/js/links',[
};
}

if (!self.imgElm) {
data.id = '__mcenew';
self.tiny.insertContent(self.dom.createHTML('img', data));
self.imgElm = self.dom.get('__mcenew');
self.dom.setAttrib(self.imgElm, 'id', null);
if (self.imgElm) {
self.dom.remove(self.imgElm);
}
if (self.captionElm) {
self.dom.remove(self.captionElm);
}
if (self.figureElm) {
self.dom.remove(self.figureElm);
}

data.id = '__mcenew';
var html_inner = self.dom.createHTML('img', data);
var caption = self.$caption.val();
var html_string;
if (caption && ! captionFromDescription) {
html_inner += '\n' + self.dom.createHTML('figcaption', {}, caption);
//html_inner += '\n' + self.dom.createHTML('figcaption', { class: 'mceNonEditable' }, caption);
html_string = self.dom.createHTML('figure', {}, html_inner);
} else {
self.dom.setAttribs(self.imgElm, data);
html_string = html_inner;
}
self.tiny.insertContent(html_string);
self.imgElm = self.dom.get('__mcenew');
self.dom.setAttrib(self.imgElm, 'id', null);

waitLoad(self.imgElm);
if (self.imgElm.complete) {
Expand Down Expand Up @@ -57344,39 +57379,56 @@ define('mockup-patterns-tinymce-url/js/links',[
self.data.title = value;
}

self.selection = self.tiny.selection;
self.tiny.focus();
var selectedElm = self.imgElm = self.selection.getNode();
self.anchorElm = self.dom.getParent(selectedElm, 'a[href]');
self.anchorElm = self.dom.getParent(self.selectedElm, 'a[href]');

var linkType;
var linkType
if (self.isImageMode()) {
if (self.imgElm.nodeName !== 'IMG') {
// try finding elsewhere
if (self.anchorElm) {
var imgs = self.anchorElm.getElementsByTagName('img');
if (imgs.length > 0) {
self.imgElm = imgs[0];
self.focusElement(self.imgElm);
}
}
}
if (self.imgElm.nodeName !== 'IMG') {
// okay, still no image, unset
self.imgElm = null;
}

var figure;
var img;
var caption;
if (self.selectedElm.nodeName === 'FIGURE') {
figure = self.selectedElm;
img = figure.querySelector('img');
caption = figure.querySelector('figcaption');
} else if (self.selectedElm.nodeName === 'IMG') {
figure = $(self.selectedElm).closest('figure');
figure = figure.length ? figure[0] : undefined;
img = self.selectedElm;
caption = figure ? figure.querySelector('figcaption') : undefined;
} else if (self.selectedElm.nodeName === 'FIGCAPTION') {
figure = $(self.selectedElm).closest('figure');
figure = figure.length ? figure[0] : undefined;
img = figure ? figure.querySelector('img') : undefined;
caption = self.selectedElm;
}

self.imgElm = img;
self.figureElm = figure;
self.captionElm = caption;

if (self.imgElm) {
var src = self.dom.getAttrib(self.imgElm, 'src');
self.$title.val(self.dom.getAttrib(self.imgElm, 'title'));
self.$alt.val(self.dom.getAttrib(self.imgElm, 'alt'));

self.$captionFromDescription.prop('checked', $(self.imgElm).hasClass('captioned'));
if (self.captionElm) {
self.$caption.val(self.captionElm.innerHTML);
if (self.$captionFromDescription.prop('checked')) {
self.$caption.prop('disabled', true);
}
}

linkType = self.dom.getAttrib(self.imgElm, 'data-linktype');
if (linkType) {
self.linkType = linkType;
self.linkTypes[self.linkType].load(self.imgElm);
var scale = self.dom.getAttrib(self.imgElm, 'data-scale');
self.$scale.val(scale);
$('#tinylink-' + self.linkType, self.modal.$modal).trigger('click');
}else if (src) {
} else if (src) {
self.guessImageLink(src);
}
var className = self.dom.getAttrib(self.imgElm, 'class');
Expand All @@ -57390,7 +57442,8 @@ define('mockup-patterns-tinymce-url/js/links',[
}
}
}
}else if (self.anchorElm) {

} else if (self.anchorElm) {
self.focusElement(self.anchorElm);
var href = '';
href = self.dom.getAttrib(self.anchorElm, 'href');
Expand Down Expand Up @@ -93623,7 +93676,7 @@ define("tinymce-compat3x", ["tinymce"], function() {
* Options:
* relatedItems(object): Related items pattern options. ({ attributes: ["UID", "Title", "Description", "getURL", "portal_type", "path", "ModificationDate"], batchSize: 20, basePath: "/", vocabularyUrl: null, width: 500, maximumSelectionSize: 1, placeholder: "Search for item on site..." })
* upload(object): Upload pattern options. ({ attributes: look at upload pattern for getting the options list })
* text(object): Translation strings ({ insertBtn: "Insert", cancelBtn: "Cancel", insertHeading: "Insert link", title: "Title", internal: "Internal", external: "External", email: "Email", anchor: "Anchor", subject: "Subject" image: "Image", imageAlign: "Align", scale: "Size", alt: "Alternative Text", externalImage: "External Image URI"})
* text(object): Translation strings ({ insertBtn: "Insert", cancelBtn: "Cancel", insertHeading: "Insert link", title: "Title", internal: "Internal", external: "External", email: "Email", anchor: "Anchor", subject: "Subject" image: "Image", imageAlign: "Align", scale: "Size", alt: "Alternative Text", captionFromDescription: "Show Image Caption from Image Description", caption: "Image Caption", externalImage: "External Image URI"})
* imageScales(string): Image scale name/value object-array or JSON string for use in the image dialog.
* targetList(array): TODO ([ {text: "Open in this window / frame", value: ""}, {text: "Open in new window", value: "_blank"}, {text: "Open in parent window / frame", value: "_parent"}, {text: "Open in top frame (replaces all frames)", value: "_top"}])
* imageTypes(string): TODO ('Image')
Expand Down Expand Up @@ -93764,7 +93817,9 @@ define('mockup-patterns-tinymce',[
imageAlign: _t('Align'),
scale: _t('Size'),
alt: _t('Alternative Text'),
externalImage: _t('External Image URL (can be relative within this site or absolute if it starts with http:// or https://)')
captionFromDescription: _t('Show Image Caption from Image Description'),
caption: _t('Image Caption'),
externalImage: _t('External Image URL (can be relative within this site or absolute if it starts with http:// or https://)'),
},
// URL generation options
loadingBaseUrl: '../../../node_modules/tinymce-builded/js/tinymce/',
Expand Down Expand Up @@ -94996,5 +95051,5 @@ require([
'use strict';
});

define("/Users/peter/workspace/buildout.coredev52py37/src/plone.staticresources/src/plone/staticresources/static/plone-logged-in.js", function(){});
define("/home/_thet/data/dev/plone/buildout.coredev/src/plone.staticresources/src/plone/staticresources/static/plone-logged-in.js", function(){});

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit 48a3840

Please sign in to comment.