summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjeroenwalter <jeroen@enormkansloos.nl>2014-12-07 17:10:30 +0100
committerjeroenwalter <jeroen@enormkansloos.nl>2014-12-07 17:10:30 +0100
commitc5394e28e0bb6b862e82436450fbfd3698765b10 (patch)
treeabe280060d0581d651142e5ec8fcd61d5d28e609
parent7c197612d673159f963e46055d3400e50dc07fa2 (diff)
downloadComicRackWeb-c5394e28e0bb6b862e82436450fbfd3698765b10.zip
ComicRackWeb-c5394e28e0bb6b862e82436450fbfd3698765b10.tar.gz
ComicRackWeb-c5394e28e0bb6b862e82436450fbfd3698765b10.tar.bz2
removed obsolete files.
-rw-r--r--ComicRackWebViewer/tablet/app/controller/FileSystem.js210
-rw-r--r--ComicRackWebViewer/tablet/app/view/FileSystem.js149
2 files changed, 0 insertions, 359 deletions
diff --git a/ComicRackWebViewer/tablet/app/controller/FileSystem.js b/ComicRackWebViewer/tablet/app/controller/FileSystem.js
deleted file mode 100644
index 86e4ddc..0000000
--- a/ComicRackWebViewer/tablet/app/controller/FileSystem.js
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- This file is part of Badaap Comic Reader.
-
- Copyright (c) 2012 Jeroen Walter
-
- Badaap Comic Reader is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Badaap Comic Reader is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Badaap Comic Reader. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-//<debug>
-
-Ext.define('Comic.controller.FileSystem', {
- extend: 'Ext.app.Controller',
-
- config: {
- refs: {
- mainview: 'mainview',
- filesystemview: 'filesystemview',
- // useless refs because there are more than 1:
- //folderlist: 'filesystemview #folderlist',
- //searchfield: 'filesystemview #folderlist searchfield',
- comicview: { selector: 'comicview', xtype: 'comicview', autoCreate: true },
- comicinfoview: { selector: 'comicinfoview', xtype: 'comicinfoview', autoCreate: true }
- },
-
- control: {
- filesystemview: {
- leafitemtap: 'doTapLeafItem',
- itemtap: 'doTapItem',
- //leafitemtaphold: 'doLeafItemTapHold',
- show: 'onShow',
- activeitemchange: 'onActiveitemchange', // triggered when a list is about to be shown, except for first paint of the first root list.
- activate: 'onActivate', // fired when the view is activated (by the tab panel)
- listchange: 'onListchange' // triggered after the list is rendered.
- },
-
- searchfield: {
- clearicontap: 'onSearchClearIconTap',
- keyup: 'onSearchKeyUp'
- },
-
- folderlist: {
- //show: 'onSearchClearIconTap',
- //hide: 'onSearchClearIconTap',
- }
- }
-
- },
- onListchange: function( /*Ext.dataview.NestedList*/ nestedlist, /*Object*/ listitem, /*Object*/ eOpts )
- {
- /* too late here, list is already rendered
- var store = listitem.getStore();
- store.clearFilter();
- var searchfield = listitem.query('searchfield');
- searchfield[0].setValue('');
- */
- //alert('onListchange');
-
- },
- onActivate: function()
- {
- //alert('onActivate');
- },
- onActiveitemchange: function( /*Ext.Container*/ nestedlist, /*Object/Number*/ value, /*Object/Number*/ oldValue, /*Object*/ eOpts )
- {
- //alert('onActiveitemchange');
- // TODO: detect if we are going up or down in the tree.
- // If up, don't clear the filter. This must be a user setting.
-
- // If the filters of nodes must be kept between list changes, then the filter must be stored with the node,
- // because the list itself (and its searchfield) may be reused, but assigned a different store each time.
-
- var store = value.getStore(),
- newId = store.getNode().getId(),
- oldId = oldValue.getStore().getNode().getId(),
- searchfield;
-
- if (phpjs.strncmp(newId, oldId, newId.length) != 1)
- {
- return;
- }
-
- store.clearFilter();
- searchfield = value.query('searchfield');
- searchfield[0].setValue('');
- },
- onShow: function()
- {
- //alert('bla');
- },
- doTapItem: function(nestedList, list, index, target, record)
- {
- },
-
- doLeafItemTapHold: function(nestedList, list, index, target, record)
- {
- alert('doLeafItemTapHold');
- // this.getMainview().push(this.getComicinfoview());
- },
-
- doTapLeafItem: function(nestedList, list, index, target, record)
- {
- // don't use routes for now
- //this.redirectTo('comic/' + record.get('comic_id'));
-
- Comic.new_comic_id = record.get('comic').id;
- Comic.context = {};
- Comic.context.source = 'filesystem';
- Comic.context.id = list.getStore().getNode().getId();
- Comic.context.index = index;
- Comic.context.record = record;
-
- this.getMainview().push(this.getComicview());
-
- },
-
- /**
- * Called when the search field has a keyup event.
- *
- * This will filter the store based on the fields content.
- */
- onSearchKeyUp: function(field, /*Ext.EventObject*/ e, /*Object*/ eOpts )
- {
- //get the store and the value of the field
- var value = field.getValue(),
- store = field.getParent().getParent().getStore(),
- searches,
- regexps,
- i;
-
-
- //first clear any current filters on the store
- store.clearFilter();
-
- //check if a value is set first, as if it isn't we dont have to do anything
- if (value)
- {
- //the user could have entered spaces, so we must split them so we can loop through them all
- searches = value.split(' ');
- regexps = [];
-
- //loop them all
- for (i = 0; i < searches.length; i++)
- {
- //if it is nothing, continue
- if (!searches[i])
- {
- continue;
- }
-
- //if found, create a new regular expression which is case insenstive
- regexps.push(new RegExp(searches[i], 'i'));
- }
-
- //now filter the store by passing a method
- //the passed method will be called for each record in the store
- store.filter(function(record)
- {
- var matched = [],
- search,
- didMatch;
-
- //loop through each of the regular expressions
- for (i = 0; i < regexps.length; i++)
- {
- search = regexps[i];
- didMatch = record.get('name').match(search);
-
- //if it matched the first or last name, push it into the matches array
- matched.push(didMatch);
- }
-
- //if nothing was found, return false (dont so in the store)
- if (regexps.length > 1 && matched.indexOf(false) != -1)
- {
- return false;
- }
- else
- {
- //else true true (show in the store)
- return matched[0];
- }
- });
- }
- },
-
- /**
- * Called when the user taps on the clear icon in the search field.
- * It simply removes the filter form the store
- */
- onSearchClearIconTap: function( /*Ext.field.Input*/ field, /*Ext.EventObject*/ e, /*Object*/ eOpts )
- {
- var store = field.getParent().getParent().getStore();
- store.clearFilter();
- }
-
-
-});
-
-//</debug>
diff --git a/ComicRackWebViewer/tablet/app/view/FileSystem.js b/ComicRackWebViewer/tablet/app/view/FileSystem.js
deleted file mode 100644
index 2485cca..0000000
--- a/ComicRackWebViewer/tablet/app/view/FileSystem.js
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- This file is part of Badaap Comic Reader.
-
- Copyright (c) 2012 Jeroen Walter
-
- Badaap Comic Reader is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Badaap Comic Reader is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Badaap Comic Reader. If not, see <http://www.gnu.org/licenses/>.
-*/
-/*
- The FileSystem view shows the folders and the comics in them as a nested list.
-
-*/
-
-
-//<debug>
-
-
-// Use one template instance for all list items instead of creating one for each list item separately.....
-var TheFileSystemItemTemplate = new Ext.XTemplate(
- '<tpl if="leaf === true"><img src="covers/{comic.id}_cover.jpg" height="60"/>{[this.getTitleText(values.comic)]}<span class="progress">{[this.getProgressText(values.comic)]}</span><span class="date_last_read"><tpl if="comic.date_last_read === null"></tpl><tpl if="comic.date_last_read !== null">{comic.date_last_read}</tpl></span></tpl><tpl if="leaf === false"><img src="resources/images/folder.png" height="60"/>{name}</br><span class="progress">{file_count} | {folder_count}</span></tpl>',
- {
- // XTemplate configuration:
- disableFormats: true,
- // member functions:
- getTitleText: function(comic)
- {
- var s = '';
- if (comic.Series)
- {
- s += comic.Series + ' ' + comic.Number;
- }
- else
- {
- s += comic.name;
- }
-
- if (comic.Title)
- {
- s += ': ' + comic.Title;
- }
-
- if (comic.Year > 0)
- {
- s += '</br>[' + comic.Year + '/' + comic.Month + ']';
- }
-
- return s;
- },
- getProgressText: function(comic)
- {
- if (comic.number_of_pages == 0)
- {
- return "no pages"; // BUG: This comic should never have been added to the database.....
- }
-
- if ((comic.last_page_read + 1) == comic.number_of_pages)
- {
- return "finished";
- }
- else
- {
- return (comic.last_page_read + 1) + "/" + comic.number_of_pages;
- }
- }
- }
-);
-
-
-Ext.define('Comic.view.FileSystem', {
- extend: 'Ext.NestedList',
- xtype: 'filesystemview',
- requires: [
- 'Comic.store.FileSystem',
- 'Ext.field.Search'
- ],
- config: {
- title: 'Files',
- displayField: 'name',
- store: 'FileSystem',
-
- //padding: '10 10 10 10', // padding for entire list, not for the items....
- //style: 'background: transparent url(resources/background_1.jpg) 0 0;',
-
- // config of each list:
-
- listConfig : {
-
- itemTpl: TheFileSystemItemTemplate,
- // not working properly:
- // indexBar : true,
- // grouped: true,
- itemId: 'folderlist',
- baseCls: 'filesystem-list',
-
- //onItemDisclosure: true,
- /*
- listeners: {
-
- itemtaphold: function (list, idx, target, record, evt) {
- Ext.Msg.alert('itemtaphold', record.data.name);
- }, // itemtaphold
-
-
- itemswipe: function (list, idx, target, record, evt) {
- this.getParent().onSwipe();
- } // itemswipe
-
- }, // listeners
- */
- items: [
- {
- xtype: 'toolbar',
- docked: 'top',
- items: [
- { xtype: 'spacer' },
- {
- xtype: 'searchfield',
- placeHolder: 'Filter...'
- },
- { xtype: 'spacer' }
- ]
- }
- ]
- }
- },
-
- //onItemDisclosure: function() { alert('onItemDisclosure'); },
-
- getTitleTextTpl: function() {
- return '{' + this.getDisplayField() + '}<tpl if="leaf !== true">/</tpl>';
- }
- /*
- onSwipe: function() {
- Ext.Msg.alert('onSwipe');
- }*/
-
-});
-
-//</debug>