1
0
mirror of https://github.com/nerzhul/ocsms.git synced 2025-06-07 07:56:23 +00:00

Packaging fixes

This commit is contained in:
Loic Blot 2018-11-12 13:43:10 +01:00
parent 9fb88ff7e6
commit cfcf2f8c57
No known key found for this signature in database
GPG Key ID: EFAA458E8C153987
3 changed files with 9 additions and 3 deletions

View File

@ -1,9 +1,15 @@
let gulp = require("gulp");
let concat = require('gulp-concat');
let rename = require("gulp-rename");
let uglify = require('gulp-uglify-es').default;
gulp.task("uglify", function () {
return gulp.src("js/devel/*.js")
return gulp.src("js/devel/app.js")
.pipe(concat('js/devel/settings.js'))
.pipe(concat('js/devel/contactlist.js'))
.pipe(concat('js/devel/conversation.js'))
.pipe(concat('js/devel/helpers.js'))
.pipe(concat('js/devel/notifications.js'))
.pipe(rename("app.min.js"))
.pipe(uglify(/* options */))
.pipe(gulp.dest("js/"));

2
js/app.min.js vendored
View File

@ -1 +1 @@
var SmsSettings=new Vue({el:"#app-settings",data:{messageLimit:100,enableNotifications:!0,contactOrderBy:"lastmsg",reverseContactOrder:!0,country:""},created:function(){var t=this;$.getJSON(Sms.generateURL("/front-api/v1/settings"),function(e,n){!0===e.status&&(t.messageLimit=parseInt(e.message_limit),t.enableNotifications=0!==parseInt(e.notification_state)?1:0,t.contactOrderBy=e.contact_order,t.reverseContactOrder=toBool(e.contact_order_reverse),t.country=e.country)})},methods:{sendMessageLimit:function(){if(null!==this.messageLimit){$.post(Sms.generateURL("/set/msglimit"),{limit:this.messageLimit})}},sendNotificationFlag:function(){$.post(Sms.generateURL("/set/notification_state"),{notification:parseInt(this.enableNotifications)})},sendContactOrder:function(){$.post(Sms.generateURL("/set/contact_order"),{attribute:this.contactOrderBy,reverse:this.reverseContactOrder})},sendCountry:function(){$.post(Sms.generateURL("/set/country"),{country:this.country})},wipeAllMessages:function(){$.post(Sms.generateURL("/front-api/v1/delete/all"),{},function(){ContactList.reset(),Conversation.clear()})},isContactListEmpty:function(){return 0===ContactList.contacts.length}}});
var Sms={selectedConversation:null,unreadCountCurrentConv:0,unreadCountNotifStep:12,lastContactListMsgDate:0,originalTitle:document.title,photoVersion:1,_winRegexp:/(.*)\/ocsms.*/,generateURL:function(e){var t=this._winRegexp.exec(window.location.href);return 2!==t.length&&console.log("A very bad error happened when parsing window location"),t[1]+"/ocsms"+e},selectConversation:function(e){"undefined"!==e&&null!=e&&(null!=this.selectedConversation&&this.selectedConversation.parent().removeClass("selected"),this.selectedConversation=e,this.selectedConversation.parent().addClass("selected"),this.selectedConversation.css("font-weight","normal"),this.selectedConversation.html(this.selectedConversation.attr("mailbox-label")))}},ContactRenderer={generateColor:function(e){if(void 0===e)return"";if("function"==typeof e.toHsl){var t=e.toHsl();return"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"}var n=md5(e).substring(0,4),o=parseInt("ffff",16);return"hsl("+parseInt(n,16)/o*256+", 90%, 65%)"},generateFirstCharacter:function(e){return"string"!=typeof e?"?":"+"===e.charAt(0)?"#":e.charAt(0)}};$.urlParam=function(e){var t=new RegExp("[?&]"+e+"=([^&#]*)").exec(window.location.href);return null==t?null:t[1]||0},Vue.filter("firstCharacter",ContactRenderer.generateFirstCharacter);const Dialog=Vue.extend({template:"#modal-template"});Vue.directive("confirm",{bind(e,t,n){const o=t.value[1],r=t.value[0];e.handleClick=(e=>{const t={doYes:function(){o(),t.show=!1},show:!0,bodyMessage:r};let n=new Dialog({data:t}).$mount();document.getElementById("app").appendChild(n.$el)}),e.addEventListener("click",e.handleClick)},unbind(e){e.removeEventListener("click",e.handleClick)}}),jQuery,OC,window.onfocus=function(){Sms.unreadCountCurrentConv=0,document.title=Sms.originalTitle};

View File

@ -12,7 +12,7 @@ use \OCA\OcSms\Lib\CountryCodes;
//\OCP\Util::addScript('ocsms', 'devel/conversation');
//\OCP\Util::addScript('ocsms', 'devel/helpers');
//\OCP\Util::addScript('ocsms', 'devel/notifications');
//\OCP\Util::addStyle('ocsms', 'style');
\OCP\Util::addStyle('ocsms', 'style');
?>
<script type="text/x-template" id="modal-template" xmlns:v-on="http://www.w3.org/1999/xhtml"