diff --git a/inc/instance-config.php b/inc/instance-config.php index 4d463751..a2dad456 100644 --- a/inc/instance-config.php +++ b/inc/instance-config.php @@ -116,6 +116,7 @@ $config['additional_javascript'][] = 'js/auto-reload.js'; $config['additional_javascript'][] = 'js/options/user-css.js'; $config['additional_javascript'][] = 'js/options/user-js.js'; + $config['additional_javascript'][] = 'js/options/fav.js'; $config['additional_javascript'][] = 'js/forced-anon.js'; $config['additional_javascript'][] = 'js/toggle-locked-threads.js'; $config['additional_javascript'][] = 'js/toggle-images.js'; @@ -152,7 +153,7 @@ $config['additional_javascript'][] = 'js/wPaint/plugins/file/wPaint.menu.main.file.min.js'; $config['additional_javascript'][] = 'js/wpaint.js'; // Code tags (fix because we no longer have different scripts for each board) - $config['additional_javascript'][] = 'js/code_tags/run_prettify.js'; + //$config['additional_javascript'][] = 'js/code_tags/run_prettify.js'; //$config['font_awesome_css'] = '/netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css'; diff --git a/js/auto-reload.js b/js/auto-reload.js index fd78181e..a976a019 100644 --- a/js/auto-reload.js +++ b/js/auto-reload.js @@ -38,7 +38,7 @@ $(document).ready(function(){ localStorage.auto_thread_update = 'true'; //default value } if (window.Options && Options.get_tab('general')) { - Options.extend_tab("general", "
"+_("Auto update")+"" + Options.extend_tab("general", "
"+_("Auto update")+"" + ('') + ('') + ('') diff --git a/js/auto-scroll.js b/js/auto-scroll.js index b8343f5e..5c253499 100644 --- a/js/auto-scroll.js +++ b/js/auto-scroll.js @@ -1,7 +1,7 @@ $('document').ready(function () { var autoScroll = localStorage['autoScroll'] ? true : false; if (window.Options && Options.get_tab('general')){ - Options.extend_tab('general',''); + $('#auto-update-fs').append(''); $('#autoScroll').find('input').prop('checked', autoScroll); } $('#autoScroll').on('change', function() { @@ -15,7 +15,7 @@ $('document').ready(function () { $('input.auto-scroll').prop('checked', autoScroll); }); if (active_page == 'thread') { - $('span[id="updater"]').children('a').after(' ( Scroll to New posts)'); + $('span[id="updater"]').children('a').after(' ( '+_('Scroll to new posts')+')'); $('input.auto-scroll').prop('checked', autoScroll); $(document).on('new_post', function (e, post) { if ($('input.auto-scroll').prop('checked')) diff --git a/js/options/fav.js b/js/options/fav.js new file mode 100644 index 00000000..17ccb337 --- /dev/null +++ b/js/options/fav.js @@ -0,0 +1,72 @@ +$(document).ready(function(){ +//Creating functions +var generateList = function(){ + var favStor = []; + for(var i=1; i div:nth-child("+i+")").html()); + } + return favStor; +} //This will generate a list of boards based off of the list on the screen +function removeBoard(boardNumber){ + favorites.splice(boardNumber, 1); + localStorage.favorites = JSON.stringify(favorites); + $("#sortable > div:nth-child("+(boardNumber+1)+")").remove(); + $("#minusList > div:nth-child("+(favorites.length+1)+")").remove(); + add_favorites(); +} //This removes a board from favorites, localStorage.favorites and the page +function addBoard(){ + $("#sortable").append("
"+($("#plusBox").val())+"
"); + $("#minusList").append( $('
-
').on('click', function(e){removeBoard($(this).data('board'));}) ); + favorites.push($("#plusBox").val()); + localStorage.favorites = JSON.stringify(favorites); + $("#plusBox").val(""); //Removing text from textbox + add_favorites(); +} //This adds the text inside the textbox to favorites, localStorage.favorites and the page + +var favorites = JSON.parse(localStorage.favorites); +Options.add_tab('fav-tab','star',_("Favorites")); + +//Pregenerating list of boards +var favList = $('
'); +for(var i=0; i'+favorites[i]+'
') ); +} + +//Creating list of minus symbols to remove unwanted boards +var minusList = $('
'); +for(var i=0; i-
').on('click', function(e){removeBoard($(this).data('board'));}) ); +} + +//Help message so people understand how sorting boards works +$(""+_("Drag the boards to sort them.")+"

").appendTo(Options.get_tab('fav-tab').content); + +//Adding list of boards and minus symbols to remove boards with +$(minusList).appendTo(Options.get_tab('fav-tab').content); //Adding the list of minus symbols to the tab +$(favList).appendTo(Options.get_tab('fav-tab').content); //Adding the list of favorite boards to the tab + +//Adding spacing and text box to right boards into +var addDiv = $("
"); + +var plusBox = $("").appendTo(addDiv); +plusBox.keydown(function( event ) { + if(event.keyCode == 13){ + $("#plus").click(); + } +}); + +//Adding plus symbol to use to add board +$("
+
").css({ + cursor: "pointer", + color: "#0000FF" +}).on('click', function(e){addBoard()}).appendTo(addDiv); + +addDiv.appendTo(Options.get_tab('fav-tab').content); //Adding the plus button + +favList.sortable(); //Making boards with sortable id use the sortable jquery function +favList.on('sortstop', function() { + favorites = generateList(); + localStorage.favorites = JSON.stringify(favorites); + add_favorites(); +}); +}); diff --git a/stylesheets/style.css b/stylesheets/style.css index 15b38ab8..8410754d 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -1177,3 +1177,7 @@ div.mix { display: none !important; } } + +#youtube-size input { + width: 50px; +}