From a4302dc3c23bda7265c477d8f1c5185be4eadf22 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 22 Jul 2012 00:06:11 -0400 Subject: text enabled by default is bad --- static/js/pichat2.js | 6 +++--- static/js/src/palette-manual.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/static/js/pichat2.js b/static/js/pichat2.js index 53e7b13..8247492 100644 --- a/static/js/pichat2.js +++ b/static/js/pichat2.js @@ -1456,9 +1456,9 @@ if(!manPaletteOpen) { // ohgod - checkbox to hide the userlist $(function(){ - $('#textbutton input').attr('checked', true); - TextEnabled = true; - setTextEnable.apply($('#textbutton input')[0]); +// $('#textbutton input').attr('checked', true); +// TextEnabled = true; +// setTextEnable.apply($('#textbutton input')[0]); $('
').prependTo('#chatbuttons'); $('#showulist').change(function(){ $('#userList').toggle( this.checked ); }); }); diff --git a/static/js/src/palette-manual.js b/static/js/src/palette-manual.js index edf8f15..1d735e7 100644 --- a/static/js/src/palette-manual.js +++ b/static/js/src/palette-manual.js @@ -210,9 +210,9 @@ if(!manPaletteOpen) { // ohgod - checkbox to hide the userlist $(function(){ - $('#textbutton input').attr('checked', true); - TextEnabled = true; - setTextEnable.apply($('#textbutton input')[0]); +// $('#textbutton input').attr('checked', true); +// TextEnabled = true; +// setTextEnable.apply($('#textbutton input')[0]); $('
').prependTo('#chatbuttons'); $('#showulist').change(function(){ $('#userList').toggle( this.checked ); }); }); -- cgit v1.2.3-70-g09d2 From c640394a1eef9d24bd10d766a7ef44953b257df0 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 22 Jul 2012 00:06:56 -0400 Subject: Merge --- static/js/pichat.js | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 115 insertions(+), 2 deletions(-) diff --git a/static/js/pichat.js b/static/js/pichat.js index 1f1cf43..8247492 100644 --- a/static/js/pichat.js +++ b/static/js/pichat.js @@ -1247,6 +1247,11 @@ function setupUpload(elementId, roomKey) { // manual fave palette by ohgod $(function(){ $('#manual-palette-button').click(manPaletteToggle); + $('#manual-add-url-txt').keyup(ifEnter(function(){ + addManualFav($('#manual-add-url-txt').val().trim()); + $('#manual-add-url-txt').val(""); + })); +/* $('#manual-add-button').click(function () { addManualFav($('#manual-add-url-txt').val().trim()); $('#manual-add-url-txt').val(""); @@ -1255,6 +1260,7 @@ $(function(){ removeManualFav($('#manual-add-url-txt').val().trim()); $('#manual-add-url-txt').val(""); }); +*/ }); var manPaletteOpen = false; @@ -1313,6 +1319,7 @@ function setManualFaves(mfavs) { localStorage.manual_favs = JSON.stringify(mfavs); }; +/* function manualPaletteBuildImageThumbs() { var imgs = JSON.parse(localStorage.manual_favs); if (imgs && imgs.length != 0) { @@ -1321,6 +1328,7 @@ function manualPaletteBuildImageThumbs() { } } }; +*/ function addManualFav(url) { if (!url) return; @@ -1331,7 +1339,8 @@ function addManualFav(url) { if ($.inArray(url, mfavs) == -1) { mfavs.push(url); setManualFaves(mfavs); - $("#manual-palette-thumbs").append(""); + manualPaletteBuildImageThumbs(); + // $("#manual-palette-thumbs").append(""); } } }; @@ -1343,7 +1352,6 @@ function removeManualFav(url) { if (idx != -1) { mfavs.splice(idx, 1); setManualFaves(mfavs); - $("#manual-palette-thumbs").html(""); manualPaletteBuildImageThumbs(); } } @@ -1351,6 +1359,111 @@ function removeManualFav(url) { +// textchimp autocomplete mod + +function manualPaletteBuildImageThumbs() { + $("#manual-palette-thumbs").html(""); + var imgs = JSON.parse(localStorage.manual_favs); + if (imgs && imgs.length != 0) { + for (var i = 0; i < imgs.length; i++) { + $("#manual-palette-thumbs").append('\ +
\ + \ +
'); + } + + var test_tags = ["dogs", "text", "funny", "disturbing"]; + $('.taginput').autocomplete({ + source: test_tags, + open: function(){ + $(this).autocomplete('widget').css({'z-index': '55555555555', 'background-color': '#EFF5FB', 'width': '128px'}); + return false; + } + }); + + + + + $('.taginput').blur(function(e){ if(!$('.ui-autocomplete').is(':visible') ) { $(e.target).parent().hide(); } }); + + $('.taginput').keypress(function(e) { if(e.charCode == 13) { add_tags(e.target); } }); + + $('.mm').hover( + function(){ $(this).children(".menuicon").show(); }, + function(){ + if(!$(this).children('.menuicon').children('.tagin').is(':visible')) { + $(this).children(".menuicon").hide(); + } + }); + + $('.menuicon').hover( + function(){ + if(!$(this).children('.tagin').is(':visible')) { + $(this).css('opacity', '1.0'); + $(this).children('.mymenu').slideDown(100); + } + }, + function(){ + if(!$(this).children('.tagin').is(':visible')) { + $(this).css('opacity', '0.7'); + $(this).children('.tagin').hide(); + $(this).children('.mymenu').slideUp(100); + } + } + ); + + $("").appendTo("head"); + + $('.mymenu li').css({ + 'background-color': '#eee', + 'margin': '1px', + 'padding-left': '2px', + 'cursor': 'pointer', + 'font-size': '10pt' + }); + + + } +} + +function showtaginput(e) { + $(e).parent().hide(); + $(e).parent().next().show(); + $(e).parent().next().children('.taginput').focus(); +} + +function delfav(e) { + console.log($(e).parents('.mm').children('img').attr('src')); + removeManualFav($(e).parents('.mm').children('img').attr('src')); +} + +function add_tags(e) { + console.log('tags: ' + $(e).val() + '(for: ' + $(e).parents('.mm').children('img').attr('src') + ')'); + $(e).parent().hide(); +} + +/* +if(!manPaletteOpen) { + manPaletteToggle(); +} +*/ + +// ohgod - checkbox to hide the userlist +$(function(){ +// $('#textbutton input').attr('checked', true); +// TextEnabled = true; +// setTextEnable.apply($('#textbutton input')[0]); + $('
').prependTo('#chatbuttons'); + $('#showulist').change(function(){ $('#userList').toggle( this.checked ); }); +}); + + function paletteToChat(img){ var chatText = $("#msgInput").val() if (chatText.length && chatText[chatText.length - 1] != " ") -- cgit v1.2.3-70-g09d2