feature(olark) bower -> npm

This commit is contained in:
coderaiser 2018-10-17 12:28:23 +03:00
parent c3dd2cb44d
commit 2673e745f4
9 changed files with 3 additions and 227 deletions

View file

@ -1,3 +0,0 @@
{
"directory" : "modules"
}

View file

@ -1,33 +0,0 @@
{
"name": "cloudcmd",
"homepage": "https://github.com/coderaiser/cloudcmd",
"authors": [
"coderaiser <mnemonic.enemy@gmail.com>"
],
"description": "orthodox web file manager with console and editor",
"main": "bin/cloudcmd.js",
"keywords": [
"console",
"editor",
"file",
"file manager",
"folder",
"orthodox",
"view",
"copy",
"rename",
"move",
"delete",
"file operation"
],
"license": "MIT",
"private": true,
"ignore": [
"node_modules",
"modules",
"test"
],
"dependencies": {
"olark": "^1.0.0"
}
}

View file

@ -1,15 +1,12 @@
/* global CloudCmd */
/* global DOM */
/* global olark */
'use strict';
CloudCmd.Contact = exports;
const {promisify} = require('es6-promisify');
const olark = require('@cloudcmd/olark');
const Images = require('../dom/images');
const loadJS = promisify(require('load.js/legacy').js);
const Events = DOM.Events;
const Key = CloudCmd.Key;
@ -17,16 +14,8 @@ const Key = CloudCmd.Key;
module.exports.show = show;
module.exports.hide = hide;
let Inited = false;
module.exports.init = async () => {
if (Inited)
return;
module.exports.init = () => {
Events.addKey(onKey);
await load();
Inited = true;
olark.identify('6216-545-10-4223');
olark('api.box.onExpand', show);
@ -34,22 +23,10 @@ module.exports.init = async () => {
olark('api.box.onShrink', hide);
};
const load = async () => {
const {PREFIX} = CloudCmd;
const path = `${PREFIX}/modules/olark/olark.min.js`;
Images.show.load('top');
await loadJS(path);
};
function show() {
Key.unsetBind();
Images.hide();
if (!Inited)
return;
olark('api.box.expand');
}

View file

@ -1,26 +0,0 @@
{
"name": "olark",
"homepage": "https://github.com/cloudcmd/olark",
"authors": [
"coderaiser <mnemonic.enemy@gmail.com>"
],
"description": "olark extension for chat",
"main": "olark.min.js",
"keywords": [
"olark",
"chat"
],
"license": "MIT",
"ignore": [],
"dependencies": {},
"version": "1.0.0",
"_release": "1.0.0",
"_resolution": {
"type": "version",
"tag": "v1.0.0",
"commit": "fe00c4e0846a370aa0d5a7b73eb7c08020d18a35"
},
"_source": "https://github.com/cloudcmd/olark.git",
"_target": "^1.0.0",
"_originalSource": "olark"
}

View file

@ -1,18 +0,0 @@
# Olark
Extracted instalation code for [olark](https://www.olark.com) to install via bower.
## Install
```
bower i olark --save
```
## How to use?
Add `olark.min.js` to your page and initialize olark with site id:
```js
olark.identify('xxxx-xxx-xx-xxxx');
```

View file

@ -1,19 +0,0 @@
{
"name": "olark",
"homepage": "https://github.com/cloudcmd/olark",
"authors": [
"coderaiser <mnemonic.enemy@gmail.com>"
],
"description": "olark extension for chat",
"main": "olark.min.js",
"keywords": [
"olark",
"chat"
],
"license": "MIT",
"ignore": [
],
"dependencies": {
}
}

View file

@ -1,86 +0,0 @@
window.olark || (function (c) {
var f = window,
d = document,
l = f.location.protocol == "https:" ? "https:" : "http:",
z = c.name,
r = "load";
var nt = function () {
f[z] = function () {
(a.s = a.s || []).push(arguments);
};
var a = f[z]._ = {}, q = c.methods.length;
while (q--) {
(function (n) {
f[z][n] = function () {
f[z]("call", n, arguments);
};
})(c.methods[q]);
}
a.l = c.loader;
a.i = nt;
a.p = {
0: +new Date()
};
a.P = function (u) {
a.p[u] = new Date() - a.p[0];
};
function s() {
a.P(r);
f[z](r);
}
f.addEventListener ? f.addEventListener(r, s, false) : f.attachEvent("on" + r, s);
var ld = function () {
function p(hd) {
hd = "head";
return ["<", hd, "></", hd, "><", i, ' onl' + 'oad="var d=', g, ";d.getElementsByTagName('head')[0].", j, "(d.", h, "('script')).", k, "='", l, "//", a.l, "'", '"', "></", i, ">"].join("");
}
var i = "body",
m = d[i];
if (!m) {
return setTimeout(ld, 100);
}
a.P(1);
var j = "appendChild",
h = "createElement",
k = "src",
n = d[h]("div"),
v = n[j](d[h](z)),
b = d[h]("iframe"),
g = "document",
e = "domain",
o;
n.style.display = "none";
m.insertBefore(n, m.firstChild).id = z;
b.frameBorder = "0";
b.id = z + "-loader";
if (/MSIE[ ]+6/.test(navigator.userAgent)) {
b.src = "javascript:false";
}
b.allowTransparency = "true";
v[j](b);
try {
b.contentWindow[g].open();
} catch (w) {
c[e] = d[e];
o = "javascript:var d=" + g + ".open();d.domain='" + d.domain + "';";
b[k] = o + "void(0);";
}
try {
var t = b.contentWindow[g];
t.write(p());
t.close();
} catch (x) {
b[k] = o + 'd.write("' + p().replace(/"/g, String.fromCharCode(92) + '"') + '");d.close();';
}
a.P(2);
};
ld();
};
nt();
})({
loader: "static.olark.com/jsclient/loader0.js",
name: "olark",
methods: ["configure", "extend", "declare", "identify"]
});

View file

@ -1,17 +0,0 @@
window.olark||(function(c){var f=window,d=document,l=f.location.protocol=="https:"?"https:":"http:",z=c.name,r="load";var nt=function(){
f[z]=function(){
(a.s=a.s||[]).push(arguments)};var a=f[z]._={
},q=c.methods.length;while(q--){(function(n){f[z][n]=function(){
f[z]("call",n,arguments)}})(c.methods[q])}a.l=c.loader;a.i=nt;a.p={
0:+new Date};a.P=function(u){
a.p[u]=new Date-a.p[0]};function s(){
a.P(r);f[z](r)}f.addEventListener?f.addEventListener(r,s,false):f.attachEvent("on"+r,s);var ld=function(){function p(hd){
hd="head";return["<",hd,"></",hd,"><",i,' onl' + 'oad="var d=',g,";d.getElementsByTagName('head')[0].",j,"(d.",h,"('script')).",k,"='",l,"//",a.l,"'",'"',"></",i,">"].join("")}var i="body",m=d[i];if(!m){
return setTimeout(ld,100)}a.P(1);var j="appendChild",h="createElement",k="src",n=d[h]("div"),v=n[j](d[h](z)),b=d[h]("iframe"),g="document",e="domain",o;n.style.display="none";m.insertBefore(n,m.firstChild).id=z;b.frameBorder="0";b.id=z+"-loader";if(/MSIE[ ]+6/.test(navigator.userAgent)){
b.src="javascript:false"}b.allowTransparency="true";v[j](b);try{
b.contentWindow[g].open()}catch(w){
c[e]=d[e];o="javascript:var d="+g+".open();d.domain='"+d.domain+"';";b[k]=o+"void(0);"}try{
var t=b.contentWindow[g];t.write(p());t.close()}catch(x){
b[k]=o+'d.write("'+p().replace(/"/g,String.fromCharCode(92)+'"')+'");d.close();'}a.P(2)};ld()};nt()})({
loader: "static.olark.com/jsclient/loader0.js",name:"olark",methods:["configure","extend","declare","identify"]});

View file

@ -167,6 +167,7 @@
"@cloudcmd/clipboard": "^1.0.2",
"@cloudcmd/create-element": "^1.0.0",
"@cloudcmd/modal": "^1.0.0",
"@cloudcmd/olark": "^2.0.1",
"babel-loader": "^8.0.0",
"babel-plugin-macros": "^2.2.1",
"clean-css-loader": "^1.0.1",