Вверх ↑
Ответов: 1731
Рейтинг: 68
#1: 2016-09-27 02:48:55 ЛС | профиль | цитата
vkapi.sha


Make(webapp)
Add(MainForm,1,84,182)
{
Width=#3:400|
Height=#3:332|
Caption=#13:ВКонтакте API|
link(onCreate,7:doWork1,[])
}
Add(MultiElementEx,3,182,182)
{
@Color=#507299
@Comment=#5:Login|
link(onEvent1,22:doWork1,[])
link(Data1,53:Value,[])
}
BEGIN_SDK
Make(webapp)
Add(MultiElementEditor,2,49,35)
{
EventCount=1
WorkCount=1
DataCount=1
VarCount=1
@Width=566
@Height=165
link(doWork1,52:doData,[(123,41)(123,139)])
link(Var1,143:Result,[(55,186)(405,186)])
}
Add(Inline,9,273,133)
{
WorkCount=1
EventCount=1
Code=#28:doWork1: function(settings){|17: let self = this;|38: VK.Auth.getLoginStatus(function(res){|36: if(res.status !== "connected"){|32: VK.Auth.login(function(lres){|34: if(lres.status == "connected")|33: self.onEvent1(lres.session);|8: else|33: self.onEvent1(lres.session);|15: },settings);|35: }else self.onEvent1(res.session);|4: });|1:}|
link(onEvent1,142:doValue,[(352,139)(352,97)])
}
Add(DoData,52,196,133)
{
link(onEventData,9:doWork1,[])
link(Data,2:Data1,[(202,84)(55,84)])
}
Add(Memory,142,399,91)
{
link(onData,143:doGet,[(447,97)(447,129)(385,129)(385,146)])
}
Add(JSON_Field,143,399,140)
{
Name=#3:mid|
link(onGet,2:onEvent1,[(523,146)(523,41)])
link(Object,142:Value,[])
}
END_SDK
Add(Label,5,504,266)
{
Left=63
Top=21
Width=#3:176|
Height=#2:21|
Theme=#9:user_name|
}
Add(MultiElementEx,7,133,182)
{
@Color=#507299
@Comment=#4:Init|
link(onEvent1,3:doWork1,[])
}
BEGIN_SDK
Make(webapp)
Add(MultiElementEditor,6,7,7)
{
EventCount=1
WorkCount=1
@Width=342
@Height=88
link(doWork1,8:doWork1,[(53,13)(53,48)])
}
Add(Inline,8,98,42)
{
WorkCount=1
EventCount=2
Code=#20:doWork1: function(){|45: let oa = document.querySelector("#openapi");|16: if(oa == null){|43: let s = document.createElement("script");|39: s.src = "//vk.com/js/api/openapi.js";|19: s.id = "openapi";|31: document.head.appendChild(s);|18: this.onEvent1();|23: }else this.onEvent2();|1:}|
link(onEvent1,17:doTimer,[])
link(onEvent2,100:doWork3,[(271,55)])
}
Add(Inline,16,210,42)
{
WorkCount=1
EventCount=1
Code=#20:doWork1: function(){|10: VK.init({|46: apiId: 5641448, // Standalone application ID|20: onlyWidgets: false|4: });|17: this.onEvent1();|1:}|
link(onEvent1,100:doWork2,[])
}
Add(Timer,17,154,42)
{
AutoStop=1
link(onTimer,16:doWork1,[])
}
Add(HubEx,100,267,42)
{
Angle=3
link(onEvent,6:onEvent1,[(271,13)])
}
END_SDK
Add(MultiElementEx,22,238,182)
{
@Color=#507299
@Comment=#49:Возвращает расширенную информацию о пользователях|28:https://vk.com/dev/users.get|
link(onEvent1,63:doEvent1,[(284,188)(284,230)(182,230)(182,272)])
link(Data1,144:Var3,[(244,168)(223,168)(223,225)])
link(Data2,28:Value,[(251,163)(286,163)])
}
BEGIN_SDK
Make(webapp)
Add(MultiElementEditor,21,119,35)
{
EventCount=1
WorkCount=1
DataCount=2
VarCount=1
@Width=307
@Height=144
link(doWork1,30:doString,[(147,41)(147,90)])
link(Var1,34:Value,[(125,148)(321,148)])
}
Add(Inline,25,245,84)
{
WorkCount=1
EventCount=1
Code=#24:doWork1: function(data){|17: let self = this;|99: VK.Api.call('users.get', {user_ids: data.split(';')[0], fields: data.split(';')[1]}, function(r) {|18: if(r.response) {|32: self.onEvent1(r.response[0]);|3: }|4: });|1:}|
link(onEvent1,34:doValue,[])
}
Add(FormatStr,30,175,84)
{
Mask=#5:%1;%2|
link(onFString,25:doWork1,[])
link(Str1,21:Data1,[(181,60)(125,60)])
link(Str2,21:Data2,[(188,54)(132,54)])
}
Add(Memory,34,315,84)
{
link(onData,21:onEvent1,[(387,90)(387,41)])
}
END_SDK
Add(Memory,28,280,112)
{
Default=String(photo_id, verified, sex, bdate, city, country, home_town, has_photo, photo_50, photo_100, photo_200_orig, photo_200, photo_400_orig, photo_max, photo_max_orig, online, lists, domain, has_mobile, contacts, site, education, universities, schools, status, last_seen, followers_count, common_count, occupation, nickname, relatives, relation, personal, connections, exports, wall_comments, activities, interests, music, movies, tv, books, games, about, quotes, can_post, can_see_all_posts, can_see_audio, can_write_private_message, can_send_friend_request, is_favorite, is_hidden_from_feed, timezone, screen_name, maiden_name, crop_photo, is_friend, friend_status, career, military, blacklisted, blacklisted_by_me)
@Comment=#64:Список дополнительных полей профилей, которые необходимо вернуть|
}
Add(JSON_Field,36,238,266)
{
Name=#10:first_name|
link(onGet,38:doGet,[])
link(Object,49:Var2,[])
}
Add(JSON_Field,38,287,266)
{
Name=#9:last_name|
link(onGet,43:doGet,[])
link(Object,50:Var2,[])
}
Add(FormatStr,40,448,266)
{
link(onFString,5:doCaption,[])
link(Str1,36:Result,[(454,253)(392,253)(392,342)(244,342)])
link(Str2,38:Result,[(461,232)(332,232)(332,312)(293,312)])
}
Add(Image,41,504,308)
{
Left=7
Top=7
Width=#2:50|
Height=#2:50|
Theme=#6:avatar|
}
Add(JSON_Field,43,343,266)
{
Name=#8:photo_50|
link(onGet,51:doEvent1,[])
link(Object,50:Var3,[(349,252)])
}
Add(GetDataEx,49,238,245)
{
link(Data,22:Var1,[])
}
Add(GetDataEx,50,287,245)
{
Angle=3
link(Data,49:Var3,[])
}
Add(Hub,51,406,266)
{
link(onEvent1,40:doString,[])
link(onEvent2,41:doLoad,[(439,279)(439,314)])
}
Add(Memory,53,182,112)
{
Default=Real(8)
@Comment=#24:Права доступа приложения|30:https://vk.com/dev/permissions|
}
Add(ListBox,56,511,469)
{
Top=63
Width=#3:400|
Height=#3:212|
link(onSelect,73:doRead,[])
}
Add(MultiElementEx,57,238,413)
{
@Color=#507299
@Comment=#59:Возвращает список аудиозаписей пользователя или сообщества.|28:https://vk.com/dev/audio.get|
link(onEvent1,67:doEnum,[(282,419)(282,455)(224,455)(224,475)])
link(Data1,144:Var2,[(244,352)(216,352)])
link(Data2,65:Value,[(251,394)(286,394)])
link(Data3,66:Value,[(258,399)(328,399)])
}
BEGIN_SDK
Make(webapp)
Add(MultiElementEditor,58,119,35)
{
EventCount=1
WorkCount=1
DataCount=3
VarCount=1
@Width=307
@Height=144
link(doWork1,60:doString,[(147,41)(147,90)])
link(Var1,61:Value,[(125,148)(321,148)])
}
Add(Inline,59,245,84)
{
WorkCount=1
EventCount=1
Code=#24:doWork1: function(data){|17: let self = this;|126: VK.Api.call('audio.get', {owner_id: data.split(';')[0], offset: data.split(';')[1], count: data.split(';')[2]}, function(r) {|18: if(r.response) {|22: r.response.shift();|29: self.onEvent1(r.response);|3: }|4: });|1:}|
link(onEvent1,61:doValue,[])
}
Add(FormatStr,60,175,84)
{
DataCount=3
Mask=#8:%1;%2;%3|
link(onFString,59:doWork1,[])
link(Str1,58:Data1,[(181,60)(125,60)])
link(Str2,58:Data2,[(188,60)(132,60)])
link(Str3,58:Data3,[(195,60)(139,60)])
}
Add(Memory,61,315,84)
{
link(onData,58:onEvent1,[(387,90)(387,41)])
}
END_SDK
Add(Hub,63,196,266)
{
link(onEvent1,36:doGet,[])
link(onEvent2,57:doWork1,[(224,279)(224,419)])
}
Add(Memory,65,280,350)
{
Default=Real(0)
@Comment=#91:Смещение, необходимое для выборки определенного количества аудиозаписей. По умолчанию — 0. |
}
Add(Memory,66,322,350)
{
Default=Real(10)
@Comment=#95:Количество аудиозаписей, информацию о которых необходимо вернуть. Максимальное значение — 6000.|
}
Add(ArrayEnum,67,238,469)
{
link(onEnum,68:doValue,[])
link(Array,74:Var2,[])
}
Add(Memory,68,294,469)
{
link(onData,69:doGet,[])
}
Add(JSON_Field,69,357,469)
{
Name=#6:artist|
link(onGet,70:doGet,[])
link(Object,72:Var2,[])
}
Add(JSON_Field,70,406,469)
{
Name=#5:title|
link(onGet,75:doString,[])
link(Object,72:Var3,[(412,450)])
}
Add(GetDataEx,72,357,443)
{
Angle=3
link(Data,68:Value,[(339,450)(339,515)(300,515)])
}
Add(ArrayRead,73,567,469)
{
link(onRead,77:doGet,[])
link(Array,74:Var3,[(573,462)])
link(Index,56:SelectIndex,[(580,452)(553,452)(553,515)(517,515)])
}
Add(GetDataEx,74,238,455)
{
link(Data,57:Var1,[])
}
Add(FormatStr,75,455,469)
{
Mask=#7:%1 – %2|
link(onFString,56:doAdd,[])
link(Str1,69:Result,[(461,455)(397,455)(397,514)(363,514)])
}
Add(JSON_Field,77,630,469)
{
Name=#3:url|
link(onGet,79:doEvent1,[])
link(Object,73:Value,[(636,453)(612,453)(612,515)(573,515)])
}
Add(AudioPlayer,78,714,455)
{
Top=277
Width=#3:400|
Point(doURL)
}
Add(Hub,79,679,469)
{
link(onEvent1,78:doURL,[])
link(onEvent2,78:doPlay,[(703,482)(703,461)])
}
Add(CSS,141,133,133)
{
StyleSheet=#8:.dialog{|46: -webkit-font-smoothing: subpixel-antialiased;|34: -moz-osx-font-smoothing: auto;|23: border-color: #507299;|1:}|0:|19:.dialog > .caption{|27: background-color: #507299;|1:}|0:|16:.dialog > .body{|49: background-color: rgb(237, 238, 240) !important;|1:}|0:|8:.avatar{|20: border-radius: 50%;|1:}|0:|11:.user_name{|17: font-size: 19px;|22: line-height: 25px;|21: font-weight: 400;|19: margin: -1px 0;|21: overflow: hidden;|28: text-overflow: ellipsis;|1:}|
}
Add(GetDataEx,144,210,218)
{
Angle=3
link(Data,3:Var1,[(188,225)])
}


Сам инлайн работает как нужно.
карма: 1

0