Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Added assets
- Loading branch information
Showing
5 changed files
with
127 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.field-multilingual-oembed .invalid .tab-panel label > div { | ||
color: #222; | ||
} | ||
|
||
.field-multilingual-oembed .invalid .tab-panel label > div > i { | ||
color: #a9a9a9; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(function ($, undefined) { | ||
|
||
|
||
})(this.jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
(function ($, undefined) { | ||
|
||
'use strict'; | ||
|
||
if (!!Symphony.Extensions.MultilingualoEmbedField) { | ||
return; | ||
} | ||
Symphony.Extensions.MultilingualoEmbedField = true; | ||
|
||
// from backend.views.js | ||
var change = function (e) { | ||
var selectbox = $(this); | ||
var parent = selectbox.parents('.instance'); | ||
var headline = parent.find('.frame-header h4'); | ||
var values = selectbox.find(':selected'); | ||
var span = headline.find('.required'); | ||
|
||
if(!!values.length) { | ||
var langs = []; | ||
values.each(function (index, elem) { | ||
var text = $(this).text(); | ||
langs.push(text); | ||
if (index < values.length - 2) { | ||
langs.push(', '); | ||
} else if (index < values.length - 1) { | ||
langs.push(' and '); | ||
} | ||
}); | ||
|
||
if (!span.length) { | ||
span = $('<span />', { | ||
class: 'required' | ||
}).appendTo(headline); | ||
} | ||
|
||
span.html( | ||
'— ' + langs.join('') + ' ' + | ||
Symphony.Language.get(langs.length > 1 ? 'are' : 'is') + ' ' + | ||
Symphony.Language.get('required') | ||
); | ||
} | ||
|
||
// Is not required | ||
else { | ||
headline.find('.required').remove(); | ||
} | ||
}; | ||
|
||
$(function () { | ||
$('.field-multilingual_oembed.instance select[name*="[required_languages]"]') | ||
.on('change', change) | ||
.trigger('change'); | ||
|
||
/*if (!!Symphony.Context.get().version) { | ||
Symphony.Elements.contents.find('.instance.field-textbox').each(function () { | ||
var $field = $(this); | ||
var $header = $field.find('.frame-header'); | ||
$header.append( | ||
$('<a />').attr('class', 'field-multilingual_textbox-converter debug') | ||
.attr('style', 'right: 11rem;font-size: 0.9em;') | ||
.text(Symphony.Language.get('Convert to multilingual')) | ||
); | ||
}).on('click', '.field-multilingual_textbox-converter', function (e) { | ||
var $field = $(this).closest('.field-textbox'); | ||
var id = $field.find('input[name$=\\[id\\]]').val(); | ||
e.stopPropagation(); | ||
if (!confirm(Symphony.Language.get('Are you sure?'))) { | ||
return false; | ||
} | ||
$.post(Symphony.Context.get('path') + '/extension/multilingual_field/convert/' + id + '/') | ||
.done(function (data) { | ||
if (data && data.ok) { | ||
window.location.reload(); | ||
} | ||
}); | ||
return; | ||
}); | ||
}*/ | ||
}); | ||
|
||
})(jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters