Merge branch 'red' into dev

This commit is contained in:
zotlabs 2018-09-18 20:51:38 -07:00
commit d3b28b718c
481 changed files with 53372 additions and 670 deletions

View file

@ -62,7 +62,7 @@ class Cron {
drop_item($rr['id'],false,(($rr['item_wall']) ? DROPITEM_PHASE1 : DROPITEM_NORMAL));
if($rr['item_wall']) {
// The notifier isn't normally invoked unless item_drop is interactive.
Zotlabs\Daemon\Master::Summon( [ 'Notifier', 'drop', $rr['id'] ] );
Master::Summon( [ 'Notifier', 'drop', $rr['id'] ] );
}
}
}

View file

@ -311,7 +311,7 @@ class Apps {
'Admin' => t('Site Admin'),
'Report Bug' => t('Report Bug'),
'View Bookmarks' => t('View Bookmarks'),
'My Chatrooms' => t('My Chatrooms'),
'Chatrooms' => t('Chatrooms'),
'Connections' => t('Connections'),
'Remote Diagnostics' => t('Remote Diagnostics'),
'Suggest Channels' => t('Suggest Channels'),
@ -510,7 +510,8 @@ class Apps {
'$icon' => $icon,
'$hosturl' => $hosturl,
'$purchase' => (($papp['page'] && (! $installed)) ? t('Purchase') : ''),
'$install' => (($hosturl && in_array($mode, ['view','install'])) ? $install_action : ''),
'$installed' => $installed,
'$action_label' => (($hosturl && in_array($mode, ['view','install'])) ? $install_action : ''),
'$edit' => ((local_channel() && $installed && $mode == 'edit') ? t('Edit') : ''),
'$delete' => ((local_channel() && $installed && $mode == 'edit') ? t('Delete') : ''),
'$undelete' => ((local_channel() && $installed && $mode == 'edit') ? t('Undelete') : ''),
@ -729,6 +730,9 @@ class Apps {
);
if($r) {
$hookinfo = Array('uid'=>$uid,'deleted'=>$deleted,'cats'=>$cats,'apps'=>$r);
call_hooks('app_list',$hookinfo);
$r = $hookinfo['apps'];
for($x = 0; $x < count($r); $x ++) {
if(! $r[$x]['app_system'])
$r[$x]['type'] = 'personal';

View file

@ -47,11 +47,11 @@ class Apps extends \Zotlabs\Web\Controller {
return replace_macros(get_markup_template('myapps.tpl'), array(
'$sitename' => get_config('system','sitename'),
'$cat' => $cat,
'$title' => t('Apps'),
'$title' => (($available) ? t('Available Apps') : t('Installed Apps')),
'$apps' => $apps,
'$authed' => ((local_channel()) ? true : false),
'$manage' => (($available) ? EMPTY_STR : t('Manage apps')),
'$create' => (($mode == 'edit') ? t('Create new app') : '')
'$create' => (($mode == 'edit') ? t('Create Custom App') : '')
));
}

View file

@ -71,7 +71,6 @@ class Bookmarks extends \Zotlabs\Web\Controller {
$channel = \App::get_channel();
//$o = profile_tabs($a,true,$channel['channel_address']);
$o = '';
$o .= '<div class="generic-content-wrapper-styled">';

View file

@ -88,9 +88,6 @@ class Cal extends \Zotlabs\Web\Controller {
$o = '';
//$tabs = profile_tabs($a, True, $channel['channel_address']);
$tabs = '';
$mode = 'view';
$y = 0;
$m = 0;
@ -347,8 +344,7 @@ class Cal extends \Zotlabs\Web\Controller {
'$next' => t('Next'),
'$today' => t('Today'),
'$form' => $form,
'$expandform' => ((x($_GET,'expandform')) ? true : false),
'$tabs' => $tabs
'$expandform' => ((x($_GET,'expandform')) ? true : false)
));
if (x($_GET,'id')){ echo $o; killme(); }

View file

@ -1,12 +1,16 @@
<?php
namespace Zotlabs\Module;
use App;
use Zotlabs\Lib\Apps;
use Zotlabs\Web\Controller;
use Zotlabs\Lib\PermissionDescription;
require_once('include/channel.php');
require_once('include/conversation.php');
require_once('include/acl_selectors.php');
class Cards extends \Zotlabs\Web\Controller {
class Cards extends Controller {
function init() {
@ -29,22 +33,27 @@ class Cards extends \Zotlabs\Web\Controller {
return login();
}
if(! \App::$profile) {
if(! App::$profile) {
notice( t('Requested profile is not available.') . EOL );
\App::$error = 404;
App::$error = 404;
return;
}
if(! feature_enabled(\App::$profile_uid, 'cards')) {
return;
if(! Apps::system_app_installed(App::$profile_uid, 'Cards')) {
//Do not display any associated widgets at this point
App::$pdl = '';
$o = '<b>Cards App (Not Installed):</b><br>';
$o .= t('Create personal planning cards');
return $o;
}
nav_set_selected(t('Cards'));
nav_set_selected('Cards');
head_add_link([
'rel' => 'alternate',
'type' => 'application/json+oembed',
'href' => z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . \App::$query_string),
'href' => z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . App::$query_string),
'title' => 'oembed'
]);
@ -52,7 +61,7 @@ class Cards extends \Zotlabs\Web\Controller {
$category = (($_REQUEST['cat']) ? escape_tags(trim($_REQUEST['cat'])) : '');
if($category) {
$sql_extra2 .= protect_sprintf(term_item_parent_query(\App::$profile['profile_uid'], 'item', $category, TERM_CATEGORY));
$sql_extra2 .= protect_sprintf(term_item_parent_query(App::$profile['profile_uid'], 'item', $category, TERM_CATEGORY));
}
@ -60,11 +69,11 @@ class Cards extends \Zotlabs\Web\Controller {
$selected_card = ((argc() > 2) ? argv(2) : '');
$_SESSION['return_url'] = \App::$query_string;
$_SESSION['return_url'] = App::$query_string;
$uid = local_channel();
$owner = \App::$profile_uid;
$observer = \App::get_observer();
$owner = App::$profile_uid;
$observer = App::get_observer();
$ob_hash = (($observer) ? $observer['xchan_hash'] : '');
@ -101,8 +110,8 @@ class Cards extends \Zotlabs\Web\Controller {
'nickname' => $channel['channel_address'],
'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid']
|| $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
'acl' => (($is_owner) ? populate_acl($channel_acl, false,
\Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_pages')) : ''),
'acl' => (($is_owner) ? populate_acl($channel_acl, false,
PermissionDescription::fromGlobalPermission('view_pages')) : ''),
'permissions' => $channel_acl,
'showacl' => (($is_owner) ? true : false),
'visitor' => true,
@ -132,8 +141,8 @@ class Cards extends \Zotlabs\Web\Controller {
$itemspage = get_pconfig(local_channel(),'system','itemspage');
\App::set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20));
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start']));
App::set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20));
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(App::$pager['itemspage']), intval(App::$pager['start']));
$sql_extra = item_permissions_sql($owner);
@ -171,7 +180,7 @@ class Cards extends \Zotlabs\Web\Controller {
WHERE item.uid = %d $item_normal
AND item.parent IN ( %s )
$sql_extra $sql_extra2 ",
intval(\App::$profile['profile_uid']),
intval(App::$profile['profile_uid']),
dbesc($parents_str)
);
if($items) {

View file

@ -1,12 +1,16 @@
<?php
namespace Zotlabs\Module;
use App;
use Zotlabs\Lib\Apps;
use Zotlabs\Web\Controller;
require_once('include/event.php');
require_once('include/auth.php');
require_once('include/security.php');
class Cdav extends \Zotlabs\Web\Controller {
class Cdav extends Controller {
function init() {
@ -126,8 +130,18 @@ class Cdav extends \Zotlabs\Web\Controller {
$auth->setRealm(ucfirst(\Zotlabs\Lib\System::get_platform_name()) . 'CalDAV/CardDAV');
if (local_channel()) {
logger('loggedin');
$channel = \App::get_channel();
if((argv(1) == 'calendars') && (!Apps::system_app_installed(local_channel(), 'CalDAV'))) {
killme();
}
if((argv(1) == 'addressbooks') && (!Apps::system_app_installed(local_channel(), 'CardDAV'))) {
killme();
}
$channel = App::get_channel();
$auth->setCurrentUser($channel['channel_address']);
$auth->channel_id = $channel['channel_id'];
$auth->channel_hash = $channel['channel_hash'];
@ -161,12 +175,15 @@ class Cdav extends \Zotlabs\Web\Controller {
$nodes = [
// /principals
new \Sabre\CalDAV\Principal\Collection($principalBackend),
// /calendars
new \Sabre\CalDAV\CalendarRoot($principalBackend, $caldavBackend),
// /addressbook
new \Sabre\CardDAV\AddressBookRoot($principalBackend, $carddavBackend),
new \Sabre\CardDAV\AddressBookRoot($principalBackend, $carddavBackend)
];
// The object tree needs in turn to be passed to the server class
$server = new \Sabre\DAV\Server($nodes);
@ -204,7 +221,15 @@ class Cdav extends \Zotlabs\Web\Controller {
if(! local_channel())
return;
$channel = \App::get_channel();
if((argv(1) === 'calendar') && (! Apps::system_app_installed(local_channel(), 'CalDAV'))) {
return;
}
if((argv(1) === 'addressbook') && (! Apps::system_app_installed(local_channel(), 'CardDAV'))) {
return;
}
$channel = App::get_channel();
$principalUri = 'principals/' . $channel['channel_address'];
if(!cdav_principal($principalUri))
@ -807,7 +832,25 @@ class Cdav extends \Zotlabs\Web\Controller {
if(!local_channel())
return;
$channel = \App::get_channel();
if((argv(1) === 'calendar') && (! Apps::system_app_installed(local_channel(), 'CalDAV'))) {
//Do not display any associated widgets at this point
App::$pdl = '';
$o = '<b>CalDAV App (Not Installed):</b><br>';
$o .= t('CalDAV capable calendar');
return $o;
}
if((argv(1) === 'addressbook') && (! Apps::system_app_installed(local_channel(), 'CardDAV'))) {
//Do not display any associated widgets at this point
App::$pdl = '';
$o = '<b>CardDAV App (Not Installed):</b><br>';
$o .= t('CalDAV capable addressbook');
return $o;
}
$channel = App::get_channel();
$principalUri = 'principals/' . $channel['channel_address'];
$pdo = \DBA::$dba->db;
@ -874,7 +917,7 @@ class Cdav extends \Zotlabs\Web\Controller {
$o .= replace_macros(get_markup_template('cdav_calendar.tpl'), [
'$sources' => $sources,
'$color' => $color,
'$lang' => \App::$language,
'$lang' => App::$language,
'$first_day' => $first_day,
'$prev' => t('Previous'),
'$next' => t('Next'),

View file

@ -120,6 +120,8 @@ class Channel extends Controller {
function get($update = 0, $load = false) {
$noscript_content = get_config('system', 'noscript_content', '1');
if($load)
$_SESSION['loadtime'] = datetime_convert();
@ -251,7 +253,8 @@ class Channel extends Controller {
$sql_extra .= term_query('item',substr($search,1),TERM_HASHTAG,TERM_COMMUNITYTAG);
}
else {
$sql_extra .= sprintf(" AND item.body like '%s' ",
$sql_extra .= sprintf(" AND (item.body like '%s' OR item.title like '%s') ",
dbesc(protect_sprintf('%' . $search . '%')),
dbesc(protect_sprintf('%' . $search . '%'))
);
}
@ -328,7 +331,7 @@ class Channel extends Controller {
App::set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20));
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(App::$pager['itemspage']), intval(App::$pager['start']));
if((! $update) || ($load)) {
if($noscript_content || $load) {
if($mid) {
$r = q("SELECT parent AS item_id from item where mid like '%s' and uid = %d $item_normal
AND item_wall = 1 $sql_extra limit 1",
@ -467,10 +470,17 @@ class Channel extends Controller {
$o .= conversation($items,$mode,$update,$page_mode);
}
else {
$o .= '<noscript>';
$o .= conversation($items,$mode,$update,'traditional');
$o .= alt_pager(count($items));
if($noscript_content) {
$o .= conversation($items,$mode,$update,'traditional');
$o .= alt_pager(count($items));
}
else {
$o .= '<div class="section-content-warning-wrapper">' . t('You must enable javascript for your browser to be able to view this content.') . '</div>';
}
$o .= '</noscript>';
$o .= conversation($items,$mode,$update,$page_mode);
if ($mid && $items[0]['title'])

View file

@ -1,15 +1,21 @@
<?php /** @file */
namespace Zotlabs\Module;
namespace Zotlabs\Module;
use App;
use Zotlabs\Lib\Apps;
use Zotlabs\Web\Controller;
use Zotlabs\Lib\Chatroom;
use Zotlabs\Access\AccessList;
use Zotlabs\Lib\Libsync;
require_once('include/bookmarks.php');
use \Zotlabs\Lib as Zlib;
class Chat extends \Zotlabs\Web\Controller {
class Chat extends Controller {
function init() {
@ -18,7 +24,7 @@ class Chat extends \Zotlabs\Web\Controller {
$which = argv(1);
if(! $which) {
if(local_channel()) {
$channel = \App::get_channel();
$channel = App::get_channel();
if($channel && $channel['channel_address'])
$which = $channel['channel_address'];
}
@ -29,7 +35,7 @@ class Chat extends \Zotlabs\Web\Controller {
}
$profile = 0;
$channel = \App::get_channel();
$channel = App::get_channel();
if((local_channel()) && (argc() > 2) && (argv(2) === 'view')) {
$which = $channel['channel_address'];
@ -51,16 +57,16 @@ class Chat extends \Zotlabs\Web\Controller {
if((! $room) || (! local_channel()))
return;
$channel = \App::get_channel();
$channel = App::get_channel();
if($_POST['action'] === 'drop') {
logger('delete chatroom');
Zlib\Chatroom::destroy($channel,array('cr_name' => $room));
Chatroom::destroy($channel,array('cr_name' => $room));
goaway(z_root() . '/chat/' . $channel['channel_address']);
}
$acl = new \Zotlabs\Access\AccessList($channel);
$acl = new AccessList($channel);
$acl->set_from_array($_REQUEST);
$arr = $acl->get();
@ -69,7 +75,7 @@ class Chat extends \Zotlabs\Web\Controller {
if(intval($arr['expire']) < 0)
$arr['expire'] = 0;
Zlib\Chatroom::create($channel,$arr);
Chatroom::create($channel,$arr);
$x = q("select * from chatroom where cr_name = '%s' and cr_uid = %d limit 1",
dbesc($room),
@ -90,26 +96,35 @@ class Chat extends \Zotlabs\Web\Controller {
function get() {
if(! Apps::system_app_installed(App::$profile_uid, 'Chatrooms')) {
//Do not display any associated widgets at this point
App::$pdl = '';
$o = '<b>Chatrooms App (Not Installed):</b><br>';
$o .= t('Access Controlled Chatrooms');
return $o;
}
if(local_channel()) {
$channel = \App::get_channel();
nav_set_selected('My Chatrooms');
$channel = App::get_channel();
nav_set_selected('Chatrooms');
}
$ob = \App::get_observer();
$ob = App::get_observer();
$observer = get_observer_hash();
if(! $observer) {
notice( t('Permission denied.') . EOL);
return;
}
if(! perm_is_allowed(\App::$profile['profile_uid'],$observer,'chat')) {
if(! perm_is_allowed(App::$profile['profile_uid'],$observer,'chat')) {
notice( t('Permission denied.') . EOL);
return;
}
if((argc() > 3) && intval(argv(2)) && (argv(3) === 'leave')) {
Zlib\Chatroom::leave($observer,argv(2),$_SERVER['REMOTE_ADDR']);
Chatroom::leave($observer,argv(2),$_SERVER['REMOTE_ADDR']);
goaway(z_root() . '/channel/' . argv(1));
}
@ -162,16 +177,16 @@ class Chat extends \Zotlabs\Web\Controller {
$room_id = intval(argv(2));
$bookmark_link = get_bookmark_link($ob);
$x = Zlib\Chatroom::enter($observer,$room_id,'online',$_SERVER['REMOTE_ADDR']);
$x = Chatroom::enter($observer,$room_id,'online',$_SERVER['REMOTE_ADDR']);
if(! $x)
return;
$x = q("select * from chatroom where cr_id = %d and cr_uid = %d $sql_extra limit 1",
intval($room_id),
intval(\App::$profile['profile_uid'])
intval(App::$profile['profile_uid'])
);
if($x) {
$acl = new \Zotlabs\Access\AccessList(false);
$acl = new AccessList(false);
$acl->set($x[0]);
$private = $acl->is_private();
@ -210,19 +225,12 @@ class Chat extends \Zotlabs\Web\Controller {
));
return $o;
}
require_once('include/conversation.php');
//$o = profile_tabs($a,((local_channel() && local_channel() == \App::$profile['profile_uid']) ? true : false),\App::$profile['channel_address']);
$o = '';
if(! feature_enabled(\App::$profile['profile_uid'],'ajaxchat')) {
notice( t('Feature disabled.') . EOL);
return $o;
}
$acl = new \Zotlabs\Access\AccessList($channel);
$acl = new AccessList($channel);
$channel_acl = $acl->get();
$lockstate = (($channel_acl['allow_cid'] || $channel_acl['allow_gid'] || $channel_acl['deny_cid'] || $channel_acl['deny_gid']) ? 'lock' : 'unlock');
@ -246,17 +254,17 @@ class Chat extends \Zotlabs\Web\Controller {
));
}
$rooms = Zlib\Chatroom::roomlist(\App::$profile['profile_uid']);
$rooms = Chatroom::roomlist(App::$profile['profile_uid']);
$o .= replace_macros(get_markup_template('chatrooms.tpl'), array(
'$header' => sprintf( t('%1$s\'s Chatrooms'), \App::$profile['fullname']),
'$header' => sprintf( t('%1$s\'s Chatrooms'), App::$profile['fullname']),
'$name' => t('Name'),
'$baseurl' => z_root(),
'$nickname' => \App::$profile['channel_address'],
'$nickname' => App::$profile['channel_address'],
'$rooms' => $rooms,
'$norooms' => t('No chatrooms available'),
'$newroom' => t('Create New'),
'$is_owner' => ((local_channel() && local_channel() == \App::$profile['profile_uid']) ? 1 : 0),
'$is_owner' => ((local_channel() && local_channel() == App::$profile['profile_uid']) ? 1 : 0),
'$chatroom_new' => $chatroom_new,
'$expire' => t('Expiration'),
'$expire_unit' => t('min') //minutes

View file

@ -11,8 +11,9 @@ class Display extends \Zotlabs\Web\Controller {
function get($update = 0, $load = false) {
$module_format = 'html';
$noscript_content = get_config('system', 'noscript_content', '1');
$module_format = 'html';
if(argc() > 1) {
$module_format = substr(argv(1),strrpos(argv(1),'.') + 1);
@ -250,7 +251,7 @@ class Display extends \Zotlabs\Web\Controller {
$sql_extra = public_permissions_sql($observer_hash);
if((! $update) || ($load)) {
if($noscript_content || $load) {
$r = null;
@ -366,7 +367,12 @@ class Display extends \Zotlabs\Web\Controller {
}
else {
$o .= '<noscript>';
$o .= conversation($items, 'display', $update, 'traditional');
if($noscript_content) {
$o .= conversation($items, 'display', $update, 'traditional');
}
else {
$o .= '<div class="section-content-warning-wrapper">' . t('You must enable javascript for your browser to be able to view this content.') . '</div>';
}
$o .= '</noscript>';
if ($items[0]['title'])
@ -428,7 +434,7 @@ class Display extends \Zotlabs\Web\Controller {
$o .= '<div id="content-complete"></div>';
if(((! $update) || ($load)) && (! $items)) {
if((($update && $load) || $noscript_content) && (! $items)) {
$r = q("SELECT id, item_deleted FROM item WHERE mid = '%s' LIMIT 1",
dbesc($item_hash)

View file

@ -1,6 +1,10 @@
<?php
namespace Zotlabs\Module;
use App;
use Zotlabs\Lib\Apps;
use Zotlabs\Web\Controller;
/**
* module: invite.php
*
@ -9,7 +13,7 @@ namespace Zotlabs\Module;
*/
class Invite extends \Zotlabs\Web\Controller {
class Invite extends Controller {
function post() {
@ -17,6 +21,10 @@ class Invite extends \Zotlabs\Web\Controller {
notice( t('Permission denied.') . EOL);
return;
}
if(! Apps::system_app_installed(local_channel(), 'Invite')) {
return;
}
check_form_security_token_redirectOnErr('/', 'send_invite');
@ -57,7 +65,7 @@ class Invite extends \Zotlabs\Web\Controller {
else
$nmessage = $message;
$account = \App::get_account();
$account = App::get_account();
$res = z_mail(
[
@ -95,6 +103,15 @@ class Invite extends \Zotlabs\Web\Controller {
return;
}
if(! Apps::system_app_installed(local_channel(), 'Invite')) {
//Do not display any associated widgets at this point
App::$pdl = '';
$o = '<b>Invite App (Not Installed):</b><br>';
$o .= t('Send email invitations to join this network');
return $o;
}
nav_set_selected('Invite');
$tpl = get_markup_template('invite.tpl');
@ -127,11 +144,11 @@ class Invite extends \Zotlabs\Web\Controller {
}
}
$ob = \App::get_observer();
$ob = App::get_observer();
if(! $ob)
return $o;
$channel = \App::get_channel();
$channel = App::get_channel();
$o = replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("send_invite"),

View file

@ -1,13 +1,28 @@
<?php
namespace Zotlabs\Module;
use App;
use Zotlabs\Lib\Apps;
use Zotlabs\Web\Controller;
class Lang extends \Zotlabs\Web\Controller {
class Lang extends Controller {
function get() {
if(local_channel()) {
if(! Apps::system_app_installed(local_channel(), 'Language')) {
//Do not display any associated widgets at this point
App::$pdl = '';
$o = '<b>Language App (Not Installed):</b><br>';
$o .= t('Change UI language');
return $o;
}
}
nav_set_selected('Language');
return lang_selector();
}
}

View file

@ -1,19 +1,27 @@
<?php
namespace Zotlabs\Module;
use App;
use Zotlabs\Lib\Apps;
use Zotlabs\Web\Controller;
require_once('include/security.php');
require_once('include/bbcode.php');
class Mood extends \Zotlabs\Web\Controller {
class Mood extends Controller {
function init() {
if(! local_channel())
return;
if(! Apps::system_app_installed(local_channel(), 'Mood')) {
return;
}
$uid = local_channel();
$channel = \App::get_channel();
$channel = App::get_channel();
$verb = notags(trim($_GET['verb']));
if(! $verb)
@ -58,7 +66,7 @@ class Mood extends \Zotlabs\Web\Controller {
$deny_gid = $channel['channel_deny_gid'];
}
$poster = \App::get_observer();
$poster = App::get_observer();
$mid = item_message_id();
@ -115,6 +123,15 @@ class Mood extends \Zotlabs\Web\Controller {
return;
}
if(! Apps::system_app_installed(local_channel(), 'Mood')) {
//Do not display any associated widgets at this point
App::$pdl = '';
$o = '<b>Mood App (Not Installed):</b><br>';
$o .= t('Set your current mood and tell your friends');
return $o;
}
nav_set_selected('Mood');
$parent = ((x($_GET,'parent')) ? intval($_GET['parent']) : '0');

View file

@ -167,8 +167,6 @@ class Network extends \Zotlabs\Web\Controller {
}
if(! $update) {
$tabs = ''; //network_tabs();
$o .= $tabs;
// search terms header
if($search) {
@ -256,8 +254,7 @@ class Network extends \Zotlabs\Web\Controller {
));
}
$o = $tabs;
$o .= $title;
$o = $title;
$o .= $status_editor;
}
@ -283,8 +280,7 @@ class Network extends \Zotlabs\Web\Controller {
'$title' => '<a href="' . zid($cid_r[0]['xchan_url']) . '" ><img src="' . zid($cid_r[0]['xchan_photo_s']) . '" alt="' . urlencode($cid_r[0]['xchan_name']) . '" /></a> <a href="' . zid($cid_r[0]['xchan_url']) . '" >' . $cid_r[0]['xchan_name'] . '</a>'
));
$o = $tabs;
$o .= $title;
$o = $title;
$o .= $status_editor;
}
elseif($xchan) {
@ -297,8 +293,8 @@ class Network extends \Zotlabs\Web\Controller {
$title = replace_macros(get_markup_template("section_title.tpl"),array(
'$title' => '<a href="' . zid($r[0]['xchan_url']) . '" ><img src="' . zid($r[0]['xchan_photo_s']) . '" alt="' . urlencode($r[0]['xchan_name']) . '" /></a> <a href="' . zid($r[0]['xchan_url']) . '" >' . $r[0]['xchan_name'] . '</a>'
));
$o = $tabs;
$o .= $title;
$o = $title;
$o .= $status_editor;
}
@ -382,7 +378,8 @@ class Network extends \Zotlabs\Web\Controller {
$sql_extra .= term_query('item',substr($search,1),TERM_HASHTAG,TERM_COMMUNITYTAG);
}
else {
$sql_extra .= sprintf(" AND item.body like '%s' ",
$sql_extra .= sprintf(" AND (item.body like '%s' OR item.title like '%s') ",
dbesc(protect_sprintf('%' . $search . '%')),
dbesc(protect_sprintf('%' . $search . '%'))
);
}

View file

@ -523,8 +523,6 @@ class Photos extends \Zotlabs\Web\Controller {
$o .= "<script> var profile_uid = " . App::$profile['profile_uid']
. "; var netargs = '?f='; var profile_page = " . App::$pager['page'] . "; </script>\r\n";
// tabs
$_is_owner = (local_channel() && (local_channel() == $owner_uid));
/**

View file

@ -1,6 +1,10 @@
<?php
namespace Zotlabs\Module; /** @file */
use App;
use Zotlabs\Lib\Apps;
use Zotlabs\Web\Controller;
/**
*
* Poke, prod, finger, or otherwise do unspeakable things to somebody - who must be a connection in your address book
@ -16,15 +20,19 @@ namespace Zotlabs\Module; /** @file */
*/
class Poke extends \Zotlabs\Web\Controller {
class Poke extends Controller {
function init() {
if(! local_channel())
return;
if(! Apps::system_app_installed(local_channel(), 'Poke')) {
return;
}
$uid = local_channel();
$channel = \App::get_channel();
$channel = App::get_channel();
$verb = notags(trim($_REQUEST['verb']));
@ -148,6 +156,15 @@ class Poke extends \Zotlabs\Web\Controller {
return;
}
if(! Apps::system_app_installed(local_channel(), 'Poke')) {
//Do not display any associated widgets at this point
App::$pdl = '';
$o = '<b>Poke App (Not Installed):</b><br>';
$o .= t('Poke somebody in your addressbook');
return $o;
}
nav_set_selected('Poke');
$name = '';

View file

@ -0,0 +1,128 @@
<?php
namespace Zotlabs\Module\Settings;
class Network {
function post() {
check_form_security_token_redirectOnErr('/settings/network', 'settings_network');
$features = self::get_features();
foreach($features as $f) {
$k = $f[0];
if(array_key_exists("feature_$k",$_POST))
set_pconfig(local_channel(),'feature',$k, (string) $_POST["feature_$k"]);
else
set_pconfig(local_channel(),'feature', $k, '');
}
build_sync_packet();
return;
}
function get() {
$features = self::get_features();
foreach($features as $f) {
$arr[] = array('feature_' . $f[0],$f[1],((intval(feature_enabled(local_channel(),$f[0]))) ? "1" : ''),$f[2],array(t('Off'),t('On')));
}
$tpl = get_markup_template("settings_module.tpl");
$o .= replace_macros($tpl, array(
'$action_url' => 'settings/network',
'$form_security_token' => get_form_security_token("settings_network"),
'$title' => t('Activity Settings'),
'$features' => $arr,
'$baseurl' => z_root(),
'$submit' => t('Submit'),
));
return $o;
}
function get_features() {
$arr = [
[
'archives',
t('Search by Date'),
t('Ability to select posts by date ranges'),
false,
get_config('feature_lock','archives')
],
[
'savedsearch',
t('Saved Searches'),
t('Save search terms for re-use'),
false,
get_config('feature_lock','savedsearch')
],
[
'order_tab',
t('Alternate Stream Order'),
t('Ability to order the stream by last post date, last comment date or unthreaded activities'),
false,
get_config('feature_lock','order_tab')
],
[
'name_tab',
t('Contact Filter'),
t('Ability to display only posts of a selected contact'),
false,
get_config('feature_lock','name_tab')
],
[
'forums_tab',
t('Forum Filter'),
t('Ability to display only posts of a specific forum'),
false,
get_config('feature_lock','forums_tab')
],
[
'personal_tab',
t('Personal Posts Filter'),
t('Ability to display only posts that you\'ve interacted on'),
false,
get_config('feature_lock','personal_tab')
],
[
'affinity',
t('Affinity Tool'),
t('Filter stream activity by depth of relationships'),
false,
get_config('feature_lock','affinity')
],
[
'suggest',
t('Suggest Channels'),
t('Show friend and connection suggestions'),
false,
get_config('feature_lock','suggest')
],
[
'connfilter',
t('Connection Filtering'),
t('Filter incoming posts from connections based on keywords/content'),
false,
get_config('feature_lock','connfilter')
]
];
return $arr;
}
}

View file

@ -97,7 +97,6 @@ class Sharedwithme extends \Zotlabs\Web\Controller {
}
//$o = profile_tabs($a, $is_owner, $channel['channel_address']);
$o = '';
$o .= replace_macros(get_markup_template('sharedwithme.tpl'), array(

View file

@ -1,19 +1,25 @@
<?php
namespace Zotlabs\Module;
use App;
use Zotlabs\Web\Controller;
use Zotlabs\Lib\Apps;
use Zotlabs\Lib\PermissionDescription;
use Zotlabs\Lib\ExtendedZip;
use ZipArchive;
require_once('include/channel.php');
require_once('include/conversation.php');
require_once('include/acl_selectors.php');
class Webpages extends \Zotlabs\Web\Controller {
class Webpages extends Controller {
function init() {
if(argc() > 1 && argv(1) === 'sys' && is_site_admin()) {
$sys = get_sys_channel();
if($sys && intval($sys['channel_id'])) {
\App::$is_sys = true;
App::$is_sys = true;
}
}
@ -29,23 +35,32 @@ class Webpages extends \Zotlabs\Web\Controller {
function get() {
if(! \App::$profile) {
if(! App::$profile) {
notice( t('Requested profile is not available.') . EOL );
\App::$error = 404;
App::$error = 404;
return;
}
if(! Apps::system_app_installed(App::$profile_uid, 'Webpages')) {
//Do not display any associated widgets at this point
App::$pdl = '';
$o = '<b>Webpages App (Not Installed):</b><br>';
$o .= t('Provide managed web pages on your channel');
return $o;
}
nav_set_selected('Webpages');
$which = argv(1);
$_SESSION['return_url'] = \App::$query_string;
$_SESSION['return_url'] = App::$query_string;
$uid = local_channel();
$owner = 0;
$observer = \App::get_observer();
$observer = App::get_observer();
$channel = \App::get_channel();
$channel = App::get_channel();
switch ($_SESSION['action']) {
case 'import':
@ -91,7 +106,7 @@ class Webpages extends \Zotlabs\Web\Controller {
}
if(\App::$is_sys && is_site_admin()) {
if(App::$is_sys && is_site_admin()) {
$sys = get_sys_channel();
if($sys && intval($sys['channel_id'])) {
$uid = $owner = intval($sys['channel_id']);
@ -127,8 +142,8 @@ class Webpages extends \Zotlabs\Web\Controller {
// Nickname is set to the observers xchan, and profile_uid to the owner's.
// This lets you post pages at other people's channels.
if((! $channel) && ($uid) && ($uid == \App::$profile_uid)) {
$channel = \App::get_channel();
if((! $channel) && ($uid) && ($uid == App::$profile_uid)) {
$channel = App::get_channel();
}
if($channel) {
$channel_acl = array(
@ -144,15 +159,15 @@ class Webpages extends \Zotlabs\Web\Controller {
$is_owner = ($uid && $uid == $owner);
//$o = profile_tabs($a, $is_owner, \App::$profile['channel_address']);
$o = '';
$x = array(
'webpage' => ITEM_TYPE_WEBPAGE,
'is_owner' => true,
'nickname' => \App::$profile['channel_address'],
'nickname' => App::$profile['channel_address'],
'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
'acl' => (($is_owner) ? populate_acl($channel_acl,false, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_pages')) : ''),
'acl' => (($is_owner) ? populate_acl($channel_acl,false, PermissionDescription::fromGlobalPermission('view_pages')) : ''),
'permissions' => $channel_acl,
'showacl' => (($is_owner) ? true : false),
'visitor' => true,
@ -280,7 +295,7 @@ class Webpages extends \Zotlabs\Web\Controller {
notice( t('Invalid file type.') . EOL);
return;
}
$zip = new \ZipArchive();
$zip = new ZipArchive();
if ($zip->open($source) === true) {
$tmp_folder_name = random_string(5);
$website = dirname($source) . '/' . $tmp_folder_name;
@ -297,7 +312,7 @@ class Webpages extends \Zotlabs\Web\Controller {
// Website files are to be imported from the channel cloud files
if (($_POST) && array_key_exists('path',$_POST) && isset($_POST['cloudsubmit'])) {
$channel = \App::get_channel();
$channel = App::get_channel();
$dirpath = get_dirpath_by_cloudpath($channel, $_POST['path']);
if(!$dirpath) {
notice( t('Invalid folder path.') . EOL);
@ -343,7 +358,7 @@ class Webpages extends \Zotlabs\Web\Controller {
case 'importselected':
require_once('include/import.php');
$channel = \App::get_channel();
$channel = App::get_channel();
// Import layout first so that pages that reference new layouts will find
// the mid of layout items in the database
@ -438,7 +453,7 @@ class Webpages extends \Zotlabs\Web\Controller {
case 'cloud':
case 'zipfile':
$channel = \App::get_channel();
$channel = App::get_channel();
$tmp_folder_name = random_string(10);
$zip_folder_name = random_string(10);
@ -657,7 +672,7 @@ class Webpages extends \Zotlabs\Web\Controller {
}
if($action === 'zipfile') {
// Generate the zip file
\Zotlabs\Lib\ExtendedZip::zipTree($tmp_folderpath, $zip_filepath, \ZipArchive::CREATE);
ExtendedZip::zipTree($tmp_folderpath, $zip_filepath, ZipArchive::CREATE);
// Output the file for download
header('Content-disposition: attachment; filename="' . $zip_filename . '"');
header("Content-Type: application/zip");
@ -666,7 +681,7 @@ class Webpages extends \Zotlabs\Web\Controller {
if(isset($_SESSION['exportcloudpath'])) {
require_once('include/attach.php');
$cloudpath = urldecode($_SESSION['exportcloudpath']);
$channel = \App::get_channel();
$channel = App::get_channel();
$dirpath = get_dirpath_by_cloudpath($channel, $cloudpath);
if(!$dirpath) {
$x = attach_mkdirp($channel, $channel['channel_hash'], array('pathname' => $cloudpath));

View file

@ -441,7 +441,7 @@ class Comanche {
$path = 'view/js/jquery.js';
break;
case 'bootstrap':
$path = 'library/bootstrap/js/bootstrap.min.js';
$path = 'vendor/twbs/bootstrap/dist/js/bootstrap.bundle.min.js';
break;
case 'foundation':
$path = 'library/foundation/js/foundation.js';
@ -466,7 +466,7 @@ class Comanche {
switch($s) {
case 'bootstrap':
$path = 'library/bootstrap/css/bootstrap.min.css';
$path = 'vendor/twbs/bootstrap/dist/css/bootstrap.min.css';
break;
case 'foundation':
$path = 'library/foundation/css/foundation.min.css';

View file

@ -26,14 +26,14 @@ class _1220 {
if(ACTIVE_DBTYPE == DBTYPE_MYSQL) {
$r = q("CREATE TABLE IF NOT EXISTS listeners (
id int(11) NOT NULL AUTO_INCREMENT,
target_id varchar(191) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',
portable_id varchar(191) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',
ltype int(11) NOT NULL DEFAULT '0',
target_id varchar(191) NOT NULL DEFAULT '',
portable_id varchar(191) NOT NULL DEFAULT '',
ltype int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (id),
KEY target_id (target_id),
KEY portable_id (portable_id),
KEY ltype (ltype)
) ENGINE=InnoDB DEFAULT CHARSET=utf8");
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4");
}

View file

@ -2,6 +2,8 @@
namespace Zotlabs\Web;
use Zotlabs\Extend\Route;
/*
* @brief
*
@ -31,9 +33,23 @@ class SubModule {
$filename = 'Zotlabs/Module/' . ucfirst(argv(0)) . '/'. ucfirst(argv($whicharg)) . '.php';
$modname = '\\Zotlabs\\Module\\' . ucfirst(argv(0)) . '\\' . ucfirst(argv($whicharg));
if(file_exists($filename)) {
$this->controller = new $modname();
}
$routes = Route::get();
if($routes) {
foreach($routes as $route) {
if(is_array($route) && strtolower($route[1]) === strtolower(argv(0)) . '/' . strtolower(argv($whicharg))) {
include_once($route[0]);
if(class_exists($modname)) {
$this->controller = new $modname;
}
}
}
}
}
/**
@ -43,6 +59,7 @@ class SubModule {
* @return boolean|mixed
*/
function call($method) {
if(! $this->controller)
return false;

View file

@ -176,7 +176,7 @@ class Activity_filter {
$arr = ['tabs' => $tabs];
call_hooks('network_tabs', $arr);
call_hooks('activity_filter', $arr);
$o = '';

View file

@ -10,9 +10,9 @@ class Appstore {
return replace_macros(get_markup_template('appstore.tpl'), [
'$title' => t('App Collections'),
'$options' => [
[ z_root() . '/apps/available', t('Available Apps'), $store ],
[ z_root() . '/apps', t('Installed apps'), 1 - $store ]
[ z_root() . '/apps', t('Installed apps'), 1 - $store ],
[ z_root() . '/apps/available', t('Available Apps'), $store ]
]
]);
}
}
}

View file

@ -2,6 +2,9 @@
namespace Zotlabs\Widget;
use App;
use Zotlabs\Lib\Apps;
require_once('include/contact_widgets.php');
class Categories {
@ -10,22 +13,22 @@ class Categories {
$cards = ((array_key_exists('cards',$arr) && $arr['cards']) ? true : false);
if(($cards) && (! feature_enabled(\App::$profile['profile_uid'],'cards')))
if(($cards) && (! Apps::system_app_installed(App::$profile['profile_uid'], 'Cards')))
return '';
$articles = ((array_key_exists('articles',$arr) && $arr['articles']) ? true : false);
if(($articles) && (! feature_enabled(\App::$profile['profile_uid'],'articles')))
if(($articles) && (! feature_enabled(App::$profile['profile_uid'],'articles')))
return '';
if((! \App::$profile['profile_uid'])
|| (! perm_is_allowed(\App::$profile['profile_uid'],get_observer_hash(),(($cards || $articles) ? 'view_pages' : 'view_stream')))) {
if((! App::$profile['profile_uid'])
|| (! perm_is_allowed(App::$profile['profile_uid'],get_observer_hash(),(($cards || $articles) ? 'view_pages' : 'view_stream')))) {
return '';
}
$cat = ((x($_REQUEST,'cat')) ? htmlspecialchars($_REQUEST['cat'],ENT_COMPAT,'UTF-8') : '');
$srchurl = (($cards) ? \App::$argv[0] . '/' . \App::$argv[1] : \App::$query_string);
$srchurl = (($cards) ? App::$argv[0] . '/' . App::$argv[1] : App::$query_string);
$srchurl = rtrim(preg_replace('/cat\=[^\&].*?(\&|$)/is','',$srchurl),'&');
$srchurl = str_replace(array('?f=','&f='),array('',''),$srchurl);

View file

@ -116,7 +116,7 @@ class Stream_order {
$arr = ['tabs' => $tabs];
call_hooks('stream_order_tabs', $arr);
call_hooks('activity_order', $arr);
$o = '';

View file

@ -1,6 +1,6 @@
version: 1.1
version: 1.2
url: $baseurl/cards/$nick
name: Cards
requires: local_channel, cards
requires: local_channel
photo: icon:list
categories: nav_featured_app, Productivity

View file

@ -1,6 +1,6 @@
version: 1
version: 1.1
url: $baseurl/chat/$nick
requires: local_channel, ajaxchat
name: My Chatrooms
requires: local_channel
name: Chatrooms
photo: icon:comments-o
categories: Productivity

View file

@ -1,6 +1,6 @@
version: 1
version: 1.1
url: $baseurl/webpages/$nick
requires: local_channel, webpages
requires: local_channel
name: Webpages
photo: icon:newspaper-o
categories: nav_featured_app, Productivity

View file

@ -38,7 +38,8 @@
"commerceguys/intl": "~0.7",
"lukasreschke/id3parser": "^0.0.1",
"smarty/smarty": "~3.1",
"ramsey/uuid": "^3.8"
"ramsey/uuid": "^3.8",
"twbs/bootstrap": "4.1.3"
},
"require-dev" : {
"phpunit/phpunit" : "@stable",

53
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "38911748179833a57ee1b46a0af8e518",
"content-hash": "b7862124a9afe837c7eef8ee66f02ff4",
"packages": [
{
"name": "bshaffer/oauth2-server-php",
@ -1110,6 +1110,57 @@
"portable"
],
"time": "2018-08-06T14:22:27+00:00"
},
{
"name": "twbs/bootstrap",
"version": "v4.1.3",
"source": {
"type": "git",
"url": "https://github.com/twbs/bootstrap.git",
"reference": "3b558734382ce58b51e5fc676453bfd53bba9201"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twbs/bootstrap/zipball/3b558734382ce58b51e5fc676453bfd53bba9201",
"reference": "3b558734382ce58b51e5fc676453bfd53bba9201",
"shasum": ""
},
"replace": {
"twitter/bootstrap": "self.version"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.3.x-dev"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jacob Thornton",
"email": "jacobthornton@gmail.com"
},
{
"name": "Mark Otto",
"email": "markdotto@gmail.com"
}
],
"description": "The most popular front-end framework for developing responsive, mobile first projects on the web.",
"homepage": "https://getbootstrap.com/",
"keywords": [
"JS",
"css",
"framework",
"front-end",
"mobile-first",
"responsive",
"sass",
"web"
],
"time": "2018-07-24T15:54:34+00:00"
}
],
"packages-dev": [

View file

@ -0,0 +1 @@
[h2]activity_filter[/h2]

View file

@ -0,0 +1 @@
[h2]activity_order[/h2]

View file

@ -1 +0,0 @@
[h2]network_tabs[/h2]

View file

@ -1 +0,0 @@
[h2]profile_tabs[/h2]

View file

@ -31,6 +31,12 @@ Hooks allow plugins/addons to "hook into" the code at many points and alter the
[zrl=[baseurl]/help/hook/account_settings_post]account_settings_post[/zrl]
Called when posting from the account settings form
[zrl=[baseurl]/help/hook/activity_filter]activity_filter[/zrl]
Called when generating the list of filters for the network page
[zrl=[baseurl]/help/hook/activity_order]activity_order[/zrl]
Called when generating the list of order options for the network page
[zrl=[baseurl]/help/hook/activity_received]activity_received[/zrl]
Called when an activity (post, comment, like, etc.) has been received from a zot source
@ -394,9 +400,6 @@ Hooks allow plugins/addons to "hook into" the code at many points and alter the
[zrl=[baseurl]/help/hook/network_ping]network_ping[/zrl]
Called during a ping request
[zrl=[baseurl]/help/hook/network_tabs]network_tabs[/zrl]
Called when generating the list of tabs for the network page
[zrl=[baseurl]/help/hook/network_to_name]network_to_name[/zrl]
Deprecated
@ -535,9 +538,6 @@ Hooks allow plugins/addons to "hook into" the code at many points and alter the
[zrl=[baseurl]/help/hook/profile_sidebar_enter]profile_sidebar_enter[/zrl]
Called before generating the 'channel sidebar' or mini-profile
[zrl=[baseurl]/help/hook/profile_tabs]profile_tabs[/zrl]
Called when generating the tabs for channel related pages (channel,profile,files,etc.)
[zrl=[baseurl]/help/hook/queue_deliver]queue_deliver[/zrl]
Called when delivering a queued message

File diff suppressed because one or more lines are too long

View file

@ -1427,6 +1427,8 @@ function attach_delete($channel_id, $resource, $is_photo = 0) {
if(! $r) {
attach_drop_photo($channel_id,$resource);
$arr = ['channel_id' => $channel_id, 'resource' => $resource, 'is_photo'=>$is_photo];
call_hooks("attach_delete",$arr);
return;
}
@ -1485,6 +1487,9 @@ function attach_delete($channel_id, $resource, $is_photo = 0) {
intval($channel_id)
);
$arr = ['channel_id' => $channel_id, 'resource' => $resource, 'is_photo'=>$is_photo];
call_hooks("attach_delete",$arr);
file_activity($channel_id, $object, $object['allow_cid'], $object['allow_gid'], $object['deny_cid'], $object['deny_gid'], 'update', true);
return;

View file

@ -1599,6 +1599,7 @@ function prepare_page($item) {
}
function network_tabs() {
$no_active='';

View file

@ -73,6 +73,7 @@ function get_features($filtered = true, $level = (-1)) {
feature_level('advanced_profiles',1),
],
// [
// 'profile_export',
// t('Profile Import/Export'),
@ -99,6 +100,7 @@ function get_features($filtered = true, $level = (-1)) {
// get_config('feature_lock','wiki'),
// feature_level('wiki',2),
// ],
/*
[
'hide_rating',
@ -118,6 +120,7 @@ function get_features($filtered = true, $level = (-1)) {
feature_level('private_notes',1),
],
// [
// 'cards',
// t('Cards'),
@ -155,6 +158,7 @@ function get_features($filtered = true, $level = (-1)) {
feature_level('photo_location',2),
],
// [
// 'ajaxchat',
// t('Access Controlled Chatrooms'),

View file

@ -295,6 +295,8 @@ function bb_to_markdown($Text, $options = []) {
*/
function html2markdown($html,$options = []) {
$markdown = '';
$html = htmlspecialchars($html);
$environment = Environment::createDefaultEnvironment($options);
$environment->addConverter(new TableConverter());

View file

@ -7,6 +7,7 @@ use Zotlabs\Lib\Libsync;
require_once('include/crypto.php');
require_once('include/attach.php');
require_once('include/msglib.php');
function mail_prepare_binary($item) {
@ -492,6 +493,7 @@ function private_messages_drop($channel_id, $messageitem_id, $drop_conversation
}
else {
xchan_mail_query($x[0]);
$x[0]['mail_deleted'] = true;
$r = q("DELETE FROM mail WHERE id = %d AND channel_id = %d",
intval($messageitem_id),

28
include/msglib.php Normal file
View file

@ -0,0 +1,28 @@
<?php
/* Common private message processing functions */
function msg_drop($message_id, $channel_id, $conv_guid) {
// Delete message
$r = q("DELETE FROM mail WHERE id = %d AND channel_id = %d",
intval($message_id),
intval($channel_id)
);
// Get new first message...
$r = q("SELECT mid, parent_mid FROM mail WHERE conv_guid = '%s' AND channel_id = %d ORDER BY id ASC LIMIT 1",
dbesc($conv_guid),
intval($channel_id)
);
// ...and if wasn't first before...
if ($r[0]['mid'] != $r[0]['parent_mid']) {
// ...refer whole thread to it
q("UPDATE mail SET parent_mid = '%s', mail_isreply = abs(mail_isreply - 1) WHERE conv_guid = '%s' AND channel_id = %d",
dbesc($r[0]['mid']),
dbesc($conv_guid),
intval($channel_id)
);
}
}

View file

@ -1,11 +1,11 @@
<?php /** @file */
use \Zotlabs\Lib as Zlib;
use \Zotlabs\Lib\Apps;
use \Zotlabs\Lib\Chatroom;
require_once('include/security.php');
require_once('include/menu.php');
function nav($template = 'default') {
/**
@ -212,26 +212,27 @@ function nav($template = 'default') {
//app bin
if($is_owner) {
if(get_pconfig(local_channel(), 'system','import_system_apps') !== datetime_convert('UTC','UTC','now','Y-m-d')) {
Zlib\Apps::import_system_apps();
Apps::import_system_apps();
set_pconfig(local_channel(), 'system','import_system_apps', datetime_convert('UTC','UTC','now','Y-m-d'));
}
$syslist = [];
$list = Zlib\Apps::app_list(local_channel(), false, ['nav_featured_app', 'nav_pinned_app']);
$syslist = array();
$list = Apps::app_list(local_channel(), false, ['nav_featured_app', 'nav_pinned_app']);
if($list) {
foreach($list as $li) {
$syslist[] = Zlib\Apps::app_encode($li);
$syslist[] = Apps::app_encode($li);
}
}
Zlib\Apps::translate_system_apps($syslist);
Apps::translate_system_apps($syslist);
}
else {
$syslist = Zlib\Apps::get_system_apps(true);
$syslist = Apps::get_system_apps(true);
}
usort($syslist,'Zotlabs\\Lib\\Apps::app_name_compare');
$syslist = Zlib\Apps::app_order(local_channel(),$syslist);
$syslist = Apps::app_order(local_channel(),$syslist);
foreach($syslist as $app) {
if(\App::$nav_sel['name'] == $app['name'])
@ -239,18 +240,18 @@ function nav($template = 'default') {
if($is_owner) {
if(strpos($app['categories'],'nav_pinned_app') !== false) {
$navbar_apps[] = Zlib\Apps::app_render($app,'navbar');
$navbar_apps[] = Apps::app_render($app,'navbar');
}
else {
$nav_apps[] = Zlib\Apps::app_render($app,'nav');
$nav_apps[] = Apps::app_render($app,'nav');
}
}
elseif(! $is_owner && strpos($app['requires'], 'local_channel') === false) {
if(strpos($app['categories'],'nav_pinned_app') !== false) {
$navbar_apps[] = Zlib\Apps::app_render($app,'navbar');
$navbar_apps[] = Apps::app_render($app,'navbar');
}
else {
$nav_apps[] = Zlib\Apps::app_render($app,'nav');
$nav_apps[] = Apps::app_render($app,'nav');
}
}
}
@ -312,12 +313,10 @@ function nav($template = 'default') {
function nav_set_selected($item){
App::$nav_sel['raw_name'] = $item;
$item = ['name' => $item];
Zlib\Apps::translate_system_apps($item);
Apps::translate_system_apps($item);
App::$nav_sel['name'] = $item['name'];
}
function channel_apps($is_owner = false, $nickname = null) {
// Don't provide any channel apps if we're running as the sys channel
@ -417,8 +416,8 @@ function channel_apps($is_owner = false, $nickname = null) {
}
if ($p['chat'] && feature_enabled($uid,'ajaxchat')) {
$has_chats = ZLib\Chatroom::list_count($uid);
if ($p['chat'] && Apps::system_app_installed($uid,'Chatrooms')) {
$has_chats = Chatroom::list_count($uid);
if ($has_chats) {
$tabs[] = [
'label' => t('Chatrooms'),
@ -443,7 +442,7 @@ function channel_apps($is_owner = false, $nickname = null) {
];
}
if($p['view_pages'] && feature_enabled($uid,'cards')) {
if($p['view_pages'] && Apps::system_app_installed($uid, 'Cards')) {
$tabs[] = [
'label' => t('Cards'),
'url' => z_root() . '/cards/' . $nickname ,
@ -454,7 +453,7 @@ function channel_apps($is_owner = false, $nickname = null) {
];
}
if($p['view_pages'] && feature_enabled($uid,'articles')) {
if($p['view_pages'] && Apps::system_app_installed($uid, 'Articles')) {
$tabs[] = [
'label' => t('Articles'),
'url' => z_root() . '/articles/' . $nickname ,
@ -466,7 +465,7 @@ function channel_apps($is_owner = false, $nickname = null) {
}
if($has_webpages && feature_enabled($uid,'webpages')) {
if($has_webpages && Apps::system_app_installed($uid, 'Webpages')) {
$tabs[] = [
'label' => t('Webpages'),
'url' => z_root() . '/page/' . $nickname . '/home',
@ -478,21 +477,20 @@ function channel_apps($is_owner = false, $nickname = null) {
}
if ($p['view_wiki']) {
if(feature_enabled($uid,'wiki')) {
$tabs[] = [
'label' => t('Wikis'),
'url' => z_root() . '/wiki/' . $nickname,
'sel' => ((argv(0) == 'wiki') ? 'active' : ''),
'title' => t('Wiki'),
'id' => 'wiki-tab',
'icon' => 'pencil-square-o'
];
}
if ($p['view_wiki'] && Apps::system_app_installed($uid, 'Wiki')) {
$tabs[] = [
'label' => t('Wikis'),
'url' => z_root() . '/wiki/' . $nickname,
'sel' => ((argv(0) == 'wiki') ? 'active' : ''),
'title' => t('Wiki'),
'id' => 'wiki-tab',
'icon' => 'pencil-square-o'
];
}
$arr = array('is_owner' => $is_owner, 'nickname' => $nickname, 'tab' => (($tab) ? $tab : false), 'tabs' => $tabs);
call_hooks('profile_tabs', $arr);
call_hooks('channel_apps', $arr);
return replace_macros(get_markup_template('profile_tabs.tpl'),

View file

@ -162,7 +162,7 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) {
if($http_code == 301 || $http_code == 302 || $http_code == 303 || $http_code == 307 || $http_code == 308) {
$matches = array();
preg_match('/(Location:|URI:)(.*?)\n/', $header, $matches);
preg_match('/(Location:|URI:)(.*?)\n/i', $header, $matches);
$newurl = trim(array_pop($matches));
if(strpos($newurl,'/') === 0)
$newurl = $url . $newurl;

View file

@ -43,7 +43,13 @@ function replace_macros($s, $r) {
call_hooks('replace_macros', $arr);
$t = App::template_engine();
$output = $t->replace_macros($arr['template'], $arr['params']);
try {
$output = $t->replace_macros($arr['template'], $arr['params']);
} catch (Exception $e) {
logger("Unable to render template: ",$e->getMessage());
$output = "<h3>ERROR: there was an error creating the output.</h3>";
}
return $output;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,8 +0,0 @@
/*!
* Bootstrap Reboot v4.1.0 (https://getbootstrap.com/)
* Copyright 2011-2018 The Bootstrap Authors
* Copyright 2011-2018 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg:not(:root){overflow:hidden}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}
/*# sourceMappingURL=bootstrap-reboot.min.css.map */

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -35,7 +35,7 @@
if (!preg_match("/^msgstr\[[1-9]/",$l)) {
if ($k!="" && (substr($l,0,7)=="msgstr " || substr($l,0,8)=="msgstr[0")){
$ink = False;
$k = stripslashes($k);
$k = stripcslashes($k);
$v = "";
if (isset(App::$strings[$k])) {
$v = App::$strings[$k];

View file

@ -1318,6 +1318,7 @@ return array(
'Zotlabs\\Update\\_1216' => $baseDir . '/Zotlabs/Update/_1216.php',
'Zotlabs\\Update\\_1217' => $baseDir . '/Zotlabs/Update/_1217.php',
'Zotlabs\\Update\\_1218' => $baseDir . '/Zotlabs/Update/_1218.php',
'Zotlabs\\Update\\_1219' => $baseDir . '/Zotlabs/Update/_1219.php',
'Zotlabs\\Web\\CheckJS' => $baseDir . '/Zotlabs/Web/CheckJS.php',
'Zotlabs\\Web\\Controller' => $baseDir . '/Zotlabs/Web/Controller.php',
'Zotlabs\\Web\\HTTPHeaders' => $baseDir . '/Zotlabs/Web/HTTPHeaders.php',

View file

@ -1486,6 +1486,7 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'Zotlabs\\Update\\_1216' => __DIR__ . '/../..' . '/Zotlabs/Update/_1216.php',
'Zotlabs\\Update\\_1217' => __DIR__ . '/../..' . '/Zotlabs/Update/_1217.php',
'Zotlabs\\Update\\_1218' => __DIR__ . '/../..' . '/Zotlabs/Update/_1218.php',
'Zotlabs\\Update\\_1219' => __DIR__ . '/../..' . '/Zotlabs/Update/_1219.php',
'Zotlabs\\Web\\CheckJS' => __DIR__ . '/../..' . '/Zotlabs/Web/CheckJS.php',
'Zotlabs\\Web\\Controller' => __DIR__ . '/../..' . '/Zotlabs/Web/Controller.php',
'Zotlabs\\Web\\HTTPHeaders' => __DIR__ . '/../..' . '/Zotlabs/Web/HTTPHeaders.php',

View file

@ -1141,5 +1141,58 @@
"polyfill",
"portable"
]
},
{
"name": "twbs/bootstrap",
"version": "v4.1.3",
"version_normalized": "4.1.3.0",
"source": {
"type": "git",
"url": "https://github.com/twbs/bootstrap.git",
"reference": "3b558734382ce58b51e5fc676453bfd53bba9201"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twbs/bootstrap/zipball/3b558734382ce58b51e5fc676453bfd53bba9201",
"reference": "3b558734382ce58b51e5fc676453bfd53bba9201",
"shasum": ""
},
"replace": {
"twitter/bootstrap": "self.version"
},
"time": "2018-07-24T15:54:34+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.3.x-dev"
}
},
"installation-source": "dist",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jacob Thornton",
"email": "jacobthornton@gmail.com"
},
{
"name": "Mark Otto",
"email": "markdotto@gmail.com"
}
],
"description": "The most popular front-end framework for developing responsive, mobile first projects on the web.",
"homepage": "https://getbootstrap.com/",
"keywords": [
"JS",
"css",
"framework",
"front-end",
"mobile-first",
"responsive",
"sass",
"web"
]
}
]

20
vendor/twbs/bootstrap/.babelrc.js vendored Normal file
View file

@ -0,0 +1,20 @@
module.exports = {
presets: [
[
'@babel/env',
{
loose: true,
modules: false,
exclude: ['transform-typeof-symbol']
}
]
],
plugins: [
'@babel/proposal-object-rest-spread'
],
env: {
test: {
plugins: [ 'istanbul' ]
}
}
};

13
vendor/twbs/bootstrap/.browserslistrc vendored Normal file
View file

@ -0,0 +1,13 @@
# https://github.com/browserslist/browserslist#readme
>= 1%
last 1 major version
not dead
Chrome >= 45
Firefox >= 38
Edge >= 12
Explorer >= 10
iOS >= 9
Safari >= 9
Android >= 4.4
Opera >= 30

14
vendor/twbs/bootstrap/.editorconfig vendored Normal file
View file

@ -0,0 +1,14 @@
# editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false

5
vendor/twbs/bootstrap/.eslintignore vendored Normal file
View file

@ -0,0 +1,5 @@
**/*.min.js
**/dist/
**/vendor/
/_gh_pages/
/package.js

233
vendor/twbs/bootstrap/.eslintrc.json vendored Normal file
View file

@ -0,0 +1,233 @@
{
"root": true,
"parser": "babel-eslint",
"env": {
"browser": true,
"es6": true
},
"extends": ["eslint:recommended", "plugin:compat/recommended"],
"rules": {
// Possible Errors
"no-await-in-loop": "error",
"no-extra-parens": "error",
"no-prototype-builtins": "error",
"no-template-curly-in-string": "error",
"valid-jsdoc": "error",
// Best Practices
"accessor-pairs": "error",
"array-callback-return": "error",
"block-scoped-var": "error",
"class-methods-use-this": "off",
"complexity": "error",
"consistent-return": "error",
"curly": "error",
"default-case": "error",
"dot-location": ["error", "property"],
"dot-notation": "error",
"eqeqeq": "error",
"guard-for-in": "error",
"no-alert": "error",
"no-caller": "error",
"no-div-regex": "error",
"no-else-return": "error",
"no-empty-function": "error",
"no-eq-null": "error",
"no-eval": "error",
"no-extend-native": "error",
"no-extra-bind": "error",
"no-extra-label": "error",
"no-floating-decimal": "error",
"no-implicit-coercion": "error",
"no-implicit-globals": "error",
"no-implied-eval": "error",
"no-invalid-this": "off",
"no-iterator": "error",
"no-labels": "error",
"no-lone-blocks": "error",
"no-loop-func": "error",
"no-magic-numbers": ["error", {
"ignore": [-1, 0, 1],
"ignoreArrayIndexes": true
}
],
"no-multi-spaces": ["error", {
"ignoreEOLComments": true,
"exceptions": {
"AssignmentExpression": true,
"ArrowFunctionExpression": true,
"CallExpression": true,
"VariableDeclarator": true
}
}
],
"no-multi-str": "error",
"no-new": "error",
"no-new-func": "error",
"no-new-wrappers": "error",
"no-octal-escape": "error",
"no-param-reassign": "off",
"no-proto": "error",
"no-restricted-properties": "error",
"no-return-assign": "error",
"no-return-await": "error",
"no-script-url": "error",
"no-self-compare": "error",
"no-sequences": "error",
"no-throw-literal": "error",
"no-unmodified-loop-condition": "error",
"no-unused-expressions": "error",
"no-useless-call": "error",
"no-useless-concat": "error",
"no-useless-return": "error",
"no-void": "error",
"no-warning-comments": "off",
"no-with": "error",
"prefer-promise-reject-errors": "error",
"radix": "error",
"require-await": "error",
"vars-on-top": "error",
"wrap-iife": "error",
"yoda": "error",
// Strict Mode
"strict": "error",
// Variables
"init-declarations": "off",
"no-catch-shadow": "error",
"no-label-var": "error",
"no-restricted-globals": "error",
"no-shadow": "off",
"no-shadow-restricted-names": "error",
"no-undef-init": "error",
"no-undefined": "error",
"no-use-before-define": "off",
// Node.js and CommonJS
"callback-return": "off",
"global-require": "error",
"handle-callback-err": "error",
"no-mixed-requires": "error",
"no-new-require": "error",
"no-path-concat": "error",
"no-process-env": "error",
"no-process-exit": "error",
"no-restricted-modules": "error",
"no-sync": "error",
// Stylistic Issues
"array-bracket-spacing": "error",
"block-spacing": "error",
"brace-style": "error",
"camelcase": "error",
"capitalized-comments": "off",
"comma-dangle": "error",
"comma-spacing": "error",
"comma-style": "error",
"computed-property-spacing": "error",
"consistent-this": "error",
"eol-last": "error",
"func-call-spacing": "error",
"func-name-matching": "error",
"func-names": "off",
"func-style": ["error", "declaration"],
"id-blacklist": "error",
"id-length": "off",
"id-match": "error",
"indent": ["error", 2, { "SwitchCase": 1 }],
"jsx-quotes": "error",
"key-spacing": "off",
"keyword-spacing": "error",
"linebreak-style": ["error", "unix"],
"line-comment-position": "off",
"lines-around-comment": "off",
"lines-around-directive": "error",
"max-depth": ["error", 10],
"max-len": "off",
"max-lines": "off",
"max-nested-callbacks": "error",
"max-params": "off",
"max-statements": "off",
"max-statements-per-line": "error",
"multiline-ternary": "off",
"new-cap": ["error", { "capIsNewExceptionPattern": "$.*" }],
"newline-after-var": "off",
"newline-per-chained-call": ["error", { "ignoreChainWithDepth": 5 }],
"new-parens": "error",
"no-array-constructor": "error",
"no-bitwise": "error",
"no-continue": "off",
"no-inline-comments": "off",
"no-lonely-if": "error",
"no-mixed-operators": "off",
"no-multi-assign": "error",
"no-multiple-empty-lines": "error",
"nonblock-statement-body-position": "error",
"no-negated-condition": "off",
"no-nested-ternary": "error",
"no-new-object": "error",
"no-plusplus": "off",
"no-restricted-syntax": "error",
"no-tabs": "error",
"no-ternary": "off",
"no-trailing-spaces": "error",
"no-underscore-dangle": "off",
"no-unneeded-ternary": "error",
"no-whitespace-before-property": "error",
"object-curly-newline": ["error", { "minProperties": 1 }],
"object-curly-spacing": ["error", "always"],
"object-property-newline": "error",
"one-var": ["error", "never"],
"one-var-declaration-per-line": "error",
"operator-assignment": "error",
"operator-linebreak": "error",
"padded-blocks": ["error", "never"],
"padding-line-between-statements": "off",
"quote-props": ["error", "as-needed"],
"quotes": ["error", "single"],
"require-jsdoc": "off",
"semi": ["error", "never"],
"semi-spacing": "error",
"sort-keys": "off",
"sort-vars": "error",
"space-before-blocks": "error",
"space-before-function-paren": ["error", {
"anonymous": "always",
"named": "never"
}],
"space-in-parens": "error",
"space-infix-ops": "error",
"space-unary-ops": "error",
"spaced-comment": "error",
"template-tag-spacing": "error",
"unicode-bom": "error",
"wrap-regex": "off",
// ECMAScript 6
"arrow-body-style": ["error", "as-needed"],
"arrow-parens": "error",
"arrow-spacing": "error",
"generator-star-spacing": "error",
"no-confusing-arrow": "error",
"no-duplicate-imports": "error",
"no-restricted-imports": "error",
"no-useless-computed-key": "error",
"no-useless-constructor": "error",
"no-useless-rename": "error",
"no-var": "error",
"object-shorthand": "error",
"prefer-arrow-callback": "error",
"prefer-const": "error",
"prefer-destructuring": "off",
"prefer-numeric-literals": "error",
"prefer-rest-params": "error",
"prefer-spread": "error",
"prefer-template": "error",
"rest-spread-spacing": "error",
"sort-imports": "error",
"symbol-description": "error",
"template-curly-spacing": "error",
"yield-star-spacing": "error"
}
}

18
vendor/twbs/bootstrap/.gitattributes vendored Normal file
View file

@ -0,0 +1,18 @@
# Enforce Unix newlines
*.css text eol=lf
*.html text eol=lf
*.js text eol=lf
*.json text eol=lf
*.md text eol=lf
*.rb text eol=lf
*.scss text eol=lf
*.svg text eol=lf
*.txt text eol=lf
*.xml text eol=lf
*.yml text eol=lf
# Don't diff or textually merge source maps
*.map binary
bootstrap.css linguist-vendored=false
bootstrap.js linguist-vendored=false

View file

@ -0,0 +1,243 @@
# Contributing to Bootstrap
Looking to contribute something to Bootstrap? **Here's how you can help.**
Please take a moment to review this document in order to make the contribution
process easy and effective for everyone involved.
Following these guidelines helps to communicate that you respect the time of
the developers managing and developing this open source project. In return,
they should reciprocate that respect in addressing your issue or assessing
patches and features.
## Using the issue tracker
The [issue tracker](https://github.com/twbs/bootstrap/issues) is
the preferred channel for [bug reports](#bug-reports), [features requests](#feature-requests)
and [submitting pull requests](#pull-requests), but please respect the following
restrictions:
* Please **do not** use the issue tracker for personal support requests. Stack
Overflow ([`bootstrap-4`](https://stackoverflow.com/questions/tagged/bootstrap-4) tag), [Slack](https://bootstrap-slack.herokuapp.com/) or [IRC](README.md#community) are better places to get help.
* Please **do not** derail or troll issues. Keep the discussion on topic and
respect the opinions of others.
* Please **do not** post comments consisting solely of "+1" or ":thumbsup:".
Use [GitHub's "reactions" feature](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/)
instead. We reserve the right to delete comments which violate this rule.
* Please **do not** open issues regarding the official themes offered on <https://themes.getbootstrap.com/>.
Instead, please email any questions or feedback regarding those themes to `themes AT getbootstrap DOT com`.
## Issues and labels
Our bug tracker utilizes several labels to help organize and identify issues. Here's what they represent and how we use them:
- `browser bug` - Issues that are reported to us, but actually are the result of a browser-specific bug. These are diagnosed with reduced test cases and result in an issue opened on that browser's own bug tracker.
- `confirmed` - Issues that have been confirmed with a reduced test case and identify a bug in Bootstrap.
- `css` - Issues stemming from our compiled CSS or source Sass files.
- `docs` - Issues for improving or updating our documentation.
- `examples` - Issues involving the example templates included in our docs.
- `feature` - Issues asking for a new feature to be added, or an existing one to be extended or modified. New features require a minor version bump (e.g., `v3.0.0` to `v3.1.0`).
- `build` - Issues with our build system, which is used to run all our tests, concatenate and compile source files, and more.
- `help wanted` - Issues we need or would love help from the community to resolve.
- `js` - Issues stemming from our compiled or source JavaScript files.
- `meta` - Issues with the project itself or our GitHub repository.
For a complete look at our labels, see the [project labels page](https://github.com/twbs/bootstrap/labels).
## Bug reports
A bug is a _demonstrable problem_ that is caused by the code in the repository.
Good bug reports are extremely helpful, so thanks!
Guidelines for bug reports:
0. **Validate and lint your code** &mdash; [validate your HTML](https://html5.validator.nu/)
and [lint your HTML](https://github.com/twbs/bootlint) to ensure your
problem isn't caused by a simple error in your own code.
1. **Use the GitHub issue search** &mdash; check if the issue has already been
reported.
2. **Check if the issue has been fixed** &mdash; try to reproduce it using the
latest `master` or development branch in the repository.
3. **Isolate the problem** &mdash; ideally create a [reduced test
case](https://css-tricks.com/reduced-test-cases/) and a live example.
[This JS Bin](https://jsbin.com/lolome/edit?html,output) is a helpful template.
A good bug report shouldn't leave others needing to chase you up for more
information. Please try to be as detailed as possible in your report. What is
your environment? What steps will reproduce the issue? What browser(s) and OS
experience the problem? Do other browsers show the bug differently? What
would you expect to be the outcome? All these details will help people to fix
any potential bugs.
Example:
> Short and descriptive example bug report title
>
> A summary of the issue and the browser/OS environment in which it occurs. If
> suitable, include the steps required to reproduce the bug.
>
> 1. This is the first step
> 2. This is the second step
> 3. Further steps, etc.
>
> `<url>` - a link to the reduced test case
>
> Any other information you want to share that is relevant to the issue being
> reported. This might include the lines of code that you have identified as
> causing the bug, and potential solutions (and your opinions on their
> merits).
### Reporting upstream browser bugs
Sometimes bugs reported to us are actually caused by bugs in the browser(s) themselves, not bugs in Bootstrap per se.
When feasible, we aim to report such upstream bugs to the relevant browser vendor(s), and then list them on our [Wall of Browser Bugs](https://getbootstrap.com/browser-bugs/) and [document them in MDN](https://developer.mozilla.org/en-US/docs/Web).
| Vendor(s) | Browser(s) | Rendering engine | Bug reporting website(s) | Notes |
| ------------- | ---------------------------- | ---------------- | ------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| Mozilla | Firefox | Gecko | https://bugzilla.mozilla.org/enter_bug.cgi | "Core" is normally the right product option to choose. |
| Apple | Safari | WebKit | https://bugs.webkit.org/enter_bug.cgi?product=WebKit <br> https://bugreport.apple.com/ | In Apple's bug reporter, choose "Safari" as the product. |
| Google, Opera | Chrome, Chromium, Opera v15+ | Blink | https://bugs.chromium.org/p/chromium/issues/list | Click the "New issue" button. |
| Microsoft | Edge | EdgeHTML | https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/ | |
### Issues bots
[@twbs-lmvtfy](https://github.com/twbs-lmvtfy) is a Bootstrap bot that hangs out in our GitHub issue tracker and automatically checks for HTML validation errors in live examples (e.g. jsFiddles, JS Bins, Bootplys, Plunks, CodePens, etc.) posted in issue comments. If it finds any errors, it will post a follow-up comment on the issue and point out the errors. If this happens with an example you've posted, please fix the errors and post an updated live example. If you opened a bug report, please check whether the bug still occurs with your revised, valid live example. If the bug no longer occurs, it was probably due to your invalid HTML rather than something in Bootstrap and we'd appreciate it if you could close out the GitHub issue.
## Feature requests
Feature requests are welcome. But take a moment to find out whether your idea
fits with the scope and aims of the project. It's up to *you* to make a strong
case to convince the project's developers of the merits of this feature. Please
provide as much detail and context as possible.
## Pull requests
Good pull requests—patches, improvements, new features—are a fantastic
help. They should remain focused in scope and avoid containing unrelated
commits.
**Please ask first** before embarking on any significant pull request (e.g.
implementing features, refactoring code, porting to a different language),
otherwise you risk spending a lot of time working on something that the
project's developers might not want to merge into the project.
Please adhere to the [coding guidelines](#code-guidelines) used throughout the
project (indentation, accurate comments, etc.) and any other requirements
(such as test coverage).
**Do not edit `bootstrap.css`, or `bootstrap.js`
directly!** Those files are automatically generated. You should edit the
source files in [`/bootstrap/scss/`](https://github.com/twbs/bootstrap/tree/master/scss)
and/or [`/bootstrap/js/`](https://github.com/twbs/bootstrap/tree/master/js) instead.
Similarly, when contributing to Bootstrap's documentation, you should edit the
documentation source files in
[the `/bootstrap/docs/` directory of the `master` branch](https://github.com/twbs/bootstrap/tree/master/docs).
**Do not edit the `gh-pages` branch.** That branch is generated from the
documentation source files and is managed separately by the Bootstrap Core Team.
Adhering to the following process is the best way to get your work
included in the project:
1. [Fork](https://help.github.com/articles/fork-a-repo/) the project, clone your fork,
and configure the remotes:
```bash
# Clone your fork of the repo into the current directory
git clone https://github.com/<your-username>/bootstrap.git
# Navigate to the newly cloned directory
cd bootstrap
# Assign the original repo to a remote called "upstream"
git remote add upstream https://github.com/twbs/bootstrap.git
```
2. If you cloned a while ago, get the latest changes from upstream:
```bash
git checkout master
git pull upstream master
```
3. Create a new topic branch (off the main project development branch) to
contain your feature, change, or fix:
```bash
git checkout -b <topic-branch-name>
```
4. Commit your changes in logical chunks. Please adhere to these [git commit
message guidelines](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
or your code is unlikely be merged into the main project. Use Git's
[interactive rebase](https://help.github.com/articles/about-git-rebase/)
feature to tidy up your commits before making them public.
5. Locally merge (or rebase) the upstream development branch into your topic branch:
```bash
git pull [--rebase] upstream master
```
6. Push your topic branch up to your fork:
```bash
git push origin <topic-branch-name>
```
7. [Open a Pull Request](https://help.github.com/articles/about-pull-requests/)
with a clear title and description against the `master` branch.
**IMPORTANT**: By submitting a patch, you agree to allow the project owners to
license your work under the terms of the [MIT License](LICENSE) (if it
includes code changes) and under the terms of the
[Creative Commons Attribution 3.0 Unported License](docs/LICENSE)
(if it includes documentation changes).
## Code guidelines
### HTML
[Adhere to the Code Guide.](http://codeguide.co/#html)
- Use tags and elements appropriate for an HTML5 doctype (e.g., self-closing tags).
- Use CDNs and HTTPS for third-party JS when possible. We don't use protocol-relative URLs in this case because they break when viewing the page locally via `file://`.
- Use [WAI-ARIA](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) attributes in documentation examples to promote accessibility.
### CSS
[Adhere to the Code Guide.](http://codeguide.co/#css)
- When feasible, default color palettes should comply with [WCAG color contrast guidelines](https://www.w3.org/TR/WCAG20/#visual-audio-contrast).
- Except in rare cases, don't remove default `:focus` styles (via e.g. `outline: none;`) without providing alternative styles. See [this A11Y Project post](https://a11yproject.com/posts/never-remove-css-outlines/) for more details.
### JS
- No semicolons (in client-side JS)
- 2 spaces (no tabs)
- strict mode
- "Attractive"
- Don't use [jQuery event alias convenience methods](https://github.com/jquery/jquery/blob/master/src/event/alias.js) (such as `$().focus()`). Instead, use [`$().trigger(eventType, ...)`](https://api.jquery.com/trigger/) or [`$().on(eventType, ...)`](https://api.jquery.com/on/), depending on whether you're firing an event or listening for an event. (For example, `$().trigger('focus')` or `$().on('focus', function (event) { /* handle focus event */ })`) We do this to be compatible with custom builds of jQuery where the event aliases module has been excluded.
### Checking coding style
Run `npm run test` before committing to ensure your changes follow our coding standards.
## License
By contributing your code, you agree to license your contribution under the [MIT License](LICENSE).
By contributing to the documentation, you agree to license your contribution under the [Creative Commons Attribution 3.0 Unported License](docs/LICENSE).
Prior to v3.1.0, Bootstrap's code was released under the Apache License v2.0.

View file

@ -0,0 +1,11 @@
Before opening:
- [Search for duplicate or closed issues](https://github.com/twbs/bootstrap/issues?utf8=%E2%9C%93&q=is%3Aissue)
- [Validate](https://html5.validator.nu/) and [lint](https://github.com/twbs/bootlint#in-the-browser) any HTML to avoid common problems
- Read the [contributing guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md)
Bug reports must include:
- Operating system and version (Windows, macOS, Android, iOS, Win10 Mobile)
- Browser and version (Chrome, Firefox, Safari, IE, MS Edge, Opera 15+, Android Browser)
- [Reduced test case](https://css-tricks.com/reduced-test-cases/) and suggested fix using [CodePen](https://codepen.io/) or [JS Bin](https://jsbin.com/)

View file

@ -0,0 +1,17 @@
---
name: Bug report
about: Tell us about a bug you may have identified in Bootstrap.
---
Before opening:
- [Search for duplicate or closed issues](https://github.com/twbs/bootstrap/issues?utf8=%E2%9C%93&q=is%3Aissue)
- [Validate](https://html5.validator.nu/) and [lint](https://github.com/twbs/bootlint#in-the-browser) any HTML to avoid common problems
- Read the [contributing guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md)
Bug reports must include:
- Operating system and version (Windows, macOS, Android, iOS, Win10 Mobile)
- Browser and version (Chrome, Firefox, Safari, IE, MS Edge, Opera 15+, Android Browser)
- [Reduced test case](https://css-tricks.com/reduced-test-cases/) and suggested fix using [CodePen](https://codepen.io/) or [JS Bin](https://jsbin.com/)

View file

@ -0,0 +1,9 @@
Before opening:
- [Search for duplicate or closed issues](https://github.com/twbs/bootstrap/issues?utf8=%E2%9C%93&q=is%3Aissue)
- Read the [contributing guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md)
Feature requests must include:
- As much detail as possible for what we should add and why it's important to Bootstrap
- Relevant links to prior art, screenshots, or live demos whenever possible

View file

@ -0,0 +1,15 @@
---
name: Feature request
about: Suggest an idea for a new feature in Bootstrap.
---
Before opening:
- [Search for duplicate or closed issues](https://github.com/twbs/bootstrap/issues?utf8=%E2%9C%93&q=is%3Aissue)
- Read the [contributing guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md)
Feature requests must include:
- As much detail as possible for what we should add and why it's important to Bootstrap
- Relevant links to prior art, screenshots, or live demos whenever possible

View file

@ -0,0 +1,11 @@
### Bug reports
See the [contributing guidelines](CONTRIBUTING.md) for sharing bug reports.
### How-to
For general troubleshooting or help getting started:
- Join [the official Slack room](https://bootstrap-slack.herokuapp.com/).
- Chat with fellow Bootstrappers in IRC. On the `irc.freenode.net` server, in the `##bootstrap` channel.
- Ask and explore Stack Overflow with the [`bootstrap-4`](https://stackoverflow.com/questions/tagged/bootstrap-4) tag.

48
vendor/twbs/bootstrap/.gitignore vendored Normal file
View file

@ -0,0 +1,48 @@
# Ignore docs files
_gh_pages
_site
site/docs/4.1/dist/
# Ignore ruby files
.ruby-version
.bundle
vendor/cache
vendor/bundle
# Numerous always-ignore extensions
*.diff
*.err
*.log
*.orig
*.rej
*.swo
*.swp
*.vi
*.zip
*~
# OS or Editor folders
._*
.cache
.DS_Store
.idea
.project
.settings
.tmproj
*.esproj
*.sublime-project
*.sublime-workspace
nbproject
Thumbs.db
# Komodo
.komodotools
*.komodoproject
# Jekyll metadata and extra config file for `github` script
docs/.jekyll-metadata
twbsconfig.yml
# Folders to ignore
node_modules
js/coverage

View file

@ -0,0 +1,4 @@
**/*.min.css
**/dist/
**/vendor/
/_gh_pages/

274
vendor/twbs/bootstrap/.stylelintrc vendored Normal file
View file

@ -0,0 +1,274 @@
{
"extends": ["stylelint-config-standard", "stylelint-config-recommended-scss"],
"plugins": [
"stylelint-order"
],
"rules": {
"at-rule-empty-line-before": null,
"at-rule-name-space-after": "always",
"at-rule-no-vendor-prefix": true,
"at-rule-semicolon-space-before": "never",
"block-closing-brace-empty-line-before": null,
"block-closing-brace-newline-after": null,
"block-opening-brace-space-before": null,
"color-named": "never",
"declaration-block-semicolon-newline-after": "always-multi-line",
"declaration-block-semicolon-newline-before": "never-multi-line",
"declaration-block-semicolon-space-after": "always-single-line",
"declaration-empty-line-before": null,
"declaration-no-important": true,
"font-family-name-quotes": "always-where-recommended",
"font-weight-notation": "numeric",
"function-url-no-scheme-relative": true,
"function-url-quotes": "always",
"length-zero-no-unit": true,
"max-empty-lines": 2,
"max-line-length": null,
"media-feature-name-no-vendor-prefix": true,
"media-feature-parentheses-space-inside": "never",
"media-feature-range-operator-space-after": "always",
"media-feature-range-operator-space-before": "never",
"no-descending-specificity": null,
"no-duplicate-selectors": true,
"number-leading-zero": "never",
"media-feature-name-no-unknown": [true, {
"ignoreMediaFeatureNames": ["prefers-reduced-motion"]
}],
"order/properties-order": [
"position",
"top",
"right",
"bottom",
"left",
"z-index",
"box-sizing",
"display",
"flex",
"flex-align",
"flex-basis",
"flex-direction",
"flex-wrap",
"flex-flow",
"flex-shrink",
"flex-grow",
"flex-order",
"flex-pack",
"align-content",
"align-items",
"align-self",
"justify-content",
"order",
"float",
"width",
"min-width",
"max-width",
"height",
"min-height",
"max-height",
"padding",
"padding-top",
"padding-right",
"padding-bottom",
"padding-left",
"margin",
"margin-top",
"margin-right",
"margin-bottom",
"margin-left",
"overflow",
"overflow-x",
"overflow-y",
"-webkit-overflow-scrolling",
"-ms-overflow-x",
"-ms-overflow-y",
"-ms-overflow-style",
"columns",
"column-count",
"column-fill",
"column-gap",
"column-rule",
"column-rule-width",
"column-rule-style",
"column-rule-color",
"column-span",
"column-width",
"orphans",
"widows",
"clip",
"clear",
"font",
"font-family",
"font-size",
"font-style",
"font-weight",
"font-variant",
"font-size-adjust",
"font-stretch",
"font-effect",
"font-emphasize",
"font-emphasize-position",
"font-emphasize-style",
"font-smooth",
"src",
"hyphens",
"line-height",
"color",
"text-align",
"text-align-last",
"text-emphasis",
"text-emphasis-color",
"text-emphasis-style",
"text-emphasis-position",
"text-decoration",
"text-indent",
"text-justify",
"text-outline",
"-ms-text-overflow",
"text-overflow",
"text-overflow-ellipsis",
"text-overflow-mode",
"text-shadow",
"text-transform",
"text-wrap",
"-webkit-text-size-adjust",
"-ms-text-size-adjust",
"letter-spacing",
"-ms-word-break",
"word-break",
"word-spacing",
"-ms-word-wrap",
"word-wrap",
"overflow-wrap",
"tab-size",
"white-space",
"vertical-align",
"direction",
"unicode-bidi",
"list-style",
"list-style-position",
"list-style-type",
"list-style-image",
"pointer-events",
"-ms-touch-action",
"touch-action",
"cursor",
"visibility",
"zoom",
"table-layout",
"empty-cells",
"caption-side",
"border-spacing",
"border-collapse",
"content",
"quotes",
"counter-reset",
"counter-increment",
"resize",
"user-select",
"nav-index",
"nav-up",
"nav-right",
"nav-down",
"nav-left",
"background",
"background-color",
"background-image",
"filter",
"background-repeat",
"background-attachment",
"background-position",
"background-position-x",
"background-position-y",
"background-clip",
"background-origin",
"background-size",
"border",
"border-color",
"border-style",
"border-width",
"border-top",
"border-top-color",
"border-top-style",
"border-top-width",
"border-right",
"border-right-color",
"border-right-style",
"border-right-width",
"border-bottom",
"border-bottom-color",
"border-bottom-style",
"border-bottom-width",
"border-left",
"border-left-color",
"border-left-style",
"border-left-width",
"border-radius",
"border-top-left-radius",
"border-top-right-radius",
"border-bottom-right-radius",
"border-bottom-left-radius",
"border-image",
"border-image-source",
"border-image-slice",
"border-image-width",
"border-image-outset",
"border-image-repeat",
"outline",
"outline-width",
"outline-style",
"outline-color",
"outline-offset",
"box-shadow",
"opacity",
"-ms-interpolation-mode",
"page-break-after",
"page-break-before",
"page-break-inside",
"transition",
"transition-delay",
"transition-timing-function",
"transition-duration",
"transition-property",
"transform",
"transform-origin",
"perspective",
"appearance",
"animation",
"animation-name",
"animation-duration",
"animation-play-state",
"animation-timing-function",
"animation-delay",
"animation-iteration-count",
"animation-direction",
"animation-fill-mode",
"fill",
"stroke"
],
"property-no-vendor-prefix": true,
"rule-empty-line-before": null,
"scss/dollar-variable-default": [true, { "ignore": "local" }],
"selector-attribute-quotes": "always",
"selector-list-comma-newline-after": "always",
"selector-list-comma-newline-before": "never-multi-line",
"selector-list-comma-space-after": "always-single-line",
"selector-list-comma-space-before": "never-single-line",
"selector-max-attribute": 2,
"selector-max-class": 4,
"selector-max-combinators": 4,
"selector-max-compound-selectors": 4,
"selector-max-empty-lines": 1,
"selector-max-id": 0,
"selector-max-specificity": null,
"selector-max-type": 2,
"selector-max-universal": 1,
"selector-no-qualifying-type": true,
"selector-no-vendor-prefix": true,
"string-quotes": "double",
"value-keyword-case": "lower",
"value-list-comma-newline-after": "never-multi-line",
"value-list-comma-newline-before": "never-multi-line",
"value-list-comma-space-after": "always",
"value-no-vendor-prefix": true
}
}

33
vendor/twbs/bootstrap/.travis.yml vendored Normal file
View file

@ -0,0 +1,33 @@
sudo: required
dist: trusty
addons:
chrome: stable
language: node_js
git:
depth: 3
node_js:
- "6"
- "8"
before_install:
- if [[ `npm -v` != 5* ]]; then npm install -g npm@5; fi
install:
- bundle install --deployment --jobs=3 --retry=3
- npm install
script:
- npm test
- if [ "$TRAVIS_NODE_VERSION" = "8" ]; then npm run check-broken-links; fi
after_success:
- if [ "$TRAVIS_NODE_VERSION" = "8" ]; then npm run coveralls; fi
stages:
- test
- name: browser
if: type = push
jobs:
include:
- stage: browser
node_js: 8
script: if ! git log --format=%B --no-merges -n 1 | grep '\[skip browser\]'; then npm test && npm run js-test-cloud; fi
cache:
directories:
- node_modules
- vendor/bundle

1
vendor/twbs/bootstrap/CNAME vendored Normal file
View file

@ -0,0 +1 @@
getbootstrap.com

View file

@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at mdo@getbootstrap.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [https://www.contributor-covenant.org/version/1/4/code-of-conduct.html][version]
[homepage]: https://www.contributor-covenant.org/
[version]: https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

8
vendor/twbs/bootstrap/Gemfile vendored Normal file
View file

@ -0,0 +1,8 @@
source 'https://rubygems.org'
group :development, :test do
gem 'jekyll', '~> 3.8.3'
gem 'jekyll-redirect-from', '~> 0.14.0'
gem 'jekyll-sitemap', '~> 1.2.0'
gem 'jekyll-toc', '~> 0.6.0'
end

22
vendor/twbs/bootstrap/LICENSE vendored Normal file
View file

@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2011-2018 Twitter, Inc.
Copyright (c) 2011-2018 The Bootstrap Authors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

177
vendor/twbs/bootstrap/README.md vendored Normal file
View file

@ -0,0 +1,177 @@
<p align="center">
<a href="https://getbootstrap.com/">
<img src="https://getbootstrap.com/docs/4.1/assets/brand/bootstrap-solid.svg" alt="Bootstrap logo" width=72 height=72>
</a>
<h3 align="center">Bootstrap</h3>
<p align="center">
Sleek, intuitive, and powerful front-end framework for faster and easier web development.
<br>
<a href="https://getbootstrap.com/docs/4.1/"><strong>Explore Bootstrap docs »</strong></a>
<br>
<br>
<a href="https://github.com/twbs/bootstrap/issues/new?template=bug.md">Report bug</a>
·
<a href="https://github.com/twbs/bootstrap/issues/new?template=feature.md&labels=feature">Request feature</a>
·
<a href="https://themes.getbootstrap.com/">Themes</a>
·
<a href="https://jobs.getbootstrap.com/">Jobs</a>
·
<a href="https://blog.getbootstrap.com/">Blog</a>
</p>
</p>
<br>
## Table of contents
- [Quick start](#quick-start)
- [Status](#status)
- [What's included](#whats-included)
- [Bugs and feature requests](#bugs-and-feature-requests)
- [Documentation](#documentation)
- [Contributing](#contributing)
- [Community](#community)
- [Versioning](#versioning)
- [Creators](#creators)
- [Copyright and license](#copyright-and-license)
## Quick start
Several quick start options are available:
- [Download the latest release.](https://github.com/twbs/bootstrap/archive/v4.1.3.zip)
- Clone the repo: `git clone https://github.com/twbs/bootstrap.git`
- Install with [npm](https://www.npmjs.com/): `npm install bootstrap`
- Install with [yarn](https://yarnpkg.com/): `yarn add bootstrap@4.1.3`
- Install with [Composer](https://getcomposer.org/): `composer require twbs/bootstrap:4.1.3`
- Install with [NuGet](https://www.nuget.org/): CSS: `Install-Package bootstrap` Sass: `Install-Package bootstrap.sass`
Read the [Getting started page](https://getbootstrap.com/docs/4.1/getting-started/introduction/) for information on the framework contents, templates and examples, and more.
## Status
[![Slack](https://bootstrap-slack.herokuapp.com/badge.svg)](https://bootstrap-slack.herokuapp.com/)
[![Build Status](https://img.shields.io/travis/twbs/bootstrap/v4-dev.svg)](https://travis-ci.org/twbs/bootstrap)
[![npm version](https://img.shields.io/npm/v/bootstrap.svg)](https://www.npmjs.com/package/bootstrap)
[![Gem version](https://img.shields.io/gem/v/bootstrap.svg)](https://rubygems.org/gems/bootstrap)
[![Meteor Atmosphere](https://img.shields.io/badge/meteor-twbs%3Abootstrap-blue.svg)](https://atmospherejs.com/twbs/bootstrap)
[![Packagist Prerelease](https://img.shields.io/packagist/vpre/twbs/bootstrap.svg)](https://packagist.org/packages/twbs/bootstrap)
[![NuGet](https://img.shields.io/nuget/vpre/bootstrap.svg)](https://www.nuget.org/packages/bootstrap/absoluteLatest)
[![peerDependencies Status](https://img.shields.io/david/peer/twbs/bootstrap.svg)](https://david-dm.org/twbs/bootstrap?type=peer)
[![devDependency Status](https://img.shields.io/david/dev/twbs/bootstrap.svg)](https://david-dm.org/twbs/bootstrap?type=dev)
[![Coverage Status](https://img.shields.io/coveralls/github/twbs/bootstrap/v4-dev.svg)](https://coveralls.io/github/twbs/bootstrap?branch=v4-dev)
[![CSS gzip size](http://img.badgesize.io/twbs/bootstrap/v4-dev/dist/css/bootstrap.min.css?compression=gzip&label=CSS+gzip+size)](https://github.com/twbs/bootstrap/tree/v4-dev/dist/css/bootstrap.min.css)
[![JS gzip size](http://img.badgesize.io/twbs/bootstrap/v4-dev/dist/js/bootstrap.min.js?compression=gzip&label=JS+gzip+size)](https://github.com/twbs/bootstrap/tree/v4-dev/dist/js/bootstrap.min.js)
[![Sauce Labs Test Status](https://saucelabs.com/browser-matrix/bootstrap.svg)](https://saucelabs.com/u/bootstrap)
## What's included
Within the download you'll find the following directories and files, logically grouping common assets and providing both compiled and minified variations. You'll see something like this:
```
bootstrap/
└── dist/
├── css/
│ ├── bootstrap-grid.css
│ ├── bootstrap-grid.css.map
│ ├── bootstrap-grid.min.css
│ ├── bootstrap-grid.min.css.map
│ ├── bootstrap-reboot.css
│ ├── bootstrap-reboot.css.map
│ ├── bootstrap-reboot.min.css
│ ├── bootstrap-reboot.min.css.map
│ ├── bootstrap.css
│ ├── bootstrap.css.map
│ ├── bootstrap.min.css
│ └── bootstrap.min.css.map
└── js/
├── bootstrap.bundle.js
├── bootstrap.bundle.js.map
├── bootstrap.bundle.min.js
├── bootstrap.bundle.min.js.map
├── bootstrap.js
├── bootstrap.js.map
├── bootstrap.min.js
└── bootstrap.min.js.map
```
We provide compiled CSS and JS (`bootstrap.*`), as well as compiled and minified CSS and JS (`bootstrap.min.*`). [source maps](https://developers.google.com/web/tools/chrome-devtools/debug/readability/source-maps) (`bootstrap.*.map`) are available for use with certain browsers' developer tools. Bundled JS files (`bootstrap.bundle.js` and minified `bootstrap.bundle.min.js`) include [Popper](https://popper.js.org/), but not [jQuery](https://jquery.com/).
## Bugs and feature requests
Have a bug or a feature request? Please first read the [issue guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md#using-the-issue-tracker) and search for existing and closed issues. If your problem or idea is not addressed yet, [please open a new issue](https://github.com/twbs/bootstrap/issues/new).
## Documentation
Bootstrap's documentation, included in this repo in the root directory, is built with [Jekyll](https://jekyllrb.com/) and publicly hosted on GitHub Pages at <https://getbootstrap.com/>. The docs may also be run locally.
Documentation search is powered by [Algolia's DocSearch](https://community.algolia.com/docsearch/). Working on our search? Be sure to set `debug: true` in `site/docs/4.1/assets/js/src/search.js` file.
### Running documentation locally
1. Run through the [tooling setup](https://getbootstrap.com/docs/4.1/getting-started/build-tools/#tooling-setup) to install Jekyll (the site builder) and other Ruby dependencies with `bundle install`.
2. Run `npm install` to install Node.js dependencies.
3. Run `npm start` to compile CSS and JavaScript files, generate our docs, and watch for changes.
4. Open `http://localhost:9001` in your browser, and voilà.
Learn more about using Jekyll by reading its [documentation](https://jekyllrb.com/docs/home/).
### Documentation for previous releases
- For v2.3.2: <https://getbootstrap.com/2.3.2/>
- For v3.3.x: <https://getbootstrap.com/docs/3.3/>
- For v4.0.x: <https://getbootstrap.com/docs/4.0/>
[Previous releases](https://github.com/twbs/bootstrap/releases) and their documentation are also available for download.
## Contributing
Please read through our [contributing guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md). Included are directions for opening issues, coding standards, and notes on development.
Moreover, if your pull request contains JavaScript patches or features, you must include [relevant unit tests](https://github.com/twbs/bootstrap/tree/master/js/tests). All HTML and CSS should conform to the [Code Guide](https://github.com/mdo/code-guide), maintained by [Mark Otto](https://github.com/mdo).
Editor preferences are available in the [editor config](https://github.com/twbs/bootstrap/blob/master/.editorconfig) for easy use in common text editors. Read more and download plugins at <https://editorconfig.org/>.
## Community
Get updates on Bootstrap's development and chat with the project maintainers and community members.
- Follow [@getbootstrap on Twitter](https://twitter.com/getbootstrap).
- Read and subscribe to [The Official Bootstrap Blog](https://blog.getbootstrap.com/).
- Join [the official Slack room](https://bootstrap-slack.herokuapp.com/).
- Chat with fellow Bootstrappers in IRC. On the `irc.freenode.net` server, in the `##bootstrap` channel.
- Implementation help may be found at Stack Overflow (tagged [`bootstrap-4`](https://stackoverflow.com/questions/tagged/bootstrap-4)).
- Developers should use the keyword `bootstrap` on packages which modify or add to the functionality of Bootstrap when distributing through [npm](https://www.npmjs.com/browse/keyword/bootstrap) or similar delivery mechanisms for maximum discoverability.
## Versioning
For transparency into our release cycle and in striving to maintain backward compatibility, Bootstrap is maintained under [the Semantic Versioning guidelines](https://semver.org/). Sometimes we screw up, but we'll adhere to those rules whenever possible.
See [the Releases section of our GitHub project](https://github.com/twbs/bootstrap/releases) for changelogs for each release version of Bootstrap. Release announcement posts on [the official Bootstrap blog](https://blog.getbootstrap.com/) contain summaries of the most noteworthy changes made in each release.
## Creators
**Mark Otto**
- <https://twitter.com/mdo>
- <https://github.com/mdo>
**Jacob Thornton**
- <https://twitter.com/fat>
- <https://github.com/fat>
## Copyright and license
Code and documentation copyright 2011-2018 the [Bootstrap Authors](https://github.com/twbs/bootstrap/graphs/contributors) and [Twitter, Inc.](https://twitter.com) Code released under the [MIT License](https://github.com/twbs/bootstrap/blob/master/LICENSE). Docs released under [Creative Commons](https://github.com/twbs/bootstrap/blob/master/docs/LICENSE).

63
vendor/twbs/bootstrap/_config.yml vendored Normal file
View file

@ -0,0 +1,63 @@
# Dependencies
markdown: kramdown
highlighter: rouge
kramdown:
auto_ids: true
# Permalinks
permalink: pretty
# Server
source: "site"
destination: ./_gh_pages
host: 0.0.0.0
port: 9001
baseurl: ""
url: "https://getbootstrap.com"
encoding: UTF-8
exclude:
- docs/4.1/assets/scss/
plugins:
- jekyll-redirect-from
- jekyll-sitemap
- jekyll-toc
# Social
title: Bootstrap
description: "The most popular HTML, CSS, and JS library in the world."
twitter: getbootstrap
authors: "Mark Otto, Jacob Thornton, and Bootstrap contributors"
social_image_path: /docs/4.1/assets/brand/bootstrap-social.png
social_logo_path: /docs/4.1/assets/brand/bootstrap-social-logo.png
# Custom variables
current_version: 4.1.3
current_ruby_version: 4.1.3
docs_version: 4.1
repo: "https://github.com/twbs/bootstrap"
slack: "https://bootstrap-slack.herokuapp.com"
blog: "https://blog.getbootstrap.com"
expo: "https://expo.getbootstrap.com"
jobs: "https://jobs.getbootstrap.com"
themes: "https://themes.getbootstrap.com"
download:
source: "https://github.com/twbs/bootstrap/archive/v4.1.3.zip"
dist: "https://github.com/twbs/bootstrap/releases/download/v4.1.3/bootstrap-4.1.3-dist.zip"
cdn:
# See https://www.srihash.org for info on how to generate the hashes
css: "https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
css_hash: "sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO"
js: "https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
js_hash: "sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
jquery: "https://code.jquery.com/jquery-3.3.1.slim.min.js"
jquery_hash: "sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
popper: "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
popper_hash: "sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
toc:
min_level: 2
max_level: 4

View file

@ -0,0 +1,20 @@
{
"env": {
"browser": false,
"node": true
},
"parserOptions": {
"sourceType": "script"
},
"extends": "../.eslintrc.json",
"rules": {
"consistent-return": "off",
"func-style": "off",
"no-console": "off",
"no-magic-numbers": "off",
"no-process-env": "off",
"no-process-exit": "off",
"no-sync": "off",
"spaced-comment": "off"
}
}

44
vendor/twbs/bootstrap/build/.htmllintrc vendored Normal file
View file

@ -0,0 +1,44 @@
{
"attr-bans": ["align", "background", "bgcolor", "border", "frameborder", "longdesc", "marginwidth", "marginheight", "scrolling"],
"attr-name-style": false,
"attr-no-dup": true,
"attr-no-unsafe-char": true,
"attr-quote-style": "double",
"attr-req-value": true,
"attr-validate": false,
"class-no-dup": true,
"class-style": "none",
"doctype-first": true,
"doctype-html5": true,
"fig-req-figcaption": false,
"focusable-tabindex-style": true,
"head-req-title": true,
"head-valid-content-model": false,
"href-style": false,
"html-req-lang": true,
"html-valid-content-model": false,
"id-class-ignore-regex": "(onclick|content|[a-z]+([A-Z][a-z])+)",
"id-class-no-ad": true,
"id-class-style": false,
"id-no-dup": true,
"img-req-alt": "allownull",
"img-req-src": false,
"indent-style": "spaces",
"indent-width": 2,
"input-radio-req-name": false,
"input-req-label": false,
"label-req-for": true,
"lang-style": "case",
"line-no-trailing-whitespace": false,
"line-end-style": "lf",
"spec-char-escape": false,
"table-req-header": false,
"tag-bans": ["b", "i"],
"tag-close": true,
"tag-name-lowercase": true,
"tag-name-match": true,
"tag-self-close": false,
"text-ignore-regex": false,
"title-max-len": 70,
"title-no-dup": true
}

View file

@ -0,0 +1,81 @@
/*!
* Script to build our plugins to use them separately.
* Copyright 2018 The Bootstrap Authors
* Copyright 2018 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
'use strict'
const rollup = require('rollup')
const path = require('path')
const babel = require('rollup-plugin-babel')
const TEST = process.env.NODE_ENV === 'test'
const plugins = [
babel({
exclude: 'node_modules/**', // Only transpile our source code
externalHelpersWhitelist: [ // Include only required helpers
'defineProperties',
'createClass',
'inheritsLoose',
'defineProperty',
'objectSpread'
]
})
]
const format = 'umd'
const rootPath = !TEST ? '../js/dist/' : '../js/coverage/dist/'
const bsPlugins = {
Alert: path.resolve(__dirname, '../js/src/alert.js'),
Button: path.resolve(__dirname, '../js/src/button.js'),
Carousel: path.resolve(__dirname, '../js/src/carousel.js'),
Collapse: path.resolve(__dirname, '../js/src/collapse.js'),
Dropdown: path.resolve(__dirname, '../js/src/dropdown.js'),
Modal: path.resolve(__dirname, '../js/src/modal.js'),
Popover: path.resolve(__dirname, '../js/src/popover.js'),
ScrollSpy: path.resolve(__dirname, '../js/src/scrollspy.js'),
Tab: path.resolve(__dirname, '../js/src/tab.js'),
Tooltip: path.resolve(__dirname, '../js/src/tooltip.js'),
Util: path.resolve(__dirname, '../js/src/util.js')
}
Object.keys(bsPlugins)
.forEach((pluginKey) => {
console.log(`Building ${pluginKey} plugin...`)
const external = ['jquery', 'popper.js']
const globals = {
jquery: 'jQuery', // Ensure we use jQuery which is always available even in noConflict mode
'popper.js': 'Popper'
}
// Do not bundle Util in plugins
if (pluginKey !== 'Util') {
external.push(bsPlugins.Util)
globals[bsPlugins.Util] = 'Util'
}
// Do not bundle Tooltip in Popover
if (pluginKey === 'Popover') {
external.push(bsPlugins.Tooltip)
globals[bsPlugins.Tooltip] = 'Tooltip'
}
rollup.rollup({
input: bsPlugins[pluginKey],
plugins,
external
}).then((bundle) => {
bundle.write({
format,
name: pluginKey,
sourcemap: true,
globals,
file: path.resolve(__dirname, `${rootPath}${pluginKey.toLowerCase()}.js`)
})
.then(() => console.log(`Building ${pluginKey} plugin... Done !`))
.catch((err) => console.error(`${pluginKey}: ${err}`))
})
})

View file

@ -0,0 +1,104 @@
#!/usr/bin/env node
/*!
* Script to update version number references in the project.
* Copyright 2017-2018 The Bootstrap Authors
* Copyright 2017-2018 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
'use strict'
const fs = require('fs')
const path = require('path')
const sh = require('shelljs')
sh.config.fatal = true
// Blame TC39... https://github.com/benjamingr/RegExp.escape/issues/37
function regExpQuote(string) {
return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&')
}
function regExpQuoteReplacement(string) {
return string.replace(/[$]/g, '$$')
}
const DRY_RUN = false
function walkAsync(directory, excludedDirectories, fileCallback, errback) {
if (excludedDirectories.has(path.parse(directory).base)) {
return
}
fs.readdir(directory, (err, names) => {
if (err) {
errback(err)
return
}
names.forEach((name) => {
const filepath = path.join(directory, name)
fs.lstat(filepath, (err, stats) => {
if (err) {
process.nextTick(errback, err)
return
}
if (stats.isDirectory()) {
process.nextTick(walkAsync, filepath, excludedDirectories, fileCallback, errback)
} else if (stats.isFile()) {
process.nextTick(fileCallback, filepath)
}
})
})
})
}
function replaceRecursively(directory, excludedDirectories, allowedExtensions, original, replacement) {
original = new RegExp(regExpQuote(original), 'g')
replacement = regExpQuoteReplacement(replacement)
const updateFile = DRY_RUN ? (filepath) => {
if (allowedExtensions.has(path.parse(filepath).ext)) {
console.log(`FILE: ${filepath}`)
} else {
console.log(`EXCLUDED:${filepath}`)
}
} : (filepath) => {
if (allowedExtensions.has(path.parse(filepath).ext)) {
sh.sed('-i', original, replacement, filepath)
}
}
walkAsync(directory, excludedDirectories, updateFile, (err) => {
console.error('ERROR while traversing directory!:')
console.error(err)
process.exit(1)
})
}
function main(args) {
if (args.length !== 2) {
console.error('USAGE: change-version old_version new_version')
console.error('Got arguments:', args)
process.exit(1)
}
const oldVersion = args[0]
const newVersion = args[1]
const EXCLUDED_DIRS = new Set([
'.git',
'node_modules',
'vendor'
])
const INCLUDED_EXTENSIONS = new Set([
// This extension whitelist is how we avoid modifying binary files
'',
'.css',
'.html',
'.js',
'.json',
'.md',
'.scss',
'.txt',
'.yml'
])
replaceRecursively('.', EXCLUDED_DIRS, INCLUDED_EXTENSIONS, oldVersion, newVersion)
}
main(process.argv.slice(2))

Binary file not shown.

View file

@ -0,0 +1,60 @@
#!/usr/bin/env node
/*!
* Script to generate SRI hashes for use in our docs.
* Remember to use the same vendor files as the CDN ones,
* otherwise the hashes won't match!
*
* Copyright 2017-2018 The Bootstrap Authors
* Copyright 2017-2018 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
'use strict'
const fs = require('fs')
const path = require('path')
const sriToolbox = require('sri-toolbox')
const sh = require('shelljs')
sh.config.fatal = true
const configFile = path.join(__dirname, '../_config.yml')
// Array of objects which holds the files to generate SRI hashes for.
// `file` is the path from the root folder
// `configPropertyName` is the _config.yml variable's name of the file
const files = [
{
file: 'dist/css/bootstrap.min.css',
configPropertyName: 'css_hash'
},
{
file: 'dist/js/bootstrap.min.js',
configPropertyName: 'js_hash'
},
{
file: 'site/docs/4.1/assets/js/vendor/jquery-slim.min.js',
configPropertyName: 'jquery_hash'
},
{
file: 'site/docs/4.1/assets/js/vendor/popper.min.js',
configPropertyName: 'popper_hash'
}
]
files.forEach((file) => {
fs.readFile(file.file, 'utf8', (err, data) => {
if (err) {
throw err
}
const integrity = sriToolbox.generate({
algorithms: ['sha384']
}, data)
console.log(`${file.configPropertyName}: ${integrity}`)
sh.sed('-i', new RegExp(`(\\s${file.configPropertyName}:\\s+"|')(\\S+)("|')`), `$1${integrity}$3`, configFile)
})
})

View file

@ -0,0 +1,82 @@
#!/usr/bin/env node
/*!
* Script to find unused Sass variables.
* Copyright 2017-2018 The Bootstrap Authors
* Copyright 2017-2018 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
'use strict'
const fs = require('fs')
const path = require('path')
const glob = require('glob')
// Blame TC39... https://github.com/benjamingr/RegExp.escape/issues/37
function regExpQuote(str) {
return str.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&')
}
let globalSuccess = true
function findUnusedVars(dir) {
if (!(fs.existsSync(dir) && fs.statSync(dir).isDirectory())) {
console.log(`"${dir}": Not a valid directory!`)
process.exit(1)
}
console.log(`Finding unused variables in "${dir}"...`)
// A variable to handle success/failure message in this function
let unusedVarsFound = false
// Array of all Sass files' content
const sassFiles = glob.sync(path.join(dir, '**/*.scss'))
// String of all Sass files' content
let sassFilesString = ''
sassFiles.forEach((file) => {
sassFilesString += fs.readFileSync(file, 'utf8')
})
// Array of all Sass variables
const variables = sassFilesString.match(/(^\$[a-zA-Z0-9_-]+[^:])/gm)
console.log(`Found ${variables.length} total variables.`)
// Loop through each variable
variables.forEach((variable) => {
const re = new RegExp(regExpQuote(variable), 'g')
const count = (sassFilesString.match(re) || []).length
if (count === 1) {
console.log(`Variable "${variable}" is not being used.`)
unusedVarsFound = true
globalSuccess = false
}
})
if (unusedVarsFound === false) {
console.log(`No unused variables found in "${dir}".`)
}
}
function main(args) {
if (args.length < 1) {
console.log('Wrong arguments!')
console.log('Usage: lint-vars.js folder [, folder2...]')
process.exit(1)
}
args.forEach((arg) => {
findUnusedVars(arg)
})
if (globalSuccess === false) {
process.exit(1)
}
}
// The first and second args are: path/to/node script.js
main(process.argv.slice(2))

View file

@ -0,0 +1,14 @@
'use strict'
module.exports = (ctx) => ({
map: ctx.file.dirname.includes('examples') ? false : {
inline: false,
annotation: true,
sourcesContent: true
},
plugins: {
autoprefixer: {
cascade: false
}
}
})

View file

@ -0,0 +1,53 @@
'use strict'
const path = require('path')
const babel = require('rollup-plugin-babel')
const resolve = require('rollup-plugin-node-resolve')
const pkg = require(path.resolve(__dirname, '../package.json'))
const BUNDLE = process.env.BUNDLE === 'true'
const year = new Date().getFullYear()
let fileDest = 'bootstrap.js'
const external = ['jquery', 'popper.js']
const plugins = [
babel({
exclude: 'node_modules/**', // Only transpile our source code
externalHelpersWhitelist: [ // Include only required helpers
'defineProperties',
'createClass',
'inheritsLoose',
'defineProperty',
'objectSpread'
]
})
]
const globals = {
jquery: 'jQuery', // Ensure we use jQuery which is always available even in noConflict mode
'popper.js': 'Popper'
}
if (BUNDLE) {
fileDest = 'bootstrap.bundle.js'
// Remove last entry in external array to bundle Popper
external.pop()
delete globals['popper.js']
plugins.push(resolve())
}
module.exports = {
input: path.resolve(__dirname, '../js/src/index.js'),
output: {
banner: `/*!
* Bootstrap v${pkg.version} (${pkg.homepage})
* Copyright 2011-${year} ${pkg.author}
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/`,
file: path.resolve(__dirname, `../dist/js/${fileDest}`),
format: 'umd',
globals,
name: 'bootstrap'
},
external,
plugins
}

View file

@ -0,0 +1,65 @@
[
{
"browserName": "safari",
"platform": "OS X 10.11",
"version": "latest"
},
{
"browserName": "chrome",
"platform": "OS X 10.11",
"version": "latest"
},
{
"browserName": "firefox",
"platform": "OS X 10.11",
"version": "latest"
},
{
"browserName": "MicrosoftEdge",
"platform": "Windows 10",
"version": "latest"
},
{
"browserName": "internet explorer",
"version": "11",
"platform": "Windows 8.1"
},
{
"browserName": "internet explorer",
"version": "10",
"platform": "Windows 8"
},
{
"browserName": "chrome",
"platform": "Windows 10",
"version": "latest"
},
{
"browserName": "firefox",
"platform": "Windows 10",
"version": "latest"
},
{
"browserName": "iphone",
"deviceName": "iPhone Simulator",
"platformName": "OS X 10.11",
"version": "9.3"
},
{
"browserName": "chrome",
"platform": "Linux",
"version": "latest"
},
{
"browserName": "firefox",
"platform": "Linux",
"version": "latest"
},
{
"platform": "Linux",
"browserName": "android",
"deviceName": "Android Emulator",
"version": "latest",
"deviceType": "phone"
}
]

View file

@ -0,0 +1,116 @@
/*!
* Script to run our Sauce Labs tests.
* Copyright 2017-2018 The Bootstrap Authors
* Copyright 2017-2018 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*
Docs: https://wiki.saucelabs.com/display/DOCS/Platform+Configurator
Mac Opera is not currently supported by Sauce Labs
Win Opera 15+ is not currently supported by Sauce Labs
iOS Chrome is not currently supported by Sauce Labs
*/
'use strict'
const path = require('path')
const JSUnitSaucelabs = require('jsunitsaucelabs')
const jsUnitSaucelabs = new JSUnitSaucelabs({
username: process.env.SAUCE_USERNAME,
password: process.env.SAUCE_ACCESS_KEY,
build: process.env.TRAVIS_JOB_ID
})
const testURL = 'http://localhost:3000/js/tests/index.html?hidepassed'
const browsersFile = require(path.resolve(__dirname, './sauce_browsers.json'))
const errorMessages = [
'Test exceeded maximum duration',
'Test exceeded maximum duration after 180 seconds'
]
let jobsDone = 0
let jobsSucceeded = 0
const waitingCallback = (error, body, id) => {
if (error) {
console.error(error)
process.exit(1)
}
if (typeof body !== 'undefined') {
if (!body.completed) {
setTimeout(() => {
jsUnitSaucelabs.getStatus(id, (error, body) => {
waitingCallback(error, body, id)
})
}, 2000)
} else {
const test = body['js tests'][0]
const platform = test.platform.join(', ')
let passed = false
let errorStr = false
if (test.result !== null) {
if (typeof test.result === 'string' && errorMessages.includes(test.result)) {
errorStr = test.result
} else {
passed = test.result.total === test.result.passed
}
}
console.log(`Tested ${testURL}`)
console.log(`Platform: ${platform}`)
console.log(`Passed: ${passed}`)
console.log(`URL: ${test.url}\n`)
if (errorStr) {
console.error(`${platform}: ${errorStr}`)
}
if (passed) {
jobsSucceeded++
}
jobsDone++
// Exit
if (jobsDone === browsersFile.length - 1) {
jsUnitSaucelabs.stop()
if (jobsDone > jobsSucceeded) {
const failedTests = jobsDone - jobsSucceeded
throw new Error(`${failedTests} test${failedTests > 1 ? 's' : ''} failed.`)
}
console.log('All tests passed')
process.exit(0)
}
}
}
}
jsUnitSaucelabs.on('tunnelCreated', () => {
browsersFile.forEach((tmpBrowser) => {
const browsersPlatform = typeof tmpBrowser.platform === 'undefined' ? tmpBrowser.platformName : tmpBrowser.platform
const browsersArray = [browsersPlatform, tmpBrowser.browserName, tmpBrowser.version]
jsUnitSaucelabs.start([browsersArray], testURL, 'qunit', (error, success) => {
if (typeof success !== 'undefined') {
const taskIds = success['js tests']
if (!taskIds || taskIds.length === 0) {
throw new Error('Error starting tests through Sauce Labs API')
}
taskIds.forEach((id) => {
jsUnitSaucelabs.getStatus(id, (error, body) => {
waitingCallback(error, body, id)
})
})
} else {
console.error(error)
}
})
})
})
jsUnitSaucelabs.initTunnel()

70
vendor/twbs/bootstrap/build/ship.sh vendored Normal file
View file

@ -0,0 +1,70 @@
#!/usr/bin/env bash
#
# Usage
# ---------------
# 1. Clone second version of Bootstrap in sibling directory named `bs-docs`.
# 2. Within `bs-docs` copy, switch to `gh-pages` branch.
# 3. Pull latest, re-bundle, re-npm.
# 4. Run script.
red=$'\e[1;31m'
green=$'\e[1;32m'
#blue=$'\e[1;34m'
magenta=$'\e[1;35m'
#cyan=$'\e[1;36m'
end=$'\e[0m'
# Get current version from package.json
current_version=$(node -p "require('./package.json').version")
if [[ $# -lt 1 ]]; then
printf "\n%s⚠ Shipping aborted. You must specify a version.\n%s" $red $end
exit 1
fi
# Pulling latest changes, just to be sure
printf "\n%s=======================================================%s" $magenta $end
printf "\n%sPulling latest changes...%s" $magenta $end
printf "\n%s=======================================================\n\n%s" $magenta $end
git pull origin v4-dev
# Update version number
printf "\n%s=======================================================%s" $magenta $end
printf "\n%sUpdating version number...%s" $magenta $end
printf "\n%s=======================================================\n%s" $magenta $end
npm run release-version "$current_version" "$1"
# Compile latest CSS and JS
printf "\n%s=======================================================%s" $magenta $end
printf "\n%sCompile latest CSS and JS...%s" $magenta $end
printf "\n%s=======================================================\n%s" $magenta $end
npm run dist
# Generate the SRI hashes
printf "\n%s=======================================================%s" $magenta $end
printf "\n%sGenerate the SRI hashes...%s" $magenta $end
printf "\n%s=======================================================\n%s" $magenta $end
npm run release-sri
# Compress the dist files
printf "\n%s=======================================================%s" $magenta $end
printf "\n%sCompressing the dist files...%s" $magenta $end
printf "\n%s=======================================================\n%s" $magenta $end
npm run release-zip
# Compile the docs
printf "\n%s=======================================================%s" $magenta $end
printf "\n%sCompile hosted documentation...%s" $magenta $end
printf "\n%s=======================================================\n%s" $magenta $end
npm run docs-github
# Copy the contents of the built docs site over to `bs-docs` repo
printf "\n%s=======================================================%s" $magenta $end
printf "\n%sCopy it over...%s" $magenta $end
printf "\n%s=======================================================\n%s" $magenta $end
cp -rf _gh_pages/. ../bs-docs/
printf "\nDone!\n"
printf "\n%s=======================================================%s" $green $end
printf "\n%sSuccess, $1 is ready to review and publish.%s" $green $end
printf "\n%s=======================================================\n\n%s" $green $end

68
vendor/twbs/bootstrap/build/vnu-jar.js vendored Normal file
View file

@ -0,0 +1,68 @@
#!/usr/bin/env node
/*!
* Script to run vnu-jar if Java is available.
* Copyright 2017-2018 The Bootstrap Authors
* Copyright 2017-2018 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
'use strict'
const childProcess = require('child_process')
const vnu = require('vnu-jar')
childProcess.exec('java -version', (error, stdout, stderr) => {
if (error) {
console.error('Skipping vnu-jar test; Java is missing.')
return
}
const is32bitJava = !stderr.match(/64-Bit/)
// vnu-jar accepts multiple ignores joined with a `|`.
// Also note that the ignores are regular expressions.
const ignores = [
// "autocomplete" is included in <button> and checkboxes and radio <input>s due to
// Firefox's non-standard autocomplete behavior - see https://bugzilla.mozilla.org/show_bug.cgi?id=654072
'Attribute “autocomplete” is only allowed when the input type is.*',
'Attribute “autocomplete” not allowed on element “button” at this point.',
// We use holder.js with `data-src` and no `src` to avoid 404 errors;
// we could work around this, but I'm not sure it's worth it.
'Element “img” is missing required attribute “src”.',
// Markup used in Components → Forms → Layout → Form grid → Horizontal form is currently invalid,
// but used this way due to lack of support for flexbox layout on <fieldset> element in most browsers
'Element “legend” not allowed as child of element “div” in this context.*',
// Content → Reboot uses various date/time inputs as a visual example.
// Documentation does not rely on them being usable.
'The “date” input type is not supported in all browsers.*',
'The “time” input type is not supported in all browsers.*',
// IE11 doesn't recognise <main> / give the element an implicit "main" landmark.
// Explicit role="main" is redundant for other modern browsers, but still valid.
'The “main” role is unnecessary for element “main”.',
// Ignore the wrong lanuage code warnings for now; they happen randomly.
'This document appears to be written in.*'
].join('|')
const args = [
'-jar',
vnu,
'--asciiquotes',
'--skip-non-html',
'--Werror',
`--filterpattern "${ignores}"`,
'_gh_pages/',
'js/tests/'
]
// For the 32-bit Java we need to pass `-Xss512k`
if (is32bitJava) {
args.splice(0, 0, '-Xss512k')
}
return childProcess.spawn('java', args, {
shell: true,
stdio: 'inherit'
})
.on('exit', process.exit)
})

View file

@ -0,0 +1,8 @@
{
"globDirectory": "./",
"globPatterns": [
"_gh_pages/**/*.{html,css,js,json,png,svg}"
],
"swSrc": "./site/sw.js",
"swDest": "./_gh_pages/sw.js"
}

58
vendor/twbs/bootstrap/build/workbox.js vendored Normal file
View file

@ -0,0 +1,58 @@
/*!
* Script to generate our docs service worker.
* Copyright 2017-2018 The Bootstrap Authors
* Copyright 2017-2018 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
'use strict'
const fs = require('fs')
const path = require('path')
const swBuild = require('workbox-build')
const config = require('./workbox.config.json')
const buildPrefix = '_gh_pages/'
const workboxSWSrcPath = require.resolve('workbox-sw')
const wbFileName = path.basename(workboxSWSrcPath)
const workboxSWDestPath = `${buildPrefix}docs/4.1/assets/js/vendor/${wbFileName}`
const workboxSWSrcMapPath = `${workboxSWSrcPath}.map`
const workboxSWDestMapPath = `${workboxSWDestPath}.map`
fs.createReadStream(workboxSWSrcPath).pipe(fs.createWriteStream(workboxSWDestPath))
fs.createReadStream(workboxSWSrcMapPath).pipe(fs.createWriteStream(workboxSWDestMapPath))
const updateUrl = (manifestEntries) => {
const manifest = manifestEntries.map((entry) => {
if (entry.url.startsWith(buildPrefix)) {
const regex = new RegExp(buildPrefix, 'g')
entry.url = entry.url.replace(regex, '')
}
return entry
})
return {
manifest,
warnings: []
}
}
config.manifestTransforms = [updateUrl]
swBuild.injectManifest(config).then(({
count,
size
}) => {
const wbSwRegex = /{fileName}/g
fs.readFile(config.swDest, 'utf8', (err, data) => {
if (err) {
throw err
}
const swFileContents = data.replace(wbSwRegex, wbFileName)
fs.writeFile(config.swDest, swFileContents, () => {
console.log(`Pre-cache Manifest generated. Pre-cached ${count} files, totalling ${size} bytes.`)
})
})
}).catch((error) => {
console.error(`Something went wrong: ${error}`)
})

Some files were not shown because too many files have changed in this diff Show more