diff --git a/css/glowingbear.css b/css/glowingbear.css index 46e1243..a7150a5 100644 --- a/css/glowingbear.css +++ b/css/glowingbear.css @@ -84,6 +84,25 @@ input[type=text], input[type=password], #sendMessage { margin-bottom: 5px !important; } +.btn-send-image { + position: relative; + overflow: hidden; + cursor: pointer; +} + +.imgur-upload { + position: absolute; + bottom: 0; + right: 0; + cursor: inherit; + font-size: 1000px !important; + height: 300px; + margin: 0; + padding: 0; + opacity: 0; + filter: ~"alpha(opacity=0)"; +} + .input-group { width: 100%; } diff --git a/directives/input.html b/directives/input.html index 26656fd..01b574a 100644 --- a/directives/input.html +++ b/directives/input.html @@ -3,7 +3,10 @@ - + diff --git a/js/inputbar.js b/js/inputbar.js index e57144a..6610017 100644 --- a/js/inputbar.js +++ b/js/inputbar.js @@ -14,11 +14,12 @@ weechat.directive('inputBar', function() { command: '=command' }, - controller: ['$rootScope', '$scope', '$element', '$log', 'connection', 'models', 'IrcUtils', 'settings', function($rootScope, + controller: ['$rootScope', '$scope', '$element', '$log', 'connection', 'imgur', 'models', 'IrcUtils', 'settings', function($rootScope, $scope, $element, //XXX do we need this? don't seem to be using it $log, connection, //XXX we should eliminate this dependency and use signals instead + imgur, models, IrcUtils, settings) { @@ -69,6 +70,13 @@ weechat.directive('inputBar', function() { }, 0); }; + $scope.uploadImage = function( $event, files ) { + // Get file + var file = files[0]; + + // Process image + imgur.process(file); + }; // Send the message to the websocket $scope.sendMessage = function() {