- Поиск на Youtube Быстрый поиск видео на Youtube.
- Фоторедактор Здесь вы можете отредактировать свои изображения перед размещением их на фотохостинге. Многофункциональный онлайн-инструментарий.
- iPleer.fm Здесь вы можете найти практически любую песню.
- Гид по сайту Тема о новых опциях на сайте с инструкциями и иллюстрациями.
- Наша беседка В этой теме можете задать любой интересующий вопрос относительно сайта и не только.
- Техподдержка В этом разделе Вы можете создать тему технического характера, связанных с компьютерами, телефонами и интернетом.
Последние темы
Любимые темы
Загрузка избранного...
Страница 1 из 1 • Поделиться
Вставка изображения с маршрутной ссылкой
Почти каждый хостинг предлагает готовую ссылку, но может и пригодится кому.
Результат :
- Код:
$(function() {
$(function() {
$('.sceditor-button-image').after('<a title="Вставка изображения" class="sceditor-button sceditor-button-imganc"><div style="background:url(http://i39.servimg.com/u/f39/18/21/41/30/imganc10.png);"></div></a>');
$('.sceditor-button-imganc').click(function() {
if ($('.sceditor-insertimganc').length) return $('.sceditor-insertimganc').remove();
$('body').append('<div class="sceditor-dropdown sceditor-insertimganc" style="position:absolute;"><div><label>Ссылка на изображение</label> <input id="imganc-img" class="url" placeholder="http://" type="text"></div><div><label>Маршрутная ссылка</label> <input id="imganc-url" class="url" placeholder="http://" type="text"></div><div><label>Ширина (необязательное поле)</label> <input id="imganc-width" size="2" type="text"></div><div><label>Высота (необязательное поле)</label> <input id="imganc-height" size="2" type="text"></div><div><input id="submit-imganc" class="button" value="Вставка" type="button"></div></div>');
$('.sceditor-insertimganc').css({
'left': $('.sceditor-button-imganc').offset().left + 'px',
'top': $('.sceditor-button-imganc').offset().top + 25 + 'px'
});
$('#submit-imganc').click(function() {
var dimension = '',
width = $('#imganc-width').val(),
height = $('#imganc-height').val(),
image = $('#imganc-img').val(),
url = $('#imganc-url').val();
if (width.length > 0 && height.length > 0) dimension = '(' + width + 'px,' + height + 'px)';
else if (width.length > 0 && height.length < 1) dimension = '(' + width + 'px,' + width + 'px)';
else if (width.length < 1 && height.length > 0) dimension = '(' + height + 'px,' + height + 'px)';
if (image.length > 0 && url.length > 0) $('#text_editor_textarea').sceditor('instance').insertText('[url=' + url + '][img' + dimension + ']' + image, '[/img][/url]');
$('.sceditor-insertimganc').remove();
return false
})
});
$('.sceditor-button-source').click(function() {
$('.sceditor-button-imganc').removeClass('disabled')
});
$('.sceditor-button').not('.sceditor-button-imganc').click(function() {
$('.sceditor-insertimganc').remove()
});
$('.sceditor-container textarea').focus(function() {
$('.sceditor-insertimganc').remove()
});
$('.sceditor-container i-frame').contents().mousedown(function() {
$('.sceditor-insertimganc').remove()
})
})
});
Результат :
Феникс- Администратор
Посты : 1598
Очки : 6378
Возраст : 52
Откуда : Россошь
Re: Вставка изображения с маршрутной ссылкой
список команд
- Код:
$(function() {
if (!$.sceditor) return;
$.sceditor.command.set('cmd', {
dropDown : function(editor, caller, callback) {
// Добавьте ниже метки, которые станут частью вашей команды, разделяя их запятыми
var items = ['sucesso', 'alerta', 'info', 'visitante', 'aviso'];
var content = $(
'<div>' +
' <div>' +
' <label>Выберите тег</label>' +
' <select></select>' +
' </div>' +
' <div>' +
' <label>Заголовок (необязательно)</label>' +
' <input type="text" id="cmdValue" value="" />' +
' </div>' +
' <div>' +
' <input type="button" class="button" value="Вставить">' +
' </div>' +
'</div>'
);
$.each(items, function(key, val) {
content.find('select').append('<option class="sceditor-cmd-option" value="' + val + '">' + val + '</option>');
});
content.find('.button').click(function(e) {
callback(content.find('select').val());
editor.closeDropDown(true);
});
editor.createDropDown(caller, "cmd", content);
},
// РЕЖИМ WYSIWYG
exec : function(caller) {
var editor = this;
$.sceditor.command.get('cmd').dropDown(editor, caller, function(cmd) {
var before = '[' + cmd + ']', end = '[/' + cmd + ']', title = $('#cmdValue').val();
if(title !== '') {
before = '[' + cmd + '="' + title + '"]';
editor.wysiwygEditorInsertHtml(before, end);
}
});
},
// РЕЖИМ ИСТОЧНИКА
txtExec : function(caller) {
var editor = this;
$.sceditor.command.get('cmd').dropDown(editor, caller, function(cmd) {
var title = $('#cmdValue').val();
if(title) {
editor.insertText('[' + cmd + '="' + title + '"]','[/' + cmd + ']');
} else {
editor.insertText('[' + cmd + ']','[/' + cmd + ']');
}
});
}, tooltip: "Список команд"});
toolbar = toolbar.replace(/quote/,'cmd,quote');
$('head').append(
'<style type="text/css">' +
'.sceditor-button-cmd div {' +
' background:url(https://cdn2.iconfinder.com/data/icons/snipicons/500/th-list-16.png) !important}' +
' .sceditor-cmd {' +
' width:auto;' +
' height:auto;' +
' overflow-y:auto;' +
'}' +
'.sceditor-cmd select {' +
' margin: 0 0 .75em;' +
'}' +
'</style>'
);
});
Феникс- Администратор
Посты : 1598
Очки : 6378
Возраст : 52
Откуда : Россошь
Страница 1 из 1
URL: | |
BBCode: | |
HTML: |
Права доступа к этому форуму:
Вы не можете отвечать на сообщения
Вт 29 Мар - 7:21 автор Nataliya
» Шаман......
Вт 29 Мар - 7:19 автор Nataliya
» [Салаты] Пять ошибок при приготовлении оливье
Ср 26 Янв - 13:20 автор Scheila
» Наша Беседка.. :)
Сб 18 Дек - 13:17 автор Феникс
» Супы из рыбы и морепродуктов
Вт 14 Дек - 22:26 автор Scheila
» Другие закуски
Вт 14 Дек - 22:25 автор Scheila
» Теперь мы есть в Telegram
Чт 26 Авг - 7:59 автор Феникс
» мои клипы.
Ср 4 Авг - 20:55 автор Nataliya
» МОМЕНТЫ ЖИЗНИ
Ср 4 Авг - 20:44 автор Nataliya