This commit is contained in:
jeroenpraat 2016-12-19 16:52:17 +01:00
commit 468fb3c77a
24 changed files with 1543 additions and 1302 deletions

View File

@ -335,6 +335,8 @@ class ThreadItem {
'wall' => t('Wall-to-Wall'), 'wall' => t('Wall-to-Wall'),
'vwall' => t('via Wall-To-Wall:'), 'vwall' => t('via Wall-To-Wall:'),
'profile_url' => $profile_link, 'profile_url' => $profile_link,
'thread_action_menu' => thread_action_menu($item,$conv->get_mode()),
'thread_author_menu' => thread_author_menu($item,$conv->get_mode()),
'item_photo_menu' => item_photo_menu($item), 'item_photo_menu' => item_photo_menu($item),
'dreport' => $dreport, 'dreport' => $dreport,
'name' => $profile_name, 'name' => $profile_name,

View File

@ -10,21 +10,16 @@ class Sslify extends \Zotlabs\Web\Controller {
$h = explode("\n",$x['header']); $h = explode("\n",$x['header']);
foreach ($h as $l) { foreach ($h as $l) {
list($k,$v) = array_map("trim", explode(":", trim($l), 2)); list($k,$v) = array_map("trim", explode(":", trim($l), 2));
$hdrs[$k] = $v; $hdrs[strtolower($k)] = $v;
}
if (array_key_exists('content-type', $hdrs)) {
$type = $hdrs['content-type'];
header('Content-Type: ' . $type);
} }
if (array_key_exists('Content-Type', $hdrs))
$type = $hdrs['Content-Type'];
header('Content-Type: ' . $type);
echo $x['body']; echo $x['body'];
killme(); killme();
} }
killme(); killme();
// for some reason when this fallback is in place - it gets triggered
// often, (creating mixed content exceptions) even though there is
// nothing obvious missing on the page when we bypass it.
goaway($_REQUEST['url']);
} }
} }

View File

@ -93,277 +93,6 @@
</div> </div>
</div> </div>
</div> </div>
<script>
// Generated by CoffeeScript 1.10.0
/**
@license Sticky-kit v1.1.3 | MIT | Leaf Corcoran 2015 | http://leafo.net
*/
(function() {
var $, win;
$ = window.jQuery;
win = $(window);
$.fn.stick_in_parent = function(opts) {
var doc, elm, enable_bottoming, fn, i, inner_scrolling, len, manual_spacer, offset_top, outer_width, parent_selector, recalc_every, sticky_class;
if (opts == null) {
opts = {};
}
sticky_class = opts.sticky_class, inner_scrolling = opts.inner_scrolling, recalc_every = opts.recalc_every, parent_selector = opts.parent, offset_top = opts.offset_top, manual_spacer = opts.spacer, enable_bottoming = opts.bottoming;
if (offset_top == null) {
offset_top = 0;
}
if (parent_selector == null) {
parent_selector = void 0;
}
if (inner_scrolling == null) {
inner_scrolling = true;
}
if (sticky_class == null) {
sticky_class = "is_stuck";
}
doc = $(document);
if (enable_bottoming == null) {
enable_bottoming = true;
}
outer_width = function(el) {
var _el, computed, w;
if (window.getComputedStyle) {
_el = el[0];
computed = window.getComputedStyle(el[0]);
w = parseFloat(computed.getPropertyValue("width")) + parseFloat(computed.getPropertyValue("margin-left")) + parseFloat(computed.getPropertyValue("margin-right"));
if (computed.getPropertyValue("box-sizing") !== "border-box") {
w += parseFloat(computed.getPropertyValue("border-left-width")) + parseFloat(computed.getPropertyValue("border-right-width")) + parseFloat(computed.getPropertyValue("padding-left")) + parseFloat(computed.getPropertyValue("padding-right"));
}
return w;
} else {
return el.outerWidth(true);
}
};
fn = function(elm, padding_bottom, parent_top, parent_height, top, height, el_float, detached) {
var bottomed, detach, fixed, last_pos, last_scroll_height, offset, parent, recalc, recalc_and_tick, recalc_counter, spacer, tick;
if (elm.data("sticky_kit")) {
return;
}
elm.data("sticky_kit", true);
last_scroll_height = doc.height();
parent = elm.parent();
if (parent_selector != null) {
parent = parent.closest(parent_selector);
}
if (!parent.length) {
throw "failed to find stick parent";
}
fixed = false;
bottomed = false;
spacer = manual_spacer != null ? manual_spacer && elm.closest(manual_spacer) : $("<div />");
if (spacer) {
spacer.css('position', elm.css('position'));
}
recalc = function() {
var border_top, padding_top, restore;
if (detached) {
return;
}
last_scroll_height = doc.height();
border_top = parseInt(parent.css("border-top-width"), 10);
padding_top = parseInt(parent.css("padding-top"), 10);
padding_bottom = parseInt(parent.css("padding-bottom"), 10);
parent_top = parent.offset().top + border_top + padding_top;
parent_height = parent.height();
if (fixed) {
fixed = false;
bottomed = false;
if (manual_spacer == null) {
elm.insertAfter(spacer);
spacer.detach();
}
elm.css({
position: "",
top: "",
width: "",
bottom: ""
}).removeClass(sticky_class);
restore = true;
}
top = elm.offset().top - (parseInt(elm.css("margin-top"), 10) || 0) - offset_top;
height = elm.outerHeight(true);
el_float = elm.css("float");
if (spacer) {
spacer.css({
width: outer_width(elm),
height: height,
display: elm.css("display"),
"vertical-align": elm.css("vertical-align"),
"float": el_float
});
}
if (restore) {
return tick();
}
};
recalc();
if (height === parent_height) {
return;
}
last_pos = void 0;
offset = offset_top;
recalc_counter = recalc_every;
tick = function() {
var css, delta, recalced, scroll, will_bottom, win_height;
if (detached) {
return;
}
recalced = false;
if (recalc_counter != null) {
recalc_counter -= 1;
if (recalc_counter <= 0) {
recalc_counter = recalc_every;
recalc();
recalced = true;
}
}
if (!recalced && doc.height() !== last_scroll_height) {
recalc();
recalced = true;
}
scroll = win.scrollTop();
if (last_pos != null) {
delta = scroll - last_pos;
}
last_pos = scroll;
if (fixed) {
if (enable_bottoming) {
will_bottom = scroll + height + offset > parent_height + parent_top;
if (bottomed && !will_bottom) {
bottomed = false;
elm.css({
position: "fixed",
bottom: "",
top: offset
}).trigger("sticky_kit:unbottom");
}
}
if (scroll < top) {
fixed = false;
offset = offset_top;
if (manual_spacer == null) {
if (el_float === "left" || el_float === "right") {
elm.insertAfter(spacer);
}
spacer.detach();
}
css = {
position: "",
width: "",
top: ""
};
elm.css(css).removeClass(sticky_class).trigger("sticky_kit:unstick");
}
if (inner_scrolling) {
win_height = win.height();
if (height + offset_top > win_height) {
if (!bottomed) {
offset -= delta;
offset = Math.max(win_height - height, offset);
offset = Math.min(offset_top, offset);
if (fixed) {
elm.css({
top: offset + "px"
});
}
}
}
}
} else {
if (scroll > top) {
fixed = true;
css = {
position: "fixed",
top: offset
};
css.width = elm.css("box-sizing") === "border-box" ? elm.outerWidth() + "px" : elm.width() + "px";
elm.css(css).addClass(sticky_class);
if (manual_spacer == null) {
elm.after(spacer);
if (el_float === "left" || el_float === "right") {
spacer.append(elm);
}
}
elm.trigger("sticky_kit:stick");
}
}
if (fixed && enable_bottoming) {
if (will_bottom == null) {
will_bottom = scroll + height + offset > parent_height + parent_top;
}
if (!bottomed && will_bottom) {
bottomed = true;
if (parent.css("position") === "static") {
parent.css({
position: "relative"
});
}
return elm.css({
position: "absolute",
bottom: padding_bottom,
top: "auto"
}).trigger("sticky_kit:bottom");
}
}
};
recalc_and_tick = function() {
recalc();
return tick();
};
detach = function() {
detached = true;
win.off("touchmove", tick);
win.off("scroll", tick);
win.off("resize", recalc_and_tick);
$(document.body).off("sticky_kit:recalc", recalc_and_tick);
elm.off("sticky_kit:detach", detach);
elm.removeData("sticky_kit");
elm.css({
position: "",
bottom: "",
top: "",
width: ""
});
parent.position("position", "");
if (fixed) {
if (manual_spacer == null) {
if (el_float === "left" || el_float === "right") {
elm.insertAfter(spacer);
}
spacer.remove();
}
return elm.removeClass(sticky_class);
}
};
win.on("touchmove", tick);
win.on("scroll", tick);
win.on("resize", recalc_and_tick);
$(document.body).on("sticky_kit:recalc", recalc_and_tick);
elm.on("sticky_kit:detach", detach);
return setTimeout(tick, 0);
};
for (i = 0, len = this.length; i < len; i++) {
elm = this[i];
fn($(elm));
}
return this;
};
}).call(this);
</script>
<script> <script>
// Generate the table of contents in the side nav menu (see view/tpl/help.tpl) // Generate the table of contents in the side nav menu (see view/tpl/help.tpl)
@ -386,9 +115,8 @@
} }
}); });
$(".widget").stick_in_parent({ $(document.body).trigger("sticky_kit:recalc");
offset_top: $('nav').outerHeight(true)
});
}); });
</script> </script>

View File

@ -1067,15 +1067,15 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $cache = false)
$Text = preg_replace("/\[zaudio\](.*?)\[\/zaudio\]/", '<a class="zid" href="$1" target="_blank" >$1</a>', $Text); $Text = preg_replace("/\[zaudio\](.*?)\[\/zaudio\]/", '<a class="zid" href="$1" target="_blank" >$1</a>', $Text);
} }
if ($tryoembed){ // if ($tryoembed){
if (strpos($Text,'[/iframe]') !== false) { // if (strpos($Text,'[/iframe]') !== false) {
$Text = preg_replace_callback("/\[iframe\](.*?)\[\/iframe\]/ism", 'bb_iframe', $Text); // $Text = preg_replace_callback("/\[iframe\](.*?)\[\/iframe\]/ism", 'bb_iframe', $Text);
} // }
} else { // } else {
if (strpos($Text,'[/iframe]') !== false) { // if (strpos($Text,'[/iframe]') !== false) {
$Text = preg_replace("/\[iframe\](.*?)\[\/iframe\]/ism", '<a href="$1" target="_blank" >$1</a>', $Text); // $Text = preg_replace("/\[iframe\](.*?)\[\/iframe\]/ism", '<a href="$1" target="_blank" >$1</a>', $Text);
} // }
} // }
// oembed tag // oembed tag
$Text = oembed_bbcode2html($Text); $Text = oembed_bbcode2html($Text);

View File

@ -689,7 +689,8 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $
'id' => (($preview) ? 'P0' : $item['item_id']), 'id' => (($preview) ? 'P0' : $item['item_id']),
'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, $profile_url), 'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, $profile_url),
'profile_url' => $profile_link, 'profile_url' => $profile_link,
'item_photo_menu' => item_photo_menu($item), 'thread_action_menu' => thread_action_menu($item,$mode),
'thread_author_menu' => thread_author_menu($item,$mode),
'name' => $profile_name, 'name' => $profile_name,
'sparkle' => $sparkle, 'sparkle' => $sparkle,
'lock' => $lock, 'lock' => $lock,
@ -960,6 +961,169 @@ function item_photo_menu($item){
return $o; return $o;
} }
function thread_action_menu($item,$mode = '') {
$menu = [];
if((local_channel()) && local_channel() == $item['uid']) {
$menu[] = [
'menu' => 'view_source',
'title' => t('View Source'),
'icon' => 'eye',
'action' => 'viewsrc(' . $item['id'] . '); return false;',
'href' => '#'
];
if(! in_array($mode, [ 'network-new', 'search', 'community'])) {
if($item['parent'] == $item['id'] && (get_observer_hash() != $item['author_xchan'])) {
$menu[] = [
'menu' => 'follow_thread',
'title' => t('Follow Thread'),
'icon' => 'plus',
'action' => 'dosubthread(' . $item['id'] . '); return false;',
'href' => '#'
];
}
$menu[] = [
'menu' => 'unfollow_thread',
'title' => t('Unfollow Thread'),
'icon' => 'minus',
'action' => 'dounsubthread(' . $item['id'] . '); return false;',
'href' => '#'
];
}
}
$args = [ 'item' => $item, 'mode' => $mode, 'menu' => $menu ];
call_hooks('thread_action_menu', $args);
return $args['menu'];
}
function thread_author_menu($item, $mode = '') {
$menu = [];
$local_channel = local_channel();
if($local_channel) {
if(! count(App::$contacts))
load_contact_links($local_channel);
$channel = App::get_channel();
$channel_hash = (($channel) ? $channel['channel_hash'] : '');
}
$profile_link = chanlink_hash($item['author_xchan']);
if($item['uid'] > 0)
$pm_url = z_root() . '/mail/new/?f=&hash=' . $item['author_xchan'];
if(App::$contacts && array_key_exists($item['author_xchan'],App::$contacts))
$contact = App::$contacts[$item['author_xchan']];
else
if($local_channel && $item['author']['xchan_addr'])
$follow_url = z_root() . '/follow/?f=&url=' . $item['author']['xchan_addr'];
if($contact) {
$poke_link = z_root() . '/poke/?f=&c=' . $contact['abook_id'];
if (! intval($contact['abook_self']))
$contact_url = z_root() . '/connedit/' . $contact['abook_id'];
$posts_link = z_root() . '/network/?cid=' . $contact['abook_id'];
$clean_url = normalise_link($item['author-link']);
}
$rating_enabled = get_config('system','rating_enabled');
$ratings_url = (($rating_enabled) ? z_root() . '/ratings/' . urlencode($item['author_xchan']) : '');
if($profile_link) {
$menu[] = [
'menu' => 'view_profile',
'title' => t('View Profile'),
'icon' => 'fw',
'action' => '',
'href' => $profile_link
];
}
if($posts_link) {
$menu[] = [
'menu' => 'view_posts',
'title' => t('Activity/Posts'),
'icon' => 'fw',
'action' => '',
'href' => $posts_link
];
}
if($follow_url) {
$menu[] = [
'menu' => 'follow',
'title' => t('Connect'),
'icon' => 'fw',
'action' => '',
'href' => $follow_url
];
}
if($contact_url) {
$menu[] = [
'menu' => 'connedit',
'title' => t('Edit Connection'),
'icon' => 'fw',
'action' => '',
'href' => $contact_url
];
}
if($pm_url) {
$menu[] = [
'menu' => 'prv_message',
'title' => t('Message'),
'icon' => 'fw',
'action' => '',
'href' => $pm_url
];
}
if($ratings_url) {
$menu[] = [
'menu' => 'ratings',
'title' => t('Ratings'),
'icon' => 'fw',
'action' => '',
'href' => $ratings_url
];
}
if($poke_link) {
$menu[] = [
'menu' => 'poke',
'title' => t('Poke'),
'icon' => 'fw',
'action' => '',
'href' => $poke_link
];
}
$args = [ 'item' => $item, 'mode' => $mode, 'menu' => $menu ];
call_hooks('thread_author_menu', $args);
return $args['menu'];
}
/** /**
* @brief Checks item to see if it is one of the builtin activities (like/dislike, event attendance, consensus items, etc.) * @brief Checks item to see if it is one of the builtin activities (like/dislike, event attendance, consensus items, etc.)
* *

View File

@ -337,7 +337,7 @@ function db_concat($fld, $sep) {
function q($sql) { function q($sql) {
$args = func_get_args(); $args = func_get_args();
unset($args[0]); array_shift($args);
if(\DBA::$dba && \DBA::$dba->connected) { if(\DBA::$dba && \DBA::$dba->connected) {
$stmt = vsprintf($sql, $args); $stmt = vsprintf($sql, $args);

View File

@ -113,7 +113,7 @@ function html2plain($html, $wraplength = 75, $compact = false)
$xpath = new DomXPath($doc); $xpath = new DomXPath($doc);
$list = $xpath->query("//pre"); $list = $xpath->query("//pre");
foreach ($list as $node) { foreach ($list as $node) {
$node->nodeValue = str_replace("\n", "\r", $node->nodeValue); $node->nodeValue = str_replace("\n", "\r", htmlspecialchars($node->nodeValue));
} }
$message = $doc->saveHTML(); $message = $doc->saveHTML();

View File

@ -59,7 +59,7 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) {
if(x($opts,'filep')) { if(x($opts,'filep')) {
@curl_setopt($ch, CURLOPT_FILE, $opts['filep']); @curl_setopt($ch, CURLOPT_FILE, $opts['filep']);
@curl_setopt($ch, CURLOPT_HEADER, $false); @curl_setopt($ch, CURLOPT_HEADER, false);
} }
if(x($opts,'upload')) if(x($opts,'upload'))
@ -87,7 +87,7 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) {
@curl_setopt($ch, CURLOPT_TIMEOUT, $opts['timeout']); @curl_setopt($ch, CURLOPT_TIMEOUT, $opts['timeout']);
} }
else { else {
$curl_time = intval(get_config('system','curl_timeout')); $curl_time = intval(@get_config('system','curl_timeout'));
@curl_setopt($ch, CURLOPT_TIMEOUT, (($curl_time !== false) ? $curl_time : 60)); @curl_setopt($ch, CURLOPT_TIMEOUT, (($curl_time !== false) ? $curl_time : 60));
} }
@ -107,7 +107,7 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) {
@curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, @curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,
((x($opts,'novalidate') && intval($opts['novalidate'])) ? false : true)); ((x($opts,'novalidate') && intval($opts['novalidate'])) ? false : true));
$prx = get_config('system','proxy'); $prx = @get_config('system','proxy');
if(strlen($prx)) { if(strlen($prx)) {
@curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1); @curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
@curl_setopt($ch, CURLOPT_PROXY, $prx); @curl_setopt($ch, CURLOPT_PROXY, $prx);
@ -226,7 +226,7 @@ function z_post_url($url,$params, $redirects = 0, $opts = array()) {
if(x($opts,'filep')) { if(x($opts,'filep')) {
@curl_setopt($ch, CURLOPT_FILE, $opts['filep']); @curl_setopt($ch, CURLOPT_FILE, $opts['filep']);
@curl_setopt($ch, CURLOPT_HEADER, $false); @curl_setopt($ch, CURLOPT_HEADER, false);
} }
if(x($opts,'headers')) { if(x($opts,'headers')) {
@ -246,7 +246,7 @@ function z_post_url($url,$params, $redirects = 0, $opts = array()) {
@curl_setopt($ch, CURLOPT_TIMEOUT, $opts['timeout']); @curl_setopt($ch, CURLOPT_TIMEOUT, $opts['timeout']);
} }
else { else {
$curl_time = intval(get_config('system','curl_timeout')); $curl_time = intval(@get_config('system','curl_timeout'));
@curl_setopt($ch, CURLOPT_TIMEOUT, (($curl_time !== false) ? $curl_time : 60)); @curl_setopt($ch, CURLOPT_TIMEOUT, (($curl_time !== false) ? $curl_time : 60));
} }

View File

@ -0,0 +1,265 @@
// Generated by CoffeeScript 1.10.0
/**
@license Sticky-kit v1.1.3 | MIT | Leaf Corcoran 2015 | http://leafo.net
*/
(function() {
var $, win;
$ = window.jQuery;
win = $(window);
$.fn.stick_in_parent = function(opts) {
var doc, elm, enable_bottoming, fn, i, inner_scrolling, len, manual_spacer, offset_top, outer_width, parent_selector, recalc_every, sticky_class;
if (opts == null) {
opts = {};
}
sticky_class = opts.sticky_class, inner_scrolling = opts.inner_scrolling, recalc_every = opts.recalc_every, parent_selector = opts.parent, offset_top = opts.offset_top, manual_spacer = opts.spacer, enable_bottoming = opts.bottoming;
if (offset_top == null) {
offset_top = 0;
}
if (parent_selector == null) {
parent_selector = void 0;
}
if (inner_scrolling == null) {
inner_scrolling = true;
}
if (sticky_class == null) {
sticky_class = "is_stuck";
}
doc = $(document);
if (enable_bottoming == null) {
enable_bottoming = true;
}
outer_width = function(el) {
var _el, computed, w;
if (window.getComputedStyle) {
_el = el[0];
computed = window.getComputedStyle(el[0]);
w = parseFloat(computed.getPropertyValue("width")) + parseFloat(computed.getPropertyValue("margin-left")) + parseFloat(computed.getPropertyValue("margin-right"));
if (computed.getPropertyValue("box-sizing") !== "border-box") {
w += parseFloat(computed.getPropertyValue("border-left-width")) + parseFloat(computed.getPropertyValue("border-right-width")) + parseFloat(computed.getPropertyValue("padding-left")) + parseFloat(computed.getPropertyValue("padding-right"));
}
return w;
} else {
return el.outerWidth(true);
}
};
fn = function(elm, padding_bottom, parent_top, parent_height, top, height, el_float, detached) {
var bottomed, detach, fixed, last_pos, last_scroll_height, offset, parent, recalc, recalc_and_tick, recalc_counter, spacer, tick;
if (elm.data("sticky_kit")) {
return;
}
elm.data("sticky_kit", true);
last_scroll_height = doc.height();
parent = elm.parent();
if (parent_selector != null) {
parent = parent.closest(parent_selector);
}
if (!parent.length) {
throw "failed to find stick parent";
}
fixed = false;
bottomed = false;
spacer = manual_spacer != null ? manual_spacer && elm.closest(manual_spacer) : $("<div />");
if (spacer) {
spacer.css('position', elm.css('position'));
}
recalc = function() {
var border_top, padding_top, restore;
if (detached) {
return;
}
last_scroll_height = doc.height();
border_top = parseInt(parent.css("border-top-width"), 10);
padding_top = parseInt(parent.css("padding-top"), 10);
padding_bottom = parseInt(parent.css("padding-bottom"), 10);
parent_top = parent.offset().top + border_top + padding_top;
parent_height = parent.height();
if (fixed) {
fixed = false;
bottomed = false;
if (manual_spacer == null) {
elm.insertAfter(spacer);
spacer.detach();
}
elm.css({
position: "",
top: "",
width: "",
bottom: ""
}).removeClass(sticky_class);
restore = true;
}
top = elm.offset().top - (parseInt(elm.css("margin-top"), 10) || 0) - offset_top;
height = elm.outerHeight(true);
el_float = elm.css("float");
if (spacer) {
spacer.css({
width: outer_width(elm),
height: height,
display: elm.css("display"),
"vertical-align": elm.css("vertical-align"),
"float": el_float
});
}
if (restore) {
return tick();
}
};
recalc();
if (height === parent_height) {
return;
}
last_pos = void 0;
offset = offset_top;
recalc_counter = recalc_every;
tick = function() {
var css, delta, recalced, scroll, will_bottom, win_height;
if (detached) {
return;
}
recalced = false;
if (recalc_counter != null) {
recalc_counter -= 1;
if (recalc_counter <= 0) {
recalc_counter = recalc_every;
recalc();
recalced = true;
}
}
if (!recalced && doc.height() !== last_scroll_height) {
recalc();
recalced = true;
}
scroll = win.scrollTop();
if (last_pos != null) {
delta = scroll - last_pos;
}
last_pos = scroll;
if (fixed) {
if (enable_bottoming) {
will_bottom = scroll + height + offset > parent_height + parent_top;
if (bottomed && !will_bottom) {
bottomed = false;
elm.css({
position: "fixed",
bottom: "",
top: offset
}).trigger("sticky_kit:unbottom");
}
}
if (scroll < top) {
fixed = false;
offset = offset_top;
if (manual_spacer == null) {
if (el_float === "left" || el_float === "right") {
elm.insertAfter(spacer);
}
spacer.detach();
}
css = {
position: "",
width: "",
top: ""
};
elm.css(css).removeClass(sticky_class).trigger("sticky_kit:unstick");
}
if (inner_scrolling) {
win_height = win.height();
if (height + offset_top > win_height) {
if (!bottomed) {
offset -= delta;
offset = Math.max(win_height - height, offset);
offset = Math.min(offset_top, offset);
if (fixed) {
elm.css({
top: offset + "px"
});
}
}
}
}
} else {
if (scroll > top) {
fixed = true;
css = {
position: "fixed",
top: offset
};
css.width = elm.css("box-sizing") === "border-box" ? elm.outerWidth() + "px" : elm.width() + "px";
elm.css(css).addClass(sticky_class);
if (manual_spacer == null) {
elm.after(spacer);
if (el_float === "left" || el_float === "right") {
spacer.append(elm);
}
}
elm.trigger("sticky_kit:stick");
}
}
if (fixed && enable_bottoming) {
if (will_bottom == null) {
will_bottom = scroll + height + offset > parent_height + parent_top;
}
if (!bottomed && will_bottom) {
bottomed = true;
if (parent.css("position") === "static") {
parent.css({
position: "relative"
});
}
return elm.css({
position: "absolute",
bottom: padding_bottom,
top: "auto"
}).trigger("sticky_kit:bottom");
}
}
};
recalc_and_tick = function() {
recalc();
return tick();
};
detach = function() {
detached = true;
win.off("touchmove", tick);
win.off("scroll", tick);
win.off("resize", recalc_and_tick);
$(document.body).off("sticky_kit:recalc", recalc_and_tick);
elm.off("sticky_kit:detach", detach);
elm.removeData("sticky_kit");
elm.css({
position: "",
bottom: "",
top: "",
width: ""
});
parent.position("position", "");
if (fixed) {
if (manual_spacer == null) {
if (el_float === "left" || el_float === "right") {
elm.insertAfter(spacer);
}
spacer.remove();
}
return elm.removeClass(sticky_class);
}
};
win.on("touchmove", tick);
win.on("scroll", tick);
win.on("resize", recalc_and_tick);
$(document.body).on("sticky_kit:recalc", recalc_and_tick);
elm.on("sticky_kit:detach", detach);
return setTimeout(tick, 0);
};
for (i = 0, len = this.length; i < len; i++) {
elm = this[i];
fn($(elm));
}
return this;
};
}).call(this);

10
library/sticky-kit/sticky-kit.min.js vendored Normal file
View File

@ -0,0 +1,10 @@
/*
Sticky-kit v1.1.3 | MIT | Leaf Corcoran 2015 | http://leafo.net
*/
(function(){var c,f;c=window.jQuery;f=c(window);c.fn.stick_in_parent=function(b){var A,w,J,n,B,K,p,q,L,k,E,t;null==b&&(b={});t=b.sticky_class;B=b.inner_scrolling;E=b.recalc_every;k=b.parent;q=b.offset_top;p=b.spacer;w=b.bottoming;null==q&&(q=0);null==k&&(k=void 0);null==B&&(B=!0);null==t&&(t="is_stuck");A=c(document);null==w&&(w=!0);L=function(a){var b;return window.getComputedStyle?(a=window.getComputedStyle(a[0]),b=parseFloat(a.getPropertyValue("width"))+parseFloat(a.getPropertyValue("margin-left"))+
parseFloat(a.getPropertyValue("margin-right")),"border-box"!==a.getPropertyValue("box-sizing")&&(b+=parseFloat(a.getPropertyValue("border-left-width"))+parseFloat(a.getPropertyValue("border-right-width"))+parseFloat(a.getPropertyValue("padding-left"))+parseFloat(a.getPropertyValue("padding-right"))),b):a.outerWidth(!0)};J=function(a,b,n,C,F,u,r,G){var v,H,m,D,I,d,g,x,y,z,h,l;if(!a.data("sticky_kit")){a.data("sticky_kit",!0);I=A.height();g=a.parent();null!=k&&(g=g.closest(k));if(!g.length)throw"failed to find stick parent";
v=m=!1;(h=null!=p?p&&a.closest(p):c("<div />"))&&h.css("position",a.css("position"));x=function(){var d,f,e;if(!G&&(I=A.height(),d=parseInt(g.css("border-top-width"),10),f=parseInt(g.css("padding-top"),10),b=parseInt(g.css("padding-bottom"),10),n=g.offset().top+d+f,C=g.height(),m&&(v=m=!1,null==p&&(a.insertAfter(h),h.detach()),a.css({position:"",top:"",width:"",bottom:""}).removeClass(t),e=!0),F=a.offset().top-(parseInt(a.css("margin-top"),10)||0)-q,u=a.outerHeight(!0),r=a.css("float"),h&&h.css({width:L(a),
height:u,display:a.css("display"),"vertical-align":a.css("vertical-align"),"float":r}),e))return l()};x();if(u!==C)return D=void 0,d=q,z=E,l=function(){var c,l,e,k;if(!G&&(e=!1,null!=z&&(--z,0>=z&&(z=E,x(),e=!0)),e||A.height()===I||x(),e=f.scrollTop(),null!=D&&(l=e-D),D=e,m?(w&&(k=e+u+d>C+n,v&&!k&&(v=!1,a.css({position:"fixed",bottom:"",top:d}).trigger("sticky_kit:unbottom"))),e<F&&(m=!1,d=q,null==p&&("left"!==r&&"right"!==r||a.insertAfter(h),h.detach()),c={position:"",width:"",top:""},a.css(c).removeClass(t).trigger("sticky_kit:unstick")),
B&&(c=f.height(),u+q>c&&!v&&(d-=l,d=Math.max(c-u,d),d=Math.min(q,d),m&&a.css({top:d+"px"})))):e>F&&(m=!0,c={position:"fixed",top:d},c.width="border-box"===a.css("box-sizing")?a.outerWidth()+"px":a.width()+"px",a.css(c).addClass(t),null==p&&(a.after(h),"left"!==r&&"right"!==r||h.append(a)),a.trigger("sticky_kit:stick")),m&&w&&(null==k&&(k=e+u+d>C+n),!v&&k)))return v=!0,"static"===g.css("position")&&g.css({position:"relative"}),a.css({position:"absolute",bottom:b,top:"auto"}).trigger("sticky_kit:bottom")},
y=function(){x();return l()},H=function(){G=!0;f.off("touchmove",l);f.off("scroll",l);f.off("resize",y);c(document.body).off("sticky_kit:recalc",y);a.off("sticky_kit:detach",H);a.removeData("sticky_kit");a.css({position:"",bottom:"",top:"",width:""});g.position("position","");if(m)return null==p&&("left"!==r&&"right"!==r||a.insertAfter(h),h.remove()),a.removeClass(t)},f.on("touchmove",l),f.on("scroll",l),f.on("resize",y),c(document.body).on("sticky_kit:recalc",y),a.on("sticky_kit:detach",H),setTimeout(l,
0)}};n=0;for(K=this.length;n<K;n++)b=this[n],J(c(b));return this}}).call(this);

File diff suppressed because it is too large Load Diff

View File

@ -65,7 +65,7 @@ li:hover .widget-nav-pills-icons {
padding: 5px; padding: 5px;
width: 100%; width: 100%;
resize: vertical; resize: vertical;
height: 250px; min-height: 250px;
} }
/* saved searches */ /* saved searches */

View File

@ -276,6 +276,7 @@ ACL.prototype.update_view = function(value) {
/* jot acl */ /* jot acl */
$('#jot-perms-icon, #dialog-perms-icon, #' + that.form_id[0].id + ' .jot-perms-icon').removeClass('fa-lock').addClass('fa-unlock'); $('#jot-perms-icon, #dialog-perms-icon, #' + that.form_id[0].id + ' .jot-perms-icon').removeClass('fa-lock').addClass('fa-unlock');
$('#jot-perms-icon').removeClass('jot-lock-warn');
$('#dbtn-jotnets').show(); $('#dbtn-jotnets').show();
$('.profile-jot-net input').attr('disabled', false); $('.profile-jot-net input').attr('disabled', false);

View File

@ -1164,7 +1164,6 @@ function preview_mail() {
return true; return true;
} }
function unpause() { function unpause() {
// unpause auto reloads if they are currently stopped // unpause auto reloads if they are currently stopped
totStopped = false; totStopped = false;

View File

@ -10,7 +10,7 @@
<header><?php if(x($page,'header')) echo $page['header']; ?></header> <header><?php if(x($page,'header')) echo $page['header']; ?></header>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"><?php if(x($page,'nav')) echo $page['nav']; ?></nav> <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"><?php if(x($page,'nav')) echo $page['nav']; ?></nav>
<main> <main>
<aside id="region_1"><?php if(x($page,'aside')) echo $page['aside']; ?></aside> <aside id="region_1"><div id="left_aside_wrapper"><?php if(x($page,'aside')) echo $page['aside']; ?></div></aside>
<section id="region_2"><?php if(x($page,'content')) echo $page['content']; ?> <section id="region_2"><?php if(x($page,'content')) echo $page['content']; ?>
<div id="page-footer"></div> <div id="page-footer"></div>
<div id="pause"></div> <div id="pause"></div>

View File

@ -26,6 +26,7 @@ head_add_js('library/jquery-textcomplete/jquery.textcomplete.js');
//head_add_js('library/colorbox/jquery.colorbox.js'); //head_add_js('library/colorbox/jquery.colorbox.js');
head_add_js('library/jquery.timeago.js'); head_add_js('library/jquery.timeago.js');
head_add_js('library/readmore.js/readmore.js'); head_add_js('library/readmore.js/readmore.js');
head_add_js('library/sticky-kit/sticky-kit.min.js');
//head_add_js('library/jquery_ac/friendica.complete.js'); //head_add_js('library/jquery_ac/friendica.complete.js');
//head_add_js('library/tiptip/jquery.tipTip.minified.js'); //head_add_js('library/tiptip/jquery.tipTip.minified.js');
head_add_js('library/jgrowl/jquery.jgrowl_minimized.js'); head_add_js('library/jgrowl/jquery.jgrowl_minimized.js');

View File

@ -22,6 +22,8 @@ body {
color: $font_colour; color: $font_colour;
margin: 0px; margin: 0px;
height: 100%; height: 100%;
overflow-x: hidden;
} }
aside { aside {
@ -30,6 +32,10 @@ aside {
max-width: $aside_widthpx; max-width: $aside_widthpx;
} }
aside#region_1 {
border-right: 1px solid transparent;
}
main { main {
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
@ -473,7 +479,6 @@ footer {
#contact-block { #contact-block {
width: 100%; width: 100%;
float: left;
} }
#contact-block-numcontacts { #contact-block-numcontacts {
@ -482,12 +487,10 @@ footer {
} }
.contact-block-div { .contact-block-div {
float: left; display: inline;
width: 50px;
height: 50px;
} }
.contact-block-textdiv { .contact-block-textdiv {
float: left;
width: 150px; width: 150px;
height: 34px; height: 34px;
} }
@ -495,12 +498,11 @@ footer {
#contact-block-end { #contact-block-end {
clear: both; clear: both;
} }
.contact-block-link {
float: left;
}
.contact-block-img { .contact-block-img {
width:48px; width:47px;
height:48px; height:47px;
margin-bottom: 3px;
} }
#tag-remove { #tag-remove {
@ -1267,6 +1269,11 @@ img.mail-conv-sender-photo {
color: $toolicon_colour; color: $toolicon_colour;
} }
.jot-icons.jot-lock-warn {
color: darkorange;
}
/* conversation */ /* conversation */
.nsfw-wrap { .nsfw-wrap {
text-align: center; text-align: center;
@ -1837,10 +1844,6 @@ nav .badge.mail-update:hover {
border-right: 1px solid $nav_bd; border-right: 1px solid $nav_bd;
} }
main {
transition: all 0.25s ease-in-out;
}
main { main {
left: -$aside_widthpx; left: -$aside_widthpx;
width: calc( 100% + $aside_widthpx ); width: calc( 100% + $aside_widthpx );

View File

@ -8,17 +8,32 @@ $(document).ready(function() {
if( $('#css3-calc').width() == 10) { if( $('#css3-calc').width() == 10) {
$(window).resize(function() { $(window).resize(function() {
if($(window).width() < 767) { if($(window).width() < 767) {
$('main').css('width', $(window).width() + 287 ); $('main').css('width', $(window).width() + $('aside').outerWidth() );
} else { } else {
$('main').css('width', '100%' ); $('main').css('width', '100%' );
} }
}); });
} }
$('#css3-calc').remove(); // Remove the test element $('#css3-calc').remove(); // Remove the test element
$('#expand-aside').click(function() { $('#left_aside_wrapper').stick_in_parent({
$('#expand-aside-icon').toggleClass('fa-arrow-circle-right').toggleClass('fa-arrow-circle-left'); offset_top: $('nav').outerHeight(true)
$('main').toggleClass('region_1-on'); });
$('#expand-aside').on('click', toggleAside);
$('section').on('click', function() {
if($('main').hasClass('region_1-on')){
toggleAside();
}
});
$(window).on('scroll', function() {
if($('main').hasClass('region_1-on') && $(window).scrollLeft() > 5){
$(window).scrollLeft(0);
toggleAside();
}
}); });
if($('aside').length && $('aside').html().length === 0) { if($('aside').length && $('aside').html().length === 0) {
@ -72,5 +87,12 @@ function makeFullScreen(full) {
$('#tabs-collapse-1').css({'visibility': ''}); $('#tabs-collapse-1').css({'visibility': ''});
$('#inline-btn').hide(); $('#inline-btn').hide();
$('main').css({'transition': ''}); $('main').css({'transition': ''});
$(document.body).trigger("sticky_kit:recalc");
} }
} }
function toggleAside() {
$(window).scroll();
$('#expand-aside-icon').toggleClass('fa-arrow-circle-right').toggleClass('fa-arrow-circle-left');
$('main').toggleClass('region_1-on');
}

View File

@ -165,7 +165,7 @@ if(file_exists('view/theme/redbasic/css/style.css')) {
$x .= $schemecss; $x .= $schemecss;
} }
$aside_width = 287; $aside_width = 288;
// left aside and right aside are 285px + converse width // left aside and right aside are 285px + converse width
if($align_left) { if($align_left) {

View File

@ -166,18 +166,27 @@
{{if $item.star}} {{if $item.star}}
<li role="presentation"><a role="menuitem" href="#" onclick="dostar({{$item.id}}); return false;"><i id="starred-{{$item.id}}" class="fa fa-star {{$item.star.isstarred}}" title="{{$item.star.toggle}}"></i> {{$item.star.toggle}}</a></li> <li role="presentation"><a role="menuitem" href="#" onclick="dostar({{$item.id}}); return false;"><i id="starred-{{$item.id}}" class="fa fa-star {{$item.star.isstarred}}" title="{{$item.star.toggle}}"></i> {{$item.star.toggle}}</a></li>
{{/if}} {{/if}}
{{if $item.thread_action_menu}}
{{foreach $item.thread_action_menu as $mitem}}
<li role="presentation"><a role="menuitem" {{if $mitem.href}}href="{{$mitem.href}}"{{/if}} {{if $mitem.action}}onclick="{{$mitem.action}}"{{/if}} {{if $mitem.title}}title="{{$mitem.title}}"{{/if}} ><i class="fa fa-{{$mitem.icon}}"></i> {{$mitem.title}}</a></li>
{{/foreach}}
{{/if}}
{{if $item.drop.dropping}} {{if $item.drop.dropping}}
<li role="presentation"><a role="menuitem" href="#" onclick="dropItem('item/drop/{{$item.id}}', '#thread-wrapper-{{$item.id}}'); return false;" title="{{$item.drop.delete}}" ><i class="fa fa-trash-o"></i> {{$item.drop.delete}}</a></li> <li role="presentation"><a role="menuitem" href="#" onclick="dropItem('item/drop/{{$item.id}}', '#thread-wrapper-{{$item.id}}'); return false;" title="{{$item.drop.delete}}" ><i class="fa fa-trash-o"></i> {{$item.drop.delete}}</a></li>
{{/if}} {{/if}}
{{if $item.item_photo_menu}}
{{if $item.thread_author_menu}}
<li role="presentation" class="divider"></li> <li role="presentation" class="divider"></li>
{{$item.item_photo_menu}} {{foreach $item.thread_author_menu as $mitem}}
<li role="presentation"><a role="menuitem" {{if $mitem.href}}href="{{$mitem.href}}"{{/if}} {{if $mitem.action}}onclick="{{$mitem.action}}"{{/if}} {{if $mitem.title}}title="{{$mitem.title}}"{{/if}} >{{$mitem.title}}</a></li>
{{/foreach}}
{{/if}}
{{if $item.edpost && $item.dreport}} {{if $item.edpost && $item.dreport}}
<li role="presentation"><a role="menuitem" href="dreport/{{$item.mid}}">{{$item.dreport}}</a></li> <li role="presentation"><a role="menuitem" href="dreport/{{$item.mid}}">{{$item.dreport}}</a></li>
{{/if}} {{/if}}
{{/if}}
</ul> </ul>
</div> </div>
</div> </div>

View File

@ -180,7 +180,7 @@
{{/if}} {{/if}}
{{if $showacl}} {{if $showacl}}
<button id="dbtn-acl" class="btn btn-default btn-sm" data-toggle="modal" data-target="#aclModal" title="{{$permset}}" type="button" data-form_id="profile-jot-form"> <button id="dbtn-acl" class="btn btn-default btn-sm" data-toggle="modal" data-target="#aclModal" title="{{$permset}}" type="button" data-form_id="profile-jot-form">
<i id="jot-perms-icon" class="fa fa-{{$lockstate}} jot-icons"></i>{{if $bang}}&nbsp;<i class="fa fa-exclamation jot-icons"></i>{{/if}} <i id="jot-perms-icon" class="fa fa-{{$lockstate}} jot-icons{{if $bang}} jot-lock-warn{{/if}}"></i>
</button> </button>
{{/if}} {{/if}}
<button id="dbtn-submit" class="btn btn-primary btn-sm" type="submit" tabindex="3" name="button-submit">{{$share}}</button> <button id="dbtn-submit" class="btn btn-primary btn-sm" type="submit" tabindex="3" name="button-submit">{{$share}}</button>

View File

@ -1 +1 @@
<div class="contact-block-div{{if $class}} {{$class}}{{/if}}"><a class="contact-block-link{{if $class}} {{$class}}{{/if}}{{if $click}} fakelink{{/if}}" href="{{if $click}}#{{else}}{{$url}}{{/if}}" {{if $click}}onclick="{{$click}}"{{/if}}><img class="contact-block-img{{if $class}} {{$class}}{{/if}}" src="{{$photo}}" title="{{$title}}" alt="{{$name}}" /></a></div> <div class="contact-block-div{{if $class}} {{$class}}{{/if}}"><a class="contact-block-link{{if $class}} {{$class}}{{/if}}{{if $click}} fakelink{{/if}}" href="{{if $click}}#{{else}}{{$url}}{{/if}}" {{if $click}}onclick="{{$click}}"{{/if}}><img class="contact-block-img{{if $class}} {{$class}}{{/if}}" src="{{$photo}}" title="{{$title}}" alt="" /></a></div>

View File

@ -1,27 +1,32 @@
<div class="widget"> <div class="widget">
<script> <h3>{{$banner}}</h3>
var noteSaveTimer = null; <textarea name="note_text" id="note-text">{{$text}}</textarea>
$(document).on('focusout',"#note-text",function(e){ <script>
if(noteSaveTimer) var noteSaveTimer = null;
clearTimeout(noteSaveTimer); var noteText = $('#note-text');
notePostFinal();
noteSaveTimer = null;
});
$(document).on('focusin',"#note-text",function(e){ $(document).ready(function(){
noteSaveTimer = setTimeout(noteSaveChanges,10000); noteText.height(noteText[0].scrollHeight);
}); });
function notePostFinal() { $(document).on('focusout',"#note-text",function(e){
$.post('notes/sync', { 'note_text' : $('#note-text').val() }); if(noteSaveTimer)
} clearTimeout(noteSaveTimer);
notePostFinal();
noteSaveTimer = null;
});
function noteSaveChanges() { $(document).on('focusin',"#note-text",function(e){
$.post('notes', { 'note_text' : $('#note-text').val() }); noteSaveTimer = setTimeout(noteSaveChanges,10000);
noteSaveTimer = setTimeout(noteSaveChanges,10000); });
}
</script>
<h3>{{$banner}}</h3> function notePostFinal() {
<textarea name="note_text" id="note-text">{{$text}}</textarea> $.post('notes/sync', { 'note_text' : $('#note-text').val() });
}
function noteSaveChanges() {
$.post('notes', { 'note_text' : $('#note-text').val() });
noteSaveTimer = setTimeout(noteSaveChanges,10000);
}
</script>
</div> </div>

View File

@ -74,13 +74,20 @@
<i class="fa fa-caret-down"></i> <i class="fa fa-caret-down"></i>
</button> </button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
{{if $item.item_photo_menu}} {{if $item.thread_action_menu}}
{{$item.item_photo_menu}} {{foreach $item.thread_action_menu as $mitem}}
<li role="presentation"><a role="menuitem" {{if $mitem.href}}href="{{$mitem.href}}"{{/if}} {{if $mitem.action}}onclick="{{$mitem.action}}"{{/if}} {{if $mitem.title}}title="{{$mitem.title}}"{{/if}} ><i class="fa fa-{{$mitem.icon}}"></i> {{$mitem.title}}</a></li>
{{/foreach}}
{{/if}} {{/if}}
{{if $item.drop.dropping}} {{if $item.drop.dropping}}
<li role="presentation" class="divider"></li>
<li><a href="item/drop/{{$item.id}}" onclick="return confirmDelete();" title="{{$item.drop.delete}}" ><i class="fa fa-trash-o"></i> {{$item.drop.delete}}</a></li> <li><a href="item/drop/{{$item.id}}" onclick="return confirmDelete();" title="{{$item.drop.delete}}" ><i class="fa fa-trash-o"></i> {{$item.drop.delete}}</a></li>
{{/if}} {{/if}}
{{if $item.thread_author_menu}}
<li role="presentation" class="divider"></li>
{{foreach $item.thread_author_menu as $mitem}}
<li role="presentation"><a role="menuitem" {{if $mitem.href}}href="{{$mitem.href}}"{{/if}} {{if $mitem.action}}onclick="{{$mitem.action}}"{{/if}} {{if $mitem.title}}title="{{$mitem.title}}"{{/if}} >{{$mitem.title}}</a></li>
{{/foreach}}
{{/if}}
</ul> </ul>
</div> </div>
{{if $item.attachments}} {{if $item.attachments}}