Skip to content

Commit

Permalink
Merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
chriscant committed Apr 15, 2019
2 parents 455b67b + 4dd3e3a commit 75cf1ae
Show file tree
Hide file tree
Showing 59 changed files with 2,132 additions and 1,521 deletions.
1 change: 1 addition & 0 deletions dev/publicRouteMiddleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const routes = [
'help',
'helpus',
'invite',
'spread',
'legacy',
'livemap',
'localstorage',
Expand Down
2 changes: 1 addition & 1 deletion dev/webpack.appfd.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module.exports = new Config().extend({
}),
// CC new FaviconsPlugin('images/user_logo.png'),
new webpack.DefinePlugin({
APP_VERSION: JSON.stringify('1.4.12, 20 March 2019'),
APP_VERSION: JSON.stringify('1.4.13, 15 April 2019'),
// CC SET ABOVE: API: JSON.stringify(BASE_URL+'/api/'),
FACEBOOK_APPID: JSON.stringify('134980666550322'),
FACEBOOK_GRAFFITI_APPID: JSON.stringify('115376591981611'),
Expand Down
6 changes: 6 additions & 0 deletions http/css/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,12 @@ a.nodecor, a.nodecor:hover, a.nodecor:visited, a.nodecor:link, a.nodecor:active
border-radius: 12px;
}

.img-largethumbnail {
min-width:250px !important;
max-width:250px !important;
width:250px !important;
}

.img-mediumthumbnail {
min-width:125px !important;
max-width:125px !important;
Expand Down
2 changes: 1 addition & 1 deletion http/js/iznik/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ define([
Iznik.wbr = function (str, num) {
var re = RegExp('([^\\s]{' + num + '})(\\w)', 'g')
return str.replace(re, function (all, text, char) {
return text + '<wbr>' + char
return text + "\n" + char
})
}

Expand Down
62 changes: 40 additions & 22 deletions http/js/iznik/models/admin.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,46 @@
define([
'jquery',
'underscore',
'backbone',
'iznik/base'
], function($, _, Backbone, Iznik) {
Iznik.Models.Admin = Iznik.Model.extend({
urlRoot: API + 'admin',
'jquery',
'underscore',
'backbone',
'iznik/base'
], function ($, _, Backbone, Iznik) {
Iznik.Models.Admin = Iznik.Model.extend({
urlRoot: API + 'admin',

parse: function (ret) {
if (ret.hasOwnProperty('admin')) {
return(ret.admin);
} else {
return(ret);
}
parse: function (ret) {
if (ret.hasOwnProperty('admin')) {
return (ret.admin)
} else {
return (ret)
}
},

delete: function (reason) {
var self = this

return $.ajax({
type: 'POST',
headers: {
'X-HTTP-Method-Override': 'DELETE'
},
url: API + 'admin/' + self.get('id'),
data: {
id: self.get('id'),
reason: reason
}, success: function (ret) {
self.destroy()
}
});
})
}
})

Iznik.Collections.Admin = Iznik.Collection.extend({
url: API + 'admin',
Iznik.Collections.Admin = Iznik.Collection.extend({
url: API + 'admin',

model: Iznik.Models.Admin,
model: Iznik.Models.Admin,

parse: function (ret) {
return (ret.admins);
}
});
});
parse: function (ret) {
return (ret.admins)
}
})
})
7 changes: 7 additions & 0 deletions http/js/iznik/models/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,13 @@ define([
ev: 'newsletterstoriescountchanged',
window: false,
sound: false
},
{
fi: 'pendingadmins',
el: '.js-pendingadminscount',
ev: 'pendingadminscountchanged',
window: false,
sound: false
}
];

Expand Down
17 changes: 17 additions & 0 deletions http/js/iznik/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ define([
'help': 'userContact',
'invite/:id': 'userInvited',
'invite': 'userInvite',
'spread': 'userInvite',
'newsfeed/:id': 'userNewsfeedSingle',
'newsfeed': 'userNewsfeed',
'chitchat/:id': 'userNewsfeedSingle',
Expand All @@ -228,6 +229,7 @@ define([
'councils/volunteers': 'userCouncilsVolunteers',
'councils/keylinks(/:section)': 'userCouncilsKeyLinks',
'councils/workbest(/:section)': 'userCouncilsWorkBest',
'councils/giveandtake(/:section)': 'userCouncilsGiveAndTake',
'councils/graphics(/:section)': 'userCouncilsGraphics',
'councils/photosvideos(/:section)': 'userCouncilsPhotosVideos',
'councils/posters': 'userCouncilsPosters',
Expand Down Expand Up @@ -293,6 +295,7 @@ define([
},

userHome: function () {
console.log("User home")
if (!MODTOOLS) {
var self = this

Expand Down Expand Up @@ -2006,6 +2009,7 @@ define([
self.listenToOnce(Iznik.Session, 'loggedIn', function () {
require(['iznik/views/teams'], function () {
var page = new Iznik.Views.ModTools.Pages.Teams()
page.modtools = false;
self.loadRoute({page: page})
})
})
Expand Down Expand Up @@ -2173,6 +2177,19 @@ define([
}
},

userCouncilsGiveAndTake: function (section) {
if (!MODTOOLS) {
var self = this

require(['iznik/views/pages/user/councils'], function () {
var page = new Iznik.Views.User.Pages.Councils.GiveAndTake({
section: section
})
self.loadRoute({page: page})
})
}
},

userCouncilsGraphics: function (section) {
if (!MODTOOLS) {
var self = this
Expand Down
11 changes: 9 additions & 2 deletions http/js/iznik/views/chat/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -1631,14 +1631,16 @@ define([
render: function () {
var self = this
var p
// console.log("Render chat message", this.model.get('id'), this.model.attributes);

if (this.model.get('id')) {
var message = this.model.get('message')
if (message) {
// Unescape emojis.
message = Iznik.twem(message)

// Incomplete HTML
message = (message+'').replace(/\<br \//g, "\n");

// Remove duplicate newlines. Make sure we have a string - might not if the message was just a digit.
message += ''
message = message.replace(/\n\s*\n\s*\n/g, '\n\n')
Expand All @@ -1648,7 +1650,9 @@ define([

// Insert some wbrs to allow us to word break long words (e.g. URLs).
// It might have line breaks in if it comes originally from an email.
message = Iznik.wbr(message, 20).replace(/(?:\r\n|\r|\n)/g, '<br />')
message = Iznik.wbr(message, 20).replace(/(?:\r\n|\r|\n)/g, "\n")

message = message.replace(/\n/g, "<br />")

this.model.set('message', message)
}
Expand Down Expand Up @@ -1736,6 +1740,9 @@ define([

p = Iznik.View.Timeago.prototype.render.call(this)
p.then(function (self) {
// Set message. Do this here as it contains HTML
self.$('.js-chatmessage').html(self.model.get('message'))

// Expand emojis.
twemoji.parse(self.el)

Expand Down
Loading

0 comments on commit 75cf1ae

Please sign in to comment.