rbbt-rest 1.6.9 → 1.6.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 05c447d083fa7c7d20eb9ec6b35fd40def102fac
4
- data.tar.gz: 223225ff89f70995dc1f0adef68da27519513630
3
+ metadata.gz: e3b50ab27bb389a1da33618271e97b558d93351d
4
+ data.tar.gz: 6d5f18b50e6d688812ad81f8128c1b87373a118d
5
5
  SHA512:
6
- metadata.gz: 45eb8f221717d239d99e2d55b8952c02c13e16a973d7a2e1fb2a2cd9ea90f95bad7fb7f86e7f2930717d1742742e52be5f4a0f768d487cda3de6c870f760bdb9
7
- data.tar.gz: 80ca57f493f3d6460053c4a5f775658b6d7bac446c8b95a3023b7d7451e070d234e3c4077ad7012f7f3eec5c2cd40b106ccb0ce5351d7410eee19044c5ab8fde
6
+ metadata.gz: 10c855ba74e528f11af3417894f4ddcd013bfd621c34f39587e98b5fd03988c96aee95aad187fe9479c9fff7f3d809e94874d45e1df4fb33a3987d22130b683b
7
+ data.tar.gz: 9ff5b63dbcf94703512ed09b2b11c2f28eb01987245a8461414d7c1d41d6248d835bf3524e6f947fab5fe2f7bac633a33952970c0c35676370a92227aa6cce22
@@ -45,6 +45,7 @@ module RbbtRESTHelpers
45
45
  @fullpath = request.fullpath
46
46
 
47
47
  @layout = consume_parameter(:_layout)
48
+
48
49
  @layout = false if @layout.nil? and @ajax
49
50
  @layout = true if @layout.nil? and not @ajax
50
51
  @layout = false if @layout == "false"
@@ -218,6 +218,13 @@ module RbbtRESTHelpers
218
218
  name = false
219
219
  end
220
220
 
221
+ if value =~ /^:length:\s*(.*)/
222
+ value = $1
223
+ length = true
224
+ else
225
+ length = false
226
+ end
227
+
221
228
  if name
222
229
  old_tsv = tsv
223
230
  tsv = tsv.reorder(:key, key).add_field "NAME" do |k,values|
@@ -226,6 +233,14 @@ module RbbtRESTHelpers
226
233
  key = "NAME"
227
234
  end
228
235
 
236
+ if length
237
+ old_tsv = tsv
238
+ tsv = tsv.reorder(:key, key).add_field "LENGTH" do |k,values|
239
+ NamedArray === values ? values[key].length.to_s : values.length.to_s
240
+ end
241
+ key = "LENGTH"
242
+ end
243
+
229
244
  case
230
245
  when value =~ /^([<>]=?)(.*)/
231
246
  tsv = tsv.select(key, invert){|k| k = k.first if Array === k; (k.nil? or (String === k and k.empty?)) ? false : k.to_f.send($1, $2.to_f)}
@@ -237,7 +252,8 @@ module RbbtRESTHelpers
237
252
  tsv = tsv.select({key => value}, invert)
238
253
  end
239
254
 
240
- tsv = old_tsv.select(tsv.keys) if name
255
+ tsv = old_tsv.select(tsv.keys) if name or length
256
+
241
257
  end
242
258
  end
243
259
 
@@ -65,6 +65,10 @@ $subtle-font: rgba(0,0,0,0.30)
65
65
  float: left
66
66
 
67
67
  =small_screen
68
+ table:not(.collapsing)
69
+ caption
70
+ width: 100%
71
+
68
72
  form.workflow_task
69
73
  .input.field.submit
70
74
  input, select
@@ -306,9 +310,5 @@ label[title]
306
310
  .progress.ui.message:empty
307
311
  display: none
308
312
 
309
- table
310
- caption
311
- width: 100%
312
-
313
313
  .examples
314
314
  clear: both
@@ -16,5 +16,6 @@
16
16
  - *String of text*: perfect match (e.g. `Cancer`)
17
17
  - *Regular expression*: flexible match (e.g. `/(bladder|breast)\s+cancer/i`)
18
18
  - *Numeric comparison*: lower of grater than (e.g. `< 0.1` or `>= 2`)
19
- - *Names: for entities* with names, such as genes or pathways; regular expression accepted (e.g. `:name:SF3B1` or `:name:/CDK\d/`)
19
+ - *Names*: for entities with names, such as genes or pathways; regular expression accepted (e.g. `:name: SF3B1` or `:name: /CDK\d/`)
20
+ - *Length*: for lists (e.g. `:length: > 2`)
20
21
 
@@ -24,9 +24,7 @@ $.ajax = function(url, options){
24
24
  url = options['url'];
25
25
  }
26
26
 
27
- url = add_parameter(url, '_layout', 'false')
28
- options['url'] = url
29
- options["crossDomain"] = true
27
+ options = $.merge(options, {url: url, crossDomain: true})
30
28
 
31
29
  add_ajax(url);
32
30
 
@@ -35,6 +33,8 @@ $.ajax = function(url, options){
35
33
  if (typeof complete == 'function'){ options['complete'] = [complete, function(){ remove_ajax(url)}] }
36
34
  if (typeof complete == 'array'){ options['complete'].push(function(){ remove_ajax(url)}) }
37
35
 
36
+ options.headers = {'X-Requested-With': 'XMLHttpRequest'}
37
+
38
38
  return $.old_ajax(options);
39
39
  }
40
40
 
@@ -3,6 +3,11 @@ rbbt.mlog = function(data){
3
3
  console.log(data)
4
4
  }
5
5
 
6
+ rbbt.ajax = function(params){
7
+ params.config = function(xhr, options){ xhr.setRequestHeader( "X-Requested-With", "XMLHttpRequest"); return xhr; }
8
+ return m.request(params)
9
+ }
10
+
6
11
  rbbt.insist_request = function(params, deferred, timeout, missing){
7
12
  if (undefined === deferred) deferred = m.deferred()
8
13
  if (undefined === timeout) timeout = 1000
@@ -13,7 +18,8 @@ rbbt.insist_request = function(params, deferred, timeout, missing){
13
18
  return xhr.responseText
14
19
  }
15
20
 
16
- m.request(params).then(
21
+
22
+ rbbt.ajax(params).then(
17
23
  function(res){
18
24
  deferred.resolve(res)
19
25
  },
@@ -59,9 +59,9 @@ fav_module.toggleFavourite_map = function(){
59
59
  var map = rbbt.page.map();
60
60
 
61
61
  if (fav_module.isFavourite_map(map)){
62
- rbbt.post({url: '/remove_favourite_entity_map/' + map.type + '/' + map.column + '/' + clean_element(map.id)}).then(fav_module.update)
62
+ rbbt.post({url: '/remove_favourite_entity_map/' + map.type + '/' + clean_element(map.column) + '/' + clean_element(map.id)}).then(fav_module.update)
63
63
  }else{
64
- rbbt.post({url: '/add_favourite_entity_map/' + map.type + '/' + map.column + '/' + clean_element(map.id)}).then(fav_module.update)
64
+ rbbt.post({url: '/add_favourite_entity_map/' + map.type + '/' + clean_element(map.column) + '/' + clean_element(map.id)}).then(fav_module.update)
65
65
  }
66
66
  }
67
67
 
@@ -23,7 +23,10 @@ rbbt.mview.plot = function(content, title, caption){
23
23
  var download = m('.download.ui.labeled.icon.button',{onclick: download_func}, [m('i.icon.download'), "Download"])
24
24
  if (title) elems.push(m('.ui.header', title))
25
25
  elems.push(m('.content.svg', m.trust(content)))
26
- if (caption) elems.push(m('figcaption', m.trust(caption)))
26
+ if (caption){
27
+ elems.push(m('figcaption', m.trust(caption)))
28
+ elems.push(m('hr'))
29
+ }
27
30
  if (content) elems.push(download)
28
31
 
29
32
  plot = m('figure.ui.segment', elems)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.9
4
+ version: 1.6.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-12 00:00:00.000000000 Z
11
+ date: 2015-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -365,7 +365,6 @@ files:
365
365
  - share/views/public/js/foundation/index.js
366
366
  - share/views/public/js/helpers.js
367
367
  - share/views/public/js/jquery-ui.js
368
- - share/views/public/js/ng-favourites.js
369
368
  - share/views/public/js/rbbt.aesthetics.js
370
369
  - share/views/public/js/rbbt.basic.js
371
370
  - share/views/public/js/rbbt.entity.js
@@ -1,13 +0,0 @@
1
- var rbbt_angular = angular.module('rbbt', [])
2
-
3
- rbbt_angular.controller('FavourtiesController', ['$scope', function($scope){
4
- $scope.favourite = 'not_favourite';
5
- $scope.toggle = function(){
6
- if ($scope.favourite == 'favourite'){
7
- $scope.favourite = 'not_favourite'
8
- }else{
9
- $scope.favourite = 'favourite'
10
- }
11
- }
12
- }]);
13
-