Your fucking browser doesn't support JavaScript, so you can't post here.
VBsupport перешел с домена .ORG на родной .RU
Ура!
Пожалуйста, обновите свои закладки - VBsupport.ru
Блок РКН снят, форум доступен на всей территории России, включая новые терртории, без VPN
На форуме введена премодерация ВСЕХ новых пользователей
Почта с временных сервисов, типа mailinator.com, gawab.com и/или прочих, которые предоставляют временный почтовый ящик без регистрации и/или почтовый ящик для рассылки спама, отслеживается и блокируется, а так же заносится в спам-блок форума, аккаунты удаляются
for English speaking users:
You may be surprised with restriction of access to the attachments of the forum. The reason is the recent change in vbsupport.org strategy:
- users with reputation < 10 belong to "simple_users" users' group
- if your reputation > 10 then administrator (kerk, Luvilla) can decide to move you into an "improved" group, but only manually
Main idea is to increase motivation of community members to share their ideas and willingness to support to each other. You may write an article for the subject where you are good enough, you may answer questions, you may share vbulletin.com/org content with vbsupport.org users, receiving "thanks" equal your reputation points. We should not only consume, we should produce something.
- you may:
* increase your reputation (doing something useful for another members of community) and being improved
* purchase temporary access to the improved category:
10 $ for 3 months. - this group can download attachments, reputation/posts do not matter.
20 $ for 3 months. - this group can download attachments, reputation/posts do not matter + adds eliminated + Inbox capacity increased + files manager increased permissions.
Please contact kerk or Luvilla regarding payments.
Important!:
- if your reputation will become less then 0, you will be moved into "simple_users" users' group automatically.*
*for temporary groups (pre-paid for 3 months) reputation/posts do not matter.
Уважаемые пользователи!
На форуме открыт новый раздел "
Каталог фрилансеров "
и отдельный раздел для платных заказов "
Куплю/Закажу "
Если вы хотите приобрести какой то скрипт/продукт/хак из каталогов перечисленных ниже:
Каталог модулей/хаков
Ещё раз обращаем Ваше внимание: всё, что Вы скачиваете и устанавливаете на свой форум, Вы устанавливаете исключительно на свой страх и риск.
Сообщество vBSupport'а физически не в состоянии проверять все стили, хаки и нули, выкладываемые пользователями.
Помните: безопасность Вашего проекта - Ваша забота.
Убедительная просьба : при обнаружении уязвимостей или сомнительных кодов обязательно отписывайтесь в теме хака/стиля
Спасибо за понимание
06-14-2010, 05:26 PM
Эксперт
Join Date: Dec 2008
Location: Харьков, Украина
Награды в конкурсах:
Posts: 1,096
Версия vB: 3.8.x
Пол:
Reputation:
Professional 885
Репутация в разделе: 327
Многооконный редактор шаблонов без перезагрузки страниц
10
Главная суть топика в идее! с реализацией на примере редактора шаблонов.
результатом будет являться следующее: многофорточность (одновременно можно открыть несколько шаблонов и редактировать каждый независимо друг от друга)
открытие редактора/редакторов без перезагрузки стр.
сохранение отредактированного шаблона/шаблонов без перезагрузки стр.
произвольное растягивание окон редактора за уголок (при соотв. настройке highslide, разумеется) либо ресайзом на yui/jquery (либо и тем и тем)
а так же можно произвольно тягать каждое окно по странице (так же при соотв. настройке highslide)
окно в окне (польза от этого сомнительная, но присутствует по дефолту)
возможность открытия отдельныех окон со списком всех шаблонов (открывать шаблоны на редактировании можно из доп. окна/окон)
для ресайзера на jquery загрузить библу jQuery и скрипт jresize из этого поста.
для ресайзера на yui загрузить скрипт textarearesize из поста #6 (дополнительной библиотеки не требуется)
редактирование трех фалов (добавляем чуток функций). в случае чего, это даст возможность без проблем откатиться и не повлияет на работу дефолта:
admincp/template.php
includes/adminfunctions.php
includes/adminfunctions_template.php
Установка: Оффтоп
template.php: Оффтоп
Code:
найти:
'return' => TYPE_STR,
добавить ниже:
'myreturn' => TYPE_STR,
Code:
найти:
if ($vbulletin->GPC['return'])
{
$goto = "template.php?do=edit&templateid=" . $vbulletin->GPC['templateid'] . "&group=" . $vbulletin->GPC['group'] . "&expandset=" . $vbulletin->GPC['expandset'] . "&searchset=" . $vbulletin->GPC['searchset'] . "&searchstring=" . urlencode($vbulletin->GPC['searchstring']);
}
добавить ниже:
elseif ($vbulletin->GPC['myreturn'])
{
$goto = "template.php?do=myedit&templateid=" . $vbulletin->GPC['templateid'] . "&group=" . $vbulletin->GPC['group'] . "&expandset=" . $vbulletin->GPC['expandset'] . "&searchset=" . $vbulletin->GPC['searchset'] . "&searchstring=" . urlencode($vbulletin->GPC['searchstring']);
}
Code:
найти:
if ($vbulletin->GPC['return'])
{
print_cp_redirect($goto);
}
добавить ниже:
elseif ($vbulletin->GPC['myreturn'])
{
print_cp_redirect($goto);
}
Code:
найти:
print_submit_row($vbphrase['save'], '_default_', 2, '', "<input type=\"submit\" class=\"button\" name=\"return\" value=\"$vbphrase[save] • $vbphrase[reload]\" />");
}
добавить ниже:
if ($_REQUEST['do'] == 'myedit'){
$vbulletin->input->clean_array_gpc('r', array(
'group' => TYPE_STR,
'searchstring' => TYPE_STR
));
$template = $db->query_first("
SELECT template.*, style.title AS style
FROM " . TABLE_PREFIX . "template AS template
LEFT JOIN " . TABLE_PREFIX . "style AS style USING(styleid)
WHERE templateid = " . $vbulletin->GPC['templateid'] . "
");
if ($template['styleid'] == -1){
$template['style'] = $vbphrase['global_templates'];
}
echo '<div align="center">';
print_myform_header('template', 'updatetemplate');
print_mytable_header(construct_phrase($vbphrase['x_y_id_z'], $vbphrase['template'], $template['title'], $template['templateid']));
construct_hidden_code('templateid', $template['templateid']);
construct_hidden_code('group', $vbulletin->GPC['group']);
construct_hidden_code('searchstring', $vbulletin->GPC['searchstring']);
construct_hidden_code('dostyleid', $template['styleid']);
construct_hidden_code('oldtitle', $template['title']);
construct_hidden_code('lastedit', $template['dateline']);
$backlink = "template.php?" . $vbulletin->session->vars['sessionurl'] . "do=modify&expandset=$template[styleid]&group=" . $vbulletin->GPC['group'] . "&templateid=" . $vbulletin->GPC['templateid'] . "&searchstring=" . urlencode($vbulletin->GPC['searchstring']);
$products = fetch_product_list();
echo ' • ';
if ($template['styleid'] == -1){
print_myselect_row($vbphrase['product'], 'product', $products, $template['product']);
}else{
print_mylabel_row($vbphrase['product'], $products[($template['product'] ? $template['product'] : 'vbulletin')]);
construct_hidden_code('product', ($template['product'] ? $template['product'] : 'vbulletin'));
}
print_mylabel_row('', "<!-- <a href=\"$backlink\" title=\"" . $vbphrase['edit_templates'] . "\"><b>$template[style]</b></a> -->");
print_myinput_row('' . ($template['styleid'] != -1 ? '<dfn>' . construct_link_code($vbphrase['view_history'], 'template.php?do=history&dostyleid=' . $template['styleid'] . '&title=' . urlencode($template['title']), 1) . '</dfn>' : ''), 'title', $template['title']);
print_mylabel_row(' • ' . $vbphrase['save_in_template_history'], '<input type="checkbox" name="savehistory" id="savehistory" value="1" /> <input type="text" name="histcomment" value="" class="bginput" size="20" />');
print_mytextarea_row('<br /><br />' . iif($template['styleid'] != -1, construct_link_code($vbphrase['show_default'], "template.php?" . $vbulletin->session->vars['sessionurl'] . "do=view&title=$template[title]", 1) . '<hr />', '') . '<!-- ' . $vbphrase['wrap_text'] . '<input type="checkbox" unselectable="on" onclick="set_wordwrap(\'ta_template\', this.checked);" checked="checked" /> -->', 'template', $template['template_un'], 22, '75" style="width:100%', true, true, 'ltr', 'code');
echo '<br />';
print_mytemplate_javascript();
print_mysubmit_row($vbphrase['save'], '_default_', 1, '', "<input type=\"submit\" class=\"button\" name=\"myreturn\" value=\"$vbphrase[save] • $vbphrase[reload]\" />");
echo '</div>';
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
adminfunctions.php: Оффтоп
Code:
найти соответствующие:
function print_xxx_xxx
Code:
добавить ниже соответствующих:
// #############################################################################
/*** Prints my div print_form_header */
function print_myform_header($phpscript = '', $do = '', $uploadform = false, $addtable = true, $name = 'cpform', $width = '90%', $target = '', $echobr = true, $method = 'post', $cellspacing = 0){
global $vbulletin, $tableadded;
if (($quote_pos = strpos($name, '"')) !== false){
$clean_name = substr($name, 0, $quote_pos);
}else{
$clean_name = $name;
}
echo "\n<!-- form started:" . $vbulletin->db->querycount . " queries executed -->\n";
echo "<form action=\"$phpscript.php?do=$do\"" . iif($uploadform, ' enctype="multipart/form-data"') . " method=\"$method\"" . iif($target, " target=\"$target\"") . " name=\"$clean_name\" id=\"$name\">\n";
if (!empty($vbulletin->session->vars['sessionhash'])){
echo "<input type=\"hidden\" name=\"s\" value=\"" . htmlspecialchars_uni($vbulletin->session->vars['sessionhash']) . "\" />\n";
}
echo "<input type=\"hidden\" name=\"do\" value=\"" . htmlspecialchars_uni($do) . "\" />\n";
if (strtolower(substr($method, 0, 4)) == 'post'){
echo "<input type=\"hidden\" name=\"adminhash\" value=\"" . ADMINHASH . "\" />\n";
echo "<input type=\"hidden\" name=\"securitytoken\" value=\"" . $vbulletin->userinfo['securitytoken'] . "\" />\n";
}
if ($addtable){
print_mytable_start($echobr, $width, $cellspacing, $clean_name . '_table');
}else{
$tableadded = 0;
}
}
// #############################################################################
/*** Prints my div print_table_start */
function print_mytable_start($echobr = true, $width = '90%', $cellspacing = 0, $id = ''){
global $tableadded;
$tableadded = 1;
if ($echobr){
echo '<br />';
}
$id_html = ($id == '' ? '' : " id=\"$id\"");
echo "\n<div style=\"display:inline\">\n";
}
// #############################################################################
/*** Prints my div print_submit_row */
function print_mysubmit_row($submitname = '', $resetname = '_default_', $colspan = 2, $goback = '', $extra = '', $alt = false){
global $vbphrase, $vbulletin;
if ($submitname === '_default_' OR $submitname === ''){
$submitname = $vbphrase['save'];
}
$button1 = "\t<!-- <input type=\"submit\" class=\"button\" value=\"" . str_pad($submitname, 8, ' ', STR_PAD_BOTH) . "\" /> -->\n";
if ($extra){
$extrabutton = "\t$extra\n";
}
if ($resetname){
if ($resetname === '_default_'){
$resetname = $vbphrase['reset'];
}
$resetbutton .= "\t<input type=\"reset\" class=\"button\" value=\"" . str_pad($resetname, 8, ' ', STR_PAD_BOTH) . "\" />\n";
}
if ($goback){
$button2 .= "\t<input type=\"button\" class=\"button\" value=\"" . str_pad($goback, 8, ' ', STR_PAD_BOTH) . "\" onclick=\"history.back(1);\" />\n";
}
if ($alt){
$tfoot = $button2 . $extrabutton . $resetbutton . $button1;
}else{
$tfoot = $button1 . $extrabutton . $resetbutton . $button2;
}
if ($vbulletin->debug AND is_array($GLOBALS['_HIDDENFIELDS'])){
$tooltip = "HIDDEN FIELDS:";
foreach($GLOBALS['_HIDDENFIELDS'] AS $key => $val){
$tooltip .= "\n\$$key = "$val"";
}}else{
$tooltip = '';
}
print_mytable_footer($colspan, $tfoot, $tooltip);
}
// #############################################################################
/*** Prints my div print_table_footer */
function print_mytable_footer($colspan = 2, $rowhtml = '', $tooltip = '', $echoform = true){
global $tableadded, $vbulletin;
if ($rowhtml){
$tooltip = iif($tooltip != '', " title=\"$tooltip\"", '');
if ($tableadded){
echo "<div style=\"display:inline\"" . iif($colspan != 1 ," colspan=\"$colspan\"") . " align=\"center\"$tooltip>$rowhtml</div>";
}else{
echo "<span align=\"center\"$tooltip>$extra</span>\n";
}}
if ($tableadded){
echo "</div>\n";
}
if ($echoform){
print_hidden_fields();
echo "</form>\n<!-- form ended: " . $vbulletin->db->querycount ." queries executed -->\n\n";
}
}
// #############################################################################
/*** Prints my div print_table_header */
function print_mytable_header($title, $colspan = 2, $htmlise = false, $anchor = '', $align = 'center', $helplink = true){
global $bgcounter, $stylevar;
if ($htmlise){
$title = htmlspecialchars_uni($title);
}
$title = "<b>$title</b>";
if ($anchor != ''){
$title = "<a name=\"$anchor\">$title</a>";
}
if ($helplink AND $help = construct_help_button('', NULL, '', 1)){
$title = "\n\t\t<div style=\"float:$stylevar[right]\">$help</div>\n\t\t$title\n\t";
}
echo "<div style=\"display:inline\" class=\"tcat\" align=\"$align\"" . iif($colspan != 1, " colspan=\"$colspan\"") . ">$title</div>";
$bgcounter = 0;
}
// #############################################################################
/*** Prints my div print_label_row */
function print_mylabel_row($title, $value = ' ', $class = '', $valign = 'top', $helpname = NULL, $dowidth = false){
global $stylevar;
if (!$class){
$class = fetch_row_bgclass();
}
if ($helpname !== NULL AND $helpbutton = construct_table_help_button($helpname)){
$value = '<div style="display:inline">' . $value . "</div> <div style=\"display:inline\">$helpbutton</div>";
}
if ($dowidth){
if (is_numeric($dowidth)){
$left_width = $dowidth;
$right_width = 100 - $dowidth;
}else{
$left_width = 70;
$right_width = 30;
}}
echo "<div style=\"display:inline\" class=\"$class\"" . ($dowidth ? " width=\"$left_width%\"" : '') . ">$title</div> <div style=\"display:inline\" class=\"$class\"" . ($dowidth ? " width=\"$right_width%\"" : '') . ">$value</div>\n";
}
// #############################################################################
/*** Prints my div print_input_row */
function print_myinput_row($title, $name, $value = '', $htmlise = true, $size = 35, $maxlength = 0, $direction = '', $inputclass = false){
global $vbulletin;
$direction = verify_text_direction($direction);
$id = 'it_' . $name . '_' . fetch_uniqueid_counter();
print_mylabel_row($title, "<div style=\"display:inline\" id=\"ctrl_$name\"><input type=\"text\" class=\"" . iif($inputclass, $inputclass, 'bginput') . "\" name=\"$name\" id=\"$id\" value=\"" . iif($htmlise, htmlspecialchars_uni($value), $value) . "\" size=\"$size\"" . iif($maxlength, " maxlength=\"$maxlength\"") . " dir=\"$direction\"" . iif($vbulletin->debug, " title=\"name="$name"\"") . " /></div>", '', 'top', $name);
}
// #############################################################################
/*** Prints my div print_textarea_row */
function print_mytextarea_row($title, $name, $value = '', $rows = 1, $cols = 1, $htmlise = true, $doeditbutton = true, $direction = '', $textareaclass = false){
global $vbphrase, $vbulletin;
$direction = verify_text_direction($direction);
if (!$doeditbutton OR strpos($name,'[') !== false){
$openwindowbutton = '';
}else{
$openwindowbutton = '';
}
$vbulletin->textarea_id = 'ta_' . $name . '_' . fetch_uniqueid_counter();
$ie_reflow_css = (is_browser('ie') ? 'style="zoom:1"' : '');
//$resizer = "<div class=\"smallfont\"><a href=\"#\" $ie_reflow_css onclick=\"return resize_textarea(1, '{$vbulletin->textarea_id}')\">$vbphrase[increase_size]</a> <a href=\"#\" $ie_reflow_css onclick=\"return resize_textarea(-1, '{$vbulletin->textarea_id}')\">$vbphrase[decrease_size]</a></div>";
print_mylabel_row($title . $openwindowbutton, "<div style=\"display:inline\" id=\"ctrl_$name\"><textarea name=\"$name\" id=\"{$vbulletin->textarea_id}\"" . iif($textareaclass, " class=\"$textareaclass resizable\"", " class=\"textedit resizable\"") . " cols=\"\" rows=\"\" style=\"width:99%; height:350px;\" wrap=\"virtual\"" . iif($vbulletin->debug, " title=\"name="$name"\"") . ">" . iif($htmlise, htmlspecialchars_uni($value), $value) . "</textarea>$resizer</div>", '', 'top', $name);
}
// #############################################################################
/*** Prints my div print_select_row */
function print_myselect_row($title, $name, $array, $selected = '', $htmlise = false, $size = 0, $multiple = false){
global $vbulletin;
$uniqueid = fetch_uniqueid_counter();
$select = "<div style=\"display:inline\" id=\"ctrl_$name\"><select name=\"$name\" id=\"sel_{$name}_$uniqueid\" class=\"bginput\"" . iif($size, " size=\"$size\"") . iif($multiple, ' multiple="multiple"') . iif($vbulletin->debug, " title=\"name="$name"\"") . ">\n";
$select .= construct_select_options($array, $selected, $htmlise);
$select .= "</select></div> • \n";
print_mylabel_row($title, $select, '', 'top', $name);
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
adminfunctions_template.php: Оффтоп
Code:
найти:
construct_link_code($vbphrase['delete'], "template.php?" . $vbulletin->session->vars['sessionurl'] . "do=delete&templateid=$template[templateid]&dostyleid=$template[styleid]$LINKEXTRA").
добавить ниже:
construct_link_code($vbphrase['myedit'], "template.php?" . $vbulletin->session->vars['sessionurl'] . "do=myedit&templateid=$template[templateid]&dostyleid=$template[styleid]$LINKEXTRA\" onclick=\"return hs.htmlExpand(this,{objectType:'iframe', width:'1000', height:'600'})").
Code:
найти:
<input type="button" class="button" style="font-weight:normal" value="' . $vbphrase['view_quickref'] . '" onclick="js_open_phrase_ref(0, 0);" />
');
}
добавить ниже:
// #############################################################################
/*** Prints my div print_template_javascript */
function print_mytemplate_javascript(){
global $stylevar, $vbphrase, $vbulletin;
print_phrase_ref_popup_javascript();
echo '<script type="text/javascript" src="../clientscript/vbulletin_templatemgr.js"></script>
';
echo '<script type="text/javascript"><!--
var textarea_id = "' . $vbulletin->textarea_id . '";
var vbphrase = { \'not_found\' : "' . fetch_js_safe_string($vbphrase['not_found']) . '" };
// --></script>
';
print_mylabel_row(iif(is_browser('ie') OR is_browser('mozilla', '20040707'), $vbphrase['search_in_template']), iif(is_browser('ie') OR is_browser('mozilla', '1.7'), '<input type="text" class="bginput" name="string" value="' . htmlspecialchars_uni($vbulletin->GPC['searchstring']) . '" size="20" onChange="n=0;" /> <input type="button" class="button" style="font-weight:normal" value=" ' . $vbphrase['find'] . ' " onClick="findInPage(document.cpform.string.value);" />') . '<input type="button" class="button" style="font-weight:normal" value="' . $vbphrase['preview'] . '" onclick="displayHTML();" /> <input type="button" class="button" style="font-weight:normal" value=" ' . $vbphrase['copy'] . ' " onclick="HighlightAll();" /> <input type="button" class="button" style="font-weight:normal" value="' . $vbphrase['view_quickref'] . '" onclick="js_open_phrase_ref(0, 0);" />');
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
добавить фразу: Оффтоп
myedit = форточка (или обозвать как-нибудь по своему)
либо воспользоваться стандартной фразой = edit. в этом случае отредактить $vbphrase['myedit'] в строке:
Code:
construct_link_code($vbphrase['myedit'] , "template.php?" . $vbulletin->session->vars['sessionurl'] . "do=myedit&templateid=$template[templateid]&dostyleid=$template[styleid]$LINKEXTRA\" onclick=\"return hs.htmlExpand(this,{objectType:'iframe', width:'1000', height:'600'})").
разумеется, для того, чтобы это все заработало, в хедер необходимо добавить скрипт highslide
для этого найти по скрипту <!DOCTYPE ... тру-ля-ля> (встречается пару-тройку раз) и в хедер добавить
Code:
<script type="text/javascript" src="../clientscript/highslide.js"></script>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
заметка: Оффтоп
в приведенном скрипте так же встроено растягивание textarea на jquery
для использования вместе с этой фичей, туда же, где добавляли highslide добавить
Code:
<script type="text/javascript" src="../clientscript/jquery-mini.js"></script>
<script type="text/javascript" src="../clientscript/jresize.js"></script>
создать файл jresize.js со сл. содержимым.
Code:
(function($){var textarea,staticOffset;var iLastMousePos=0;var iMin=32;var grip;$.fn.TextAreaResizer=function(){return this.each(function(){textarea=$(this).addClass('processed'),staticOffset=null;$(this).wrap('<div class="resizable-textarea"><span></span></div>').parent().append($('<div class="grippie"></div>').bind("mousedown",{el:this},startDrag));var grippie=$('div.grippie',$(this).parent())[0];grippie.style.marginRight=(grippie.offsetWidth-$(this)[0].offsetWidth)+'px'})};function startDrag(e){textarea=$(e.data.el);textarea.blur();iLastMousePos=mousePosition(e).y;staticOffset=textarea.height()-iLastMousePos;textarea.css('opacity',0.25);$(document).mousemove(performDrag).mouseup(endDrag);return false}function performDrag(e){var iThisMousePos=mousePosition(e).y;var iMousePos=staticOffset+iThisMousePos;if(iLastMousePos>=(iThisMousePos)){iMousePos-=5}iLastMousePos=iThisMousePos;iMousePos=Math.max(iMin,iMousePos);textarea.height(iMousePos+'px');if(iMousePos<iMin){endDrag(e)}return false}function endDrag(e){$(document).unbind('mousemove',performDrag).unbind('mouseup',endDrag);textarea.css('opacity',1);textarea.focus();textarea=null;staticOffset=null;iLastMousePos=0}function mousePosition(e){return{x:e.clientX+document.documentElement.scrollLeft,y:e.clientY+document.documentElement.scrollTop}}})(jQuery);
$(document).ready(function() {$('textarea.resizable:not(.processed)').TextAreaResizer();});
добавить небольшой css
Code:
/* ********** textarea resizer ********** */
.resizable-textarea textarea{display:block; margin-bottom:0; width:95%; height:20%;}
div.grippie{background:url(../путь до картинки/grippie.png) no-repeat scroll center 2px; cursor:s-resize; height:9px; overflow:hidden;} /* grippie.png - это какая-нибудь пикча, за которую тянется textarea */
если этого не сделать, то функция удобного ресайза (тянучки) попросту будет отсутствовать.
в этом случае будет задействован только стандартный ресайз (для этого в функции print_mytextarea_row, найдите и раскомментируйте //$resizer = ...
зы - данная реализация меняет редактор стиля [-1] в дебаг режиме онли!
Last edited by syn : 05-29-2011 at 11:00 AM .
Yandex Bot
06-14-2010, 09:51 PM
Специалист
Join Date: Jun 2007
Posts: 4,731
Версия vB: 3.8.x
Пол:
Reputation:
Мастер 4229
Репутация в разделе: 2623
Идея классная, пощупать бы демку. = )
06-15-2010, 01:50 PM
Эксперт
Join Date: Dec 2008
Location: Харьков, Украина
Награды в конкурсах:
Posts: 1,096
Версия vB: 3.8.x
Пол:
Reputation:
Professional 885
Репутация в разделе: 327
демо ёк =)
добавл скрины в первый пост вместо демки... (млять, но форум их похецал до всрачки)
Last edited by syn : 02-27-2011 at 03:49 PM .
06-15-2010, 02:03 PM
Эксперт
Join Date: Dec 2008
Location: Харьков, Украина
Награды в конкурсах:
Posts: 1,096
Версия vB: 3.8.x
Пол:
Reputation:
Professional 885
Репутация в разделе: 327
кстати, если хош глянуть в работе, т.с. малой кровью, подключи в админку hs библу и отредактируй вот это
Code:
найти:
construct_link_code($vbphrase['delete'], "template.php?" . $vbulletin->session->vars['sessionurl'] . "do=delete&templateid=$template[templateid]&dostyleid=$template[styleid]$LINKEXTRA").
добавить ниже:
construct_link_code($vbphrase['edit'], "template.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&templateid=$template[templateid]&dostyleid=$template[styleid]$LINKEXTRA\" onclick=\"return hs.htmlExpand(this,{objectType:'iframe', width:'1000', height:'600'})").
у тебя будет открываться стандартный редактор в хс.
весь остальной код, фактически это все верстка и перекомпановка редактора до более удобного/практичного вида, с увеличенным размером рабочего поля.
Last edited by syn : 06-15-2010 at 02:59 PM .
06-15-2010, 04:00 PM
Специалист
Join Date: Jun 2007
Posts: 4,731
Версия vB: 3.8.x
Пол:
Reputation:
Мастер 4229
Репутация в разделе: 2623
Syn , скринов хватило. Спасибо, классная штука. Буду пользоваться.
02-25-2011, 08:26 PM
Эксперт
Join Date: Dec 2008
Location: Харьков, Украина
Награды в конкурсах:
Posts: 1,096
Версия vB: 3.8.x
Пол:
Reputation:
Professional 885
Репутация в разделе: 327
YUI Resizer
2
Поскольку использование сразу 3-х монстобиблов не есть гуд, избавимся для начала хотя бы от одной из них (в частности от jQuery).
Выкидываем к хреням jQuery с требухой: Оффтоп
Code:
<script type="text/javascript" src="../clientscript/jquery-mini.js"></script>
<script type="text/javascript" src="../clientscript/jresize.js"></script>
выкидываем css код:
Code:
/* ********** textarea resizer ********** */
.resizable-textarea textarea{display:block; margin-bottom:0; width:95%; height:20%;}
div.grippie{background:url(../путь до картинки/grippie.png) no-repeat scroll center 2px; cursor:s-resize; height:9px; overflow:hidden;}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Подключаем новый ресайзер: Оффтоп
Подключаем небольшой файлик [
textarearesize-min.js ] из аттача
и в css добавляем новый сласс (или меняем старый от предыдущего [j ресайзера]).
Code:
div.textarea-resize-handle{background:#738fbf; height:5px; border:solid #738fbf; border-width:0 1px 1px 1px; cursor:s-resize;}
или класс с картинкой
div.textarea-resize-handle{background:url(../путь до картинки/grippie.png) no-repeat scroll center 2px; height:9px; cursor:s-resize;}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
заметка: Оффтоп
По дефолту инициализируются все textarea с классом "textarea"
Если textarea имеют другой класс, нужно заменить на соответствующий в textarearesize-min.js
Code:
YAHOO.util.Event.onDOMReady(function(){createResTextarea("textarea ")});
Либо можно соответственно добавить данный класс к существующему.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
зы - Осталось избавиться от Highslide и можно даже собрать в продукт (если это кому-то кроме меня и OldEr еще нужно).
зызы - если кто найдет/напишет хороший скриптик модальных окошек на YUI будет оч хорошо.
Last edited by syn : 02-27-2011 at 03:55 PM .
02-25-2011, 09:34 PM
Специалист
Join Date: Jun 2007
Posts: 4,731
Версия vB: 3.8.x
Пол:
Reputation:
Мастер 4229
Репутация в разделе: 2623
Quote:
Originally Posted by
Syn
(если конечно это кому-то кроме меня и OldEr еще нужно).
Я думаю, что народ на vbulletin.org тоже оценит, так что было бы хорошо в виде продукта все сделать. = )
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT +4. The time now is 08:51 AM .