|  |  | @ -85,7 +85,11 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  |                  </div> |  |  |  |                  </div> | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                  <!-- footer --> |  |  |  |                  <!-- footer --> | 
			
		
	
		
		
			
				
					
					|  |  |  |                  <tiny-sidebar-form-footer id={ state.current.id ? state.current.id : false } loading={ state.loading }></tiny-sidebar-form-footer> |  |  |  |                  <tiny-sidebar-form-footer | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     id={ state.current._id ? state.current._id : false } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     loading={ state.loading } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     handle-delete={ handleDelete }> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 </tiny-sidebar-form-footer> | 
			
		
	
		
		
			
				
					
					|  |  |  |             </form> |  |  |  |             </form> | 
			
		
	
		
		
			
				
					
					|  |  |  |             </div> |  |  |  |             </div> | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -125,12 +129,6 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                  ...sidebarMixin,  // adding basic funtion for sidebar |  |  |  |                  ...sidebarMixin,  // adding basic funtion for sidebar | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                  state: { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                      open: false,     // if sidebar is open |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                      loading: false,  // if loading is shown |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                      current: false |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                  }, |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                  /** |  |  |  |                  /** | 
			
		
	
		
		
			
				
					
					|  |  |  |                   * |  |  |  |                   * | 
			
		
	
		
		
			
				
					
					|  |  |  |                   * |  |  |  |                   * | 
			
		
	
	
		
		
			
				
					|  |  | @ -140,36 +138,21 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  |                      // adding event for open sidebar |  |  |  |                      // adding event for open sidebar | 
			
		
	
		
		
			
				
					
					|  |  |  |                      formStore.on('open', (id) =>  { |  |  |  |                      formStore.on('open', (id) =>  { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                         tagsStore.trigger('update', []) |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                         this.state.current = false |  |  |  |                         this.state.current = false | 
			
		
	
		
		
			
				
					
					|  |  |  |                         this.state.open = true |  |  |  |                         this.state.open = true | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                         // if id is send, load apps from pouchdb |  |  |  |                         // reset tags | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         if (id) { |  |  |  |                         tagsStore.trigger('update', []) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                              appsStore.getOne(id) |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                         } else { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                             this.update() |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                         } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                      }) |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                      // creating formValidator |  |  |  |                         // if id is not undefined, get data from pouchdb | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                      this.state.validator = new FormValidator(this.$('.form'), { |  |  |  |                         if (id !== undefined) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                          'name': { |  |  |  |                             appsStore.getOne(id) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                              'presence': true |  |  |  |                         } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                          }, |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                          'command': { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                              'presence': true |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                          }, |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                          'tags': { |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                          } |  |  |  |                         this.update() | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                      }) |  |  |  |                      }) | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                      // adding on success |  |  |  |                      this.createValidator() | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                      this.state.validator.onSuccess((event, data) => { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                          this.handleSuccess(event, data) |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                      }) |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                      // receive from extensions database |  |  |  |                      // receive from extensions database | 
			
		
	
		
		
			
				
					
					|  |  |  |                      appsStore.on('success', (data) => { |  |  |  |                      appsStore.on('success', (data) => { | 
			
		
	
	
		
		
			
				
					|  |  | @ -185,6 +168,17 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  |                      }) |  |  |  |                      }) | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                      // receive from extensions database |  |  |  |                      // receive from extensions database | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                      appsStore.on('close', (data) => { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                          appsStore.trigger('update') | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                          this.state.open = false | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                          // stop loading | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                          this.state.loading = false | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                          this.update() | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                      }) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                      appsStore.on('readyOne', (data) => { |  |  |  |                      appsStore.on('readyOne', (data) => { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                          this.state.current = data |  |  |  |                          this.state.current = data | 
			
		
	
	
		
		
			
				
					|  |  | @ -200,7 +194,31 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  |                          this.update() |  |  |  |                          this.update() | 
			
		
	
		
		
			
				
					
					|  |  |  |                      }) |  |  |  |                      }) | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                  }, |  |  |  |                 }, | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 /** | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                  *  creating Validator for form | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                  * | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                  * | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                  */ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 createValidator() { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     this.state.validator = new FormValidator(this.$('.form'), { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         'name': { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             'presence': true | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         }, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         'command': { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             'presence': true | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         }, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         'tags': { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     }) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     // adding on success | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     this.state.validator.onSuccess((event, data) => { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         this.handleSuccess(event, data) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     }) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 }, | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 /** |  |  |  |                 /** | 
			
		
	
		
		
			
				
					
					|  |  |  |                  *  choose a file for command |  |  |  |                  *  choose a file for command | 
			
		
	
	
		
		
			
				
					|  |  | @ -299,6 +317,10 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  |                     this.update() |  |  |  |                     this.update() | 
			
		
	
		
		
			
				
					
					|  |  |  |                  }, |  |  |  |                  }, | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                  handleDelete() { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                      appsStore.remove(this.state.current) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                  }, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                  /** |  |  |  |                  /** | 
			
		
	
		
		
			
				
					
					|  |  |  |                   * |  |  |  |                   * | 
			
		
	
		
		
			
				
					
					|  |  |  |                   * |  |  |  |                   * | 
			
		
	
	
		
		
			
				
					|  |  | 
 |