diff --git a/dev/webpack.appfd.config.js b/dev/webpack.appfd.config.js index ba02c1fd3..50cd92a56 100644 --- a/dev/webpack.appfd.config.js +++ b/dev/webpack.appfd.config.js @@ -69,7 +69,7 @@ module.exports = new Config().extend({ }), // CC new FaviconsPlugin('images/user_logo.png'), new webpack.DefinePlugin({ - APP_VERSION: JSON.stringify('1.3.16, 25 July 2018'), + APP_VERSION: JSON.stringify('1.3.17, 7 August 2018'), // CC SET ABOVE: API: JSON.stringify(BASE_URL+'/api/'), FACEBOOK_APPID: JSON.stringify('134980666550322'), FACEBOOK_GRAFFITI_APPID: JSON.stringify('115376591981611'), diff --git a/http/css/style.less b/http/css/style.less index edc8ad64d..c3792f514 100644 --- a/http/css/style.less +++ b/http/css/style.less @@ -65,15 +65,15 @@ body { } .inlineblock { - display: inline-block; + display: inline-block !important; } .inline { - display: inline; + display: inline !important; } .block { - display: block; + display: block !important; } .bordright { @@ -347,6 +347,14 @@ nav .nav-tabs>li { margin-left: 20px; } +.margrightsm { + margin-right: 5px; +} + +.margrightlg { + margin-right: 20px; +} + .margtop { margin-top: 20px; } diff --git a/http/css/user.css b/http/css/user.css index a87e67492..6e2793a4e 100644 --- a/http/css/user.css +++ b/http/css/user.css @@ -49,7 +49,7 @@ display: block; width: 0; z-index: 1; - bottom: -31px; + bottom: -30px; left: 27px; } diff --git a/http/images/logos/WatermelonDay.gif b/http/images/logos/WatermelonDay.gif new file mode 100644 index 000000000..7ae0db419 Binary files /dev/null and b/http/images/logos/WatermelonDay.gif differ diff --git a/http/js/iznik/models/user/user.js b/http/js/iznik/models/user/user.js index 34d815941..0ba62afe9 100644 --- a/http/js/iznik/models/user/user.js +++ b/http/js/iznik/models/user/user.js @@ -11,6 +11,33 @@ define([ Iznik.Models.ModTools.User = Iznik.Model.extend({ urlRoot: API + '/user', + rate: function(rating) { + var self = this; + + var p = new Promise(function(resolve, reject) { + $.ajax({ + url: API + 'user', + type: 'POST', + data: { + action: 'Rate', + ratee: self.get('id'), + rating: rating + }, + success: function(ret) { + if (ret.ret == 0) { + resolve(); + } else { + reject(); + } + }, error: function() { + reject(); + } + }); + }); + + return(p); + }, + unbounce: function() { var self = this; diff --git a/http/js/iznik/views/pages/chat.js b/http/js/iznik/views/pages/chat.js index 84f4f937d..8b04c2e36 100644 --- a/http/js/iznik/views/pages/chat.js +++ b/http/js/iznik/views/pages/chat.js @@ -928,10 +928,11 @@ define([ var p = Iznik.View.prototype.render.call(self); p.then(function (self) { + // Empty rather than hide because glyphicons have a display set which would mean they show anyway. if (!self.options.modtools) { - self.$('.js-privacy').hide(); + self.$('.js-privacy').empty(); } else { - self.$('.js-promise').hide(); + self.$('.js-promise').empty(); } self.$('.js-tooltip').tooltip(); @@ -1093,7 +1094,23 @@ define([ self.$('.js-replytimeholder').slideDown('slow'); } - self.showReplyTimeInfo() + self.showReplyTimeInfo(); + + self.ratings = new Iznik.Views.User.Ratings({ + model: usermod + }); + + self.ratings.render(); + self.$('.js-ratings').html(self.ratings.$el); + + self.ratings2 = new Iznik.Views.User.Ratings({ + model: usermod + }); + self.ratings2.template = "user_ratingschat"; + + self.ratings2.render(); + self.$('.js-ratings2').html(self.ratings2.$el); + }); } }); diff --git a/http/js/iznik/views/pages/modtools/settings.js b/http/js/iznik/views/pages/modtools/settings.js index 426a12ef6..3c106135c 100644 --- a/http/js/iznik/views/pages/modtools/settings.js +++ b/http/js/iznik/views/pages/modtools/settings.js @@ -421,13 +421,6 @@ define([ control: 'radio', options: [{label: 'Yes', value: 1}, {label: 'No', value:0 }] }, - { - name: 'spammers.chatreview', - label: '(Freegle only) Check for spam messages to members?', - control: 'radio', - options: [{label: 'Yes', value: 1}, {label: 'No', value:0 }], - helpMessage: "Messages to members come through the system. It can flag suspicious ones for review so you can check if they are spam or not. If you turn this off, such replies (some of which may be fine) will be dropped and members won't see them." - }, { name: 'spammers.messagereview', label: 'Check for spam messages to group?', diff --git a/http/js/iznik/views/pages/modtools/support.js b/http/js/iznik/views/pages/modtools/support.js index faa09b8a5..084a87d5e 100644 --- a/http/js/iznik/views/pages/modtools/support.js +++ b/http/js/iznik/views/pages/modtools/support.js @@ -1444,7 +1444,7 @@ define([ var self = this; var p = Iznik.View.prototype.render.call(self); p.then(function() { - var group = self.model.get('onhere') ? ('https://' + USER_SITE + '/explore/' + self.model.get('nameshort')) : ('https://groups.yahoo.com/group/' + self.model.get('nameshort')); + var group = self.model.get('onhere') ? ('https://' + USER_SITE + '/explore/' + self.model.get('nameshort')) : ('https://groups.yahoo.com/neo/groups/' + self.model.get('nameshort')); self.$('.js-group').attr('href', group); var m = new moment(self.model.get('added')); diff --git a/http/js/iznik/views/pages/mydata.js b/http/js/iznik/views/pages/mydata.js index 39a2eb4a0..e8b6fd628 100644 --- a/http/js/iznik/views/pages/mydata.js +++ b/http/js/iznik/views/pages/mydata.js @@ -147,7 +147,8 @@ define([ [ 'stories_likes', Iznik.Views.MyData.StoryLike, '.js-storylikes' ], [ 'aboutme', Iznik.Views.MyData.AboutMe, '.js-aboutme' ], [ 'logins', Iznik.Views.MyData.Login, '.js-logins' ], - [ 'exports', Iznik.Views.MyData.Export, '.js-exports' ] + [ 'exports', Iznik.Views.MyData.Export, '.js-exports' ], + [ 'ratings', Iznik.Views.User.Ratings, '.js-ratings' ] ], function(view) { _.each(self.model.get(view[0]), function(mod) { var v = new view[1]({ diff --git a/http/js/iznik/views/pages/pages.js b/http/js/iznik/views/pages/pages.js index ce3679e61..b21634fbd 100644 --- a/http/js/iznik/views/pages/pages.js +++ b/http/js/iznik/views/pages/pages.js @@ -144,29 +144,22 @@ define([ Iznik.setTitleCounts(null, ret.count); } }, complete: function() { - $.ajax({ - url: API + 'newsfeed?count=true', - type: 'GET', - context: self, - success: function(ret) { - if (ret.ret == 0) { - var el = $('.js-unseennews'); - if (el.html() != ret.unseencount) { - el.html(ret.unseencount); - - if (ret.unseencount) { - $('.js-unseennews').show(); - } - else { - $('.js-unseennews').hide(); - } - } - } - }, complete: function() { - self.notificationChecking = false; - _.delay(_.bind(this.notificationCheck, this), 30000); + // We have the unseen newsfeed count in the session. That is loosely up to date, which is + // fine for our purposes. This saves getting the count on each page transition. + var unseencount = Iznik.Session.get('newsfeedcount'); + unseencount = _.isUndefined(unseencount) ? 0 : unseencount; + + var el = $('.js-unseennews'); + if (el.html() != unseencount) { + el.html(unseencount); + + if (unseencount) { + $('.js-unseennews').show(); } - }); + else { + $('.js-unseennews').hide(); + } + } } }); } diff --git a/http/js/iznik/views/pages/user/explore.js b/http/js/iznik/views/pages/user/explore.js index 130a28401..5c1e7c809 100644 --- a/http/js/iznik/views/pages/user/explore.js +++ b/http/js/iznik/views/pages/user/explore.js @@ -426,7 +426,7 @@ define([ window.open(this.model.get('external')); } else if (this.model.get('onyahoo') && !this.model.get('onhere')) { // Yahoo group - open new tab. - window.open("https://groups.yahoo.com/group/" + this.model.get('nameshort')); + window.open("https://groups.yahoo.com/neo/groups/" + this.model.get('nameshort')); } else { Router.navigate('/explore/' + this.model.get('nameshort'), true); } diff --git a/http/js/iznik/views/pages/user/home.js b/http/js/iznik/views/pages/user/home.js index bd116f1e1..abbe41090 100644 --- a/http/js/iznik/views/pages/user/home.js +++ b/http/js/iznik/views/pages/user/home.js @@ -539,11 +539,36 @@ define([ checkSubmit: function() { var cont = false; + var self = this; + var uid = this.$('.js-user').val(); if (this.$('.js-outcome').val() == 'Withdrawn') { cont = true; } else { - cont = this.$('.js-user').val() != -1; + cont = uid != -1; + } + + self.$('.js-ratewrapper').hide(); + self.$('.js-ratings').empty(); + + if (uid > 0) { + self.userMod = new Iznik.Models.ModTools.User({ + id: self.$('.js-user').val() + }); + + self.userMod.fetch({ + data: { + info: true + } + }).then(function() { + self.rate = new Iznik.Views.User.Ratings({ + model: self.userMod + }) + + self.rate.render(); + self.$('.js-rating').html(self.rate.$el); + self.$('.js-ratewrapper').fadeIn('slow'); + }); } this.$('.js-confirm').prop('disabled', !cont); diff --git a/http/js/iznik/views/pages/user/newsfeed.js b/http/js/iznik/views/pages/user/newsfeed.js index 653ff1e28..b13b7ece8 100644 --- a/http/js/iznik/views/pages/user/newsfeed.js +++ b/http/js/iznik/views/pages/user/newsfeed.js @@ -552,11 +552,21 @@ define([ }, photoZoom: function (e) { + var self = this; + e.preventDefault(); e.stopPropagation(); + // The image might be in this model, or hung off something underneath, like a story. + if (!self.model.get('image')) { + var story = self.model.get('story'); + if (story.photo) { + self.model.set('image', story.photo); + } + } + var v = new Iznik.Views.User.Feed.PhotoZoom({ - model: this.model + model: self.model }); v.render(); diff --git a/http/js/iznik/views/pages/user/pages.js b/http/js/iznik/views/pages/user/pages.js index 523b5f88a..6320f2ec5 100644 --- a/http/js/iznik/views/pages/user/pages.js +++ b/http/js/iznik/views/pages/user/pages.js @@ -275,7 +275,7 @@ define([ self.$('.js-homegroup').fadeIn('slow'); } else if (first.onyahoo && first.showonyahoo) { // But Yahoo does and we want to show it. - self.$('.js-toyahoo').attr('href', 'https://groups.yahoo.com/group/' + first.nameshort); + self.$('.js-toyahoo').attr('href', 'https://groups.yahoo.com/neo/groups/' + first.nameshort); self.$('.js-onyahoo').fadeIn('slow'); self.$('.js-toyahoo').show(); self.$('.js-homegroup').fadeIn('slow'); @@ -287,7 +287,7 @@ define([ if (first.onyahoo && first.showonyahoo && self.$('.js-groups').length > 0) { // But it's also on Yahoo, and some people might want to go there. self.$('.js-yahootoo').show(); - self.$('.js-yahootoo a').attr('href', 'https://groups.yahoo.com/group/' + first.nameshort); + self.$('.js-yahootoo a').attr('href', 'https://groups.yahoo.com/neo/groups/' + first.nameshort); } } } diff --git a/http/js/iznik/views/pages/user/post.js b/http/js/iznik/views/pages/user/post.js index be136cc18..5126f4284 100644 --- a/http/js/iznik/views/pages/user/post.js +++ b/http/js/iznik/views/pages/user/post.js @@ -1,6 +1,8 @@ import 'bootstrap-fileinput/js/plugins/piexif.min.js'; import 'bootstrap-fileinput'; +var Bloodhound = require('bloodhound-js'); + define([ 'jquery', 'underscore', @@ -261,29 +263,6 @@ define([ } }, - itemSource: function (query, syncResults, asyncResults) { - var self = this; - - if (query.length >= 2) { - $.ajax({ - type: 'GET', - url: API + 'item', - data: { - typeahead: query - }, success: function (ret) { - var matches = []; - _.each(ret.items, function (item) { - if (item.hasOwnProperty('item')) { - matches.push(item.item.name); - } - }); - - asyncResults(matches); - } - }) - } - }, - allUploaded: function() { var self = this; @@ -319,27 +298,56 @@ define([ _.delay(_.bind(self.checkNext, self), 300); - self.typeahead = self.$('.js-item').typeahead({ - minLength: 2, - hint: false, - highlight: true, - autoselect: false, - tabAutocomplete: false, - }, { - name: 'items', - source: self.itemSource, - limit: 3 + // We use bloodhound for better typeahead function which puts less load on the server. + self.hound = new Bloodhound({ + queryTokenizer: Bloodhound.tokenizers.whitespace, + datumTokenizer: Bloodhound.tokenizers.whitespace, + identify: function(datum) { + console.log("Identify", datum); + }, + remote: { + url: API + 'item', + prepare: function(query, settings) { + settings.url = settings.url + '?typeahead=' + encodeURIComponent(query); + return(settings); + }, + transform: function(ret) { + if (ret.ret === 0) { + var trans = []; + _.each(ret.items, function(item) { + if (item.hasOwnProperty('item')) { + trans.push(item.item.name); + } + }) + return(trans); + } + } + }, }); - if (self.options.item) { - self.$('.js-item').typeahead('val', self.options.item); - } + self.hound.initialize().then(function() { + self.typeahead = self.$('.js-item').typeahead({ + minLength: 2, + hint: false, + highlight: true, + autoselect: false, + tabAutocomplete: false, + }, { + name: 'items', + source: self.hound, + limit: 3 + }); - // Close the suggestions after 30 seconds in case people are confused. - self.$('.js-item').bind('typeahead:open', function() { - _.delay(function() { - self.$('.js-item').typeahead('close'); - }, 30000); + if (self.options.item) { + self.$('.js-item').typeahead('val', self.options.item); + } + + // Close the suggestions after 30 seconds in case people are confused. + self.$('.js-item').bind('typeahead:open', function() { + _.delay(function() { + self.$('.js-item').typeahead('close'); + }, 30000); + }); }); // File upload diff --git a/http/js/iznik/views/pages/user/settings.js b/http/js/iznik/views/pages/user/settings.js index 43d0b91a0..477e656df 100644 --- a/http/js/iznik/views/pages/user/settings.js +++ b/http/js/iznik/views/pages/user/settings.js @@ -71,8 +71,12 @@ define([ saveAboutMe: function() { var self = this; self.$('.js-saveaboutmeok').addClass('hidden'); + var msg = self.$('.js-aboutme').val(); + msg = twemoji.replace(msg, function(emoji) { + return '\\\\u' + twemoji.convert.toCodePoint(emoji) + '\\\\u'; + }); - Iznik.Session.saveAboutMe(self.$('.js-aboutme').val()).then(function() { + Iznik.Session.saveAboutMe(msg).then(function() { self.$('.js-saveaboutmeok').removeClass('hidden'); }) }, @@ -512,7 +516,9 @@ define([ } if (me.aboutme) { - self.$('.js-aboutme').val(me.aboutme.text); + var msg = me.aboutme.text; + msg = Iznik.twem(msg); + self.$('.js-aboutme').val(msg); } self.showHideMine(); diff --git a/http/js/iznik/views/pages/user/stories.js b/http/js/iznik/views/pages/user/stories.js index f719af921..ba0e730ff 100644 --- a/http/js/iznik/views/pages/user/stories.js +++ b/http/js/iznik/views/pages/user/stories.js @@ -41,7 +41,7 @@ define([ el: self.$('.js-list'), modelView: Iznik.Views.User.Pages.Stories.One, collection: self.collection, - processKeyEvents: false + processKeyEvents: false, }); self.collectionView.render(); @@ -88,6 +88,61 @@ define([ 'click .js-add': 'addStory' }, + imageid: null, + + setupPhotoUpload: function() { + var self = this; + + // Photo upload. + self.$el.find('.js-addphoto').fileinput({ + uploadExtraData: { + imgtype: 'Story', + story: 1, + ocr: false + }, + showUpload: false, + allowedFileExtensions: ['jpg', 'jpeg', 'gif', 'png'], + uploadUrl: API + 'image', + resizeImage: true, + maxImageWidth: 800, + browseIcon: ' ', + browseLabel: 'Add Photo', + browseClass: 'btn btn-primary btn-lg nowrap', + showCaption: false, + showRemove: false, + showUploadedThumbs: false, + dropZoneEnabled: false, + buttonLabelClass: '', + fileActionSettings: { + showZoom: false, + showRemove: false, + showUpload: false + }, + layoutTemplates: { + footer: '' + }, + elErrorContainer: '#js-uploaderror' + }); + + // Upload as soon as we have it. + self.$el.find('.js-addphoto').on('fileimagesresized', function (event) { + self.$('.js-photopreviewwrapper').show(); + self.$('.js-addphotowrapper').hide(); + self.$('.js-addphoto').fileinput('upload'); + }); + + self.$el.find('.js-addphoto').on('fileuploaded', function (event, data) { + self.$('.js-photopreview').attr('src', data.response.paththumb); + self.imageid = data.response.id; + + _.delay(function() { + self.$('.file-preview-frame').remove(); + }, 500); + }); + }, + addStory: function() { var self = this; self.$('.error').removeClass('error'); @@ -108,7 +163,8 @@ define([ data: { headline: headline, story: story, - public: isPublic + public: isPublic, + photo: self.imageid }, success: function(ret) { if (ret.ret == 0) { self.close(); @@ -119,6 +175,17 @@ define([ }) } } + }, + + render: function() { + var self = this; + + var p = Iznik.Views.Modal.prototype.render.call(this); + p.then(function() { + self.setupPhotoUpload(); + }); + + return(p); } }); diff --git a/http/js/iznik/views/signinup.js b/http/js/iznik/views/signinup.js index d1f168765..b98f29db9 100644 --- a/http/js/iznik/views/signinup.js +++ b/http/js/iznik/views/signinup.js @@ -120,9 +120,15 @@ define([ }, success: function (ret) { if (ret.ret == 0) { - // We're logged in. Reload this page, and now that we are logged in the route - // should behave differently. - Router.mobileReload(); // CC + // We're logged in. Force a test login, which will refresh any locally cached session. + self.listenToOnce(Iznik.Session, 'isLoggedIn', function() { + // Reload this page, and now that we are logged in the route + // should behave differently. + Router.mobileReload(); // CC + // CC window.location.reload(); + }); + + Iznik.Session.testLoggedIn(true); } else if (parseInt(ret.ret) == 2) { self.$('.js-unknown').fadeIn('slow'); } else { @@ -154,9 +160,15 @@ define([ }, success: function (ret) { if (parseInt(ret.ret) == 0) { - // We're logged in. Reload this page, and now that we are logged in the route - // should behave differently. - Router.mobileReload(); // CC + // We're logged in. Force a test login, which will refresh any locally cached session. + self.listenToOnce(Iznik.Session, 'isLoggedIn', function() { + // Reload this page, and now that we are logged in the route + // should behave differently. + Router.mobileReload(); // CC + // CC window.location.reload(); + }); + + Iznik.Session.testLoggedIn(true); } else { self.$('.js-signuperror .js-errmsg').html(ret.status); self.$('.js-signuperror').fadeIn('slow'); diff --git a/http/js/iznik/views/teams.js b/http/js/iznik/views/teams.js index 7b37b0e91..f601a6599 100644 --- a/http/js/iznik/views/teams.js +++ b/http/js/iznik/views/teams.js @@ -29,7 +29,6 @@ define([ var p = Iznik.View.prototype.render.call(this); p.then(function() { - console.log() if (Iznik.Session.hasPermission('Teams')) { self.$('.js-teamadmin').show(); } @@ -121,6 +120,7 @@ define([ var self = this; var name = self.$('.js-teamname').val(); + var email = self.$('.js-teamemail').val(); var desc = self.$('.js-teamdesc').val(); var c = new Iznik.Collections.Team(); @@ -128,6 +128,7 @@ define([ c.create({ name: name, + email: email, description: desc }, { wait: true diff --git a/http/js/iznik/views/user/message.js b/http/js/iznik/views/user/message.js index 6fbc08955..88e1f2ab0 100644 --- a/http/js/iznik/views/user/message.js +++ b/http/js/iznik/views/user/message.js @@ -176,10 +176,18 @@ define([ self.unread += thisun; if (thisun > 0) { - // This chat might indicate a new replier we've not got listed. Get the replies - // to make sure. - // TODO Could make this perform better than doing a full fetch. - fetch = true; + // This chat might indicate a new replier we've not got listed. + var foundchat = false; + _.each(self.model.get('replies'), function(reply) { + if (reply.chatid == chat.get('id')) { + foundchat = true; + } + }) + + if (!foundchat) { + // Refetch the message to update the replies. + fetch = true; + } } } }); @@ -868,7 +876,15 @@ define([ // If the number of unseen messages in this chat changes, update this view so that the count is // displayed here. self.listenToOnce(self.chat, 'change:unseen', self.render); - Iznik.View.Timeago.prototype.render.call(self); + Iznik.View.Timeago.prototype.render.call(self).then(function() { + self.ratings = new Iznik.Views.User.Ratings({ + model: new Iznik.Models.ModTools.User(self.model.get('user')) + }); + + self.ratings.render(); + self.$('.js-ratings').html(self.ratings.$el); + // console.log("Rendered", self.$('.js-ratings'), self.ratings.$el); + }); // We might promise to this person from a chat. self.listenTo(self.chat, 'promised', _.bind(self.chatPromised, self)); @@ -876,32 +892,41 @@ define([ } }, - render: function () { - var self = this; + rendered: 0, - self.model.set('me', Iznik.Session.get('me')); - self.model.set('message', self.options.message.toJSON2()); + render: function() { + var self = this; - var chat = Iznik.Session.chats.get({ - id: self.model.get('chatid') - }); + self.rendered++; var p; - // We might not find this chat, most commonly if we've not yet fetched it from the server and it's in - // our cache. If not, fetch it. - if (!_.isUndefined(chat)) { - self.chat = chat; + if (self.rendered > 1) { + console.log("Render loop"); console.trace(); p = Iznik.resolvedPromise(self); } else { - self.chat = new Iznik.Models.Chat.Room({ + self.model.set('me', Iznik.Session.get('me')); + self.model.set('message', self.options.message.toJSON2()); + + var chat = Iznik.Session.chats.get({ id: self.model.get('chatid') }); - p = self.chat.fetch(); - } + // We might not find this chat, most commonly if we've not yet fetched it from the server and it's in + // our cache. If not, fetch it. + if (!_.isUndefined(chat)) { + self.chat = chat; + p = Iznik.resolvedPromise(self); + } else { + self.chat = new Iznik.Models.Chat.Room({ + id: self.model.get('chatid') + }); + + p = self.chat.fetch(); + } - p.then(_.bind(self.gotChat, self)); + p.then(_.bind(self.gotChat, self)); + } return(p); } diff --git a/http/js/iznik/views/user/user.js b/http/js/iznik/views/user/user.js index c2bcf997c..d440d9c98 100644 --- a/http/js/iznik/views/user/user.js +++ b/http/js/iznik/views/user/user.js @@ -1200,6 +1200,20 @@ define([ if (Iznik.Session.get('me').id != self.model.get('id')) { self.$('.js-dm').show(); } + + self.ratings1 = new Iznik.Views.User.Ratings({ + model: self.model + }); + + self.ratings1.render(); + self.$('.js-ratings1').html(self.ratings1.$el); + + self.ratings2 = new Iznik.Views.User.Ratings({ + model: self.model + }); + + self.ratings2.render(); + self.$('.js-ratings2').html(self.ratings2.$el); }) }); @@ -1207,6 +1221,48 @@ define([ } }) + Iznik.Views.User.Ratings = Iznik.View.extend({ + template: 'user_ratings', + + tagName: 'span', + + className: 'padtopsm', + + events: { + 'click .js-up': 'up', + 'click .js-down': 'down' + }, + + rate: function(rating) { + var self = this; + + var m = new Iznik.Models.ModTools.User({ + id: self.model.get('id') + }); + + self.$el.addClass('faded'); + + m.rate(rating).then(function() { + self.model.fetch({ + data: { + info: true + } + }).then(function () { + self.render(); + self.$el.removeClass('faded'); + }) + }); + }, + + up: function() { + this.rate('Up'); + }, + + down: function() { + this.rate('Down'); + } + }); + Iznik.Views.User.TellAboutMe = Iznik.Views.Modal.extend({ template: 'user_tellaboutme', @@ -1217,7 +1273,12 @@ define([ save: function() { var self = this; - Iznik.Session.saveAboutMe(self.$('.js-aboutme').val()).then(function() { + var msg = self.$('.js-aboutme').val(); + msg = twemoji.replace(msg, function(emoji) { + return '\\\\u' + twemoji.convert.toCodePoint(emoji) + '\\\\u'; + }); + + Iznik.Session.saveAboutMe(msg).then(function() { Iznik.Session.testLoggedIn(true); self.close(); }); @@ -1232,7 +1293,8 @@ define([ var aboutme = Iznik.Session.get('me').aboutme; if (aboutme) { - self.$('.js-aboutme').val(aboutme.text); + var msg = Iznik.twem(aboutme.text); + self.$('.js-aboutme').val(msg); } }); diff --git a/http/template/chat/interested.html b/http/template/chat/interested.html index 9e5dfa3da..036300d8f 100644 --- a/http/template/chat/interested.html +++ b/http/template/chat/interested.html @@ -11,7 +11,7 @@
-
+
<% if (obj.user) { %> <% if (refmsg.mine) { %> diff --git a/http/template/chat/page/pane.html b/http/template/chat/page/pane.html index 16b742681..f82ae573d 100644 --- a/http/template/chat/page/pane.html +++ b/http/template/chat/page/pane.html @@ -1,6 +1,25 @@ -
-
-
+
+
+
+ <% if (chattype == 'User2User' || chattype == 'User2Mod') { %> + {{name}} + <% } else { %> + {{name}} + <% } %> +