aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
Diffstat (limited to 'view')
-rw-r--r--view/css/conversation.css6
-rw-r--r--view/en/htconfig.tpl1
-rw-r--r--view/js/autocomplete.js127
-rw-r--r--view/js/main.js9
-rw-r--r--view/js/mod_chat.js3
-rw-r--r--view/js/mod_events.js3
-rw-r--r--view/js/mod_mail.js1
-rw-r--r--view/js/mod_photos.js2
-rw-r--r--view/js/mod_profiles.js1
-rwxr-xr-xview/tpl/head.tpl2
-rwxr-xr-xview/tpl/jot-header.tpl5
-rwxr-xr-xview/tpl/jot.tpl2
-rwxr-xr-xview/tpl/login.tpl2
-rwxr-xr-xview/tpl/nav.tpl50
-rw-r--r--view/tpl/pdledit.tpl3
15 files changed, 211 insertions, 6 deletions
diff --git a/view/css/conversation.css b/view/css/conversation.css
index 39c973c14..304e0f196 100644
--- a/view/css/conversation.css
+++ b/view/css/conversation.css
@@ -296,3 +296,9 @@ a.wall-item-name-link {
.event-label {
font-weight: bold;
}
+
+/* bb-code */
+
+.overline {
+ text-decoration: overline;
+}
diff --git a/view/en/htconfig.tpl b/view/en/htconfig.tpl
index 13c5aa942..4aa6132a6 100644
--- a/view/en/htconfig.tpl
+++ b/view/en/htconfig.tpl
@@ -43,6 +43,7 @@ App::$config['system']['location_hash'] = '{{$site_id}}';
App::$config['system']['transport_security_header'] = 1;
App::$config['system']['content_security_policy'] = 1;
+App::$config['system']['ssl_cookie_protection'] = 1;
// Your choices are REGISTER_OPEN, REGISTER_APPROVE, or REGISTER_CLOSED.
// Be certain to create your own personal account before setting
diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js
index 437425a0e..a4a1fdf51 100644
--- a/view/js/autocomplete.js
+++ b/view/js/autocomplete.js
@@ -100,6 +100,66 @@ function submit_form(e) {
$(e).parents('form').submit();
}
+function getWord(text, caretPos) {
+ var index = text.indexOf(caretPos);
+ var postText = text.substring(caretPos, caretPos+8);
+ if ((postText.indexOf("[/list]") > 0) || postText.indexOf("[/ul]") > 0 || postText.indexOf("[/ol]") > 0) {
+ return postText;
+ }
+}
+
+function getCaretPosition(ctrl) {
+ var CaretPos = 0; // IE Support
+ if (document.selection) {
+ ctrl.focus();
+ var Sel = document.selection.createRange();
+ Sel.moveStart('character', -ctrl.value.length);
+ CaretPos = Sel.text.length;
+ }
+ // Firefox support
+ else if (ctrl.selectionStart || ctrl.selectionStart == '0')
+ CaretPos = ctrl.selectionStart;
+ return (CaretPos);
+}
+
+function setCaretPosition(ctrl, pos){
+ if(ctrl.setSelectionRange) {
+ ctrl.focus();
+ ctrl.setSelectionRange(pos,pos);
+ }
+ else if (ctrl.createTextRange) {
+ var range = ctrl.createTextRange();
+ range.collapse(true);
+ range.moveEnd('character', pos);
+ range.moveStart('character', pos);
+ range.select();
+ }
+}
+
+function listNewLineAutocomplete(id) {
+ var text = document.getElementById(id);
+ var caretPos = getCaretPosition(text)
+ var word = getWord(text.value, caretPos);
+ if (word != null) {
+ var textBefore = text.value.substring(0, caretPos);
+ var textAfter = text.value.substring(caretPos, text.length);
+ $('#' + id).val(textBefore + '\r\n[*] ' + textAfter);
+ setCaretPosition(text, caretPos + 5);
+ return true;
+ }
+}
+
+function string2bb(element) {
+ if(element == 'bold') return 'b';
+ else if(element == 'italic') return 'i';
+ else if(element == 'underline') return 'u';
+ else if(element == 'overline') return 'o';
+ else if(element == 'strike') return 's';
+ else if(element == 'superscript') return 'sup';
+ else if(element == 'subscript') return 'sub';
+ else return element;
+}
+
/**
* jQuery plugin 'editor_autocomplete'
*/
@@ -197,3 +257,70 @@ function submit_form(e) {
a.on('textComplete:select', function(e, value, strategy) { onselect(value); });
};
})( jQuery );
+
+(function( $ ) {
+ $.fn.bbco_autocomplete = function(type) {
+
+ if(type=='bbcode') {
+ var open_close_elements = ['bold', 'italic', 'underline', 'overline', 'strike', 'superscript', 'subscript', 'quote', 'code', 'spoiler', 'map', 'nobb', 'list', 'ul', 'ol', 'li', 'table', 'tr', 'th', 'td', 'center', 'color', 'font', 'size', 'zrl', 'zmg', 'rpost', 'qr', 'observer'];
+ var open_elements = ['observer.baseurl', 'observer.address', 'observer.photo', 'observer.name', 'observer.webname', 'observer.url', '*', 'hr', ];
+
+ var elements = open_close_elements.concat(open_elements);
+ }
+
+ if(type=='comanche') {
+ var open_close_elements = ['region', 'layout', 'template', 'theme', 'widget', 'block', 'menu', 'var', 'css', 'js', 'authored', 'comment', 'webpage'];
+ var open_elements = [];
+
+ var elements = open_close_elements.concat(open_elements);
+ }
+
+ if(type=='comanche-block') {
+ var open_close_elements = ['menu', 'var'];
+ var open_elements = [];
+
+ var elements = open_close_elements.concat(open_elements);
+ }
+
+ bbco = {
+ match: /\[(\w*\**)$/,
+ search: function (term, callback) {
+ callback($.map(elements, function (element) {
+ return element.indexOf(term) === 0 ? element : null;
+ }));
+ },
+ index: 1,
+ replace: function (element) {
+ element = string2bb(element);
+ if(open_elements.indexOf(element) < 0) {
+ if(element === 'list' || element === 'ol' || element === 'ul') {
+ return ['\[' + element + '\]' + '\n\[*\] ', '\n\[/' + element + '\]'];
+ }
+ else if(element === 'table') {
+ return ['\[' + element + '\]' + '\n\[tr\]', '\[/tr\]\n\[/' + element + '\]'];
+ }
+ else {
+ return ['\[' + element + '\]', '\[/' + element + '\]'];
+ }
+ }
+ else {
+ return '\[' + element + '\] ';
+ }
+ }
+ };
+
+ this.attr('autocomplete','off');
+ var a = this.textcomplete([bbco], {className:'acpopup', zIndex:1020});
+
+ a.on('textComplete:select', function(e, value, strategy) { value; });
+
+ $(this).keypress(function(e){
+ if (e.keyCode == 13) {
+ x = listNewLineAutocomplete(this.id);
+ if(x)
+ e.preventDefault();
+ }
+ });
+ };
+})( jQuery );
+
diff --git a/view/js/main.js b/view/js/main.js
index 04b317914..799ae82bc 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -491,6 +491,7 @@ function updateConvItems(mode,data) {
if(isVisible)
showHideComments(itmId);
$("> .wall-item-outside-wrapper .autotime, > .thread-wrapper .autotime",this).timeago();
+ $("> .shared_header .autotime",this).timeago();
}
else {
$('img',this).each(function() {
@@ -502,6 +503,7 @@ function updateConvItems(mode,data) {
if(isVisible)
showHideComments(itmId);
$("> .wall-item-outside-wrapper .autotime, > .thread-wrapper .autotime",this).timeago();
+ $("> .shared_header .autotime",this).timeago();
}
prev = ident;
});
@@ -529,6 +531,7 @@ function updateConvItems(mode,data) {
if(isVisible)
showHideComments(itmId);
$("> .wall-item-outside-wrapper .autotime, > .thread-wrapper .autotime",this).timeago();
+ $("> .shared_header .autotime",this).timeago();
}
else {
$('img',this).each(function() {
@@ -540,6 +543,7 @@ function updateConvItems(mode,data) {
if(isVisible)
showHideComments(itmId);
$("> .wall-item-outside-wrapper .autotime, > .thread-wrapper .autotime",this).timeago();
+ $("> .shared_header .autotime",this).timeago();
}
});
@@ -573,6 +577,7 @@ function updateConvItems(mode,data) {
if(isVisible)
showHideComments(itmId);
$("> .wall-item-outside-wrapper .autotime, > .thread-wrapper .autotime",this).timeago();
+ $("> .shared_header .autotime",this).timeago();
}
prev = ident;
});
@@ -617,6 +622,8 @@ function updateConvItems(mode,data) {
/* autocomplete @nicknames */
$(".comment-edit-form textarea").editor_autocomplete(baseurl+"/acl?f=&n=1");
+ /* autocomplete bbcode */
+ $(".comment-edit-form textarea").bbco_autocomplete('bbcode');
var bimgs = ((preloadImages) ? false : $(".wall-item-body img").not(function() { return this.complete; }));
var bimgcount = bimgs.length;
@@ -1046,6 +1053,7 @@ function preview_comment(id) {
function(data) {
if(data.preview) {
$("#comment-edit-preview-" + id).html(data.preview);
+ $("#comment-edit-preview-" + id + " .autotime").timeago();
$("#comment-edit-preview-" + id + " a").click(function() { return false; });
}
},
@@ -1076,6 +1084,7 @@ function preview_post() {
function(data) {
if(data.preview) {
$("#jot-preview-content").html(data.preview);
+ $("#jot-preview-content .autotime").timeago();
$("#jot-preview-content" + " a").click(function() { return false; });
}
},
diff --git a/view/js/mod_chat.js b/view/js/mod_chat.js
index 0d47e3e77..f9d2a599c 100644
--- a/view/js/mod_chat.js
+++ b/view/js/mod_chat.js
@@ -15,4 +15,7 @@ $(document).ready(function() {
$('#jot-public').show();
}
}).trigger('change');
+
+ $('#chatText').bbco_autocomplete('bbcode');
+
});
diff --git a/view/js/mod_events.js b/view/js/mod_events.js
index 0b7b3d24c..74b811dd6 100644
--- a/view/js/mod_events.js
+++ b/view/js/mod_events.js
@@ -3,9 +3,8 @@
*/
$(document).ready( function() {
-
enableDisableFinishDate();
-
+ $('#comment-edit-text-desc, #comment-edit-text-loc').bbco_autocomplete('bbcode');
});
function enableDisableFinishDate() {
diff --git a/view/js/mod_mail.js b/view/js/mod_mail.js
index 561df7229..3e55c8aeb 100644
--- a/view/js/mod_mail.js
+++ b/view/js/mod_mail.js
@@ -3,4 +3,5 @@ $(document).ready(function() {
$("#recip-complete").val(data.xid);
});
$(".autotime").timeago()
+ $('#prvmail-text').bbco_autocomplete('bbcode');
});
diff --git a/view/js/mod_photos.js b/view/js/mod_photos.js
index d371c3f2f..34e2e3f25 100644
--- a/view/js/mod_photos.js
+++ b/view/js/mod_photos.js
@@ -11,6 +11,8 @@ $(document).ready(function() {
$("#photo-edit-newtag").val('@' + data.name);
});
+ $('#id_body').bbco_autocomplete('bbcode');
+
$('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
var selstr;
$('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
diff --git a/view/js/mod_profiles.js b/view/js/mod_profiles.js
index aad2ca902..a7754e0c5 100644
--- a/view/js/mod_profiles.js
+++ b/view/js/mod_profiles.js
@@ -1,3 +1,4 @@
$(document).ready(function() {
$('form').areYouSure(); // Warn user about unsaved settings
+ $('textarea').bbco_autocomplete('bbcode');
});
diff --git a/view/tpl/head.tpl b/view/tpl/head.tpl
index ba883c1f0..ab229eaf7 100755
--- a/view/tpl/head.tpl
+++ b/view/tpl/head.tpl
@@ -16,7 +16,7 @@
<link rel="search"
href="{{$baseurl}}/opensearch"
type="application/opensearchdescription+xml"
- title="Search in the Hubzilla" />
+ title="{{$osearch}}" />
<script>
diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl
index 84fccc105..769923a51 100755
--- a/view/tpl/jot-header.tpl
+++ b/view/tpl/jot-header.tpl
@@ -11,10 +11,15 @@ function initEditor(cb){
if(plaintext == 'none') {
$("#profile-jot-text-loading").spin(false).hide();
$("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
+ {{if $bbco_autocomplete}}
+ $("#profile-jot-text").bbco_autocomplete('{{$bbco_autocomplete}}'); // autocomplete bbcode
+ {{/if}}
+ {{if $editor_autocomplete}}
if(typeof channelId === 'undefined')
$("#profile-jot-text").editor_autocomplete(baseurl+"/acl");
else
$("#profile-jot-text").editor_autocomplete(baseurl+"/acl",[channelId]); // Also gives suggestions from current channel's connections
+ {{/if}}
editor = true;
$("a#jot-perms-icon").colorbox({
'inline' : true,
diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl
index dea75efa9..026c586a0 100755
--- a/view/tpl/jot.tpl
+++ b/view/tpl/jot.tpl
@@ -48,6 +48,7 @@
{{/if}}
<div id="profile-jot-submit-wrapper" class="jothidden">
<div id="profile-jot-submit-left" class="btn-toolbar pull-left">
+ {{if $bbcode}}
<div class="btn-group">
<button id="main-editor-bold" class="btn btn-default btn-sm" title="{{$bold}}" onclick="inserteditortag('b', 'profile-jot-text'); return false;">
<i class="icon-bold jot-icons"></i>
@@ -65,6 +66,7 @@
<i class="icon-terminal jot-icons"></i>
</button>
</div>
+ {{/if}}
{{if $visitor}}
<div class="btn-group hidden-xs">
{{if $writefiles}}
diff --git a/view/tpl/login.tpl b/view/tpl/login.tpl
index da38f3571..d56c8f272 100755
--- a/view/tpl/login.tpl
+++ b/view/tpl/login.tpl
@@ -5,7 +5,7 @@
<div id="login-input" class="form-group">
{{include file="field_input.tpl" field=$lname}}
{{include file="field_password.tpl" field=$lpassword}}
- {{include file="field_checkbox.tpl" field=$remember}}
+ {{include file="field_checkbox.tpl" field=$remember_me}}
<button type="submit" name="submit" class="btn btn-block btn-primary">{{$login}}</button>
</div>
<div id="login-extra-links">
diff --git a/view/tpl/nav.tpl b/view/tpl/nav.tpl
index 3d6809c22..886f73947 100755
--- a/view/tpl/nav.tpl
+++ b/view/tpl/nav.tpl
@@ -1,4 +1,45 @@
- <div class="container-fluid">
+<script>
+ $(document).mouseup(function (e)
+ {
+ var container = $("#help-content");
+
+ if (!container.is(e.target) // if the target of the click isn't the container...
+ && container.has(e.target).length === 0 // ... nor a descendant of the container
+ && container.hasClass('help-content-open'))
+ {
+ container.removeClass('help-content-open');
+ }
+ });
+</script>
+<style>
+.help-content {
+ background: rgba(255, 255, 255, 0.9);
+ color: #333333;
+ position: fixed;
+ top: 50px;
+ left: -80%;
+ width: 80%;
+ height: 60%;
+ padding: 20px;
+ transition: left 300ms cubic-bezier(0.17, 0.04, 0.03, 0.94);
+ box-sizing: border-box;
+ border: #CCC thin solid;
+ overflow: auto;
+}
+
+.help-content-open {
+ left: 0px;
+ -moz-box-shadow: 3px 3px 3px #ccc;
+ -webkit-box-shadow: 3px 3px 3px #ccc;
+ box-shadow: 3px 3px 3px #ccc;
+}
+
+.help-content dd {
+ margin-bottom: 1em;
+}
+</style>
+
+<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse-1">
<span class="icon-bar"></span>
@@ -189,8 +230,13 @@
{{if $nav.help}}
<li class="{{$sel.help}}">
- <a class="{{$nav.help.2}}" target="hubzilla-help" href="{{$nav.help.0}}" title="{{$nav.help.3}}" id="{{$nav.help.4}}"><i class="icon-question"></i></a>
+ <a class="{{$nav.help.2}}" target="hubzilla-help" href="{{$nav.help.0}}" title="{{$nav.help.3}}" id="{{$nav.help.4}}" onclick="$('#help-content').toggleClass('help-content-open'); return false;"><i class="icon-question"></i></a>
</li>
+
+ <div id="help-content" class="help-content">
+ {{$nav.help.5}}
+ <p class="pull-right"><a href="{{$nav.help.0}}">Click here for more documentation...</a></p>
+ </div>
{{/if}}
</ul>
</div>
diff --git a/view/tpl/pdledit.tpl b/view/tpl/pdledit.tpl
index af8e37602..3e1f5a3fc 100644
--- a/view/tpl/pdledit.tpl
+++ b/view/tpl/pdledit.tpl
@@ -18,4 +18,7 @@
<input type="submit" name="submit" value="{{$submit}}" />
</form>
+<script>
+ $('textarea').bbco_autocomplete('comanche');
+</script>
</div>