Posts

angular ui router - Why don't comment upvotes work? thinkster.io, angularjs tutorial, mean, incrementUpvote() -

i'm following thinkster angular js tutorial here: https://thinkster.io/angulartutorial/mean-stack-tutorial/ and clicking on upvotes icon next comment fails increment upvote count. in ui-router template(included inline in index.html), ng-click calls addupvote()--but addupvote() defined controller specified in state. way template can call addupvote() if template's associated state/controller somehow inherits other state/controller. , in fact, according ui-router docs here: https://github.com/angular-ui/ui-router/wiki/nested-states-%26-nested-views the way states defined in app.js, app.js: app.config([ '$stateprovider', '$urlrouterprovider', function($stateprovider, $urlrouterprovider) { $urlrouterprovider.otherwise('home'); $stateprovider .state('home', { url: '/home', templateurl: '/home.html', controller: 'mainctrl' } ) .state('posts', { url: '/p...

jquery - Is it possible to display a single image bigger when our website is viewed on a mobile? -

we have login button showing @ top right of our page "customer login". is possible make image bigger only when site viewed on mobile phone? clearly in ideal world we'd have whole mobile version of our site created, unfeasible @ moment. if helps our site can viewed - here you can use media queries that: @media (max-width: 768px){ /* ipad , below */ img{width: 100%;max-width: 100%;} }

javascript - How to center a PopupPanel -

in web app built in google apps script , want show popup containing som text , links. figured popuppanel way go. i've done: var app = uiapp.getactiveapplication(); var popup = app.createpopuppanel() .setanimationenabled(true) .setmodal(true) .setglassenabled(true) .setautohideenabled(true); popup.add(app.createlabel('text text text')); popup.setpopupposition(100, 100); popup.setheight('300px'); popup.setwidth('500px'); popup.show(); but instead of setting fixed position, center box in current window. since there seems no such functionality, tried pixel size of window, or form app, or panel sized 100%, can't size anywhere, there seems possible set size. is there way center popuppanel , or create popup other way, centered? i found way of doing want. not beautiful solution, works. var app = uiapp.getactiveapplication(); var popup = app.createpopuppanel() .setanimationenabled(true) .setmodal(true) .s...

android - Fragment slide out animation doesn't work -

i have android app in loading fragment 1 fragment on click of button fragment fragment = new editimagesfragment(); fragmentmanager fragmentmanager = getfragmentmanager(); fragmenttransaction tran = fragmentmanager.begintransaction(); tran.setcustomanimations(r.anim.push, r.anim.pop); tran.replace(r.id.content_frame, fragment).addtobackstack(null).commit(); and have push , pop (slide in , out ) kind of animations defined follows <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" > <objectanimator xmlns:android="http://schemas.android.com/apk/res/android" android:duration="500" android:propertyname="x" android:valuefrom="1000" android:valueto="0" android:valuetype="floattype" /> </set> <?xml version="1.0" encoding="utf-8"?> <set ...

css - Preventing Render-Blocking in Bootstrap 3.2 -

i have issue client's website uses twitter bootstrap 3.2 less. technical lead @ client has flagged google pagespeed insights showing red flag against several of css files in site causing render blocking issues: https://developers.google.com/speed/pagespeed/insights/?url=http%3a%2f%2fwww.ukessays.com%2fservices%2fessay-writing-service.php&tab=mobile however, above fold content on majority of pages contains of css elements used in site idea of "in-lining" of css render above fold content seems ridiculous. make things worse important pages in site have lowest speed scores: http://www.ukessays.com/services/essay-writing-service.php : 71/100 vs http://www.ukessays.com/essay-help/referencing/ : 77/100 as website re-built using twitter bootstrap make more responsive i'm left looking bit of idiot scores less previous non-responsive website. fact css compiled using less has effective prevented implementing dynamic solution problem server-side has come a...

javascript - How to read array inside JSON Object this is inside another array -

i newbie json, parsing json object , struck @ point have read array elements inside object, again in array.. here json { "definitionsource": "test", "relatedtopics": [ { "result": "", "icon": { "url": "https://duckduckgo.com/i/a5e4a93a.jpg" }, "firsturl": "xyz", "text": "sample." }, { "result": "", "icon": { "url": "xyz" }, "firsturl": "xyz", "text": "sample." }, { "topics": [ { "result": "", "icon": { "url": "https://duckduckgo.com/i/10d02dbf.jpg" }, "firsturl": "https://...

javascript - Trying to scrape data generated by ajax request using scrapy, but the ajax request redirects to home page -

i new scraping not sure why getting problem. trying scrape customer vendor chats anyvan.com. normal job page of site looks this . clicking on pink view button in bids session sends ajax request loads chats. xhr request can been seen in developers tool -> network -> filter xhr request. i using following simple spider simulate request using scrapy seems getting redirected anyvan.com class avspider(spider): name = "anyvanscraper" allowed_domains = ["anyvan.com"] # start url job url start_urls = ["http://www.anyvan.com/view-listing/1935650"] def parse(self, response): # receives response start url. don't it. url = 'http://www.anyvan.com/ajax-bid-comment/bid/14916780' return request('http://www.anyvan.com/ajax-bid-comment/bid/14916780' , callback=self.parse_stores) def parse_stores(self, response): y = response.body f = open('html.txt','w') ...