aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
Diffstat (limited to 'view')
-rw-r--r--view/css/mod_cal.css4
-rw-r--r--view/css/mod_events.css4
-rw-r--r--view/js/mod_cal.js22
-rw-r--r--view/js/mod_events.js18
-rw-r--r--view/php/default.php2
-rw-r--r--view/php/theme_init.php1
-rw-r--r--view/theme/redbasic/css/style.css6
-rwxr-xr-xview/tpl/event_head.tpl7
-rwxr-xr-xview/tpl/jot-header.tpl83
-rwxr-xr-xview/tpl/jot.tpl29
-rwxr-xr-xview/tpl/profile_advanced.tpl2
-rw-r--r--view/tpl/wiki.tpl41
12 files changed, 215 insertions, 4 deletions
diff --git a/view/css/mod_cal.css b/view/css/mod_cal.css
index f0b5c0166..184227a91 100644
--- a/view/css/mod_cal.css
+++ b/view/css/mod_cal.css
@@ -1,3 +1,7 @@
+.fc-scroller {
+ overflow: hidden !important;
+}
+
/* fix borders */
.fc th:first-child,
diff --git a/view/css/mod_events.css b/view/css/mod_events.css
index f0b5c0166..184227a91 100644
--- a/view/css/mod_events.css
+++ b/view/css/mod_events.css
@@ -1,3 +1,7 @@
+.fc-scroller {
+ overflow: hidden !important;
+}
+
/* fix borders */
.fc th:first-child,
diff --git a/view/js/mod_cal.js b/view/js/mod_cal.js
new file mode 100644
index 000000000..5867f676e
--- /dev/null
+++ b/view/js/mod_cal.js
@@ -0,0 +1,22 @@
+/**
+ * JavaScript for mod/cal
+ */
+
+$(document).ready( function() {
+ $(document).on('click','#fullscreen-btn', on_fullscreen);
+ $(document).on('click','#inline-btn', on_inline);
+});
+
+function on_fullscreen() {
+ var view = $('#events-calendar').fullCalendar('getView');
+ if(view.type === 'month') {
+ $('#events-calendar').fullCalendar('option', 'height', $(window).height() - $('.section-title-wrapper').outerHeight(true) - 2); // -2 is for border width (top and bottom) of .generic-content-wrapper
+ }
+}
+
+function on_inline() {
+ var view = $('#events-calendar').fullCalendar('getView');
+ if(view.type === 'month') {
+ $('#events-calendar').fullCalendar('option', 'height', '');
+ }
+}
diff --git a/view/js/mod_events.js b/view/js/mod_events.js
index 74b811dd6..66cf81ddd 100644
--- a/view/js/mod_events.js
+++ b/view/js/mod_events.js
@@ -5,11 +5,29 @@
$(document).ready( function() {
enableDisableFinishDate();
$('#comment-edit-text-desc, #comment-edit-text-loc').bbco_autocomplete('bbcode');
+
+ $(document).on('click','#fullscreen-btn', on_fullscreen);
+ $(document).on('click','#inline-btn', on_inline);
});
+
function enableDisableFinishDate() {
if( $('#id_nofinish').is(':checked'))
$('#id_finish_text').prop("disabled", true);
else
$('#id_finish_text').prop("disabled", false);
}
+
+function on_fullscreen() {
+ var view = $('#events-calendar').fullCalendar('getView');
+ if(view.type === 'month') {
+ $('#events-calendar').fullCalendar('option', 'height', $(window).height() - $('.section-title-wrapper').outerHeight(true) - 2); // -2 is for border width (top and bottom) of .generic-content-wrapper
+ }
+}
+
+function on_inline() {
+ var view = $('#events-calendar').fullCalendar('getView');
+ if(view.type === 'month') {
+ $('#events-calendar').fullCalendar('option', 'height', '');
+ }
+}
diff --git a/view/php/default.php b/view/php/default.php
index ad6b7a3d1..f5be4fa35 100644
--- a/view/php/default.php
+++ b/view/php/default.php
@@ -5,7 +5,7 @@
<script>var baseurl="<?php echo z_root() ?>";</script>
<?php if(x($page,'htmlhead')) echo $page['htmlhead'] ?>
</head>
-<body>
+<body <?php if($page['direction']) echo 'dir="rtl"' ?> >
<?php if(x($page,'banner')) echo $page['banner']; ?>
<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>
diff --git a/view/php/theme_init.php b/view/php/theme_init.php
index 648b144b3..e9ba2aa05 100644
--- a/view/php/theme_init.php
+++ b/view/php/theme_init.php
@@ -10,6 +10,7 @@ head_add_css('view/css/conversation.css');
head_add_css('view/css/widgets.css');
head_add_css('view/css/colorbox.css');
head_add_css('library/justifiedGallery/justifiedGallery.min.css');
+head_add_css('library/Text_Highlighter/sample.css');
head_add_js('jquery.js');
//head_add_js('jquery-migrate-1.1.1.js');
diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css
index 30b0cebb4..c9c85daa3 100644
--- a/view/theme/redbasic/css/style.css
+++ b/view/theme/redbasic/css/style.css
@@ -2020,3 +2020,9 @@ dl.bb-dl > dd > li {
.help-searchlist a {
font-size: 130%;
}
+
+.embed-photo-selected-photo {
+ border-color: blue;
+ border-style: solid;
+ border-width: 5px;
+}
diff --git a/view/tpl/event_head.tpl b/view/tpl/event_head.tpl
index 5083c5835..762bdcbb8 100755
--- a/view/tpl/event_head.tpl
+++ b/view/tpl/event_head.tpl
@@ -30,6 +30,12 @@
function changeView(action, viewName) {
$('#events-calendar').fullCalendar(action, viewName);
var view = $('#events-calendar').fullCalendar('getView');
+ if(view.type === 'agendaDay' || view.type === 'agendaWeek') {
+ $('#events-calendar').fullCalendar('option', 'height', 'auto');
+ }
+ else {
+ $('#events-calendar').fullCalendar('option', 'height', '');
+ }
$('#title').text(view.title);
}
@@ -42,7 +48,6 @@
firstDay: {{$first_day}},
eventLimit: 3,
- height: 'auto',
monthNames: aStr['monthNames'],
monthNamesShort: aStr['monthNamesShort'],
diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl
index 43df2e175..f3dd8cafe 100755
--- a/view/tpl/jot-header.tpl
+++ b/view/tpl/jot-header.tpl
@@ -364,6 +364,89 @@ function enableOnUser(){
{{$geotag}}
+ var initializeEmbedPhotoDialog = function () {
+ $('.embed-photo-selected-photo').each(function (index) {
+ $(this).removeClass('embed-photo-selected-photo');
+ });
+ getPhotoAlbumList();
+ $('#embedPhotoModalBodyAlbumDialog').off('click');
+ $('#embedPhotoModal').modal();
+ };
+
+ var choosePhotoFromAlbum = function (album) {
+ $.post("embedphotos/album", {name: album},
+ function(data) {
+ if (data['status']) {
+ $('#embedPhotoModalLabel').html('{{$modalchooseimages}}');
+ $('#embedPhotoModalBodyAlbumDialog').html('\
+ <div><ul class="nav">\n\
+ <li><a href="#" onclick="initializeEmbedPhotoDialog();return false;">\n\
+ <i class="fa fa-chevron-left"></i>&nbsp\n\
+ {{$modaldiffalbum}}\n\
+ </a>\n\
+ </li>\n\
+ </ul><br></div>')
+ $('#embedPhotoModalBodyAlbumDialog').append(data['content']);
+ $('#embedPhotoModalBodyAlbumDialog').click(function (evt) {
+ evt.preventDefault();
+ var image = document.getElementById(evt.target.id);
+ if (typeof($(image).parent()[0]) !== 'undefined') {
+ var imageparent = document.getElementById($(image).parent()[0].id);
+ $(imageparent).toggleClass('embed-photo-selected-photo');
+ }
+ });
+ $('#embedPhotoModalBodyAlbumListDialog').addClass('hide');
+ $('#embedPhotoModalBodyAlbumDialog').removeClass('hide');
+ $('#embed-photo-OKButton').click(function () {
+ $('.embed-photo-selected-photo').each(function (index) {
+ var href = $(this).attr('href');
+ $.post("embedphotos/photolink", {href: href},
+ function(ddata) {
+ if (ddata['status']) {
+ addeditortext(ddata['photolink']);
+ } else {
+ window.console.log('{{$modalerrorlink}}' + ':' + ddata['errormsg']);
+ }
+ return false;
+ },
+ 'json');
+ });
+ $('#embedPhotoModalBodyAlbumDialog').html('');
+ $('#embedPhotoModalBodyAlbumDialog').off('click');
+ $('#embedPhotoModal').modal('hide');
+ });
+ } else {
+ window.console.log('{{$modalerroralbum}} ' + JSON.stringify(album) + ':' + data['errormsg']);
+ }
+ return false;
+ },
+ 'json');
+ };
+
+ var getPhotoAlbumList = function () {
+ $.post("embedphotos/albumlist", {},
+ function(data) {
+ if (data['status']) {
+ var albums = data['albumlist']; //JSON.parse(data['albumlist']);
+ $('#embedPhotoModalLabel').html('{{$modalchoosealbum}}');
+ $('#embedPhotoModalBodyAlbumList').html('<ul class="nav"></ul>');
+ for(var i=0; i<albums.length; i++) {
+ var albumName = albums[i].text;
+ var albumLink = '<li>';
+ albumLink += '<a href="#" onclick="choosePhotoFromAlbum(\'' + albumName + '\');return false;">' + albumName + '</a>';
+ albumLink += '</li>';
+ $('#embedPhotoModalBodyAlbumList').find('ul').append(albumLink);
+ }
+ $('#embedPhotoModalBodyAlbumDialog').addClass('hide');
+ $('#embedPhotoModalBodyAlbumListDialog').removeClass('hide');
+ } else {
+ window.console.log('{{$modalerrorlist}}' + ':' + data['errormsg']);
+ }
+ return false;
+ },
+ 'json');
+ };
+
</script>
<script>
diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl
index 685706026..490349a04 100755
--- a/view/tpl/jot.tpl
+++ b/view/tpl/jot.tpl
@@ -79,6 +79,11 @@
<i id="profile-link" class="fa fa-link jot-icons"></i>
</button>
{{/if}}
+ {{if $embedPhotos}}
+ <button id="embed-photo-wrapper" class="btn btn-default btn-sm" title="{{$embedPhotos}}" onclick="initializeEmbedPhotoDialog();return false;">
+ <i id="embed-photo" class="fa fa-file-image-o jot-icons"></i>
+ </button>
+ {{/if}}
</div>
<div class="btn-group hidden-xs hidden-sm">
{{if $setloc}}
@@ -225,6 +230,30 @@
</div><!-- /.modal -->
{{/if}}
+{{if $embedPhotos}}
+<div class="modal" id="embedPhotoModal" tabindex="-1" role="dialog" aria-labelledby="embedPhotoLabel" aria-hidden="true">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
+ <h4 class="modal-title" id="embedPhotoModalLabel">{{$embedPhotosModalTitle}}</h4>
+ </div>
+ <div class="modal-body" id="embedPhotoModalBody" >
+ <div id="embedPhotoModalBodyAlbumListDialog" class="hide">
+ <div id="embedPhotoModalBodyAlbumList"></div>
+ </div>
+ <div id="embedPhotoModalBodyAlbumDialog" class="hide">
+ </div>
+ </div>
+ <div class="modal-footer">
+ <button type="button" class="btn btn-default" data-dismiss="modal">{{$embedPhotosModalCancel}}</button>
+ <button id="embed-photo-OKButton" type="button" class="btn btn-primary">{{$embedPhotosModalOK}}</button>
+ </div>
+ </div><!-- /.modal-content -->
+ </div><!-- /.modal-dialog -->
+</div><!-- /.modal -->
+{{/if}}
+
{{if $content || $attachment || $expanded}}
<script>initEditor();</script>
{{/if}}
diff --git a/view/tpl/profile_advanced.tpl b/view/tpl/profile_advanced.tpl
index a4c98b1d0..d0c9621f9 100755
--- a/view/tpl/profile_advanced.tpl
+++ b/view/tpl/profile_advanced.tpl
@@ -282,7 +282,7 @@
<ul class="profile-thing-list">
{{foreach $items as $item}}
<li>{{if $item.img}}<a href="{{$item.url}}" ><img src="{{$item.img}}" class="profile-thing-img" width="100" height="100" alt="{{$item.term}}" /></a>{{/if}}
- <a href="{{$item.url}}" >{{$item.term}}</a>
+ <a href="{{$item.editurl}}" >{{$item.term}}</a>
{{if $profile.canlike}}<br />
<button type="button" class="btn btn-default btn-sm" onclick="doprofilelike('thing/' + '{{$item.term_hash}}','like'); return false;" title="{{$likethis}}" >
<i class="fa fa-thumbs-o-up" title="{{$likethis}}"></i>
diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl
index 1312f8518..dc78aad9f 100644
--- a/view/tpl/wiki.tpl
+++ b/view/tpl/wiki.tpl
@@ -25,7 +25,7 @@
<button id="inline-btn" type="button" class="btn btn-default btn-xs" onclick="makeFullScreen(false);
adjustInlineTopBarHeight();"><i class="fa fa-compress"></i></button>
</div>
- <h2>{{$wikiheader}}</h2>
+ <h2><span id="wiki-header-name">{{$wikiheaderName}}</span>: <span id="wiki-header-page">{{$wikiheaderPage}}</span></h2>
<div class="clear"></div>
</div>
<div id="new-wiki-form-wrapper" class="section-content-tools-wrapper" style="display:none;">
@@ -57,6 +57,17 @@
<hr>
</div>
+ <div id="rename-page-form-wrapper" class="section-content-tools-wrapper" style="display:none;">
+ <form id="rename-page-form" action="wiki/rename/page" method="post" >
+ <div class="clear"></div>
+ {{include file="field_input.tpl" field=$pageRename}}
+ <div class="btn-group pull-right">
+ <button id="rename-page-submit" class="btn btn-warning" type="submit" name="submit" >Rename Page</button>
+ </div>
+ </form> <div class="clear"></div>
+ <hr>
+ </div>
+
<div id="wiki-content-container" class="section-content-wrapper" {{if $hideEditor}}style="display: none;"{{/if}}>
<ul class="nav nav-tabs" id="wiki-nav-tabs">
<li><a data-toggle="tab" href="#edit-pane">Edit</a></li>
@@ -67,6 +78,7 @@
<a data-toggle="dropdown" class="dropdown-toggle" href="#">Page <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a id="save-page" data-toggle="tab" href="#">Save</a></li>
+ <li><a id="rename-page" data-toggle="tab" href="#">Rename</a></li>
<li><a id="delete-page" data-toggle="tab" href="#">Delete</a></li>
</ul>
</li>
@@ -115,7 +127,34 @@
if (window.wiki_page_name === 'Home') {
$('#delete-page').hide();
+ $('#rename-page').hide();
}
+
+ $('#rename-page').click(function (ev) {
+ $('#rename-page-form-wrapper').show();
+ });
+
+ $( "#rename-page-form" ).submit(function( event ) {
+ $.post("wiki/{{$channel}}/rename/page",
+ {
+ oldName: window.wiki_page_name,
+ newName: $('#id_pageRename').val(),
+ resource_id: window.wiki_resource_id
+ },
+ function (data) {
+ if (data.success) {
+ $('#rename-page-form-wrapper').hide();
+ window.console.log('data: ' + JSON.stringify(data));
+ window.wiki_page_name = data.name.urlName;
+ $('#wiki-header-page').html(data.name.htmlName);
+ wiki_refresh_page_list();
+ } else {
+ window.console.log('Error renaming page.');
+ }
+ }, 'json');
+ event.preventDefault();
+ });
+
$(document).ready(function () {
wiki_refresh_page_list();
// Show Edit tab first. Otherwise the Ace editor does not load.