diff --git a/src/content/lang/en.json b/src/content/lang/en.json index c5f0763..08f9f92 100644 --- a/src/content/lang/en.json +++ b/src/content/lang/en.json @@ -8,8 +8,6 @@ "author_url": "http://www.mytinytodo.net" }, "My Tiny Todolist": "My Tiny Todolist", - "desktop_version": "Desktop version", - "mobile_version": "Mobile version", "powered_by": "Powered by", "htab_newtask": "New task", "htab_search": "Search", diff --git a/src/content/lang/ru.json b/src/content/lang/ru.json index fd4b2d0..29cf0fc 100644 --- a/src/content/lang/ru.json +++ b/src/content/lang/ru.json @@ -8,8 +8,6 @@ "author_url": "http://www.mytinytodo.net" }, "My Tiny Todolist": "My Tiny Todolist", - "desktop_version": "Версия для компьютера", - "mobile_version": "Мобильная версия", "powered_by": "Работает на", "htab_newtask": "Новая задача", "htab_search": "Поиск", diff --git a/src/content/themes/default/index.php b/src/content/themes/default/index.php index c79ec50..083af64 100644 --- a/src/content/themes/default/index.php +++ b/src/content/themes/default/index.php @@ -1,29 +1,25 @@ - - + + - -<?php mttinfo('title'); ?> - - - - - - - - - + + + <?php mttinfo('title'); ?> + + + + + + rtl()) echo 'dir="rtl"'; ?>> + - - - @@ -285,11 +279,6 @@ $().ready(function(){ diff --git a/src/content/themes/default/mobile.css b/src/content/themes/default/mobile.css deleted file mode 100644 index 4614c9d..0000000 --- a/src/content/themes/default/mobile.css +++ /dev/null @@ -1,66 +0,0 @@ -/* - This file is a part of myTinyTodo. - Copyright 2009-2010,2020 Max Pozdeev -*/ - -html { font-size:100%; } -body { margin:0px; font-size:100%; } -h2 { margin:0; margin-bottom:2px; font-size:1rem; } - -#body { margin-left:1px; margin-right:1px; padding:1px; padding-bottom:12px;} -#bar_login, #bar_logout { padding-right:1px; } - -.mtt-img-button { padding:4px; } -.mtt-menu-button { padding:4px; } - -#tabs ul { margin-top:0px; } -#tabs ul li { width:70px; margin-right: 1px; } -.mtt-tabs-add-button { padding-left:0.4rem; padding-right:0.4rem; } - -#task { padding:5px; padding-right:18px; margin-left:-22px; } -#task_placeholder span { padding:6px; } - -.searchbox-c { width:30%; max-width:190px; } -#toolbar.mtt-intask .searchbox-c { display:none; } -#toolbar.mtt-insearch .taskbox-c { display:none; } -#toolbar.mtt-insearch .searchbox-c { width:100%; max-width:100%; } -#search { padding:5px 20px; border-radius:15px; } - -#tasklist li { padding:0px 3px; } -.task-actions { display:none; } -.task-date { display:none; } -.task-note-actions { display:block; padding-top:8px; } -.task-note-block { margin-left:0px; border-left:1px solid #777777; background:none; padding-left:4px; display:none; } -body[dir="rtl"] .task-note-block { border-left:none; border-right:1px solid #777777; padding-left:0; padding-right:4px; } -.task-note-area textarea { width:95%; } - -#tasklist li .task-through { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; } -#tasklist li:hover { background-color:#ffffff; } -#tasklist li.task-expanded .task-note-block { display:none; } -#tasklist li.clicked { background-color:#f6f6f6; } -#tasklist li.clicked .task-actions { display:block; } -#tasklist li.clicked .task-through { white-space:normal; display:inline; } -#tasklist li.clicked.task-has-note .task-note-block { display:block; } -#tasklist li.clicked.doubleclicked.task-has-note .task-note-block { display:none; } -.task-toggle { display:none; } -#tasklist .mtt-task-placeholder { line-height:1rem; padding-top:0.6rem; padding-bottom:0.6rem; } -#tasklist .ui-sortable-helper { box-shadow:0px 0px 3px #333; } - -#page_taskedit { max-width:99.5%; border:none; position:static; padding:0; } -#page_taskedit .form-table { width:100%; } -#page_taskedit .form-row .in500 { color:#444444; } -#page_taskedit .form-row textarea { height: 70px; } - -#loading { padding:0px; padding-top:1px; padding-right:1px; height:16px; overflow:hidden; } - -#tagcloud { max-width:100%; margin:0px 5px 5px 5px; } -.mtt-settings-table .in350 { min-width:50px; } -.mtt-notes-showhide { display:none; } - -#footer_content { padding:0.7rem 0.35rem; } - -.mtt-menu-container li { padding-top:0.3rem; padding-bottom:0.3rem; } -#slmenucontainer { max-width:100vw; } -#slmenucontainer a { overflow:hidden; text-overflow:ellipsis; } -#cmenulistscontainer { max-width:100vw; } -#cmenulistscontainer li { overflow:hidden; text-overflow:ellipsis; } diff --git a/src/content/themes/default/print.css b/src/content/themes/default/print.css index 4395838..a373781 100644 --- a/src/content/themes/default/print.css +++ b/src/content/themes/default/print.css @@ -34,7 +34,6 @@ li.task-completed { opacity:1; } #footer_content { border-top:1px solid #777777; background:none; } #footer_content a { text-decoration:none; color:#000000; } -#mobileordesktop { display: none; } #tagcloudbtn { display:none; } .mtt-notes-showhide { display:none; } diff --git a/src/content/themes/default/style.css b/src/content/themes/default/style.css index 32844e1..4bdf431 100644 --- a/src/content/themes/default/style.css +++ b/src/content/themes/default/style.css @@ -67,8 +67,6 @@ a { color:#0000ff; cursor:pointer; text-decoration:underline; } .mtt-tab.mtt-tabs-selected { border-color:transparent; background-color:#ededed; } .mtt-tab:hover { background-color:#ddd; } .mtt-tab.mtt-tabs-selected:hover { background-color:#ededed; } -.mtt-tabs.mtt-tabs-only-one li { display:none; } -.mtt-tabs.mtt-tabs-only-one li.mtt-tabs-selected { display:block; } .mtt-tabs-hidden { display:none; } .mtt-tabs .mtt-list-sort-placeholder { background-color:#ddd; border:1px solid #aaa; } @@ -378,3 +376,73 @@ li.mtt-item-hidden { display:none; } .mtt-settings-table select { padding:2px; border:1px solid #ccc; border-radius:2px; } .mtt-settings-table .form-bottom-buttons input { padding:4px; border:1px solid #ccc; border-radius:3px; background-color:#efefef; margin:2px; } .mtt-settings-table input:focus, .mtt-settings-table select:focus { outline:none; border-color:#5a8df0; box-shadow:0 0 0 2px rgba(90,141,240,0.7); } + +@media only screen and (max-width: 600px) { + + html { font-size:100%; } + body { font-size:100%; } + h2 { margin:0; margin-bottom:2px; font-size:1rem; } + + #body { margin-left:1px; margin-right:1px; padding:1px; padding-bottom:12px;} + #bar_login, #bar_logout { padding-right:1px; } + + .mtt-img-button { padding:4px; } + .mtt-menu-button { padding:4px; } + + #tabs ul { margin-top:0px; } + #tabs ul li { width:70px; margin-right: 1px; } + .mtt-tabs-add-button { padding-left:0.4rem; padding-right:0.4rem; } + + /* singletab */ + .mtt-tabs li { display:none; } + .mtt-tabs li.mtt-tabs-selected { display:block; } + + #task { padding:5px; padding-right:18px; margin-left:-22px; } + #task_placeholder span { padding:6px; } + + .searchbox-c { width:30%; max-width:190px; } + #toolbar.mtt-intask .searchbox-c { display:none; } + #toolbar.mtt-insearch .taskbox-c { display:none; } + #toolbar.mtt-insearch .searchbox-c { width:100%; max-width:100%; } + #search { padding:5px 20px; border-radius:15px; } + + #tasklist li { padding:0px 3px; } + .task-actions { display:none; } + .task-date { display:none; } + .task-note-actions { display:block; padding-top:8px; } + .task-note-block { margin-left:0px; border-left:1px solid #777777; background:none; padding-left:4px; display:none; } + body[dir="rtl"] .task-note-block { border-left:none; border-right:1px solid #777777; padding-left:0; padding-right:4px; } + .task-note-area textarea { width:95%; } + + #tasklist li .task-through { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; } + #tasklist li:hover { background-color:#ffffff; } + #tasklist li.task-expanded .task-note-block { display:none; } + #tasklist li.clicked { background-color:#f6f6f6; } + #tasklist li.clicked .task-actions { display:block; } + #tasklist li.clicked .task-through { white-space:normal; display:inline; } + #tasklist li.clicked.task-has-note .task-note-block { display:block; } + #tasklist li.clicked.doubleclicked.task-has-note .task-note-block { display:none; } + .task-toggle { display:none; } + #tasklist .mtt-task-placeholder { line-height:1rem; padding-top:0.6rem; padding-bottom:0.6rem; } + #tasklist .ui-sortable-helper { box-shadow:0px 0px 3px #333; } + + #page_taskedit { max-width:99.5%; border:none; position:static; padding:0; } + #page_taskedit .form-table { width:100%; } + #page_taskedit .form-row .in500 { color:#444444; } + #page_taskedit .form-row textarea { height: 70px; } + + #loading { padding:0px; padding-top:1px; padding-right:1px; height:16px; overflow:hidden; } + + #tagcloud { max-width:100%; margin:0px 5px 5px 5px; } + .mtt-settings-table .in350 { min-width:50px; } + .mtt-notes-showhide { display:none; } + + #footer_content { padding:0.7rem 0.35rem; } + + .mtt-menu-container li { padding-top:0.3rem; padding-bottom:0.3rem; } + #slmenucontainer { max-width:100vw; } + #slmenucontainer a { overflow:hidden; text-overflow:ellipsis; } + #cmenulistscontainer { max-width:100vw; } + #cmenulistscontainer li { overflow:hidden; text-overflow:ellipsis; } + +} /* end of @media min 600px */ diff --git a/src/includes/mytinytodo.js b/src/includes/mytinytodo.js index 0a9b042..06b40cc 100644 --- a/src/includes/mytinytodo.js +++ b/src/includes/mytinytodo.js @@ -53,7 +53,6 @@ var mytinytodo = window.mytinytodo = _mtt = { options: { title: '', openList: 0, - singletab: false, autotag: false, instantSearch: true, tagPreview: true, @@ -130,6 +129,9 @@ var mytinytodo = window.mytinytodo = _mtt = { else { this.homeUrl = this.mttUrl; } + if ( ! options.hasOwnProperty('touchDevice') ) { + this.options.touchDevice = ('ontouchend' in document); + } jQuery.extend(this.options, options); @@ -137,7 +139,6 @@ var mytinytodo = window.mytinytodo = _mtt = { flag.isLogged = options.isLogged ? true : false; if(this.options.showdate) $('#page_tasks').addClass('show-inline-date'); - if(this.options.singletab) $('#lists .mtt-tabs').addClass('mtt-tabs-only-one'); // handlers $('.mtt-tabs-add-button').click(function(){ @@ -145,11 +146,6 @@ var mytinytodo = window.mytinytodo = _mtt = { }); $('.mtt-tabs-select-button').click(function(event){ - if(event.metaKey || event.ctrlKey) { - // toggle singetab interface - _mtt.applySingletab(!_mtt.options.singletab); - return false; - } if(!_mtt.menus.selectlist) _mtt.menus.selectlist = new mttMenu('slmenucontainer', {onclick:slmenuSelect, adjustWidth:true, alignRight:true}); _mtt.menus.selectlist.show(this); }); @@ -490,16 +486,6 @@ var mytinytodo = window.mytinytodo = _mtt = { cursor: 'grabbing' }); - if (options.touchDevice) { - $("#tasklist").disableSelection(); - $("#tasklist").sortable('option', { - axis: 'y', - delay: 0, - cancel: 'input', - distance: 0 - }); - $('#cmenu_note').hide(); - } $("#lists ul").sortable({ delay:150, @@ -508,7 +494,18 @@ var mytinytodo = window.mytinytodo = _mtt = { cursor: 'grabbing' }); - this.applySingletab(); + + if (this.options.touchDevice) { + $("#tasklist").disableSelection(); + $("#tasklist").sortable('option', { + axis: 'y', + delay: 0, + cancel: 'input', + distance: 0 + }); + $('#cmenu_note').hide(); + $("#lists ul").sortable('disable'); + } // AJAX Errors @@ -757,20 +754,6 @@ var mytinytodo = window.mytinytodo = _mtt = { if (this.pages.current.onBack) this.pages.current.onBack.call(this); }, - applySingletab: function(yesno) - { - if(yesno == null) yesno = this.options.singletab; - else this.options.singletab = yesno; - - if(yesno) { - $('#lists .mtt-tabs').addClass('mtt-tabs-only-one'); - $("#lists ul").sortable('disable'); - } - else { - $('#lists .mtt-tabs').removeClass('mtt-tabs-only-one'); - $("#lists ul").sortable('enable'); - } - }, filter: { _filters: [], diff --git a/src/index.php b/src/index.php index 57bf90f..75e8909 100644 --- a/src/index.php +++ b/src/index.php @@ -29,14 +29,6 @@ if (!is_int(Config::get('firstdayofweek')) || Config::get('firstdayofweek')<0 || Config::set('firstdayofweek', 1); } - -if ( isset($_GET['desktop']) ) { //more priority than mobile - Config::set('mobile', 0); -} -else if ( isset($_GET['mobile']) || isset($_GET['pda']) ) { - Config::set('mobile', 1); -} - define('TEMPLATEPATH', MTTTHEMES. Config::get('template'). '/'); require(TEMPLATEPATH. 'index.php'); @@ -55,17 +47,3 @@ function redirectWithHashRoute(array $q, array $hash) header("Location: ". $url); exit; } - -function is_mobile() -{ //basic detection - if (preg_match("/(iphone|ipad|android)/i", _server('HTTP_USER_AGENT'))) { - return true; - } - return false; -} - -function getDesktopUrl($escape = true) -{ - $url = is_mobile() ? get_unsafe_mttinfo('desktop_url') : get_unsafe_mttinfo('url'); - return $escape ? htmlspecialchars($url) : $url; -} \ No newline at end of file diff --git a/src/init.php b/src/init.php index b5bd32f..309a0f5 100644 --- a/src/init.php +++ b/src/init.php @@ -174,15 +174,6 @@ function get_unsafe_mttinfo($v) $_mttinfo['url'] = ($is_https ? 'https://' : 'http://'). $_SERVER['HTTP_HOST']. url_dir(getRequestUri()); } return $_mttinfo['url']; - case 'mobile_url': - $_mttinfo['mobile_url'] = Config::getUrl('mobile_url'); - if ($_mttinfo['mobile_url'] == '') { - $_mttinfo['mobile_url'] = get_unsafe_mttinfo('url'). '?mobile'; - } - return $_mttinfo['mobile_url']; - case 'desktop_url': - $_mttinfo['desktop_url'] = get_unsafe_mttinfo('url'). '?desktop'; - return $_mttinfo['desktop_url']; case 'mtt_url': /* Directory with ajax.php. No need to set if you use default directory structure. */ $_mttinfo['mtt_url'] = Config::getUrl('mtt_url'); // need to have a trailing slash