1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 21:27:25 +02:00

JS work and HTML cleanup

This commit is contained in:
CaMer0n
2012-05-16 06:05:39 +00:00
parent e9f6febe02
commit 9f1a322c98
12 changed files with 1209 additions and 1255 deletions

View File

@@ -870,7 +870,7 @@ if(isset($page_title[$action]))
<fieldset id='core-admin-log-list'> <fieldset id='core-admin-log-list'>
<legend class='e-hideme'>{$page_title[$action]}</legend> <legend class='e-hideme'>{$page_title[$action]}</legend>
<table class='adminlist'> <table class='adminlist'>
<colgroup span='4'> <colgroup>
"; ";
foreach($col_widths[$action] as $i) foreach($col_widths[$action] as $i)

View File

@@ -955,7 +955,7 @@ class cron
<form method='post' action='" <form method='post' action='"
.e_SELF."' id='cronform'> .e_SELF."' id='cronform'>
<table class='adminlist'> <table class='adminlist'>
<colgroup span='8'> <colgroup>
<col /> <col />
<col /> <col />
<col /> <col />

View File

@@ -139,7 +139,7 @@ class emotec
$text = " $text = "
<div class='admintabs' id='tab-container'> <div class='admintabs' id='tab-container'>
<ul class='e-tabs e-hideme' id='core-emote-tabs'> <ul class='e-tabs' id='core-emote-tabs'>
<li id='tab-activate'><a href='#emoticon-activate'>".EMOLAN_1."</a></li> <li id='tab-activate'><a href='#emoticon-activate'>".EMOLAN_1."</a></li>
<li id='tab-packages'><a href='#emoticon-packages'>".EMOLAN_13."</a></li> <li id='tab-packages'><a href='#emoticon-packages'>".EMOLAN_13."</a></li>
</ul> </ul>

File diff suppressed because it is too large Load Diff

View File

@@ -29,6 +29,13 @@ if (!getperms("I"))
e107::coreLan('links', true); e107::coreLan('links', true);
if(e_AJAX_REQUEST)
{
print_a($_POST);
echo "HI THERE";
exit;
}
class links_admin extends e_admin_dispatcher class links_admin extends e_admin_dispatcher
{ {
@@ -67,6 +74,7 @@ class links_admin_ui extends e_admin_ui
protected $batchDelete = true; protected $batchDelete = true;
protected $batchCopy = true; protected $batchCopy = true;
protected $listOrder = 'link_order ASC'; protected $listOrder = 'link_order ASC';
protected $listSorting = true;
public $current_parent = 0; public $current_parent = 0;
public $sublink_data = null; public $sublink_data = null;

View File

@@ -355,7 +355,7 @@ else
<fieldset id='core-search-configuration-main'> <fieldset id='core-search-configuration-main'>
<legend class='e-hideme'>".SEALAN_1."</legend> <legend class='e-hideme'>".SEALAN_1."</legend>
<table class='adminlist'> <table class='adminlist'>
<colgroup span='4'> <colgroup>
<col style='width:55%' /> <col style='width:55%' />
<col style='width:25%' /> <col style='width:25%' />
<col style='width:10%' /> <col style='width:10%' />

View File

@@ -4367,7 +4367,8 @@ class e_admin_form_ui extends e_form
e107::js('core','scriptaculous/controls.js','prototype', 2); e107::js('core','scriptaculous/controls.js','prototype', 2);
//TODO - external JS //TODO - external JS
e107::getJs()->footerInline(" e107::js('footer-inline',"
//autocomplete fields //autocomplete fields
\$\$('input[name=searchquery]').each(function(el, cnt) { \$\$('input[name=searchquery]').each(function(el, cnt) {
if(!cnt) el.activate(); if(!cnt) el.activate();
@@ -4399,7 +4400,7 @@ class e_admin_form_ui extends e_form
}); });
} }
}); });
"); ",'prototype');
return $text; return $text;
} }

View File

@@ -156,8 +156,9 @@ class e_form
//TODO Parse selection data back to parent form. //TODO Parse selection data back to parent form.
$url = e_ADMIN_ABS."image.php?mode=main&amp;action=dialog".$cat; $url = e_ADMIN_ABS."image.php?mode=main&amp;action=dialog".$cat;
$url .= "&amp;iframe=1";
$ret = "<a title='Click to Change' rel='external' class='e-dialog' href='".$url."'>".$label."</a>"; $ret = "<a title='Click on a thumbnail to change..' rel='external' class='e-dialog' href='".$url."'>".$label."</a>";
// $footer = "<div style=\'padding:5px;text-align:center\' <a href=\'#\' >Save</a></div>"; // $footer = "<div style=\'padding:5px;text-align:center\' <a href=\'#\' >Save</a></div>";
$footer = ''; $footer = '';
@@ -172,7 +173,7 @@ class e_form
$$("a.e-dialog").invoke("observe", "click", function(ev) { $$("a.e-dialog").invoke("observe", "click", function(ev) {
var element = ev.findElement("a"); var element = ev.findElement("a");
ev.stop(); ev.stop();
new e107Widgets.URLDialog(element.href + "&iframe=1", { new e107Widgets.URLDialog(element.href, {
id: element["id"] || "e-dialog", id: element["id"] || "e-dialog",
width: 830, width: 830,
height: 650 height: 650
@@ -182,26 +183,6 @@ class e_form
','prototype'); ','prototype');
/*
e107::getJs()->requireCoreLib('core/admin.js')
->requireCoreLib('core/dialog.js')
->requireCoreLib('core/draggable.js')
->coreCSS('core/dialog/dialog.css')
->coreCSS('core/dialog/e107/e107.css')
->footerInline('
$$("a.e-dialog").invoke("observe", "click", function(ev) {
var element = ev.findElement("a");
ev.stop();
new e107Widgets.URLDialog(element.href + "&iframe=1", {
id: element["id"] || "e-dialog",
width: 830,
height: 650
}).center().setHeader("Media Manager : '.$category.'").setFooter('.$footer.').activate().show();
});
');
*/
e107::setRegistry('core/form/mediaurl', true); e107::setRegistry('core/form/mediaurl', true);
} }
return $ret; return $ret;
@@ -1301,7 +1282,7 @@ class e_form
if($cnt) if($cnt)
{ {
return ' return '
<tr'.$trclass.'> <tr'.$trclass.' id="'.$fieldvalues[$pid].'">
'.$ret.' '.$ret.'
</tr> </tr>
'; ';
@@ -1989,6 +1970,10 @@ class e_form
{ {
$tp = e107::getParser(); $tp = e107::getParser();
$text = ''; $text = '';
//print_a($form_options);
foreach ($form_options as $fid => $options) foreach ($form_options as $fid => $options)
{ {
$tree_model = $tree_models[$fid]; $tree_model = $tree_models[$fid];
@@ -2007,6 +1992,7 @@ class e_form
$current_fields = varset($options['fieldpref']) ? $options['fieldpref'] : array_keys($options['fields']); $current_fields = varset($options['fieldpref']) ? $options['fieldpref'] : array_keys($options['fields']);
$legend_class = vartrue($options['legend_class'], 'e-hideme'); $legend_class = vartrue($options['legend_class'], 'e-hideme');
$text .= " $text .= "
<form method='post' action='{$formurl}' id='{$elid}-list-form'> <form method='post' action='{$formurl}' id='{$elid}-list-form'>
<div>".$this->token()." <div>".$this->token()."
@@ -2017,7 +2003,7 @@ class e_form
<table cellpadding='0' cellspacing='0' class='adminlist' id='{$elid}-list-table'> <table cellpadding='0' cellspacing='0' class='adminlist' id='{$elid}-list-table'>
".$this->colGroup($fields, $current_fields)." ".$this->colGroup($fields, $current_fields)."
".$this->thead($fields, $current_fields, varset($options['head_query']), varset($options['query']))." ".$this->thead($fields, $current_fields, varset($options['head_query']), varset($options['query']))."
<tbody> <tbody id='e-sort'>
"; ";
if(!$tree) if(!$tree)

View File

@@ -382,7 +382,6 @@ class e_media
{ {
$onclicki = "parent.document.getElementById('{$tagid}').value = '{$im['media_url']}'; $onclicki = "parent.document.getElementById('{$tagid}').value = '{$im['media_url']}';
parent.document.getElementById('".$prevId."').src = '{$realPath}'; parent.document.getElementById('".$prevId."').src = '{$realPath}';
parent.e107Widgets.DialogManagerDefault.getWindow('e-dialog').close();
return false;"; return false;";
} }
else // TinyMce and other applications. else // TinyMce and other applications.
@@ -395,7 +394,7 @@ class e_media
} }
$text .= "<a class='media-select' title=\"".$diz."\" href='#' onclick=\"{$onclicki}\" >\n"; $text .= "<a class='media-select e-dialog-close' title=\"".$diz."\" href='#' onclick=\"{$onclicki}\" >\n";
$text .= "<img src='".e107::getParser()->thumbUrl($im['media_url'], $att)."' alt=\"".$im['media_title']."\" />\n"; $text .= "<img src='".e107::getParser()->thumbUrl($im['media_url'], $att)."' alt=\"".$im['media_title']."\" />\n";
$text .= "</a>\n\n"; $text .= "</a>\n\n";
} }

View File

@@ -716,7 +716,7 @@ class themeHandler
$text .= " $text .= "
<div id='core-thememanager-configure'> <div id='core-thememanager-configure'>
<table cellpadding='0' cellspacing='0' class='adminform'> <table cellpadding='0' cellspacing='0' class='adminform'>
<colgroup span='3'> <colgroup>
<col class='col-label' /> <col class='col-label' />
<col class='col-control' /> <col class='col-control' />
<col class='col-control' /> <col class='col-control' />

View File

@@ -1103,8 +1103,8 @@ class e_userperms
<form method='post' action='".e_SELF."' id='myform'> <form method='post' action='".e_SELF."' id='myform'>
<fieldset id='core-administrator-edit'> <fieldset id='core-administrator-edit'>
<legend class='e-hideme'>".ADMSLAN_52."</legend> <legend class='e-hideme'>".ADMSLAN_52."</legend>
<table cellpadding='0' cellspacing='0' class='adminform'> <table class='adminform'>
<colgroup span='2'> <colgroup>
<col class='col-label' /> <col class='col-label' />
<col class='col-control' /> <col class='col-control' />
</colgroup> </colgroup>
@@ -1157,7 +1157,7 @@ class e_userperms
foreach($groupedList as $section=>$list) foreach($groupedList as $section=>$list)
{ {
$text .= "\t\t<table class='adminlist'> $text .= "\t\t<table class='adminlist'>
<colgroup span='3'> <colgroup>
<col class='center' style='width:50px' /> <col class='center' style='width:50px' />
<col style='width:50px' /> <col style='width:50px' />
<col /> <col />

View File

@@ -41,7 +41,7 @@ define("IMODE", "lite");
// [dont render core style sheet link] // [dont render core style sheet link]
$no_core_css = TRUE; $no_core_css = TRUE;
//temporary fixed - awaiting theme.xml addition //Prototype Scripts
e107::js('core', 'core/decorate.js', 'prototype', 2); e107::js('core', 'core/decorate.js', 'prototype', 2);
e107::js('core', 'core/tabs.js', 'prototype', 2); e107::js('core', 'core/tabs.js', 'prototype', 2);
@@ -68,6 +68,12 @@ e107::js('inline',"
element.select('legend').invoke('hide'); element.select('legend').invoke('hide');
}); });
$$('a.e-dialog-close').invoke('observe', 'click', function(ev) {
parent.e107Widgets.DialogManagerDefault.getWindow('e-dialog').close();
});
//
}, document, true); }, document, true);
" "
,'prototype'); ,'prototype');
@@ -87,11 +93,16 @@ e107::css('inline',"/******** Tabs JS */
",'prototype'); ",'prototype');
// jQUERY scripts
e107::js('core', 'core/colorbox/jquery.colorbox-min.js', 'jquery', 2);
e107::css('core', 'core/colorbox/colorbox.css', 'jquery');
e107::js('inline',' e107::js('inline','
$(document).ready(function() $(document).ready(function()
{ {
$(".e-hideme").hide();
$(".e-expandit").click(function () { $(".e-expandit").click(function () {
$(".e-hideme").toggle("slow"); $(".e-hideme").toggle("slow");
@@ -108,69 +119,51 @@ e107::js('inline','
$(".adminlist tr:even").addClass("even"); $(".adminlist tr:even").addClass("even");
$(".adminlist tr:odd").addClass("odd"); $(".adminlist tr:odd").addClass("odd");
$(".e-dialog").click(function () { $("a.e-dialog").colorbox({
var link = $(this).attr("href"); iframe:true,
$("").load(link).dialog({ width:"60%",
modal:true height:"60%",
}); speed:100
return false;
});
}); });
$(".e-dialog-close").click(function () {
parent.$.colorbox.close()
});
var fixHelper = function(e, ui) {
ui.children().each(function() {
$(this).width($(this).width());
});
return ui;
};
$("#e-sort").sortable({
helper: fixHelper,
cursor: "move",
opacity: 0.9,
containment: "parent",
update: function(event, ui) {
$.ajax({
type: "POST",
url: "links.php?ajax_used=1",
data: { name: "John", location: "Boston" }
}).done(function( msg ) {
alert( "Data Saved: " + msg + ui);
});
}
}).disableSelection();
})
','jquery'); ','jquery');
e107::css('inline'," e107::css('inline',"
.e-hideme { display:none; } #e-sort.tr { cursor: pointer;}
",'jquery'); ",'jquery');
/*
<div class="admintabs" id="tab-container">
<ul class="e-tabs e-hideme" id="core-emote-tabs">
<li id="tab-general"><a href="#core-newspost-create">General Information</a></li>
<li id="tab-seo"><a href="#core-newspost-seo">SEO</a></li>
<li id="tab-advanced"><a href="#core-newspost-edit-options">Advanced Options</a></li>
</ul>
*/
//
// e107::getJs()->requireCoreLib(array(
// 'core/decorate.js' => 2,
// 'core/tabs.js' => 2
// ));
function theme_head()
{
return '';
return "
<script type='text/javascript'>
/**
* Decorate all tables having e-list class
* TODO: add 'adminlist' class to all list core tables, allow theme decorate.
*/
e107.runOnLoad( function(event) {
var element = event.memo['element'] ? $(event.memo.element) : $$('body')[0];
element.select('table.adminlist:not(.no-decorate)').each(function(element) {
e107Utils.Decorate.table(element, {tr_td: 'first last'});
});
element.select('div.admintabs').each(function(element) {
//show tab navaigation
element.select('ul.e-tabs').each( function(el){
el.show();
el.removeClassName('e-hideme');//prevent hideme re-register (e.g. ajax load)
});
//init tabs
new e107Widgets.Tabs(element);
//hide legends if any
element.select('legend').invoke('hide');
});
}, document, true);
</script>";
}
// [layout] // [layout]
$layout = "_default"; $layout = "_default";