Move base64 migration prompt to corner and only when the pad is stored
This commit is contained in:
@@ -81,6 +81,10 @@
|
|||||||
line-height: 200px;
|
line-height: 200px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
&.cp-corner-big {
|
||||||
|
width: 400px;
|
||||||
|
height: 250px;
|
||||||
|
}
|
||||||
|
|
||||||
.cp-corner-actions {
|
.cp-corner-actions {
|
||||||
min-height: 30px;
|
min-height: 30px;
|
||||||
|
|||||||
@@ -222,6 +222,7 @@ define(function () {
|
|||||||
out.notifyRenamed = "{0} is now known as {1}";
|
out.notifyRenamed = "{0} is now known as {1}";
|
||||||
out.notifyLeft = "{0} has left the collaborative session";
|
out.notifyLeft = "{0} has left the collaborative session";
|
||||||
|
|
||||||
|
out.ok = 'OK';
|
||||||
out.okButton = 'OK (enter)';
|
out.okButton = 'OK (enter)';
|
||||||
|
|
||||||
out.cancel = "Cancel";
|
out.cancel = "Cancel";
|
||||||
|
|||||||
@@ -879,7 +879,9 @@ define([
|
|||||||
|
|
||||||
UI.createRadio = Pages.createRadio;
|
UI.createRadio = Pages.createRadio;
|
||||||
|
|
||||||
UI.cornerPopup = function (text, actions, footer, startHidden) {
|
UI.cornerPopup = function (text, actions, footer, opts) {
|
||||||
|
opts = opts || {};
|
||||||
|
|
||||||
var minimize = h('div.cp-corner-minimize.fa.fa-window-minimize');
|
var minimize = h('div.cp-corner-minimize.fa.fa-window-minimize');
|
||||||
var maximize = h('div.cp-corner-maximize.fa.fa-window-maximize');
|
var maximize = h('div.cp-corner-maximize.fa.fa-window-maximize');
|
||||||
var popup = h('div.cp-corner-container', [
|
var popup = h('div.cp-corner-container', [
|
||||||
@@ -902,9 +904,12 @@ define([
|
|||||||
$(popup).removeClass('cp-minimized');
|
$(popup).removeClass('cp-minimized');
|
||||||
});
|
});
|
||||||
|
|
||||||
if (startHidden) {
|
if (opts.hidden) {
|
||||||
$(popup).addClass('cp-minimized');
|
$(popup).addClass('cp-minimized');
|
||||||
}
|
}
|
||||||
|
if (opts.big) {
|
||||||
|
$(popup).addClass('cp-corner-big');
|
||||||
|
}
|
||||||
|
|
||||||
var hide = function () {
|
var hide = function () {
|
||||||
$(popup).hide();
|
$(popup).hide();
|
||||||
|
|||||||
@@ -2335,13 +2335,10 @@ define([
|
|||||||
|
|
||||||
var hide = h('button.cp-corner-cancel', Messages.autostore_hide);
|
var hide = h('button.cp-corner-cancel', Messages.autostore_hide);
|
||||||
var store = h('button.cp-corner-primary', Messages.autostore_store);
|
var store = h('button.cp-corner-primary', Messages.autostore_store);
|
||||||
var actions = h('div', [
|
var actions = h('div', [store, hide]);
|
||||||
store,
|
|
||||||
hide,
|
|
||||||
]);
|
|
||||||
|
|
||||||
var initialHide = data && data.autoStore && data.autoStore === -1;
|
var initialHide = data && data.autoStore && data.autoStore === -1;
|
||||||
var modal = UI.cornerPopup(text, actions, footer, initialHide);
|
var modal = UI.cornerPopup(text, actions, footer, {hidden: initialHide});
|
||||||
|
|
||||||
$(modal.popup).find('.cp-corner-footer a').click(function (e) {
|
$(modal.popup).find('.cp-corner-footer a').click(function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ define([
|
|||||||
'/common/common-hash.js',
|
'/common/common-hash.js',
|
||||||
'/common/common-util.js',
|
'/common/common-util.js',
|
||||||
'/common/common-interface.js',
|
'/common/common-interface.js',
|
||||||
|
'/common/hyperscript.js',
|
||||||
'/bower_components/chainpad/chainpad.dist.js',
|
'/bower_components/chainpad/chainpad.dist.js',
|
||||||
'/customize/application_config.js',
|
'/customize/application_config.js',
|
||||||
'/common/test.js',
|
'/common/test.js',
|
||||||
@@ -54,6 +55,7 @@ define([
|
|||||||
Hash,
|
Hash,
|
||||||
Util,
|
Util,
|
||||||
UI,
|
UI,
|
||||||
|
h,
|
||||||
ChainPad,
|
ChainPad,
|
||||||
AppConfig,
|
AppConfig,
|
||||||
Test
|
Test
|
||||||
@@ -588,15 +590,24 @@ define([
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
framework._.sfCommon.isPadStored(function (err, val) {
|
||||||
|
if (!val) { return; }
|
||||||
var b64images = $(inner).find('img[src^="data:image"]:not(.cke_reset)');
|
var b64images = $(inner).find('img[src^="data:image"]:not(.cke_reset)');
|
||||||
if (b64images.length) {
|
if (b64images.length && framework._.sfCommon.isLoggedIn()) {
|
||||||
UI.confirm(Messages.pad_base64, function (yes) {
|
var no = h('button.cp-corner-cancel', Messages.cancel);
|
||||||
if (!yes) { return; }
|
var yes = h('button.cp-corner-primary', Messages.ok);
|
||||||
|
var actions = h('div', [yes, no]);
|
||||||
|
var modal = UI.cornerPopup(Messages.pad_base64, actions, '', {big: true});
|
||||||
|
$(no).click(function () {
|
||||||
|
modal.delete();
|
||||||
|
});
|
||||||
|
$(yes).click(function () {
|
||||||
|
modal.delete();
|
||||||
b64images.each(function (i, el) {
|
b64images.each(function (i, el) {
|
||||||
var src = $(el).attr('src');
|
var src = $(el).attr('src');
|
||||||
var blob = Util.dataURIToBlob(src);
|
var blob = Util.dataURIToBlob(src);
|
||||||
var ext = '.' + (blob.type.split('/')[1] || 'png');
|
var ext = '.' + (blob.type.split('/')[1] || 'png');
|
||||||
var name = framework._.title.getTitle()+'_image' || 'Pad_image';
|
var name = (framework._.title.getTitle() || 'Pad')+'_image';
|
||||||
blob.name = name + ext;
|
blob.name = name + ext;
|
||||||
var ev = {
|
var ev = {
|
||||||
insertElement: function (newEl) {
|
insertElement: function (newEl) {
|
||||||
@@ -609,6 +620,7 @@ define([
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
/*setTimeout(function () {
|
/*setTimeout(function () {
|
||||||
$('iframe.cke_wysiwyg_frame').focus();
|
$('iframe.cke_wysiwyg_frame').focus();
|
||||||
editor.focus();
|
editor.focus();
|
||||||
|
|||||||
Reference in New Issue
Block a user