mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 20:00:37 +02:00
Issue #3912 Typing ':' now pops-up a menu of available routes. Bootstrap-suggest library added for this and other areas in future.
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -2,3 +2,6 @@
|
||||
path = e107_tests/lib/cpaneluapi
|
||||
url = https://github.com/N1ghteyes/cpanel-UAPI-php-class.git
|
||||
branch = master
|
||||
[submodule "e107_web/lib/bootstrap-suggest"]
|
||||
path = e107_web/lib/bootstrap-suggest
|
||||
url = https://github.com/e107inc/bootstrap-suggest.git
|
||||
|
@@ -31,6 +31,79 @@ if(!empty($_GET['iframe']))
|
||||
}
|
||||
|
||||
|
||||
//e107::js('core','bootstrap-suggest/dist/bootstrap-suggest.min.js');
|
||||
//e107::css('core','bootstrap-suggest/dist/bootstrap-suggest.css');
|
||||
//e107::js('core','bootstrap-suggest/bootstrap-suggest.js');
|
||||
//e107::css('core','bootstrap-suggest/bootstrap-suggest.css');
|
||||
e107::library('load', 'bootstrap-suggest');
|
||||
/*
|
||||
e107::js('footer-inline', "
|
||||
$('textarea').suggest(':', {
|
||||
data: function(q, lookup) {
|
||||
|
||||
$.getJSON('theme.php', {q : q }, function(data) {
|
||||
console.log(data);
|
||||
console.log(lookup);
|
||||
lookup.call(data);
|
||||
});
|
||||
|
||||
// we aren't returning any
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
");*/
|
||||
|
||||
|
||||
e107::js('footer-inline', "
|
||||
|
||||
$('textarea.input-custompages').suggest(':', {
|
||||
|
||||
data: function() {
|
||||
|
||||
var i = $.ajax({
|
||||
type: 'GET',
|
||||
url: 'theme.php',
|
||||
async: false,
|
||||
data: {
|
||||
mode: 'suggest'
|
||||
}
|
||||
}).done(function(data) {
|
||||
// console.log(data);
|
||||
return data;
|
||||
}).responseText;
|
||||
|
||||
try
|
||||
{
|
||||
var d = $.parseJSON(i);
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
// Not JSON.
|
||||
return;
|
||||
}
|
||||
|
||||
return d;
|
||||
},
|
||||
filter: {
|
||||
casesensitive: false,
|
||||
limit: 300
|
||||
},
|
||||
endKey: \"\\n\",
|
||||
map: function(item) {
|
||||
return {
|
||||
value: item.value,
|
||||
text: item.value
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
");
|
||||
|
||||
|
||||
|
||||
class theme_admin extends e_admin_dispatcher
|
||||
{
|
||||
/**
|
||||
@@ -78,6 +151,18 @@ class theme_admin extends e_admin_dispatcher
|
||||
function init()
|
||||
{
|
||||
|
||||
|
||||
if(e_AJAX_REQUEST)
|
||||
{
|
||||
|
||||
$newRoutes = $this->getAllRoutes();
|
||||
|
||||
echo json_encode($newRoutes);
|
||||
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -169,7 +254,57 @@ class theme_admin extends e_admin_dispatcher
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
private function getAllRoutes(): array
|
||||
{
|
||||
|
||||
$legacy = array(
|
||||
'gallery/index/category',
|
||||
'gallery/index/list',
|
||||
'news/list/items',
|
||||
'news/list/category',
|
||||
'news/list/all',
|
||||
'news/list/short',
|
||||
'news/list/day',
|
||||
'news/list/month',
|
||||
'news/list/tag',
|
||||
'news/list/author',
|
||||
'news/view/item',
|
||||
'page/chapter/index',
|
||||
'page/book/index',
|
||||
'page/view/index',
|
||||
'page/view/other',
|
||||
'page/list/index',
|
||||
'search/index/index',
|
||||
'system/error/notfound',
|
||||
'user/myprofile/view',
|
||||
'user/myprofile/edit',
|
||||
'user/profile/list',
|
||||
'user/profile/view',
|
||||
'user/login/index',
|
||||
'user/register/index'
|
||||
);
|
||||
|
||||
|
||||
$newRoutes = e107::getUrlConfig('route');
|
||||
|
||||
foreach($legacy as $v)
|
||||
{
|
||||
$newRoutes[$v] = $v;
|
||||
}
|
||||
|
||||
ksort($newRoutes);
|
||||
|
||||
$ret = [];
|
||||
foreach($newRoutes as $k => $v)
|
||||
{
|
||||
$ret[] = array('value' => $k, 'label' => $k);
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -3021,6 +3021,19 @@ class e107
|
||||
|
||||
$array = self::callMethod($obj, $methodName,$profile);
|
||||
|
||||
if($mode === 'route' && !empty($array))
|
||||
{
|
||||
foreach($array as $k=>$v)
|
||||
{
|
||||
if(empty($v['alias']) && !empty($obj->alias))
|
||||
{
|
||||
$v['alias'] = $obj->alias;
|
||||
}
|
||||
$new_addon[$key.'/'.$k] = $v;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if($array)
|
||||
{
|
||||
foreach($array as $k=>$v)
|
||||
|
@@ -944,7 +944,7 @@ class core_library
|
||||
|
||||
|
||||
|
||||
// Animate (local).
|
||||
// Animate (local).
|
||||
$libraries['animate.css'] = array(
|
||||
'name' => 'Animate.css (local)',
|
||||
'vendor_url' => 'https://daneden.github.io/animate.css/',
|
||||
@@ -960,25 +960,38 @@ class core_library
|
||||
),
|
||||
),
|
||||
),
|
||||
/* 'variants' => array(
|
||||
// 'unminified' version for debugging.
|
||||
'dev' => array(
|
||||
'files' => array(
|
||||
'css' => array(
|
||||
'css/font-awesome.css' => array(
|
||||
'zone' => 2,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),*/
|
||||
// Override library path.
|
||||
|
||||
'library_path' => '{e_WEB}lib/animate.css',
|
||||
// 'path' => '3.5.2',
|
||||
'version' => '3.5.2',
|
||||
);
|
||||
|
||||
// Animate (local).
|
||||
$libraries['bootstrap-suggest'] = array(
|
||||
'name' => 'Bootstrap Suggest (local)',
|
||||
'vendor_url' => 'https://github.com/lodev09/bootstrap-suggest',
|
||||
'version_arguments' => array(
|
||||
'file' => 'bootstrap-suggest.js',
|
||||
'pattern' => '/(\d\.\d\.\d+)/',
|
||||
'lines' => 3,
|
||||
),
|
||||
'files' => array(
|
||||
'css' => array(
|
||||
'bootstrap-suggest.css' => array(
|
||||
'zone' => 2,
|
||||
),
|
||||
),
|
||||
'js' => array(
|
||||
'bootstrap-suggest.min.js' => array(
|
||||
'zone' => 2,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
'library_path' => '{e_WEB}lib/bootstrap-suggest',
|
||||
'path' => 'dist',
|
||||
'version' => '2.0.3',
|
||||
);
|
||||
|
||||
|
||||
return $libraries;
|
||||
|
@@ -2599,7 +2599,7 @@ class themeHandler
|
||||
//if(isset($pref['sitetheme_custompages'][$key]))
|
||||
//{
|
||||
$itext .= $custompage_diz."<div class='e-hideme' id='element-to-be-shown-{$key}'>
|
||||
<textarea style='width:97%' rows='6' placeholder='usersettings.php' cols='20' name='custompages[".$key."]' >".(isset($pref['sitetheme_custompages'][$key]) ? implode("\n", $pref['sitetheme_custompages'][$key]) : "")."</textarea>";
|
||||
<textarea class='input-custompages' style='width:97%' rows='6' placeholder='usersettings.php' cols='20' name='custompages[".$key."]' >".(isset($pref['sitetheme_custompages'][$key]) ? implode("\n", $pref['sitetheme_custompages'][$key]) : "")."</textarea>";
|
||||
|
||||
|
||||
|
||||
|
@@ -832,13 +832,42 @@ class e107Test extends \Codeception\Test\Unit
|
||||
$res = null;
|
||||
$this->assertTrue($res);
|
||||
}
|
||||
|
||||
*/
|
||||
public function testGetUrlConfig()
|
||||
{
|
||||
$res = null;
|
||||
$this->assertTrue($res);
|
||||
}
|
||||
|
||||
|
||||
$expected = array (
|
||||
'index' =>
|
||||
array (
|
||||
'alias' => 'contact',
|
||||
'regex' => '^{alias}\\/?$',
|
||||
'sef' => '{alias}',
|
||||
'redirect' => '{e_BASE}contact.php',
|
||||
),
|
||||
);
|
||||
|
||||
$result = e107::getUrlConfig();
|
||||
$this->assertNotEmpty($result['contact']);
|
||||
$this->assertSame($expected, $result['contact']);
|
||||
|
||||
// ----
|
||||
|
||||
$expected = array (
|
||||
'alias' => 'contact',
|
||||
'regex' => '^{alias}\\/?$',
|
||||
'sef' => '{alias}',
|
||||
'redirect' => '{e_BASE}contact.php',
|
||||
);
|
||||
|
||||
$result = e107::getUrlConfig('route');
|
||||
$this->assertNotEmpty($result['contact/index']);
|
||||
$this->assertSame($expected, $result['contact/index']);
|
||||
|
||||
|
||||
|
||||
}
|
||||
/*
|
||||
public function testGetThemeInfo()
|
||||
{
|
||||
$res = null;
|
||||
|
@@ -634,7 +634,7 @@
|
||||
.table-bordered,.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid rgba(0,0,0,0.3)}
|
||||
.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}
|
||||
.table-striped>tbody>tr:nth-of-type(odd){background-color:#fff}
|
||||
.table-hover>tbody>tr:hover,.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#565656}
|
||||
.table-hover>tbody>tr:hover,.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color: rgba(0,0,0,0.1);}
|
||||
table col[class*=col-]{position:static;float:none;display:table-column}
|
||||
table td[class*=col-],table th[class*=col-]{position:static;float:none;display:table-cell}
|
||||
.btn-group>.btn-group,.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group,.dropdown-menu{float:left}
|
||||
@@ -1643,7 +1643,8 @@ ul.col-selection { background-color: #FCFDFF; }
|
||||
.e-chart svg text { fill: rgba(0,0,0,0.75); } /* Google charts */
|
||||
|
||||
.admin-right-panel .alert a.close { text-shadow: 0 1px 0 #fff; color: rgba(0,0,0,0.6) }
|
||||
|
||||
.admin-right-panel .dropdown-menu { background-color: rgb(252, 253, 255); color: rgba(0,0,0,0.75) }
|
||||
.admin-right-panel .dropdown-menu a { color: rgba(0,0,0,0.75); }
|
||||
#admin-menus #sc-admin-help { background: #373737 }
|
||||
|
||||
|
||||
|
1
e107_web/lib/bootstrap-suggest
Submodule
1
e107_web/lib/bootstrap-suggest
Submodule
Submodule e107_web/lib/bootstrap-suggest added at 53cccc3fa4
Reference in New Issue
Block a user