unsakini 0.0.1 → 0.0.2
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 +4 -4
- data/Rakefile +1 -5
- data/app/controllers/api/boards_controller.rb +8 -2
- data/app/controllers/api/comments_controller.rb +1 -1
- data/app/controllers/api/posts_controller.rb +1 -1
- data/app/controllers/api/share_board_controller.rb +7 -7
- data/app/controllers/api/users_controller.rb +1 -1
- data/app/controllers/concerns/board_owner_controller_concern.rb +2 -2
- data/app/controllers/concerns/comment_owner_controller_concern.rb +2 -2
- data/app/controllers/concerns/logged_in_controller_concern.rb +1 -1
- data/app/controllers/concerns/post_owner_controller_concern.rb +2 -2
- data/app/controllers/web_base_controller.rb +4 -0
- data/app/models/user_board.rb +11 -0
- data/app/serializers/user_board_serializer.rb +2 -1
- data/app/views/web_base/index.html +16 -0
- data/config/routes.rb +3 -0
- data/db/migrate/20161124102633_add_is_shared_to_boards.rb +5 -0
- data/lib/tasks/unsakini_tasks.rake +28 -30
- data/lib/unsakini/engine.rb +7 -8
- data/lib/unsakini/version.rb +1 -1
- data/spec/{requests/render_app_index_spec.rb → controllers/web_base_controller_spec.rb} +7 -0
- data/spec/dummy/app/assets/config/manifest.js +2 -0
- data/spec/dummy/app/assets/javascripts/cable.js +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +2 -1
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config/application.rb +0 -7
- data/spec/dummy/config/environments/development.rb +7 -0
- data/spec/dummy/config/environments/production.rb +8 -0
- data/spec/dummy/config/initializers/assets.rb +11 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/spec/dummy/config/initializers/new_framework_defaults.rb +6 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/routes.rb +1 -1
- data/spec/dummy/config/secrets.yml +2 -2
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20161124184342_add_is_shared_to_boards.unsakini_engine.rb +6 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/app/index.html +0 -14
- data/spec/dummy/public/app/inline.map +1 -1
- data/spec/dummy/public/app/main.bundle.js +110 -64
- data/spec/dummy/public/app/main.map +1 -1
- data/spec/dummy/public/app/styles.map +1 -1
- data/spec/dummy/tmp/unsakini-ng2/LICENSE +21 -0
- data/spec/dummy/tmp/unsakini-ng2/README.md +1 -0
- data/{angular → spec/dummy/tmp/unsakini-ng2}/angular-cli.json +1 -1
- data/spec/dummy/tmp/unsakini-ng2/src/app/registration/registration.component.css +0 -0
- data/spec/models/user_board_spec.rb +2 -0
- data/spec/requests/api/boards/api_boards_crud_spec.rb +174 -0
- data/spec/requests/api/boards/api_boards_pagination_spec.rb +51 -0
- data/spec/requests/api/{api_boards_spec.rb → boards/api_private_board_spec.rb} +1 -98
- data/spec/requests/api/boards/api_shared_board_spec.rb +66 -0
- data/spec/support/scenario_helper.rb +66 -34
- data/spec/support/serialize_helper.rb +4 -0
- metadata +154 -127
- data/angular/README.md +0 -31
- data/config/initializers/unsakini.rb +0 -4
- data/spec/dummy/angular/README.md +0 -31
- data/spec/dummy/angular/angular-cli.json +0 -59
- data/spec/dummy/angular/karma.conf.js +0 -45
- data/spec/dummy/angular/package.json +0 -49
- data/spec/dummy/angular/protractor.conf.js +0 -32
- data/spec/dummy/angular/src/app/app.component.html +0 -4
- data/spec/dummy/angular/src/app/app.component.spec.ts +0 -47
- data/spec/dummy/angular/src/app/app.component.ts +0 -10
- data/spec/dummy/angular/src/app/app.module.ts +0 -29
- data/spec/dummy/angular/src/app/app.routes.module.ts +0 -29
- data/spec/dummy/angular/src/app/index.ts +0 -2
- data/spec/dummy/angular/src/app/registration/registration.component.html +0 -14
- data/spec/dummy/angular/src/app/registration/registration.component.spec.ts +0 -157
- data/spec/dummy/angular/src/app/registration/registration.component.ts +0 -42
- data/spec/dummy/angular/src/environments/environment.prod.ts +0 -3
- data/spec/dummy/angular/src/environments/environment.ts +0 -8
- data/spec/dummy/angular/src/favicon.ico +0 -0
- data/spec/dummy/angular/src/index.html +0 -14
- data/spec/dummy/angular/src/main.ts +0 -12
- data/spec/dummy/angular/src/polyfills.ts +0 -19
- data/spec/dummy/angular/src/styles.css +0 -1
- data/spec/dummy/angular/src/test.ts +0 -31
- data/spec/dummy/angular/src/tsconfig.json +0 -18
- data/spec/dummy/angular/src/typings.d.ts +0 -2
- data/spec/dummy/angular/tslint.json +0 -114
- data/spec/dummy/angular/typings.json +0 -4
- data/spec/dummy/config/crypto.yml +0 -7
- data/spec/dummy/config/initializers/cors.rb +0 -16
- data/spec/dummy/db/schema.rb +0 -56
- data/spec/dummy/db/test.sqlite3 +0 -0
- /data/spec/dummy/db/migrate/{20161123150822_create_boards.unsakini_engine.rb → 20161124184336_create_boards.unsakini_engine.rb} +0 -0
- /data/spec/dummy/db/migrate/{20161123150823_create_user_boards.unsakini_engine.rb → 20161124184337_create_user_boards.unsakini_engine.rb} +0 -0
- /data/spec/dummy/db/migrate/{20161123150824_create_posts.unsakini_engine.rb → 20161124184338_create_posts.unsakini_engine.rb} +0 -0
- /data/spec/dummy/db/migrate/{20161123150825_create_comments.unsakini_engine.rb → 20161124184339_create_comments.unsakini_engine.rb} +0 -0
- /data/spec/dummy/db/migrate/{20161123150826_add_encrypted_password_to_user_board.unsakini_engine.rb → 20161124184340_add_encrypted_password_to_user_board.unsakini_engine.rb} +0 -0
- /data/spec/dummy/db/migrate/{20161123150827_create_users.unsakini_engine.rb → 20161124184341_create_users.unsakini_engine.rb} +0 -0
- /data/{angular/src/app/app.component.css → spec/dummy/public/apple-touch-icon-precomposed.png} +0 -0
- /data/{angular/src/app/registration/registration.component.css → spec/dummy/public/apple-touch-icon.png} +0 -0
- /data/spec/dummy/{angular/src/app/app.component.css → public/favicon.ico} +0 -0
- /data/spec/dummy/{angular → tmp/unsakini-ng2}/e2e/app.e2e-spec.ts +0 -0
- /data/spec/dummy/{angular → tmp/unsakini-ng2}/e2e/app.po.ts +0 -0
- /data/spec/dummy/{angular → tmp/unsakini-ng2}/e2e/signup.e2e-spec.ts +0 -0
- /data/spec/dummy/{angular → tmp/unsakini-ng2}/e2e/signup.po.ts +0 -0
- /data/spec/dummy/{angular → tmp/unsakini-ng2}/e2e/tsconfig.json +0 -0
- /data/{angular → spec/dummy/tmp/unsakini-ng2}/karma.conf.js +0 -0
- /data/{angular → spec/dummy/tmp/unsakini-ng2}/package.json +0 -0
- /data/{angular → spec/dummy/tmp/unsakini-ng2}/protractor.conf.js +0 -0
- /data/spec/dummy/{angular/src/app/registration/registration.component.css → tmp/unsakini-ng2/src/app/app.component.css} +0 -0
- /data/{angular → spec/dummy/tmp/unsakini-ng2}/src/app/app.component.html +0 -0
- /data/{angular → spec/dummy/tmp/unsakini-ng2}/src/app/app.component.spec.ts +0 -0
- /data/{angular → spec/dummy/tmp/unsakini-ng2}/src/app/app.component.ts +0 -0
- /data/{angular → spec/dummy/tmp/unsakini-ng2}/src/app/app.module.ts +0 -0
- /data/{angular → spec/dummy/tmp/unsakini-ng2}/src/app/app.routes.module.ts +0 -0
- /data/{angular → spec/dummy/tmp/unsakini-ng2}/src/app/index.ts +0 -0
- /data/{angular → spec/dummy/tmp/unsakini-ng2}/src/app/registration/registration.component.html +0 -0
- /data/{angular → spec/dummy/tmp/unsakini-ng2}/src/app/registration/registration.component.spec.ts +0 -0
- /data/{angular → spec/dummy/tmp/unsakini-ng2}/src/app/registration/registration.component.ts +0 -0
- /data/{angular → spec/dummy/tmp/unsakini-ng2}/src/environments/environment.prod.ts +0 -0
- /data/{angular → spec/dummy/tmp/unsakini-ng2}/src/environments/environment.ts +0 -0
- /data/{angular → spec/dummy/tmp/unsakini-ng2}/src/favicon.ico +0 -0
- /data/{angular → spec/dummy/tmp/unsakini-ng2}/src/index.html +0 -0
- /data/{angular → spec/dummy/tmp/unsakini-ng2}/src/main.ts +0 -0
- /data/{angular → spec/dummy/tmp/unsakini-ng2}/src/polyfills.ts +0 -0
- /data/{angular → spec/dummy/tmp/unsakini-ng2}/src/styles.css +0 -0
- /data/{angular → spec/dummy/tmp/unsakini-ng2}/src/test.ts +0 -0
- /data/{angular → spec/dummy/tmp/unsakini-ng2}/src/tsconfig.json +0 -0
- /data/{angular → spec/dummy/tmp/unsakini-ng2}/src/typings.d.ts +0 -0
- /data/{angular → spec/dummy/tmp/unsakini-ng2}/tslint.json +0 -0
- /data/{angular → spec/dummy/tmp/unsakini-ng2}/typings.json +0 -0
- /data/spec/requests/api/{api_share_board_spec.rb → boards/api_sharing_board_spec.rb} +0 -0
- /data/spec/requests/api/{board/post/api_board_post_comments_spec.rb → comments/api_comments_spec.rb} +0 -0
- /data/spec/requests/api/{board/api_board_posts_spec.rb → posts/api_posts_spec.rb} +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["webpack:////home/adones/Projects/Rails/unsakini/spec/dummy/angular/src/styles.css?0dc5","webpack:////home/adones/Projects/Rails/unsakini/spec/dummy/angular/src/styles.css","webpack:////home/adones/Projects/Rails/unsakini/spec/dummy/angular/~/css-loader/lib/css-base.js","webpack:////home/adones/Projects/Rails/unsakini/spec/dummy/angular/~/style-loader/addStyles.js"],"names":[],"mappings":";;;;;AAAA;;AAEA;AACA;AACA;AACA;AACA,iDAAgF;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,gCAAgC,UAAU,EAAE;AAC5C,C;;;;;;;ACpBA;AACA;;;AAGA;AACA;;AAEA;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA,wCAAwC,gBAAgB;AACxD,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjDA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,sBAAsB;AACtC;AACA;AACA,kBAAkB,2BAA2B;AAC7C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;AACA,iBAAiB,2BAA2B;AAC5C;AACA;AACA,QAAQ,uBAAuB;AAC/B;AACA;AACA,GAAG;AACH;AACA,iBAAiB,uBAAuB;AACxC;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA,gCAAgC,sBAAsB;AACtD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uDAAuD;AACvD;;AAEA,6BAA6B,mBAAmB;;AAEhD;;AAEA;;AAEA;AACA;AACA","file":"styles.bundle.js","sourcesContent":["// style-loader: Adds some css to the DOM by adding a <style> tag\n\n// load the styles\nvar content = require(\"!!./../node_modules/css-loader/index.js?sourcemap!./../node_modules/postcss-loader/index.js!./styles.css\");\nif(typeof content === 'string') content = [[module.id, content, '']];\n// add the styles to the DOM\nvar update = require(\"!./../node_modules/style-loader/addStyles.js\")(content, {});\nif(content.locals) module.exports = content.locals;\n// Hot Module Replacement\nif(module.hot) {\n\t// When the styles change, update the <style> tags\n\tif(!content.locals) {\n\t\tmodule.hot.accept(\"!!./../node_modules/css-loader/index.js?sourcemap!./../node_modules/postcss-loader/index.js!./styles.css\", function() {\n\t\t\tvar newContent = require(\"!!./../node_modules/css-loader/index.js?sourcemap!./../node_modules/postcss-loader/index.js!./styles.css\");\n\t\t\tif(typeof newContent === 'string') newContent = [[module.id, newContent, '']];\n\t\t\tupdate(newContent);\n\t\t});\n\t}\n\t// When the module is disposed, remove the <style> tags\n\tmodule.hot.dispose(function() { update(); });\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/adones/Projects/Rails/unsakini/spec/dummy/angular/src/styles.css\n// module id = 379\n// module chunks = 1","exports = module.exports = require(\"./../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \"/* You can add global styles to this file, and also import other style files */\\n\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/adones/Projects/Rails/unsakini/spec/dummy/angular/~/css-loader?sourcemap!/home/adones/Projects/Rails/unsakini/spec/dummy/angular/~/postcss-loader!/home/adones/Projects/Rails/unsakini/spec/dummy/angular/src/styles.css\n// module id = 652\n// module chunks = 1","/*\r\n\tMIT License http://www.opensource.org/licenses/mit-license.php\r\n\tAuthor Tobias Koppers @sokra\r\n*/\r\n// css base code, injected by the css-loader\r\nmodule.exports = function() {\r\n\tvar list = [];\r\n\r\n\t// return the list of modules as css string\r\n\tlist.toString = function toString() {\r\n\t\tvar result = [];\r\n\t\tfor(var i = 0; i < this.length; i++) {\r\n\t\t\tvar item = this[i];\r\n\t\t\tif(item[2]) {\r\n\t\t\t\tresult.push(\"@media \" + item[2] + \"{\" + item[1] + \"}\");\r\n\t\t\t} else {\r\n\t\t\t\tresult.push(item[1]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result.join(\"\");\r\n\t};\r\n\r\n\t// import a list of modules into the list\r\n\tlist.i = function(modules, mediaQuery) {\r\n\t\tif(typeof modules === \"string\")\r\n\t\t\tmodules = [[null, modules, \"\"]];\r\n\t\tvar alreadyImportedModules = {};\r\n\t\tfor(var i = 0; i < this.length; i++) {\r\n\t\t\tvar id = this[i][0];\r\n\t\t\tif(typeof id === \"number\")\r\n\t\t\t\talreadyImportedModules[id] = true;\r\n\t\t}\r\n\t\tfor(i = 0; i < modules.length; i++) {\r\n\t\t\tvar item = modules[i];\r\n\t\t\t// skip already imported module\r\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\r\n\t\t\t// when a module is imported multiple times with different media queries.\r\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\r\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\r\n\t\t\t\tif(mediaQuery && !item[2]) {\r\n\t\t\t\t\titem[2] = mediaQuery;\r\n\t\t\t\t} else if(mediaQuery) {\r\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\r\n\t\t\t\t}\r\n\t\t\t\tlist.push(item);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\treturn list;\r\n};\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/adones/Projects/Rails/unsakini/spec/dummy/angular/~/css-loader/lib/css-base.js\n// module id = 653\n// module chunks = 1","/*\r\n\tMIT License http://www.opensource.org/licenses/mit-license.php\r\n\tAuthor Tobias Koppers @sokra\r\n*/\r\nvar stylesInDom = {},\r\n\tmemoize = function(fn) {\r\n\t\tvar memo;\r\n\t\treturn function () {\r\n\t\t\tif (typeof memo === \"undefined\") memo = fn.apply(this, arguments);\r\n\t\t\treturn memo;\r\n\t\t};\r\n\t},\r\n\tisOldIE = memoize(function() {\r\n\t\treturn /msie [6-9]\\b/.test(window.navigator.userAgent.toLowerCase());\r\n\t}),\r\n\tgetHeadElement = memoize(function () {\r\n\t\treturn document.head || document.getElementsByTagName(\"head\")[0];\r\n\t}),\r\n\tsingletonElement = null,\r\n\tsingletonCounter = 0,\r\n\tstyleElementsInsertedAtTop = [];\r\n\r\nmodule.exports = function(list, options) {\r\n\tif(typeof DEBUG !== \"undefined\" && DEBUG) {\r\n\t\tif(typeof document !== \"object\") throw new Error(\"The style-loader cannot be used in a non-browser environment\");\r\n\t}\r\n\r\n\toptions = options || {};\r\n\t// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>\r\n\t// tags it will allow on a page\r\n\tif (typeof options.singleton === \"undefined\") options.singleton = isOldIE();\r\n\r\n\t// By default, add <style> tags to the bottom of <head>.\r\n\tif (typeof options.insertAt === \"undefined\") options.insertAt = \"bottom\";\r\n\r\n\tvar styles = listToStyles(list);\r\n\taddStylesToDom(styles, options);\r\n\r\n\treturn function update(newList) {\r\n\t\tvar mayRemove = [];\r\n\t\tfor(var i = 0; i < styles.length; i++) {\r\n\t\t\tvar item = styles[i];\r\n\t\t\tvar domStyle = stylesInDom[item.id];\r\n\t\t\tdomStyle.refs--;\r\n\t\t\tmayRemove.push(domStyle);\r\n\t\t}\r\n\t\tif(newList) {\r\n\t\t\tvar newStyles = listToStyles(newList);\r\n\t\t\taddStylesToDom(newStyles, options);\r\n\t\t}\r\n\t\tfor(var i = 0; i < mayRemove.length; i++) {\r\n\t\t\tvar domStyle = mayRemove[i];\r\n\t\t\tif(domStyle.refs === 0) {\r\n\t\t\t\tfor(var j = 0; j < domStyle.parts.length; j++)\r\n\t\t\t\t\tdomStyle.parts[j]();\r\n\t\t\t\tdelete stylesInDom[domStyle.id];\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}\r\n\r\nfunction addStylesToDom(styles, options) {\r\n\tfor(var i = 0; i < styles.length; i++) {\r\n\t\tvar item = styles[i];\r\n\t\tvar domStyle = stylesInDom[item.id];\r\n\t\tif(domStyle) {\r\n\t\t\tdomStyle.refs++;\r\n\t\t\tfor(var j = 0; j < domStyle.parts.length; j++) {\r\n\t\t\t\tdomStyle.parts[j](item.parts[j]);\r\n\t\t\t}\r\n\t\t\tfor(; j < item.parts.length; j++) {\r\n\t\t\t\tdomStyle.parts.push(addStyle(item.parts[j], options));\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar parts = [];\r\n\t\t\tfor(var j = 0; j < item.parts.length; j++) {\r\n\t\t\t\tparts.push(addStyle(item.parts[j], options));\r\n\t\t\t}\r\n\t\t\tstylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction listToStyles(list) {\r\n\tvar styles = [];\r\n\tvar newStyles = {};\r\n\tfor(var i = 0; i < list.length; i++) {\r\n\t\tvar item = list[i];\r\n\t\tvar id = item[0];\r\n\t\tvar css = item[1];\r\n\t\tvar media = item[2];\r\n\t\tvar sourceMap = item[3];\r\n\t\tvar part = {css: css, media: media, sourceMap: sourceMap};\r\n\t\tif(!newStyles[id])\r\n\t\t\tstyles.push(newStyles[id] = {id: id, parts: [part]});\r\n\t\telse\r\n\t\t\tnewStyles[id].parts.push(part);\r\n\t}\r\n\treturn styles;\r\n}\r\n\r\nfunction insertStyleElement(options, styleElement) {\r\n\tvar head = getHeadElement();\r\n\tvar lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1];\r\n\tif (options.insertAt === \"top\") {\r\n\t\tif(!lastStyleElementInsertedAtTop) {\r\n\t\t\thead.insertBefore(styleElement, head.firstChild);\r\n\t\t} else if(lastStyleElementInsertedAtTop.nextSibling) {\r\n\t\t\thead.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling);\r\n\t\t} else {\r\n\t\t\thead.appendChild(styleElement);\r\n\t\t}\r\n\t\tstyleElementsInsertedAtTop.push(styleElement);\r\n\t} else if (options.insertAt === \"bottom\") {\r\n\t\thead.appendChild(styleElement);\r\n\t} else {\r\n\t\tthrow new Error(\"Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.\");\r\n\t}\r\n}\r\n\r\nfunction removeStyleElement(styleElement) {\r\n\tstyleElement.parentNode.removeChild(styleElement);\r\n\tvar idx = styleElementsInsertedAtTop.indexOf(styleElement);\r\n\tif(idx >= 0) {\r\n\t\tstyleElementsInsertedAtTop.splice(idx, 1);\r\n\t}\r\n}\r\n\r\nfunction createStyleElement(options) {\r\n\tvar styleElement = document.createElement(\"style\");\r\n\tstyleElement.type = \"text/css\";\r\n\tinsertStyleElement(options, styleElement);\r\n\treturn styleElement;\r\n}\r\n\r\nfunction createLinkElement(options) {\r\n\tvar linkElement = document.createElement(\"link\");\r\n\tlinkElement.rel = \"stylesheet\";\r\n\tinsertStyleElement(options, linkElement);\r\n\treturn linkElement;\r\n}\r\n\r\nfunction addStyle(obj, options) {\r\n\tvar styleElement, update, remove;\r\n\r\n\tif (options.singleton) {\r\n\t\tvar styleIndex = singletonCounter++;\r\n\t\tstyleElement = singletonElement || (singletonElement = createStyleElement(options));\r\n\t\tupdate = applyToSingletonTag.bind(null, styleElement, styleIndex, false);\r\n\t\tremove = applyToSingletonTag.bind(null, styleElement, styleIndex, true);\r\n\t} else if(obj.sourceMap &&\r\n\t\ttypeof URL === \"function\" &&\r\n\t\ttypeof URL.createObjectURL === \"function\" &&\r\n\t\ttypeof URL.revokeObjectURL === \"function\" &&\r\n\t\ttypeof Blob === \"function\" &&\r\n\t\ttypeof btoa === \"function\") {\r\n\t\tstyleElement = createLinkElement(options);\r\n\t\tupdate = updateLink.bind(null, styleElement);\r\n\t\tremove = function() {\r\n\t\t\tremoveStyleElement(styleElement);\r\n\t\t\tif(styleElement.href)\r\n\t\t\t\tURL.revokeObjectURL(styleElement.href);\r\n\t\t};\r\n\t} else {\r\n\t\tstyleElement = createStyleElement(options);\r\n\t\tupdate = applyToTag.bind(null, styleElement);\r\n\t\tremove = function() {\r\n\t\t\tremoveStyleElement(styleElement);\r\n\t\t};\r\n\t}\r\n\r\n\tupdate(obj);\r\n\r\n\treturn function updateStyle(newObj) {\r\n\t\tif(newObj) {\r\n\t\t\tif(newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap)\r\n\t\t\t\treturn;\r\n\t\t\tupdate(obj = newObj);\r\n\t\t} else {\r\n\t\t\tremove();\r\n\t\t}\r\n\t};\r\n}\r\n\r\nvar replaceText = (function () {\r\n\tvar textStore = [];\r\n\r\n\treturn function (index, replacement) {\r\n\t\ttextStore[index] = replacement;\r\n\t\treturn textStore.filter(Boolean).join('\\n');\r\n\t};\r\n})();\r\n\r\nfunction applyToSingletonTag(styleElement, index, remove, obj) {\r\n\tvar css = remove ? \"\" : obj.css;\r\n\r\n\tif (styleElement.styleSheet) {\r\n\t\tstyleElement.styleSheet.cssText = replaceText(index, css);\r\n\t} else {\r\n\t\tvar cssNode = document.createTextNode(css);\r\n\t\tvar childNodes = styleElement.childNodes;\r\n\t\tif (childNodes[index]) styleElement.removeChild(childNodes[index]);\r\n\t\tif (childNodes.length) {\r\n\t\t\tstyleElement.insertBefore(cssNode, childNodes[index]);\r\n\t\t} else {\r\n\t\t\tstyleElement.appendChild(cssNode);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction applyToTag(styleElement, obj) {\r\n\tvar css = obj.css;\r\n\tvar media = obj.media;\r\n\r\n\tif(media) {\r\n\t\tstyleElement.setAttribute(\"media\", media)\r\n\t}\r\n\r\n\tif(styleElement.styleSheet) {\r\n\t\tstyleElement.styleSheet.cssText = css;\r\n\t} else {\r\n\t\twhile(styleElement.firstChild) {\r\n\t\t\tstyleElement.removeChild(styleElement.firstChild);\r\n\t\t}\r\n\t\tstyleElement.appendChild(document.createTextNode(css));\r\n\t}\r\n}\r\n\r\nfunction updateLink(linkElement, obj) {\r\n\tvar css = obj.css;\r\n\tvar sourceMap = obj.sourceMap;\r\n\r\n\tif(sourceMap) {\r\n\t\t// http://stackoverflow.com/a/26603875\r\n\t\tcss += \"\\n/*# sourceMappingURL=data:application/json;base64,\" + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + \" */\";\r\n\t}\r\n\r\n\tvar blob = new Blob([css], { type: \"text/css\" });\r\n\r\n\tvar oldSrc = linkElement.href;\r\n\r\n\tlinkElement.href = URL.createObjectURL(blob);\r\n\r\n\tif(oldSrc)\r\n\t\tURL.revokeObjectURL(oldSrc);\r\n}\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/adones/Projects/Rails/unsakini/spec/dummy/angular/~/style-loader/addStyles.js\n// module id = 695\n// module chunks = 1"],"sourceRoot":""}
|
1
|
+
{"version":3,"sources":["webpack:////home/adones/Projects/UNSAKINI/unsakini-ng2/src/styles.css?46c6","webpack:////home/adones/Projects/UNSAKINI/unsakini-ng2/src/styles.css","webpack:////home/adones/Projects/UNSAKINI/unsakini-ng2/~/css-loader/lib/css-base.js","webpack:////home/adones/Projects/UNSAKINI/unsakini-ng2/~/style-loader/addStyles.js"],"names":[],"mappings":";;;;;AAAA;;AAEA;AACA;AACA;AACA;AACA,iDAAgF;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,gCAAgC,UAAU,EAAE;AAC5C,C;;;;;;;ACpBA;AACA;;;AAGA;AACA;;AAEA;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA,wCAAwC,gBAAgB;AACxD,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjDA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,sBAAsB;AACtC;AACA;AACA,kBAAkB,2BAA2B;AAC7C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;AACA,iBAAiB,2BAA2B;AAC5C;AACA;AACA,QAAQ,uBAAuB;AAC/B;AACA;AACA,GAAG;AACH;AACA,iBAAiB,uBAAuB;AACxC;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA,gCAAgC,sBAAsB;AACtD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uDAAuD;AACvD;;AAEA,6BAA6B,mBAAmB;;AAEhD;;AAEA;;AAEA;AACA;AACA","file":"styles.bundle.js","sourcesContent":["// style-loader: Adds some css to the DOM by adding a <style> tag\n\n// load the styles\nvar content = require(\"!!./../node_modules/css-loader/index.js?sourcemap!./../node_modules/postcss-loader/index.js!./styles.css\");\nif(typeof content === 'string') content = [[module.id, content, '']];\n// add the styles to the DOM\nvar update = require(\"!./../node_modules/style-loader/addStyles.js\")(content, {});\nif(content.locals) module.exports = content.locals;\n// Hot Module Replacement\nif(module.hot) {\n\t// When the styles change, update the <style> tags\n\tif(!content.locals) {\n\t\tmodule.hot.accept(\"!!./../node_modules/css-loader/index.js?sourcemap!./../node_modules/postcss-loader/index.js!./styles.css\", function() {\n\t\t\tvar newContent = require(\"!!./../node_modules/css-loader/index.js?sourcemap!./../node_modules/postcss-loader/index.js!./styles.css\");\n\t\t\tif(typeof newContent === 'string') newContent = [[module.id, newContent, '']];\n\t\t\tupdate(newContent);\n\t\t});\n\t}\n\t// When the module is disposed, remove the <style> tags\n\tmodule.hot.dispose(function() { update(); });\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/adones/Projects/UNSAKINI/unsakini-ng2/src/styles.css\n// module id = 379\n// module chunks = 1","exports = module.exports = require(\"./../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \"/* You can add global styles to this file, and also import other style files */\\n\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/adones/Projects/UNSAKINI/unsakini-ng2/~/css-loader?sourcemap!/home/adones/Projects/UNSAKINI/unsakini-ng2/~/postcss-loader!/home/adones/Projects/UNSAKINI/unsakini-ng2/src/styles.css\n// module id = 652\n// module chunks = 1","/*\r\n\tMIT License http://www.opensource.org/licenses/mit-license.php\r\n\tAuthor Tobias Koppers @sokra\r\n*/\r\n// css base code, injected by the css-loader\r\nmodule.exports = function() {\r\n\tvar list = [];\r\n\r\n\t// return the list of modules as css string\r\n\tlist.toString = function toString() {\r\n\t\tvar result = [];\r\n\t\tfor(var i = 0; i < this.length; i++) {\r\n\t\t\tvar item = this[i];\r\n\t\t\tif(item[2]) {\r\n\t\t\t\tresult.push(\"@media \" + item[2] + \"{\" + item[1] + \"}\");\r\n\t\t\t} else {\r\n\t\t\t\tresult.push(item[1]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result.join(\"\");\r\n\t};\r\n\r\n\t// import a list of modules into the list\r\n\tlist.i = function(modules, mediaQuery) {\r\n\t\tif(typeof modules === \"string\")\r\n\t\t\tmodules = [[null, modules, \"\"]];\r\n\t\tvar alreadyImportedModules = {};\r\n\t\tfor(var i = 0; i < this.length; i++) {\r\n\t\t\tvar id = this[i][0];\r\n\t\t\tif(typeof id === \"number\")\r\n\t\t\t\talreadyImportedModules[id] = true;\r\n\t\t}\r\n\t\tfor(i = 0; i < modules.length; i++) {\r\n\t\t\tvar item = modules[i];\r\n\t\t\t// skip already imported module\r\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\r\n\t\t\t// when a module is imported multiple times with different media queries.\r\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\r\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\r\n\t\t\t\tif(mediaQuery && !item[2]) {\r\n\t\t\t\t\titem[2] = mediaQuery;\r\n\t\t\t\t} else if(mediaQuery) {\r\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\r\n\t\t\t\t}\r\n\t\t\t\tlist.push(item);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\treturn list;\r\n};\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/adones/Projects/UNSAKINI/unsakini-ng2/~/css-loader/lib/css-base.js\n// module id = 653\n// module chunks = 1","/*\r\n\tMIT License http://www.opensource.org/licenses/mit-license.php\r\n\tAuthor Tobias Koppers @sokra\r\n*/\r\nvar stylesInDom = {},\r\n\tmemoize = function(fn) {\r\n\t\tvar memo;\r\n\t\treturn function () {\r\n\t\t\tif (typeof memo === \"undefined\") memo = fn.apply(this, arguments);\r\n\t\t\treturn memo;\r\n\t\t};\r\n\t},\r\n\tisOldIE = memoize(function() {\r\n\t\treturn /msie [6-9]\\b/.test(window.navigator.userAgent.toLowerCase());\r\n\t}),\r\n\tgetHeadElement = memoize(function () {\r\n\t\treturn document.head || document.getElementsByTagName(\"head\")[0];\r\n\t}),\r\n\tsingletonElement = null,\r\n\tsingletonCounter = 0,\r\n\tstyleElementsInsertedAtTop = [];\r\n\r\nmodule.exports = function(list, options) {\r\n\tif(typeof DEBUG !== \"undefined\" && DEBUG) {\r\n\t\tif(typeof document !== \"object\") throw new Error(\"The style-loader cannot be used in a non-browser environment\");\r\n\t}\r\n\r\n\toptions = options || {};\r\n\t// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>\r\n\t// tags it will allow on a page\r\n\tif (typeof options.singleton === \"undefined\") options.singleton = isOldIE();\r\n\r\n\t// By default, add <style> tags to the bottom of <head>.\r\n\tif (typeof options.insertAt === \"undefined\") options.insertAt = \"bottom\";\r\n\r\n\tvar styles = listToStyles(list);\r\n\taddStylesToDom(styles, options);\r\n\r\n\treturn function update(newList) {\r\n\t\tvar mayRemove = [];\r\n\t\tfor(var i = 0; i < styles.length; i++) {\r\n\t\t\tvar item = styles[i];\r\n\t\t\tvar domStyle = stylesInDom[item.id];\r\n\t\t\tdomStyle.refs--;\r\n\t\t\tmayRemove.push(domStyle);\r\n\t\t}\r\n\t\tif(newList) {\r\n\t\t\tvar newStyles = listToStyles(newList);\r\n\t\t\taddStylesToDom(newStyles, options);\r\n\t\t}\r\n\t\tfor(var i = 0; i < mayRemove.length; i++) {\r\n\t\t\tvar domStyle = mayRemove[i];\r\n\t\t\tif(domStyle.refs === 0) {\r\n\t\t\t\tfor(var j = 0; j < domStyle.parts.length; j++)\r\n\t\t\t\t\tdomStyle.parts[j]();\r\n\t\t\t\tdelete stylesInDom[domStyle.id];\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}\r\n\r\nfunction addStylesToDom(styles, options) {\r\n\tfor(var i = 0; i < styles.length; i++) {\r\n\t\tvar item = styles[i];\r\n\t\tvar domStyle = stylesInDom[item.id];\r\n\t\tif(domStyle) {\r\n\t\t\tdomStyle.refs++;\r\n\t\t\tfor(var j = 0; j < domStyle.parts.length; j++) {\r\n\t\t\t\tdomStyle.parts[j](item.parts[j]);\r\n\t\t\t}\r\n\t\t\tfor(; j < item.parts.length; j++) {\r\n\t\t\t\tdomStyle.parts.push(addStyle(item.parts[j], options));\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar parts = [];\r\n\t\t\tfor(var j = 0; j < item.parts.length; j++) {\r\n\t\t\t\tparts.push(addStyle(item.parts[j], options));\r\n\t\t\t}\r\n\t\t\tstylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction listToStyles(list) {\r\n\tvar styles = [];\r\n\tvar newStyles = {};\r\n\tfor(var i = 0; i < list.length; i++) {\r\n\t\tvar item = list[i];\r\n\t\tvar id = item[0];\r\n\t\tvar css = item[1];\r\n\t\tvar media = item[2];\r\n\t\tvar sourceMap = item[3];\r\n\t\tvar part = {css: css, media: media, sourceMap: sourceMap};\r\n\t\tif(!newStyles[id])\r\n\t\t\tstyles.push(newStyles[id] = {id: id, parts: [part]});\r\n\t\telse\r\n\t\t\tnewStyles[id].parts.push(part);\r\n\t}\r\n\treturn styles;\r\n}\r\n\r\nfunction insertStyleElement(options, styleElement) {\r\n\tvar head = getHeadElement();\r\n\tvar lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1];\r\n\tif (options.insertAt === \"top\") {\r\n\t\tif(!lastStyleElementInsertedAtTop) {\r\n\t\t\thead.insertBefore(styleElement, head.firstChild);\r\n\t\t} else if(lastStyleElementInsertedAtTop.nextSibling) {\r\n\t\t\thead.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling);\r\n\t\t} else {\r\n\t\t\thead.appendChild(styleElement);\r\n\t\t}\r\n\t\tstyleElementsInsertedAtTop.push(styleElement);\r\n\t} else if (options.insertAt === \"bottom\") {\r\n\t\thead.appendChild(styleElement);\r\n\t} else {\r\n\t\tthrow new Error(\"Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.\");\r\n\t}\r\n}\r\n\r\nfunction removeStyleElement(styleElement) {\r\n\tstyleElement.parentNode.removeChild(styleElement);\r\n\tvar idx = styleElementsInsertedAtTop.indexOf(styleElement);\r\n\tif(idx >= 0) {\r\n\t\tstyleElementsInsertedAtTop.splice(idx, 1);\r\n\t}\r\n}\r\n\r\nfunction createStyleElement(options) {\r\n\tvar styleElement = document.createElement(\"style\");\r\n\tstyleElement.type = \"text/css\";\r\n\tinsertStyleElement(options, styleElement);\r\n\treturn styleElement;\r\n}\r\n\r\nfunction createLinkElement(options) {\r\n\tvar linkElement = document.createElement(\"link\");\r\n\tlinkElement.rel = \"stylesheet\";\r\n\tinsertStyleElement(options, linkElement);\r\n\treturn linkElement;\r\n}\r\n\r\nfunction addStyle(obj, options) {\r\n\tvar styleElement, update, remove;\r\n\r\n\tif (options.singleton) {\r\n\t\tvar styleIndex = singletonCounter++;\r\n\t\tstyleElement = singletonElement || (singletonElement = createStyleElement(options));\r\n\t\tupdate = applyToSingletonTag.bind(null, styleElement, styleIndex, false);\r\n\t\tremove = applyToSingletonTag.bind(null, styleElement, styleIndex, true);\r\n\t} else if(obj.sourceMap &&\r\n\t\ttypeof URL === \"function\" &&\r\n\t\ttypeof URL.createObjectURL === \"function\" &&\r\n\t\ttypeof URL.revokeObjectURL === \"function\" &&\r\n\t\ttypeof Blob === \"function\" &&\r\n\t\ttypeof btoa === \"function\") {\r\n\t\tstyleElement = createLinkElement(options);\r\n\t\tupdate = updateLink.bind(null, styleElement);\r\n\t\tremove = function() {\r\n\t\t\tremoveStyleElement(styleElement);\r\n\t\t\tif(styleElement.href)\r\n\t\t\t\tURL.revokeObjectURL(styleElement.href);\r\n\t\t};\r\n\t} else {\r\n\t\tstyleElement = createStyleElement(options);\r\n\t\tupdate = applyToTag.bind(null, styleElement);\r\n\t\tremove = function() {\r\n\t\t\tremoveStyleElement(styleElement);\r\n\t\t};\r\n\t}\r\n\r\n\tupdate(obj);\r\n\r\n\treturn function updateStyle(newObj) {\r\n\t\tif(newObj) {\r\n\t\t\tif(newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap)\r\n\t\t\t\treturn;\r\n\t\t\tupdate(obj = newObj);\r\n\t\t} else {\r\n\t\t\tremove();\r\n\t\t}\r\n\t};\r\n}\r\n\r\nvar replaceText = (function () {\r\n\tvar textStore = [];\r\n\r\n\treturn function (index, replacement) {\r\n\t\ttextStore[index] = replacement;\r\n\t\treturn textStore.filter(Boolean).join('\\n');\r\n\t};\r\n})();\r\n\r\nfunction applyToSingletonTag(styleElement, index, remove, obj) {\r\n\tvar css = remove ? \"\" : obj.css;\r\n\r\n\tif (styleElement.styleSheet) {\r\n\t\tstyleElement.styleSheet.cssText = replaceText(index, css);\r\n\t} else {\r\n\t\tvar cssNode = document.createTextNode(css);\r\n\t\tvar childNodes = styleElement.childNodes;\r\n\t\tif (childNodes[index]) styleElement.removeChild(childNodes[index]);\r\n\t\tif (childNodes.length) {\r\n\t\t\tstyleElement.insertBefore(cssNode, childNodes[index]);\r\n\t\t} else {\r\n\t\t\tstyleElement.appendChild(cssNode);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction applyToTag(styleElement, obj) {\r\n\tvar css = obj.css;\r\n\tvar media = obj.media;\r\n\r\n\tif(media) {\r\n\t\tstyleElement.setAttribute(\"media\", media)\r\n\t}\r\n\r\n\tif(styleElement.styleSheet) {\r\n\t\tstyleElement.styleSheet.cssText = css;\r\n\t} else {\r\n\t\twhile(styleElement.firstChild) {\r\n\t\t\tstyleElement.removeChild(styleElement.firstChild);\r\n\t\t}\r\n\t\tstyleElement.appendChild(document.createTextNode(css));\r\n\t}\r\n}\r\n\r\nfunction updateLink(linkElement, obj) {\r\n\tvar css = obj.css;\r\n\tvar sourceMap = obj.sourceMap;\r\n\r\n\tif(sourceMap) {\r\n\t\t// http://stackoverflow.com/a/26603875\r\n\t\tcss += \"\\n/*# sourceMappingURL=data:application/json;base64,\" + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + \" */\";\r\n\t}\r\n\r\n\tvar blob = new Blob([css], { type: \"text/css\" });\r\n\r\n\tvar oldSrc = linkElement.href;\r\n\r\n\tlinkElement.href = URL.createObjectURL(blob);\r\n\r\n\tif(oldSrc)\r\n\t\tURL.revokeObjectURL(oldSrc);\r\n}\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/adones/Projects/UNSAKINI/unsakini-ng2/~/style-loader/addStyles.js\n// module id = 695\n// module chunks = 1"],"sourceRoot":""}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2016 unsakini
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
@@ -0,0 +1 @@
|
|
1
|
+
### Angular Client for Unsakini
|
File without changes
|
@@ -0,0 +1,174 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
RSpec.describe "Api::Boards", type: :request do
|
4
|
+
|
5
|
+
let(:valid_board_params) {
|
6
|
+
{
|
7
|
+
:board => {:name => "board name"},
|
8
|
+
:encrypted_password => Faker::Crypto.md5
|
9
|
+
}
|
10
|
+
}
|
11
|
+
let(:invalid_board_name_param) {
|
12
|
+
{
|
13
|
+
:board => {:name => nil},
|
14
|
+
:encrypted_password => Faker::Crypto.md5
|
15
|
+
}
|
16
|
+
}
|
17
|
+
let(:invalid_encrypted_password_param) {
|
18
|
+
{
|
19
|
+
:board => {:name => "board name"},
|
20
|
+
:encrypted_password => nil
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
before(:each) do
|
25
|
+
user_has_shared_board_scenario
|
26
|
+
end
|
27
|
+
|
28
|
+
describe "POST /api/boards" do
|
29
|
+
|
30
|
+
it "returns http unauthorized" do
|
31
|
+
post api_boards_path
|
32
|
+
expect(response).to have_http_status(:unauthorized)
|
33
|
+
end
|
34
|
+
|
35
|
+
it "rejects invalid board name" do
|
36
|
+
prev_boards_count = @user.boards.count
|
37
|
+
preve_user_boards_count = @user.user_boards.count
|
38
|
+
post api_boards_path, params: invalid_board_name_param, headers: auth_headers(@user), as: :json
|
39
|
+
expect(response).to have_http_status(:unprocessable_entity)
|
40
|
+
expect(@user.boards.count).to eq(prev_boards_count)
|
41
|
+
expect(@user.user_boards.count).to eq(preve_user_boards_count)
|
42
|
+
end
|
43
|
+
|
44
|
+
it "rejects invalid encrypted_password" do
|
45
|
+
prev_boards_count = @user.boards.count
|
46
|
+
preve_user_boards_count = @user.user_boards.count
|
47
|
+
post api_boards_path, params: invalid_encrypted_password_param, headers: auth_headers(@user), as: :json
|
48
|
+
expect(response).to have_http_status(:unprocessable_entity)
|
49
|
+
expect(@user.boards.count).to eq(prev_boards_count)
|
50
|
+
expect(@user.user_boards.count).to eq(preve_user_boards_count)
|
51
|
+
end
|
52
|
+
|
53
|
+
it "creates new board" do
|
54
|
+
prev_boards_count = @user.boards.count
|
55
|
+
preve_user_boards_count = @user.user_boards.count
|
56
|
+
post api_boards_path, params: valid_board_params, headers: auth_headers(@user), as: :json
|
57
|
+
expect(response).to have_http_status(:created)
|
58
|
+
expect(parse_json(response.body)).to match_json_schema(:board)
|
59
|
+
expect(body_to_json["board"]["name"]).to eq(valid_board_params[:board][:name])
|
60
|
+
expect(body_to_json["encrypted_password"]).to eq(valid_board_params[:encrypted_password])
|
61
|
+
expect(body_to_json["is_admin"]).to be true
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
|
66
|
+
describe "GET /api/boards/:id" do
|
67
|
+
|
68
|
+
it "returns http unauthorized" do
|
69
|
+
get api_board_path(@board)
|
70
|
+
expect(response).to have_http_status(:unauthorized)
|
71
|
+
end
|
72
|
+
|
73
|
+
it "returns http not_found" do
|
74
|
+
get api_board_path({id: 1000000}), headers: auth_headers(@user), as: :json
|
75
|
+
expect(response).to have_http_status(:not_found)
|
76
|
+
end
|
77
|
+
|
78
|
+
it "returns http forbidden" do
|
79
|
+
get api_board_path(@board), headers: auth_headers(@user_2)
|
80
|
+
expect(response).to have_http_status(:forbidden)
|
81
|
+
end
|
82
|
+
|
83
|
+
it "returns board resource" do
|
84
|
+
# debugger
|
85
|
+
get api_board_path(@board), headers: auth_headers(@user)
|
86
|
+
# debugger
|
87
|
+
expect(response).to have_http_status(:ok)
|
88
|
+
expect(response.body).to match_json_schema(:board)
|
89
|
+
expect(response.body).to be_json_eql(serialize(@user_board))
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
describe "PUT /api/boards/:id" do
|
94
|
+
|
95
|
+
it "returns http unauthorized" do
|
96
|
+
put api_board_path(@board)
|
97
|
+
expect(response).to have_http_status(:unauthorized)
|
98
|
+
end
|
99
|
+
|
100
|
+
it "returns http forbidden" do
|
101
|
+
put api_board_path(@board), params: valid_board_params, headers: auth_headers(@user_2), as: :json
|
102
|
+
expect(response).to have_http_status(:forbidden)
|
103
|
+
end
|
104
|
+
|
105
|
+
it "returns http not_found" do
|
106
|
+
put api_board_path({id: 1000000}), params: valid_board_params, headers: auth_headers(@user), as: :json
|
107
|
+
expect(response).to have_http_status(:not_found)
|
108
|
+
end
|
109
|
+
|
110
|
+
it "rejects invalide encrypted_password" do
|
111
|
+
put api_board_path(@board), params: invalid_encrypted_password_param, headers: auth_headers(@user), as: :json
|
112
|
+
expect(response).to have_http_status(:unprocessable_entity)
|
113
|
+
@board.reload
|
114
|
+
@user_board.reload
|
115
|
+
expect(@board.name).not_to eq(invalid_encrypted_password_param[:board][:name])
|
116
|
+
expect(@user_board.encrypted_password).not_to eq(invalid_encrypted_password_param[:encrypted_password])
|
117
|
+
end
|
118
|
+
|
119
|
+
it "accepts invalid board name" do
|
120
|
+
put api_board_path(@board), params: invalid_board_name_param, headers: auth_headers(@user), as: :json
|
121
|
+
expect(response).to have_http_status(:ok)
|
122
|
+
@board.reload
|
123
|
+
@user_board.reload
|
124
|
+
expect(@board.name).not_to be_falsy
|
125
|
+
expect(@user_board.encrypted_password).to eq(invalid_board_name_param[:encrypted_password])
|
126
|
+
end
|
127
|
+
|
128
|
+
it "updates the board resource" do
|
129
|
+
put api_board_path(@board), params: valid_board_params, headers: auth_headers(@user), as: :json
|
130
|
+
expect(response).to have_http_status(:ok)
|
131
|
+
expect(response.body).to match_json_schema(:board)
|
132
|
+
expect(body_to_json['board']['name']).to eq(valid_board_params[:board][:name])
|
133
|
+
expect(body_to_json['encrypted_password']).to eq(valid_board_params[:encrypted_password])
|
134
|
+
@user_board.reload
|
135
|
+
expect(response.body).to be_json_eql(serialize(@user_board))
|
136
|
+
expect(@board.user_boards.where.not(encrypted_password: '').first).to eq @user_board
|
137
|
+
expect(@board.user_boards.where.not(encrypted_password: '').count).to eq 1
|
138
|
+
expect(@shared_board.user_boards.where.not(encrypted_password: '').all).not_to be_nil
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
describe "DELETE /api/boards/:id" do
|
143
|
+
|
144
|
+
it "returns http unauthorized" do
|
145
|
+
delete api_board_path(@board)
|
146
|
+
expect(response).to have_http_status(:unauthorized)
|
147
|
+
end
|
148
|
+
|
149
|
+
it "returns http forbidden if not board owner" do
|
150
|
+
delete api_board_path(@board), headers: auth_headers(@user_2), as: :json
|
151
|
+
expect(response).to have_http_status(:forbidden)
|
152
|
+
end
|
153
|
+
|
154
|
+
it "returns http not_found" do
|
155
|
+
delete api_board_path({id: 1000000}), headers: auth_headers(@user), as: :json
|
156
|
+
expect(response).to have_http_status(:not_found)
|
157
|
+
end
|
158
|
+
|
159
|
+
it "deletes the board resource and its post and comments" do
|
160
|
+
expect(Board.find_by_id(@board.id)).not_to be_nil
|
161
|
+
expect(UserBoard.where(board_id: @board.id).all).not_to be_empty
|
162
|
+
expect(Post.where(board_id: @board.id).all).not_to be_empty
|
163
|
+
expect(Comment.where(post_id: @post.id).all).not_to be_empty
|
164
|
+
expect{delete api_board_path(@board), headers: auth_headers(@user), as: :json}
|
165
|
+
.to change{@user.boards.count}.by(-1)
|
166
|
+
expect(response).to have_http_status(:ok)
|
167
|
+
expect(Board.find_by_id(@board.id)).to be_nil
|
168
|
+
expect(UserBoard.where(board_id: @board.id).all).to be_empty
|
169
|
+
expect(Post.where(board_id: @board.id).all).to be_empty
|
170
|
+
expect(Comment.where(post_id: @post.id).all).to be_empty
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
RSpec.describe "Api::Boards", type: :request do
|
4
|
+
|
5
|
+
before(:each) do
|
6
|
+
boards_pagination_scenario
|
7
|
+
end
|
8
|
+
|
9
|
+
let(:num_per_page) {
|
10
|
+
10
|
11
|
+
}
|
12
|
+
|
13
|
+
|
14
|
+
describe "Pagination" do
|
15
|
+
|
16
|
+
context "Private Boards" do
|
17
|
+
|
18
|
+
describe "GET /api/boards" do
|
19
|
+
|
20
|
+
it "returns current user's boards" do
|
21
|
+
get api_boards_path, params: {page: 1}, headers: auth_headers(@user)
|
22
|
+
expect(response).to have_http_status(:ok)
|
23
|
+
expect(body_to_json.count).to eq num_per_page
|
24
|
+
expect(body_to_json('0')).to match_json_schema(:board)
|
25
|
+
expect(get_header("Total").to_i).to eq @num_boards
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
context "My Shared Boards" do
|
33
|
+
|
34
|
+
describe "GET /api/boards, admin = true" do
|
35
|
+
|
36
|
+
it "returns current user's shared boards" do
|
37
|
+
get api_boards_path, params: {page: 1, admin: true, shared: true}, headers: auth_headers(@user)
|
38
|
+
expect(response).to have_http_status(:ok)
|
39
|
+
expect(body_to_json.count).to eq num_per_page
|
40
|
+
expect(body_to_json('0')).to match_json_schema(:board)
|
41
|
+
expect(get_header("Total").to_i).to eq @num_my_shared_boards
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
|
51
|
+
end
|
@@ -21,64 +21,7 @@ RSpec.describe "Api::Boards", type: :request do
|
|
21
21
|
}
|
22
22
|
}
|
23
23
|
|
24
|
-
|
25
|
-
before(:each) do
|
26
|
-
user_has_board_scenario
|
27
|
-
end
|
28
|
-
it "returns http unauthorized" do
|
29
|
-
get api_boards_path
|
30
|
-
expect(response).to have_http_status(:unauthorized)
|
31
|
-
end
|
32
|
-
it "returns current user's boards" do
|
33
|
-
get api_boards_path, headers: auth_headers(@user)
|
34
|
-
expect(response).to have_http_status(:ok)
|
35
|
-
expect(body_to_json('0')).to match_json_schema(:board)
|
36
|
-
expect(response.body).to be_json_eql(serialize(@user.user_boards.all))
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
describe "POST /api/boards" do
|
41
|
-
|
42
|
-
before(:each) do
|
43
|
-
create_board_scenario
|
44
|
-
end
|
45
|
-
|
46
|
-
it "returns http unauthorized" do
|
47
|
-
post api_boards_path
|
48
|
-
expect(response).to have_http_status(:unauthorized)
|
49
|
-
end
|
50
|
-
|
51
|
-
it "rejects invalid board name" do
|
52
|
-
prev_boards_count = @user.boards.count
|
53
|
-
preve_user_boards_count = @user.user_boards.count
|
54
|
-
post api_boards_path, params: invalid_board_name_param, headers: auth_headers(@user), as: :json
|
55
|
-
expect(response).to have_http_status(:unprocessable_entity)
|
56
|
-
expect(@user.boards.count).to eq(prev_boards_count)
|
57
|
-
expect(@user.user_boards.count).to eq(preve_user_boards_count)
|
58
|
-
end
|
59
|
-
|
60
|
-
it "rejects invalid encrypted_password" do
|
61
|
-
prev_boards_count = @user.boards.count
|
62
|
-
preve_user_boards_count = @user.user_boards.count
|
63
|
-
post api_boards_path, params: invalid_encrypted_password_param, headers: auth_headers(@user), as: :json
|
64
|
-
expect(response).to have_http_status(:unprocessable_entity)
|
65
|
-
expect(@user.boards.count).to eq(prev_boards_count)
|
66
|
-
expect(@user.user_boards.count).to eq(preve_user_boards_count)
|
67
|
-
end
|
68
|
-
|
69
|
-
it "creates new board" do
|
70
|
-
prev_boards_count = @user.boards.count
|
71
|
-
preve_user_boards_count = @user.user_boards.count
|
72
|
-
post api_boards_path, params: valid_board_params, headers: auth_headers(@user), as: :json
|
73
|
-
expect(response).to have_http_status(:created)
|
74
|
-
expect(parse_json(response.body)).to match_json_schema(:board)
|
75
|
-
expect(body_to_json["board"]["name"]).to eq(valid_board_params[:board][:name])
|
76
|
-
expect(body_to_json["encrypted_password"]).to eq(valid_board_params[:encrypted_password])
|
77
|
-
expect(body_to_json["is_admin"]).to be true
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
|
-
context "My Boards" do
|
24
|
+
context "Private Boards" do
|
82
25
|
|
83
26
|
before(:each) do
|
84
27
|
user_has_shared_board_scenario
|
@@ -190,47 +133,7 @@ RSpec.describe "Api::Boards", type: :request do
|
|
190
133
|
expect(Post.where(board_id: @board.id).all).to be_empty
|
191
134
|
expect(Comment.where(post_id: @post.id).all).to be_empty
|
192
135
|
end
|
193
|
-
end
|
194
|
-
end
|
195
|
-
|
196
|
-
context "Shared Board" do
|
197
136
|
|
198
|
-
before(:each) do
|
199
|
-
user_has_shared_board_scenario
|
200
|
-
end
|
201
|
-
|
202
|
-
describe "GET /api/boards/:id" do
|
203
|
-
|
204
|
-
it "returns http unauthorized" do
|
205
|
-
get api_board_path(@shared_board)
|
206
|
-
expect(response).to have_http_status(:unauthorized)
|
207
|
-
end
|
208
|
-
|
209
|
-
it "returns board resource" do
|
210
|
-
get api_board_path(@shared_board), headers: auth_headers(@user_2)
|
211
|
-
expect(response).to have_http_status(:ok)
|
212
|
-
expect(response.body).to match_json_schema(:board)
|
213
|
-
expect(response.body).to be_json_eql(serialize(@shared_user_board_2))
|
214
|
-
end
|
215
|
-
end
|
216
|
-
|
217
|
-
describe "PUT /api/boards/:id" do
|
218
|
-
it "updates the board resource" do
|
219
|
-
put api_board_path(@shared_board), params: valid_board_params, headers: auth_headers(@user_2), as: :json
|
220
|
-
expect(response).to have_http_status(:forbidden)
|
221
|
-
@shared_board.reload
|
222
|
-
expect(@shared_board.name).not_to eq(valid_board_params[:board][:name])
|
223
|
-
expect(@shared_user_board_2.encrypted_password).not_to eq(valid_board_params[:encrypted_password])
|
224
|
-
end
|
225
|
-
end
|
226
|
-
|
227
|
-
describe "DELETE /api/boards/:id" do
|
228
|
-
|
229
|
-
it "returns http forbidden if not board owner" do
|
230
|
-
delete api_board_path(@shared_board), headers: auth_headers(@user_2), as: :json
|
231
|
-
expect(response).to have_http_status(:forbidden)
|
232
|
-
expect(Board.find(@shared_board.id)).not_to be_nil
|
233
|
-
end
|
234
137
|
end
|
235
138
|
|
236
139
|
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
RSpec.describe "Api::Boards", type: :request do
|
4
|
+
|
5
|
+
let(:valid_board_params) {
|
6
|
+
{
|
7
|
+
:board => {:name => "board name"},
|
8
|
+
:encrypted_password => Faker::Crypto.md5
|
9
|
+
}
|
10
|
+
}
|
11
|
+
let(:invalid_board_name_param) {
|
12
|
+
{
|
13
|
+
:board => {:name => nil},
|
14
|
+
:encrypted_password => Faker::Crypto.md5
|
15
|
+
}
|
16
|
+
}
|
17
|
+
let(:invalid_encrypted_password_param) {
|
18
|
+
{
|
19
|
+
:board => {:name => "board name"},
|
20
|
+
:encrypted_password => nil
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
context "Shared Board" do
|
25
|
+
|
26
|
+
before(:each) do
|
27
|
+
user_has_shared_board_scenario
|
28
|
+
end
|
29
|
+
|
30
|
+
describe "GET /api/boards/:id" do
|
31
|
+
|
32
|
+
it "returns http unauthorized" do
|
33
|
+
get api_board_path(@shared_board)
|
34
|
+
expect(response).to have_http_status(:unauthorized)
|
35
|
+
end
|
36
|
+
|
37
|
+
it "returns board resource" do
|
38
|
+
get api_board_path(@shared_board), headers: auth_headers(@user_2)
|
39
|
+
expect(response).to have_http_status(:ok)
|
40
|
+
expect(response.body).to match_json_schema(:board)
|
41
|
+
expect(response.body).to be_json_eql(serialize(@shared_user_board_2))
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
describe "PUT /api/boards/:id" do
|
46
|
+
it "updates the board resource" do
|
47
|
+
put api_board_path(@shared_board), params: valid_board_params, headers: auth_headers(@user_2), as: :json
|
48
|
+
expect(response).to have_http_status(:forbidden)
|
49
|
+
@shared_board.reload
|
50
|
+
expect(@shared_board.name).not_to eq(valid_board_params[:board][:name])
|
51
|
+
expect(@shared_user_board_2.encrypted_password).not_to eq(valid_board_params[:encrypted_password])
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
describe "DELETE /api/boards/:id" do
|
56
|
+
|
57
|
+
it "returns http forbidden if not board owner" do
|
58
|
+
delete api_board_path(@shared_board), headers: auth_headers(@user_2), as: :json
|
59
|
+
expect(response).to have_http_status(:forbidden)
|
60
|
+
expect(Board.find(@shared_board.id)).not_to be_nil
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|